From: "Rodolfo García Peñas (kix)" <[email protected]>

The global variable wPreferences should be defined at src/WindowMaker.h
because the struct WPreferences is in that file, and that file is included
in all .c files. So, if we include the wPreferences definition there, we
can remove all externs.
---
 src/WindowMaker.h |    1 +
 src/actions.c     |    1 -
 src/appicon.c     |    1 -
 src/appmenu.c     |    1 -
 src/balloon.c     |    2 --
 src/client.c      |    1 -
 src/cycling.c     |    2 --
 src/defaults.c    |    1 -
 src/dialog.c      |    2 --
 src/dock.c        |    1 -
 src/dockedapp.c   |    3 ---
 src/event.c       |    2 --
 src/framewin.c    |    2 --
 src/icon.c        |    3 ---
 src/main.c        |    2 --
 src/menu.c        |    4 ----
 src/misc.c        |    3 ---
 src/monitor.c     |    3 ---
 src/moveres.c     |    1 -
 src/placement.c   |    2 --
 src/rootmenu.c    |    1 -
 src/screen.c      |    1 -
 src/stacking.c    |    2 --
 src/startup.c     |    1 -
 src/superfluous.c |    2 --
 src/switchmenu.c  |    3 ---
 src/switchpanel.c |    2 --
 src/texture.c     |    2 --
 src/usermenu.c    |    2 --
 src/wcore.c       |    2 --
 src/wdefaults.c   |    1 -
 src/window.c      |    1 -
 src/winmenu.c     |    2 --
 src/winspector.c  |    1 -
 src/wmspec.c      |    1 -
 src/workspace.c   |    1 -
 36 files changed, 1 insertion(+), 62 deletions(-)

diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index ee6dbf9..425ae39 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -452,6 +452,7 @@ extern Display      *dpy;
 extern unsigned int ValidModMask;
 extern char WProgramState;
 extern char WProgramSigState;
+WPreferences wPreferences;
 
 /****** Notifications ******/
 extern const char *WMNManaged;
diff --git a/src/actions.c b/src/actions.c
index a79de8a..9a7d74e 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -52,7 +52,6 @@
 int ignore_wks_change = 0;
 extern Time LastTimestamp;
 extern Time LastFocusChange;
-extern WPreferences wPreferences;
 extern Atom _XA_WM_TAKE_FOCUS;
 extern void ProcessPendingEvents();
 extern int calcIntersectionLength(int p1, int l1, int p2, int l2);
diff --git a/src/appicon.c b/src/appicon.c
index 902559c..e9af354 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -58,7 +58,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 0d6c7f4..b5ca827 100644
--- a/src/appmenu.c
+++ b/src/appmenu.c
@@ -40,7 +40,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 c00375a..9d65d8c 100644
--- a/src/balloon.c
+++ b/src/balloon.c
@@ -43,8 +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 c11f306..1d75e32 100644
--- a/src/client.c
+++ b/src/client.c
@@ -582,7 +582,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 b2c7726..5601193 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 13c5d69..2ab83bc 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -73,7 +73,6 @@ extern WDDomain *WDWindowMaker;
 extern WDDomain *WDWindowAttributes;
 extern WDDomain *WDRootMenu;
 extern int wScreenCount;
