From d517d5cac05a6b0ea905ccf23d79efecb6a0c06e Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Sun, 12 May 2013 00:24:52 +0200 Subject: [PATCH] wmaker: Cleaned dangerous function prototype usage - remove extern declaration in source file, use header instead - add inclusion of header defining the functions of the file to get the compiler to cross-check them - marked static the functions that should not be visible ouside their file --- src/actions.c | 1 - src/colormap.c | 5 ++++- src/event.c | 1 - src/funcs.h | 1 + src/geomview.c | 3 +++ src/main.c | 1 + src/monitor.c | 2 +- src/moveres.c | 1 + src/osdep_bsd.c | 1 + src/osdep_darwin.c | 1 + src/osdep_linux.c | 2 ++ src/osdep_stub.c | 1 + src/placement.c | 5 +---- src/placement.h | 2 ++ src/properties.c | 1 + src/rootmenu.c | 1 + src/workspace.c | 1 - 17 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/actions.c b/src/actions.c index 3fb3fe62..17046cfd 100644 --- a/src/actions.c +++ b/src/actions.c @@ -56,7 +56,6 @@ extern Time LastTimestamp; extern Time LastFocusChange; extern WPreferences wPreferences; extern Atom _XA_WM_TAKE_FOCUS; -extern void ProcessPendingEvents(); static void find_Maximus_geometry(WWindow *wwin, WArea usableArea, int *new_x, int *new_y, unsigned int *new_width, unsigned int *new_height); diff --git a/src/colormap.c b/src/colormap.c index 3a8906ae..121d33b3 100644 --- a/src/colormap.c +++ b/src/colormap.c @@ -27,9 +27,12 @@ #include "WindowMaker.h" #include -#include "window.h" +#include "window.h" #include "framewin.h" +#include "colormap.h" + + void wColormapInstallForWindow(WScreen * scr, WWindow * wwin) { int i; diff --git a/src/event.c b/src/event.c index a05d6486..692fd8a9 100644 --- a/src/event.c +++ b/src/event.c @@ -327,7 +327,6 @@ void DispatchEvent(XEvent * event) #define BUFF_SIZE ((sizeof(struct inotify_event) + 64)*5) static void handle_inotify_events(int fd, int wd) { - extern void wDefaultsCheckDomains(void *); ssize_t eventQLength, i = 0; char buff[BUFF_SIZE] = { 0 }; /* Check config only once per read of the event queue */ diff --git a/src/funcs.h b/src/funcs.h index 848fc40c..b996856b 100644 --- a/src/funcs.h +++ b/src/funcs.h @@ -41,6 +41,7 @@ void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next, Bool class_only) void EventLoop(void); void DispatchEvent(XEvent *event); +void ProcessPendingEvents(void); WMagicNumber wAddDeathHandler(pid_t pid, WDeathHandler *callback, void *cdata); Bool IsDoubleClick(WScreen *scr, XEvent *event); diff --git a/src/geomview.c b/src/geomview.c index f067ce49..859cb4c6 100644 --- a/src/geomview.c +++ b/src/geomview.c @@ -1,6 +1,9 @@ #include +#include "geomview.h" + + typedef struct W_GeometryView { W_Class widgetClass; WMView *view; diff --git a/src/main.c b/src/main.c index f1a63b34..b1958e81 100644 --- a/src/main.c +++ b/src/main.c @@ -52,6 +52,7 @@ #include "session.h" #include "shutdown.h" #include "dialog.h" +#include "main.h" #include diff --git a/src/monitor.c b/src/monitor.c index 9267709b..22eaaa9e 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -43,7 +43,7 @@ /****** Global Variables ******/ extern WPreferences wPreferences; -int showCrashDialog(int sig) +static int showCrashDialog(int sig) { int crashAction; diff --git a/src/moveres.c b/src/moveres.c index 2d3574e2..23045eb5 100644 --- a/src/moveres.c +++ b/src/moveres.c @@ -37,6 +37,7 @@ #include "funcs.h" #include "actions.h" #include "workspace.h" +#include "placement.h" #include "geomview.h" #include "screen.h" diff --git a/src/osdep_bsd.c b/src/osdep_bsd.c index dbcdf9e2..e92a7c8f 100644 --- a/src/osdep_bsd.c +++ b/src/osdep_bsd.c @@ -32,6 +32,7 @@ #include #include "wconfig.h" +#include "funcs.h" /* * copy argc and argv for an existing process identified by `pid' diff --git a/src/osdep_darwin.c b/src/osdep_darwin.c index ca38df2c..04ece9f6 100644 --- a/src/osdep_darwin.c +++ b/src/osdep_darwin.c @@ -9,6 +9,7 @@ #include #include "wconfig.h" +#include "funcs.h" /* * copy argc and argv for an existing process identified by `pid' diff --git a/src/osdep_linux.c b/src/osdep_linux.c index fd97f59b..1336d2f8 100644 --- a/src/osdep_linux.c +++ b/src/osdep_linux.c @@ -12,6 +12,8 @@ #include #include "wconfig.h" +#include "funcs.h" + #define RETRY( x ) do { \ x; \ diff --git a/src/osdep_stub.c b/src/osdep_stub.c index 79fe9c16..d0349cda 100644 --- a/src/osdep_stub.c +++ b/src/osdep_stub.c @@ -4,6 +4,7 @@ #include #include "wconfig.h" +#include "funcs.h" Bool GetCommandForPid(int pid, char ***argv, int *argc) { diff --git a/src/placement.c b/src/placement.c index 5e4a8e77..1e707094 100644 --- a/src/placement.c +++ b/src/placement.c @@ -38,6 +38,7 @@ #include "application.h" #include "dock.h" #include "xinerama.h" +#include "placement.h" extern WPreferences wPreferences; @@ -47,10 +48,6 @@ extern WPreferences wPreferences; #define Y_ORIGIN WMAX(usableArea.y1,\ wPreferences.window_place_origin.y) -/* interactive window placement is in moveres.c */ -extern void InteractivePlaceWindow(WWindow *wwin, int *x_ret, int *y_ret, - unsigned width, unsigned height); - /* Returns True if it is an icon and is in this workspace */ static Bool iconPosition(WCoreWindow *wcore, int sx1, int sy1, int sx2, int sy2, diff --git a/src/placement.h b/src/placement.h index e9bfed8c..d3455ee3 100644 --- a/src/placement.h +++ b/src/placement.h @@ -33,6 +33,8 @@ int calcIntersectionArea(int x1, int y1, int w1, int h1, int x2, int y2, int w2, void PlaceWindow(WWindow *wwin, int *x_ret, int *y_ret, unsigned width, unsigned height); +void InteractivePlaceWindow(WWindow * wwin, int *x_ret, int *y_ret, unsigned width, unsigned height); + /* Set the points x and y inside the screen */ void get_right_position_on_screen(WScreen *scr, int *x, int *y, int size_x, int size_y); diff --git a/src/properties.c b/src/properties.c index 0442077d..5bde9124 100644 --- a/src/properties.c +++ b/src/properties.c @@ -29,6 +29,7 @@ #include "WindowMaker.h" #include "window.h" #include "GNUstep.h" +#include "properties.h" /* atoms */ extern Atom _XA_WM_STATE; diff --git a/src/rootmenu.c b/src/rootmenu.c index 28bed809..f93e5bf0 100644 --- a/src/rootmenu.c +++ b/src/rootmenu.c @@ -52,6 +52,7 @@ #include "session.h" #include "shutdown.h" #include "xmodifier.h" +#include "rootmenu.h" #include diff --git a/src/workspace.c b/src/workspace.c index b4cccd0c..ab79e680 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -61,7 +61,6 @@ extern int ignore_wks_change; extern WPreferences wPreferences; extern XContext wVEdgeContext; -extern void ProcessPendingEvents(); extern WShortKey wKeyBindings[WKBD_LAST]; static WMPropList *dWorkspaces = NULL; -- 2.11.4.GIT