Various fixes for sparse warnings.
authorMikael Magnusson <mikachu@comhem.se>
Wed, 16 Jan 2008 14:25:08 +0000 (15:25 +0100)
committerMikael Magnusson <mikachu@comhem.se>
Wed, 16 Jan 2008 14:35:25 +0000 (15:35 +0100)
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.

15 files changed:
openbox/actions.c
openbox/client.c
openbox/client_list_combined_menu.c
openbox/event.c
openbox/focus_cycle_indicator.c
openbox/keyboard.c
openbox/mainloop.c
openbox/ping.c
openbox/prop.h
openbox/resist.c
openbox/screen.c
openbox/stacking.c
openbox/translate.c
openbox/xerror.c
render/instance.c

index 75d4af0..0c84489 100644 (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;
     ObActionsDefinition *def = NULL;
index c90c39b..6a6ec2b 100644 (file)
@@ -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;
index 194c927..f7fc36b 100644 (file)
@@ -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
index 5d85eae..f4ebfa4 100644 (file)
@@ -43,6 +43,7 @@
 #include "stacking.h"
 #include "extensions.h"
 #include "translate.h"
+#include "ping.h"
 
 #include <X11/Xlib.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_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);
index 340abec..0aa65a7 100644 (file)
@@ -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;
index eddda57..4c570df 100644 (file)
@@ -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);
index 825d3f4..f78f5b1 100644 (file)
@@ -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[] =
index d4217fd..eed0947 100644 (file)
@@ -21,6 +21,7 @@
 #include "client.h"
 #include "prop.h"
 #include "event.h"
+#include "debug.h"
 #include "mainloop.h"
 #include "openbox.h"
 
index 9288414..5ca7047 100644 (file)
@@ -196,7 +196,7 @@ typedef struct Atoms {
     Atom ob_theme;
     Atom ob_control;
 } Atoms;
-Atoms prop_atoms;
+extern Atoms prop_atoms;
 
 void prop_startup();
 
index 62c2b29..f21eb8e 100644 (file)
@@ -23,6 +23,7 @@
 #include "screen.h"
 #include "dock.h"
 #include "config.h"
+#include "resist.h"
 #include "parser/parse.h"
 
 #include <glib.h>
index b88562f..e008ffe 100644 (file)
@@ -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 */
index 34ab058..b18c02a 100644 (file)
@@ -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;
index b2ae7d6..c697679 100644 (file)
@@ -20,6 +20,7 @@
 #include "openbox.h"
 #include "mouse.h"
 #include "modkeys.h"
+#include "translate.h"
 #include "gettext.h"
 #include <glib.h>
 #include <string.h>
index 6e88460..2657b8e 100644 (file)
@@ -20,6 +20,7 @@
 #include "openbox.h"
 #include "gettext.h"
 #include "debug.h"
+#include "xerror.h"
 #include <glib.h>
 #include <X11/Xlib.h>
 
index 91f9db7..b867815 100644 (file)
@@ -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;