-extern WPreferences wPreferences;
 extern WShortKey wKeyBindings[WKBD_LAST];
 
 typedef struct {
diff --git a/src/dialog.c b/src/dialog.c
index 6964495..ae88804 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -59,8 +59,6 @@
 #include "actions.h"
 #include "xinerama.h"
 
-extern WPreferences wPreferences;
-
 static WMPoint getCenter(WScreen * scr, int width, int height)
 {
        return wGetPointToCenterRectInHead(scr, 
wGetHeadForPointerLocation(scr), width, height);
diff --git a/src/dock.c b/src/dock.c
index 21d6aee..fbf1c1d 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -62,7 +62,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 6c6d1f0..00acc46 100644
--- a/src/dockedapp.c
+++ b/src/dockedapp.c
@@ -38,9 +38,6 @@
 #include "framewin.h"
 #include "xinerama.h"
 
-/**** Global variables ****/
-extern WPreferences wPreferences;
-
 static void updateCommand(WAppIcon * icon, char *command)
 {
        if (icon->command)
diff --git a/src/event.c b/src/event.c
index 2ac11f3..830da08 100644
--- a/src/event.c
+++ b/src/event.c
@@ -81,8 +81,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 b7a6e97..efc10e0 100644
--- a/src/framewin.c
+++ b/src/framewin.c
@@ -42,8 +42,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 13a0c94..0a965b7 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -45,9 +45,6 @@
 #include "appicon.h"
 #include "wmspec.h"
 
-/**** Global varianebles ****/
-extern WPreferences wPreferences;
-
 #define MOD_MASK wPreferences.modifier_mask
 #define CACHE_ICON_PATH "/Library/WindowMaker/CachedPixmaps"
 #define ICON_BORDER 3
diff --git a/src/main.c b/src/main.c
index 51808b0..d916547 100644
--- a/src/main.c
+++ b/src/main.c
@@ -77,8 +77,6 @@ char *Locale = NULL;
 
 int wScreenCount = 0;
 
-WPreferences wPreferences;
-
 WShortKey wKeyBindings[WKBD_LAST];
 
 /* defaults domains */
diff --git a/src/menu.c b/src/menu.c
index 7bb0639..d29b3f2 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -45,13 +45,9 @@
 #include "rootmenu.h"
 
 /****** Global Variables ******/
-
 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 9922ea2..4018f12 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -47,9 +47,6 @@
 #include "xutil.h"
 #include "xmodifier.h"
 
-/**** global variables *****/
-extern WPreferences wPreferences;
-
 /* XFetchName Wrapper */
 Bool wFetchName(Display *dpy, Window win, char **winname)
 {
diff --git a/src/monitor.c b/src/monitor.c
index ecf05b9..508918e 100644
--- a/src/monitor.c
+++ b/src/monitor.c
@@ -39,9 +39,6 @@
 #include "dialog.h"
 #include "main.h"
 
-/****** Global Variables ******/
-extern WPreferences wPreferences;
-
 int showCrashDialog(int sig)
 {
        int crashAction;
diff --git a/src/moveres.c b/src/moveres.c
index 44ddefa..c9b6eee 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 b30e0af..07bd510 100644
--- a/src/placement.c
+++ b/src/placement.c
@@ -39,8 +39,6 @@
 #include "dock.h"
 #include "xinerama.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 2fcd0ae..f7a875a 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -59,7 +59,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 *readMenuFile(WScreen * scr, char *file_name);
diff --git a/src/screen.c b/src/screen.c
index bc8f3fa..652ac05 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 890e4d1..11875c3 100644
--- a/src/stacking.c
+++ b/src/stacking.c
@@ -39,8 +39,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 e140026..a9da684 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -82,7 +82,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 135ce42..7531a33 100644
--- a/src/superfluous.c
+++ b/src/superfluous.c
@@ -49,8 +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)
 {
 #ifdef NORMAL_ICON_KABOOM
diff --git a/src/switchmenu.c b/src/switchmenu.c
index 6569252..9e84e68 100644
--- a/src/switchmenu.c
+++ b/src/switchmenu.c
@@ -43,9 +43,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 fcd61fa..6167e53 100644
--- a/src/switchpanel.c
+++ b/src/switchpanel.c
@@ -64,8 +64,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 a29406a..91f6351 100644
--- a/src/texture.c
+++ b/src/texture.c
@@ -33,8 +33,6 @@
 #include "texture.h"
 #include "funcs.h"
 
-extern WPreferences wPreferences;
-
 static void bevelImage(RImage * image, int relief);
 static RImage * get_texture_image(WScreen *scr, char *pixmap_file);
 
diff --git a/src/usermenu.c b/src/usermenu.c
index 22d089f..e00ecc2 100644
--- a/src/usermenu.c
+++ b/src/usermenu.c
@@ -81,8 +81,6 @@
 #define MAX_SHORTCUT_LENGTH 32
 
 /*** var ***/
-extern WPreferences wPreferences;
-
 typedef struct {
        WScreen *screen;
        WShortKey *key;
diff --git a/src/wcore.c b/src/wcore.c
index 1abe842..db8af82 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 0e7d6cd..65380b4 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 47d280c..b6f2c2f 100644
--- a/src/window.c
+++ b/src/window.c
@@ -82,7 +82,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 96609aa..b125622 100644
--- a/src/winmenu.c
+++ b/src/winmenu.c
@@ -73,8 +73,6 @@ extern Atom _XA_GNUSTEP_WM_MINIATURIZE_WINDOW;
 
 extern WShortKey wKeyBindings[WKBD_LAST];
 
-extern WPreferences wPreferences;
-
 static void updateOptionsMenu(WMenu * menu, WWindow * wwin);
 
 static void execWindowOptionCommand(WMenu * menu, WMenuEntry * entry)
diff --git a/src/winspector.c b/src/winspector.c
index 7335030..6a575ca 100644
--- a/src/winspector.c
+++ b/src/winspector.c
@@ -115,7 +115,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 c758f0a..c23c778 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 7b62798..a6ae262 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -53,7 +53,6 @@
 #define WORKSPACE_NAME_DISPLAY_PADDING 32
 
 extern int ignore_wks_change;
-extern WPreferences wPreferences;
 extern XContext wVEdgeContext;
 extern void ProcessPendingEvents();
 
-- 
1.7.10.4


-- 
To unsubscribe, send mail to [email protected].

Reply via email to