all repos — openbox @ 0be98fee4743c795b06aa23881b82eff5bab3ef6

openbox fork - make it a bit more like ryudo

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.
Mikael Magnusson mikachu@comhem.se
commit

0be98fee4743c795b06aa23881b82eff5bab3ef6

parent

cafba3acf3ef5b34be867a155ec05b35e82384e9

M openbox/actions.copenbox/actions.c

@@ -124,7 +124,7 @@ g_free(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;
M openbox/client.copenbox/client.c

@@ -24,6 +24,7 @@ #include "dock.h"

#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 @@ self->sync_counter = None;

} #endif -void client_get_colormap(ObClient *self) +static void client_get_colormap(ObClient *self) { XWindowAttributes wa;

@@ -3276,10 +3281,10 @@ client_change_state(self);

} } -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;
M openbox/client_list_combined_menu.copenbox/client_list_combined_menu.c

@@ -30,7 +30,7 @@ #include <glib.h>

#define MENU_NAME "client-list-combined-menu" -ObMenu *combined_menu; +static ObMenu *combined_menu; #define SEPARATOR -1 #define ADD_DESKTOP -2
M openbox/event.copenbox/event.c

@@ -43,6 +43,7 @@ #include "group.h"

#include "stacking.h" #include "extensions.h" #include "translate.h" +#include "ping.h" #include <X11/Xlib.h> #include <X11/Xatom.h>

@@ -102,8 +103,8 @@

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 @@ ob_main_loop_timeout_remove_data(ob_main_loop, focus_delay_func,

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);
M openbox/focus_cycle_indicator.copenbox/focus_cycle_indicator.c

@@ -18,6 +18,7 @@ See the COPYING file for a copy of the GNU General Public License.

*/ #include "focus_cycle.h" +#include "focus_cycle_indicator.h" #include "client.h" #include "openbox.h" #include "frame.h"

@@ -29,7 +30,7 @@ #include <glib.h>

#define FOCUS_INDICATOR_WIDTH 6 -struct +static struct { InternalWindow top; InternalWindow left;
M openbox/keyboard.copenbox/keyboard.c

@@ -265,7 +265,7 @@ p = p->next_sibling;

} } -void keyboard_rebind() +void keyboard_rebind(void) { tree_rebind(keyboard_firstnode); grab_keys(TRUE);
M openbox/mainloop.copenbox/mainloop.c

@@ -39,13 +39,13 @@ /* all created ObMainLoops. Used by the signal handler to pass along signals */

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[] =
M openbox/ping.copenbox/ping.c

@@ -21,6 +21,7 @@ #include "ping.h"

#include "client.h" #include "prop.h" #include "event.h" +#include "debug.h" #include "mainloop.h" #include "openbox.h"
M openbox/prop.hopenbox/prop.h

@@ -196,7 +196,7 @@ Atom openbox_pid; /* this is depreecated in favour of ob_control */

Atom ob_theme; Atom ob_control; } Atoms; -Atoms prop_atoms; +extern Atoms prop_atoms; void prop_startup();
M openbox/resist.copenbox/resist.c

@@ -23,6 +23,7 @@ #include "stacking.h"

#include "screen.h" #include "dock.h" #include "config.h" +#include "resist.h" #include "parser/parse.h" #include <glib.h>
M openbox/screen.copenbox/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 */
M openbox/stacking.copenbox/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 @@

pause_changes = TRUE; } -void stacking_restore() +void stacking_restore(void) { Window *win; GList *it;
M openbox/translate.copenbox/translate.c

@@ -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>
M openbox/xerror.copenbox/xerror.c

@@ -20,6 +20,7 @@

#include "openbox.h" #include "gettext.h" #include "debug.h" +#include "xerror.h" #include <glib.h> #include <X11/Xlib.h>
M render/instance.crender/instance.c

@@ -91,7 +91,7 @@ }

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 @@ }

#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;