From 74cd836e48c51ef5b27f4a3d7727683ccfcdd112 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Sun, 30 Jun 2013 16:02:35 +0200 Subject: [PATCH] wmaker: Replaced local 'extern' definition of wPreferences by proper header usage Signed-off-by: Christophe CURIS --- src/WindowMaker.h | 4 ++-- src/actions.c | 1 - src/appicon.c | 1 - src/appmenu.c | 1 - src/balloon.c | 1 - src/client.c | 1 - src/cycling.c | 2 -- src/defaults.c | 5 ++--- src/dialog.c | 1 - src/dock.c | 1 - src/dockedapp.c | 2 -- src/event.c | 2 -- src/framewin.c | 1 - src/icon.c | 1 - src/main.c | 4 ++-- src/menu.c | 2 -- src/misc.c | 3 +-- src/monitor.c | 2 -- src/moveres.c | 1 - src/placement.c | 1 - src/rootmenu.c | 1 - src/screen.c | 1 - src/stacking.c | 2 -- src/startup.c | 1 - src/superfluous.c | 1 - src/switchmenu.c | 3 --- src/switchpanel.c | 2 -- src/texture.c | 1 - src/usermenu.c | 2 -- src/wcore.c | 2 -- src/wdefaults.c | 1 - src/window.c | 1 - src/winmenu.c | 1 - src/winspector.c | 1 - src/wmspec.c | 1 - src/workspace.c | 1 - 36 files changed, 7 insertions(+), 52 deletions(-) diff --git a/src/WindowMaker.h b/src/WindowMaker.h index 23ea0469..69923c1c 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -297,7 +297,7 @@ typedef struct WCoord { int x, y; } WCoord; -typedef struct WPreferences { +extern struct WPreferences { char *pixmap_path; /* : separated list of paths to find pixmaps */ char *icon_path; /* : separated list of paths to find icons */ WMArray *fallbackWMs; /* fallback window manager list */ @@ -446,7 +446,7 @@ typedef struct WPreferences { #endif unsigned int restarting:2; } flags; /* internal flags */ -} WPreferences; +} wPreferences; /****** Global Variables ******/ extern Display *dpy; diff --git a/src/actions.c b/src/actions.c index e492419a..b4eda5f0 100644 --- a/src/actions.c +++ b/src/actions.c @@ -55,7 +55,6 @@ int ignore_wks_change = 0; extern Time LastTimestamp; extern Time LastFocusChange; -extern WPreferences wPreferences; extern Atom _XA_WM_TAKE_FOCUS; static void find_Maximus_geometry(WWindow *wwin, WArea usableArea, int *new_x, int *new_y, diff --git a/src/appicon.c b/src/appicon.c index e1fada13..41e52e73 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -61,7 +61,6 @@ /**** Global variables ****/ extern Cursor wCursor[WCUR_LAST]; -extern WPreferences wPreferences; extern WDDomain *WDWindowAttributes; extern XContext wWinContext; diff --git a/src/appmenu.c b/src/appmenu.c index 343797b4..539f0564 100644 --- a/src/appmenu.c +++ b/src/appmenu.c @@ -39,7 +39,6 @@ /******** Global Variables **********/ extern Atom _XA_WINDOWMAKER_MENU; extern Time LastTimestamp; -extern WPreferences wPreferences; typedef struct { short code; diff --git a/src/balloon.c b/src/balloon.c index af7ceed3..e2c294a1 100644 --- a/src/balloon.c +++ b/src/balloon.c @@ -43,7 +43,6 @@ #include "workspace.h" #include "balloon.h" -extern WPreferences wPreferences; typedef struct _WBalloon { Window window; diff --git a/src/client.c b/src/client.c index 060ec599..0c4126f2 100644 --- a/src/client.c +++ b/src/client.c @@ -577,7 +577,6 @@ void wClientCheckProperty(WWindow * wwin, XPropertyEvent * event) wAppMenuDestroy(wapp->menu); } if (wwin->fake_group) { - extern WPreferences wPreferences; WScreen *scr = wwin->screen_ptr; WWindow *foo = scr->focused_window; WFakeGroupLeader *fPtr = wwin->fake_group; diff --git a/src/cycling.c b/src/cycling.c index 3414ae21..4955e3f4 100644 --- a/src/cycling.c +++ b/src/cycling.c @@ -39,8 +39,6 @@ #include "switchpanel.h" /* Globals */ -extern WPreferences wPreferences; - extern WShortKey wKeyBindings[WKBD_LAST]; static void raiseWindow(WSwitchPanel * swpanel, WWindow * wwin) diff --git a/src/defaults.c b/src/defaults.c index 601eb54d..02f01a3e 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -76,7 +76,6 @@ extern WDDomain *WDWindowMaker; extern WDDomain *WDWindowAttributes; extern WDDomain *WDRootMenu; extern int wScreenCount; -extern WPreferences wPreferences; extern WShortKey wKeyBindings[WKBD_LAST]; typedef struct _WDefaultEntry WDefaultEntry; @@ -3065,7 +3064,7 @@ static int setSwPOptions(WScreen * scr, WDefaultEntry * entry, void *tdata, void char *path; RImage *bgimage; int cwidth, cheight; - WPreferences *prefs = foo; + struct WPreferences *prefs = foo; if (!WMIsPLArray(array) || WMGetPropListItemCount(array) == 0) { if (prefs->swtileImage) @@ -3182,7 +3181,7 @@ static int setModifierKeyLabels(WScreen * scr, WDefaultEntry * entry, void *tdat { WMPropList *array = tdata; int i; - WPreferences *prefs = foo; + struct WPreferences *prefs = foo; if (!WMIsPLArray(array) || WMGetPropListItemCount(array) != 7) { wwarning(_("Value for option \"%s\" must be an array of 7 strings"), entry->key); diff --git a/src/dialog.c b/src/dialog.c index bef0985c..c36d9fa4 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -60,7 +60,6 @@ #include "actions.h" #include "xinerama.h" -extern WPreferences wPreferences; static WMPoint getCenter(WScreen * scr, int width, int height) { diff --git a/src/dock.c b/src/dock.c index 3f44b44e..3c3c150c 100644 --- a/src/dock.c +++ b/src/dock.c @@ -66,7 +66,6 @@ /**** Global variables ****/ extern Cursor wCursor[WCUR_LAST]; -extern WPreferences wPreferences; extern XContext wWinContext; extern void appIconMouseDown(WObjDescriptor *desc, XEvent *event); diff --git a/src/dockedapp.c b/src/dockedapp.c index 0ef180f1..b24f1277 100644 --- a/src/dockedapp.c +++ b/src/dockedapp.c @@ -39,8 +39,6 @@ #include "framewin.h" #include "xinerama.h" -/**** Global variables ****/ -extern WPreferences wPreferences; static void updateCommand(WAppIcon * icon, char *command) { diff --git a/src/event.c b/src/event.c index c6951bb4..495d2b46 100644 --- a/src/event.c +++ b/src/event.c @@ -87,8 +87,6 @@ extern int wScreenCount; extern Time LastTimestamp; extern Time LastFocusChange; -extern WPreferences wPreferences; - #define MOD_MASK wPreferences.modifier_mask extern Atom _XA_WM_COLORMAP_NOTIFY; diff --git a/src/framewin.c b/src/framewin.c index db0d9880..91572951 100644 --- a/src/framewin.c +++ b/src/framewin.c @@ -45,7 +45,6 @@ #define DBLCLICK_TIME wPreferences.dblclick_time -extern WPreferences wPreferences; static void handleExpose(WObjDescriptor * desc, XEvent * event); static void handleButtonExpose(WObjDescriptor * desc, XEvent * event); diff --git a/src/icon.c b/src/icon.c index 0472d7a7..3e065853 100644 --- a/src/icon.c +++ b/src/icon.c @@ -49,7 +49,6 @@ #include "winmenu.h" /**** Global varianebles ****/ -extern WPreferences wPreferences; #define MOD_MASK wPreferences.modifier_mask #define CACHE_ICON_PATH "/Library/WindowMaker/CachedPixmaps" diff --git a/src/main.c b/src/main.c index 36ae4994..199033e7 100644 --- a/src/main.c +++ b/src/main.c @@ -82,7 +82,7 @@ char *Locale = NULL; int wScreenCount = 0; -WPreferences wPreferences; +struct WPreferences wPreferences; WShortKey wKeyBindings[WKBD_LAST]; @@ -599,7 +599,7 @@ int main(int argc, char **argv) /* setup common stuff for the monitor and wmaker itself */ WMInitializeApplication("WindowMaker", &argc, argv); - memset(&wPreferences, 0, sizeof(WPreferences)); + memset(&wPreferences, 0, sizeof(wPreferences)); wPreferences.fallbackWMs = WMCreateArray(8); alt = getenv("WINDOWMAKER_ALT_WM"); diff --git a/src/menu.c b/src/menu.c index 75a2db50..0ececa71 100644 --- a/src/menu.c +++ b/src/menu.c @@ -51,8 +51,6 @@ extern Cursor wCursor[WCUR_LAST]; extern XContext wWinContext; -extern WPreferences wPreferences; - #define MOD_MASK wPreferences.modifier_mask #define MENU_SCROLL_STEP menuScrollParameters[(int)wPreferences.menu_scroll_speed].steps diff --git a/src/misc.c b/src/misc.c index 4c4eacaf..27a6ab26 100644 --- a/src/misc.c +++ b/src/misc.c @@ -50,8 +50,7 @@ #include "xutil.h" #include "xmodifier.h" -/**** global variables *****/ -extern WPreferences wPreferences; + #define ICON_SIZE wPreferences.icon_size /**** Local prototypes *****/ diff --git a/src/monitor.c b/src/monitor.c index d33372dd..c023b306 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -39,8 +39,6 @@ #include "dialog.h" #include "main.h" -/****** Global Variables ******/ -extern WPreferences wPreferences; static int showCrashDialog(int sig) { diff --git a/src/moveres.c b/src/moveres.c index 3984906f..26b8cf96 100644 --- a/src/moveres.c +++ b/src/moveres.c @@ -62,7 +62,6 @@ /****** Global Variables ******/ extern Cursor wCursor[WCUR_LAST]; -extern WPreferences wPreferences; /* *---------------------------------------------------------------------- diff --git a/src/placement.c b/src/placement.c index a445ec17..59f137d7 100644 --- a/src/placement.c +++ b/src/placement.c @@ -39,7 +39,6 @@ #include "xinerama.h" #include "placement.h" -extern WPreferences wPreferences; #define X_ORIGIN WMAX(usableArea.x1,\ wPreferences.window_place_origin.x) diff --git a/src/rootmenu.c b/src/rootmenu.c index 5d971b6b..64939f7e 100644 --- a/src/rootmenu.c +++ b/src/rootmenu.c @@ -63,7 +63,6 @@ extern char *Locale; extern WDDomain *WDRootMenu; extern Cursor wCursor[WCUR_LAST]; -extern WPreferences wPreferences; static WMenu *readMenuPipe(WScreen * scr, char **file_name); static WMenu *readPLMenuPipe(WScreen * scr, char **file_name); diff --git a/src/screen.c b/src/screen.c index 90b54450..a5cb5fbf 100644 --- a/src/screen.c +++ b/src/screen.c @@ -71,7 +71,6 @@ /**** Global variables ****/ extern Cursor wCursor[WCUR_LAST]; -extern WPreferences wPreferences; extern Atom _XA_WINDOWMAKER_STATE; extern Atom _XA_WINDOWMAKER_NOTICEBOARD; diff --git a/src/stacking.c b/src/stacking.c index f28e5b3e..4a773406 100644 --- a/src/stacking.c +++ b/src/stacking.c @@ -38,8 +38,6 @@ /*** Global Variables ***/ extern XContext wStackContext; -extern WPreferences wPreferences; - static void notifyStackChange(WCoreWindow * frame, char *detail) { WWindow *wwin = wWindowFor(frame->window); diff --git a/src/startup.c b/src/startup.c index 0175e7cb..5f994f8e 100644 --- a/src/startup.c +++ b/src/startup.c @@ -85,7 +85,6 @@ #endif /****** Global Variables ******/ -extern WPreferences wPreferences; extern WDDomain *WDWindowMaker; extern WDDomain *WDRootMenu; extern WDDomain *WDWindowAttributes; diff --git a/src/superfluous.c b/src/superfluous.c index 0c95ed4d..e33e6eb7 100644 --- a/src/superfluous.c +++ b/src/superfluous.c @@ -49,7 +49,6 @@ #define BOUNCE_DAMP 0.6 #define URGENT_BOUNCE_DELAY 3000 -extern WPreferences wPreferences; void DoKaboom(WScreen * scr, Window win, int x, int y) { diff --git a/src/switchmenu.c b/src/switchmenu.c index 227b7fa2..191063d3 100644 --- a/src/switchmenu.c +++ b/src/switchmenu.c @@ -44,9 +44,6 @@ ((w)->wm_gnustep_attr->window_level == WMMainMenuWindowLevel || \ (w)->wm_gnustep_attr->window_level == WMSubmenuWindowLevel)) -/********* Global Variables *******/ -extern WPreferences wPreferences; - static int initialized = 0; static void observer(void *self, WMNotification * notif); static void wsobserver(void *self, WMNotification * notif); diff --git a/src/switchpanel.c b/src/switchpanel.c index f616bfaf..f305d413 100644 --- a/src/switchpanel.c +++ b/src/switchpanel.c @@ -66,8 +66,6 @@ struct SwitchPanel { WMColor *white; }; -extern WPreferences wPreferences; - #define BORDER_SPACE 10 #define ICON_SIZE 48 #define ICON_TILE_SIZE 64 diff --git a/src/texture.c b/src/texture.c index aaa10fb6..a401fcee 100644 --- a/src/texture.c +++ b/src/texture.c @@ -34,7 +34,6 @@ #include "window.h" #include "misc.h" -extern WPreferences wPreferences; static void bevelImage(RImage * image, int relief); static RImage * get_texture_image(WScreen *scr, const char *pixmap_file); diff --git a/src/usermenu.c b/src/usermenu.c index e688a33f..d3f6fccc 100644 --- a/src/usermenu.c +++ b/src/usermenu.c @@ -79,8 +79,6 @@ #define MAX_SHORTCUT_LENGTH 32 -/*** var ***/ -extern WPreferences wPreferences; typedef struct { WScreen *screen; diff --git a/src/wcore.c b/src/wcore.c index a2aff96a..3e77fbfa 100644 --- a/src/wcore.c +++ b/src/wcore.c @@ -30,8 +30,6 @@ #include "wcore.h" /****** Global Variables ******/ -extern WPreferences wPreferences; - /* cursors */ extern Cursor wCursor[WCUR_LAST]; extern XContext wWinContext; diff --git a/src/wdefaults.c b/src/wdefaults.c index 93ef0e39..09cf2c52 100644 --- a/src/wdefaults.c +++ b/src/wdefaults.c @@ -48,7 +48,6 @@ if (mask) mask->flag = 1;} /* Global stuff */ -extern WPreferences wPreferences; extern WDDomain *WDWindowAttributes; /* Local stuff */ diff --git a/src/window.c b/src/window.c index 795216d4..a5de8a9c 100644 --- a/src/window.c +++ b/src/window.c @@ -86,7 +86,6 @@ extern XContext wWinContext; extern Atom _XA_WM_DELETE_WINDOW; extern Atom _XA_GNUSTEP_WM_MINIATURIZE_WINDOW; extern Atom _XA_WINDOWMAKER_STATE; -extern WPreferences wPreferences; extern Time LastTimestamp; /***** Local Stuff *****/ diff --git a/src/winmenu.c b/src/winmenu.c index 07735d23..a8a7bb8e 100644 --- a/src/winmenu.c +++ b/src/winmenu.c @@ -75,7 +75,6 @@ extern Atom _XA_GNUSTEP_WM_MINIATURIZE_WINDOW; extern WShortKey wKeyBindings[WKBD_LAST]; -extern WPreferences wPreferences; static void updateOptionsMenu(WMenu * menu, WWindow * wwin); diff --git a/src/winspector.c b/src/winspector.c index 13f4799a..fedc013a 100644 --- a/src/winspector.c +++ b/src/winspector.c @@ -116,7 +116,6 @@ typedef struct InspectorPanel { extern Cursor wCursor[WCUR_LAST]; extern WDDomain *WDWindowAttributes; -extern WPreferences wPreferences; static InspectorPanel *panelList = NULL; static WMPropList *ANoTitlebar = NULL; diff --git a/src/wmspec.c b/src/wmspec.c index 149eab1d..e71265b0 100644 --- a/src/wmspec.c +++ b/src/wmspec.c @@ -53,7 +53,6 @@ /* Global variables */ extern Atom _XA_WM_DELETE_WINDOW; extern Time LastTimestamp; -extern WPreferences wPreferences; /* Root Window Properties */ static Atom net_supported; diff --git a/src/workspace.c b/src/workspace.c index e4256764..bb75d6be 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -60,7 +60,6 @@ #define WORKSPACE_NAME_DISPLAY_PADDING 32 extern int ignore_wks_change; -extern WPreferences wPreferences; extern XContext wVEdgeContext; extern WShortKey wKeyBindings[WKBD_LAST]; -- 2.11.4.GIT