Various fixes for sparse warnings.

Define void functions with (void), not ().
Add missing includes.
Some functions were declared static but defined non-static.
Some variables that should be file static were file global but not used in any other file.
prop.h defined a new prop_atoms in each file that included it instead of declaring it extern.
This commit is contained in:
Mikael Magnusson 2008-01-16 15:25:08 +01:00
parent cafba3acf3
commit 0be98fee47
15 changed files with 32 additions and 21 deletions

View file

@ -124,7 +124,7 @@ static void actions_definition_unref(ObActionsDefinition *def)
} }
} }
ObActionsAct* actions_build_act_from_string(const gchar *name) static ObActionsAct* actions_build_act_from_string(const gchar *name)
{ {
GSList *it; GSList *it;
ObActionsDefinition *def = NULL; ObActionsDefinition *def = NULL;

View file

@ -24,6 +24,7 @@
#include "xerror.h" #include "xerror.h"
#include "screen.h" #include "screen.h"
#include "moveresize.h" #include "moveresize.h"
#include "ping.h"
#include "place.h" #include "place.h"
#include "prop.h" #include "prop.h"
#include "extensions.h" #include "extensions.h"
@ -79,6 +80,10 @@ static void client_get_state(ObClient *self);
static void client_get_shaped(ObClient *self); static void client_get_shaped(ObClient *self);
static void client_get_mwm_hints(ObClient *self); static void client_get_mwm_hints(ObClient *self);
static void client_get_colormap(ObClient *self); static void client_get_colormap(ObClient *self);
static void client_set_desktop_recursive(ObClient *self,
guint target,
gboolean donthide,
gboolean dontraise);
static void client_change_allowed_actions(ObClient *self); static void client_change_allowed_actions(ObClient *self);
static void client_change_state(ObClient *self); static void client_change_state(ObClient *self);
static void client_change_wm_state(ObClient *self); static void client_change_wm_state(ObClient *self);
@ -1551,7 +1556,7 @@ void client_update_sync_request_counter(ObClient *self)
} }
#endif #endif
void client_get_colormap(ObClient *self) static void client_get_colormap(ObClient *self)
{ {
XWindowAttributes wa; XWindowAttributes wa;
@ -3276,10 +3281,10 @@ void client_hilite(ObClient *self, gboolean hilite)
} }
} }
void client_set_desktop_recursive(ObClient *self, static void client_set_desktop_recursive(ObClient *self,
guint target, guint target,
gboolean donthide, gboolean donthide,
gboolean dontraise) gboolean dontraise)
{ {
guint old; guint old;
GSList *it; GSList *it;

View file

@ -30,7 +30,7 @@
#define MENU_NAME "client-list-combined-menu" #define MENU_NAME "client-list-combined-menu"
ObMenu *combined_menu; static ObMenu *combined_menu;
#define SEPARATOR -1 #define SEPARATOR -1
#define ADD_DESKTOP -2 #define ADD_DESKTOP -2

View file

@ -43,6 +43,7 @@
#include "stacking.h" #include "stacking.h"
#include "extensions.h" #include "extensions.h"
#include "translate.h" #include "translate.h"
#include "ping.h"
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
@ -102,8 +103,8 @@ static void focus_delay_client_dest(ObClient *client, gpointer data);
Time event_curtime = CurrentTime; Time event_curtime = CurrentTime;
Time event_last_user_time = CurrentTime; Time event_last_user_time = CurrentTime;
/*! The serial of the current X event */ /*! The serial of the current X event */
gulong event_curserial;
static gulong event_curserial;
static gboolean focus_left_screen = FALSE; static gboolean focus_left_screen = FALSE;
/*! A list of ObSerialRanges which are to be ignored for mouse enter events */ /*! A list of ObSerialRanges which are to be ignored for mouse enter events */
static GSList *ignore_serials = NULL; static GSList *ignore_serials = NULL;
@ -1917,7 +1918,7 @@ static void focus_delay_client_dest(ObClient *client, gpointer data)
client, FALSE); client, FALSE);
} }
void event_halt_focus_delay() void event_halt_focus_delay(void)
{ {
/* ignore all enter events up till the event which caused this to occur */ /* ignore all enter events up till the event which caused this to occur */
if (event_curserial) event_ignore_enter_range(1, event_curserial); if (event_curserial) event_ignore_enter_range(1, event_curserial);

View file

@ -18,6 +18,7 @@
*/ */
#include "focus_cycle.h" #include "focus_cycle.h"
#include "focus_cycle_indicator.h"
#include "client.h" #include "client.h"
#include "openbox.h" #include "openbox.h"
#include "frame.h" #include "frame.h"
@ -29,7 +30,7 @@
#define FOCUS_INDICATOR_WIDTH 6 #define FOCUS_INDICATOR_WIDTH 6
struct static struct
{ {
InternalWindow top; InternalWindow top;
InternalWindow left; InternalWindow left;

View file

@ -265,7 +265,7 @@ void keyboard_event(ObClient *client, const XEvent *e)
} }
} }
void keyboard_rebind() void keyboard_rebind(void)
{ {
tree_rebind(keyboard_firstnode); tree_rebind(keyboard_firstnode);
grab_keys(TRUE); grab_keys(TRUE);

View file

@ -39,13 +39,13 @@ typedef struct _ObMainLoopFdHandlerType ObMainLoopFdHandlerType;
static GSList *all_loops; static GSList *all_loops;
/* signals are global to all loops */ /* signals are global to all loops */
struct { static struct {
guint installed; /* a ref count */ guint installed; /* a ref count */
struct sigaction oldact; struct sigaction oldact;
} all_signals[NUM_SIGNALS]; } all_signals[NUM_SIGNALS];
/* a set of all possible signals */ /* a set of all possible signals */
sigset_t all_signals_set; static sigset_t all_signals_set;
/* signals which cause a core dump, these can't be used for callbacks */ /* signals which cause a core dump, these can't be used for callbacks */
static gint core_signals[] = static gint core_signals[] =

View file

@ -21,6 +21,7 @@
#include "client.h" #include "client.h"
#include "prop.h" #include "prop.h"
#include "event.h" #include "event.h"
#include "debug.h"
#include "mainloop.h" #include "mainloop.h"
#include "openbox.h" #include "openbox.h"

View file

@ -196,7 +196,7 @@ typedef struct Atoms {
Atom ob_theme; Atom ob_theme;
Atom ob_control; Atom ob_control;
} Atoms; } Atoms;
Atoms prop_atoms; extern Atoms prop_atoms;
void prop_startup(); void prop_startup();

View file

@ -23,6 +23,7 @@
#include "screen.h" #include "screen.h"
#include "dock.h" #include "dock.h"
#include "config.h" #include "config.h"
#include "resist.h"
#include "parser/parse.h" #include "parser/parse.h"
#include <glib.h> #include <glib.h>

View file

@ -60,15 +60,15 @@ guint screen_num_desktops;
guint screen_num_monitors; guint screen_num_monitors;
guint screen_desktop; guint screen_desktop;
guint screen_last_desktop = 1; guint screen_last_desktop = 1;
guint screen_old_desktop;
gboolean screen_desktop_timeout = TRUE;
Size screen_physical_size;
gboolean screen_showing_desktop; gboolean screen_showing_desktop;
ObDesktopLayout screen_desktop_layout; ObDesktopLayout screen_desktop_layout;
gchar **screen_desktop_names; gchar **screen_desktop_names;
Window screen_support_win; Window screen_support_win;
Time screen_desktop_user_time = CurrentTime; Time screen_desktop_user_time = CurrentTime;
static Size screen_physical_size;
static guint screen_old_desktop;
static gboolean screen_desktop_timeout = TRUE;
/*! An array of desktops, holding array of areas per monitor */ /*! An array of desktops, holding array of areas per monitor */
static Rect *monitor_area = NULL; static Rect *monitor_area = NULL;
/*! An array of desktops, holding an array of struts */ /*! An array of desktops, holding an array of struts */

View file

@ -31,7 +31,7 @@ GList *stacking_list = NULL;
/*! When true, stacking changes will not be reflected on the screen. This is /*! When true, stacking changes will not be reflected on the screen. This is
to freeze the on-screen stacking order while a window is being temporarily to freeze the on-screen stacking order while a window is being temporarily
raised during focus cycling */ raised during focus cycling */
gboolean pause_changes = FALSE; static gboolean pause_changes = FALSE;
void stacking_set_list(void) void stacking_set_list(void)
{ {
@ -134,7 +134,7 @@ void stacking_temp_raise(ObWindow *window)
pause_changes = TRUE; pause_changes = TRUE;
} }
void stacking_restore() void stacking_restore(void)
{ {
Window *win; Window *win;
GList *it; GList *it;

View file

@ -20,6 +20,7 @@
#include "openbox.h" #include "openbox.h"
#include "mouse.h" #include "mouse.h"
#include "modkeys.h" #include "modkeys.h"
#include "translate.h"
#include "gettext.h" #include "gettext.h"
#include <glib.h> #include <glib.h>
#include <string.h> #include <string.h>

View file

@ -20,6 +20,7 @@
#include "openbox.h" #include "openbox.h"
#include "gettext.h" #include "gettext.h"
#include "debug.h" #include "debug.h"
#include "xerror.h"
#include <glib.h> #include <glib.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>

View file

@ -91,7 +91,7 @@ RrInstance* RrInstanceNew (Display *display, gint screen)
return definst; return definst;
} }
void RrTrueColorSetup (RrInstance *inst) static void RrTrueColorSetup (RrInstance *inst)
{ {
gulong red_mask, green_mask, blue_mask; gulong red_mask, green_mask, blue_mask;
XImage *timage = NULL; XImage *timage = NULL;
@ -121,7 +121,7 @@ void RrTrueColorSetup (RrInstance *inst)
#define RrPseudoNcolors(inst) (1 << (inst->pseudo_bpc * 3)) #define RrPseudoNcolors(inst) (1 << (inst->pseudo_bpc * 3))
void RrPseudoColorSetup (RrInstance *inst) static void RrPseudoColorSetup (RrInstance *inst)
{ {
XColor icolors[256]; XColor icolors[256];
gint tr, tg, tb, n, r, g, b, i, incolors, ii; gint tr, tg, tb, n, r, g, b, i, incolors, ii;