From 0be98fee4743c795b06aa23881b82eff5bab3ef6 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Wed, 16 Jan 2008 15:25:08 +0100 Subject: [PATCH] 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. --- openbox/actions.c | 2 +- openbox/client.c | 15 ++++++++++----- openbox/client_list_combined_menu.c | 2 +- openbox/event.c | 5 +++-- openbox/focus_cycle_indicator.c | 3 ++- openbox/keyboard.c | 2 +- openbox/mainloop.c | 4 ++-- openbox/ping.c | 1 + openbox/prop.h | 2 +- openbox/resist.c | 1 + openbox/screen.c | 6 +++--- openbox/stacking.c | 4 ++-- openbox/translate.c | 1 + openbox/xerror.c | 1 + render/instance.c | 4 ++-- 15 files changed, 32 insertions(+), 21 deletions(-) diff --git a/openbox/actions.c b/openbox/actions.c index 75d4af0..0c84489 100644 --- a/openbox/actions.c +++ b/openbox/actions.c @@ -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; ObActionsDefinition *def = NULL; diff --git a/openbox/client.c b/openbox/client.c index c90c39b..6a6ec2b 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -24,6 +24,7 @@ #include "xerror.h" #include "screen.h" #include "moveresize.h" +#include "ping.h" #include "place.h" #include "prop.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_mwm_hints(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_state(ObClient *self); static void client_change_wm_state(ObClient *self); @@ -1551,7 +1556,7 @@ void client_update_sync_request_counter(ObClient *self) } #endif -void client_get_colormap(ObClient *self) +static void client_get_colormap(ObClient *self) { XWindowAttributes wa; @@ -3276,10 +3281,10 @@ void client_hilite(ObClient *self, gboolean hilite) } } -void client_set_desktop_recursive(ObClient *self, - guint target, - gboolean donthide, - gboolean dontraise) +static void client_set_desktop_recursive(ObClient *self, + guint target, + gboolean donthide, + gboolean dontraise) { guint old; GSList *it; diff --git a/openbox/client_list_combined_menu.c b/openbox/client_list_combined_menu.c index 194c927..f7fc36b 100644 --- a/openbox/client_list_combined_menu.c +++ b/openbox/client_list_combined_menu.c @@ -30,7 +30,7 @@ #define MENU_NAME "client-list-combined-menu" -ObMenu *combined_menu; +static ObMenu *combined_menu; #define SEPARATOR -1 #define ADD_DESKTOP -2 diff --git a/openbox/event.c b/openbox/event.c index 5d85eae..f4ebfa4 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -43,6 +43,7 @@ #include "stacking.h" #include "extensions.h" #include "translate.h" +#include "ping.h" #include #include @@ -102,8 +103,8 @@ static void focus_delay_client_dest(ObClient *client, gpointer data); Time event_curtime = CurrentTime; Time event_last_user_time = CurrentTime; /*! The serial of the current X event */ -gulong event_curserial; +static gulong event_curserial; static gboolean focus_left_screen = FALSE; /*! A list of ObSerialRanges which are to be ignored for mouse enter events */ static GSList *ignore_serials = NULL; @@ -1917,7 +1918,7 @@ static void focus_delay_client_dest(ObClient *client, gpointer data) 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 */ if (event_curserial) event_ignore_enter_range(1, event_curserial); diff --git a/openbox/focus_cycle_indicator.c b/openbox/focus_cycle_indicator.c index 340abec..0aa65a7 100644 --- a/openbox/focus_cycle_indicator.c +++ b/openbox/focus_cycle_indicator.c @@ -18,6 +18,7 @@ */ #include "focus_cycle.h" +#include "focus_cycle_indicator.h" #include "client.h" #include "openbox.h" #include "frame.h" @@ -29,7 +30,7 @@ #define FOCUS_INDICATOR_WIDTH 6 -struct +static struct { InternalWindow top; InternalWindow left; diff --git a/openbox/keyboard.c b/openbox/keyboard.c index eddda57..4c570df 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -265,7 +265,7 @@ void keyboard_event(ObClient *client, const XEvent *e) } } -void keyboard_rebind() +void keyboard_rebind(void) { tree_rebind(keyboard_firstnode); grab_keys(TRUE); diff --git a/openbox/mainloop.c b/openbox/mainloop.c index 825d3f4..f78f5b1 100644 --- a/openbox/mainloop.c +++ b/openbox/mainloop.c @@ -39,13 +39,13 @@ typedef struct _ObMainLoopFdHandlerType ObMainLoopFdHandlerType; static GSList *all_loops; /* signals are global to all loops */ -struct { +static struct { guint installed; /* a ref count */ struct sigaction oldact; } all_signals[NUM_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 */ static gint core_signals[] = diff --git a/openbox/ping.c b/openbox/ping.c index d4217fd..eed0947 100644 --- a/openbox/ping.c +++ b/openbox/ping.c @@ -21,6 +21,7 @@ #include "client.h" #include "prop.h" #include "event.h" +#include "debug.h" #include "mainloop.h" #include "openbox.h" diff --git a/openbox/prop.h b/openbox/prop.h index 9288414..5ca7047 100644 --- a/openbox/prop.h +++ b/openbox/prop.h @@ -196,7 +196,7 @@ typedef struct Atoms { Atom ob_theme; Atom ob_control; } Atoms; -Atoms prop_atoms; +extern Atoms prop_atoms; void prop_startup(); diff --git a/openbox/resist.c b/openbox/resist.c index 62c2b29..f21eb8e 100644 --- a/openbox/resist.c +++ b/openbox/resist.c @@ -23,6 +23,7 @@ #include "screen.h" #include "dock.h" #include "config.h" +#include "resist.h" #include "parser/parse.h" #include diff --git a/openbox/screen.c b/openbox/screen.c index b88562f..e008ffe 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -60,15 +60,15 @@ guint screen_num_desktops; guint screen_num_monitors; guint screen_desktop; guint screen_last_desktop = 1; -guint screen_old_desktop; -gboolean screen_desktop_timeout = TRUE; -Size screen_physical_size; gboolean screen_showing_desktop; ObDesktopLayout screen_desktop_layout; gchar **screen_desktop_names; Window screen_support_win; 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 */ static Rect *monitor_area = NULL; /*! An array of desktops, holding an array of struts */ diff --git a/openbox/stacking.c b/openbox/stacking.c index 34ab058..b18c02a 100644 --- a/openbox/stacking.c +++ b/openbox/stacking.c @@ -31,7 +31,7 @@ GList *stacking_list = NULL; /*! 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 raised during focus cycling */ -gboolean pause_changes = FALSE; +static gboolean pause_changes = FALSE; void stacking_set_list(void) { @@ -134,7 +134,7 @@ void stacking_temp_raise(ObWindow *window) pause_changes = TRUE; } -void stacking_restore() +void stacking_restore(void) { Window *win; GList *it; diff --git a/openbox/translate.c b/openbox/translate.c index b2ae7d6..c697679 100644 --- a/openbox/translate.c +++ b/openbox/translate.c @@ -20,6 +20,7 @@ #include "openbox.h" #include "mouse.h" #include "modkeys.h" +#include "translate.h" #include "gettext.h" #include #include diff --git a/openbox/xerror.c b/openbox/xerror.c index 6e88460..2657b8e 100644 --- a/openbox/xerror.c +++ b/openbox/xerror.c @@ -20,6 +20,7 @@ #include "openbox.h" #include "gettext.h" #include "debug.h" +#include "xerror.h" #include #include diff --git a/render/instance.c b/render/instance.c index 91f9db7..b867815 100644 --- a/render/instance.c +++ b/render/instance.c @@ -91,7 +91,7 @@ RrInstance* RrInstanceNew (Display *display, gint screen) return definst; } -void RrTrueColorSetup (RrInstance *inst) +static void RrTrueColorSetup (RrInstance *inst) { gulong red_mask, green_mask, blue_mask; XImage *timage = NULL; @@ -121,7 +121,7 @@ void RrTrueColorSetup (RrInstance *inst) #define RrPseudoNcolors(inst) (1 << (inst->pseudo_bpc * 3)) -void RrPseudoColorSetup (RrInstance *inst) +static void RrPseudoColorSetup (RrInstance *inst) { XColor icolors[256]; gint tr, tg, tb, n, r, g, b, i, incolors, ii; -- 1.9.1