1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

Address some sparse warnings

Plain integer as NULL pointer, non-ANSI function declaration etc.
This commit is contained in:
Carlos R. Mafra
2010-04-12 23:31:59 +02:00
parent 62f4eff7ae
commit 4041278f48
21 changed files with 40 additions and 51 deletions

View File

@@ -815,7 +815,7 @@ void animateResize(WScreen *scr, int x, int y, int w, int h, int fx, int fy, int
} }
#endif /* ANIMATIONS */ #endif /* ANIMATIONS */
static void flushExpose() static void flushExpose(void)
{ {
XEvent tmpev; XEvent tmpev;

View File

@@ -35,7 +35,7 @@
#include "menu.h" #include "menu.h"
#include "actions.h" #include "actions.h"
#include "funcs.h" #include "funcs.h"
#include "appmenu.h"
#include "framewin.h" #include "framewin.h"
/******** Global Variables **********/ /******** Global Variables **********/

View File

@@ -104,7 +104,7 @@ int wMessageDialog(WScreen * scr, char *title, char *message, char *defBtn, char
return result; return result;
} }
void toggleSaveSession(WMWidget * w, void *data) static void toggleSaveSession(WMWidget *w, void *data)
{ {
wPreferences.save_session_on_exit = WMGetButtonSelected((WMButton *) w); wPreferences.save_session_on_exit = WMGetButtonSelected((WMButton *) w);
} }

View File

@@ -129,7 +129,7 @@ static void clipAutoRaise(void *cdata);
static void showClipBalloon(WDock * dock, int workspace); static void showClipBalloon(WDock * dock, int workspace);
static void make_keys() static void make_keys(void)
{ {
if (dCommand != NULL) if (dCommand != NULL)
return; return;

View File

@@ -72,7 +72,7 @@ static void putidef(char *line, char *name, int value)
strcat(line, tmp); strcat(line, tmp);
} }
static char *username() static char *username(void)
{ {
char *tmp; char *tmp;
@@ -235,7 +235,7 @@ Bool wGetIconName(Display *dpy, Window win, char **iconname)
return False; return False;
} }
static void eatExpose() static void eatExpose(void)
{ {
XEvent event, foo; XEvent event, foo;

View File

@@ -33,6 +33,7 @@
#include "WindowMaker.h" #include "WindowMaker.h"
#include "texture.h" #include "texture.h"
#include "resources.h"
#include "screen.h" #include "screen.h"
int wGetColor(WScreen * scr, char *color_name, XColor * color) int wGetColor(WScreen * scr, char *color_name, XColor * color)

View File

@@ -92,7 +92,7 @@ static WMPropList *dWorkspace;
static WMPropList *dDock; static WMPropList *dDock;
static WMPropList *dClip; static WMPropList *dClip;
static void make_keys() static void make_keys(void)
{ {
if (dApplications != NULL) if (dApplications != NULL)
return; return;

View File

@@ -104,7 +104,7 @@ static WMPropList *sShortcutMask;
static WMPropList *sDock; static WMPropList *sDock;
static WMPropList *sYes, *sNo; static WMPropList *sYes, *sNo;
static void make_keys() static void make_keys(void)
{ {
if (sApplications != NULL) if (sApplications != NULL)
return; return;

View File

@@ -301,7 +301,7 @@ static RETSIGTYPE buryChild(int foo)
errno = save_errno; errno = save_errno;
} }
static void getOffendingModifiers() static void getOffendingModifiers(void)
{ {
int i; int i;
XModifierKeymap *modmap; XModifierKeymap *modmap;

View File

@@ -34,8 +34,8 @@
#include "WindowMaker.h" #include "WindowMaker.h"
#include "screen.h" #include "screen.h"
#include "superfluous.h"
#include "dock.h" #include "dock.h"
#include "superfluous.h"
#include "framewin.h" #include "framewin.h"
#include "window.h" #include "window.h"
#include "actions.h" #include "actions.h"

View File

@@ -19,11 +19,12 @@
* USA. * USA.
*/ */
#ifndef WMSUPERFLUOUS_H
#define WMSUPERFLUOUS_H
#define PIECES ((64/ICON_KABOOM_PIECE_SIZE)*(64/ICON_KABOOM_PIECE_SIZE)) #define PIECES ((64/ICON_KABOOM_PIECE_SIZE)*(64/ICON_KABOOM_PIECE_SIZE))
extern void DoKaboom(WScreen *scr, Window win, int x, int y);
extern Pixmap MakeGhostDock(WDock *dock, int sx, int dx, int y);
extern Pixmap MakeGhostIcon(WScreen *scr, Drawable drawable);
extern void DoKaboom(); #endif /* WMSUPERFLUOUS_H */
extern Pixmap MakeGhostDock();
extern Pixmap MakeGhostIcon();

View File

@@ -81,7 +81,7 @@ static void focusWindow(WMenu * menu, WMenuEntry * entry)
} }
} }
void InitializeSwitchMenu() void InitializeSwitchMenu(void)
{ {
if (!initialized) { if (!initialized) {
initialized = 1; initialized = 1;
@@ -357,7 +357,7 @@ void UpdateSwitchMenu(WScreen * scr, WWindow * wwin, int action)
wMenuPaint(switchmenu); wMenuPaint(switchmenu);
} }
void UpdateSwitchMenuWorkspace(WScreen * scr, int workspace) static void UpdateSwitchMenuWorkspace(WScreen *scr, int workspace)
{ {
WMenu *menu = scr->switch_menu; WMenu *menu = scr->switch_menu;
int i; int i;

View File

@@ -435,7 +435,7 @@ WSwitchPanel *wInitSwitchPanel(WScreen * scr, WWindow * curwin, Bool class_only)
panel->scr = scr; panel->scr = scr;
panel->windows = makeWindowListArray(curwin, wPreferences.swtileImage != 0, class_only); panel->windows = makeWindowListArray(curwin, wPreferences.swtileImage != NULL, class_only);
count = WMGetArrayItemCount(panel->windows); count = WMGetArrayItemCount(panel->windows);
if (count == 0) { if (count == 0) {

View File

@@ -43,20 +43,15 @@
#include "icon.h" #include "icon.h"
/* Global stuff */ /* Global stuff */
extern WPreferences wPreferences; extern WPreferences wPreferences;
extern WMPropList *wAttributeDomainName; extern WMPropList *wAttributeDomainName;
extern WDDomain *WDWindowAttributes; extern WDDomain *WDWindowAttributes;
/* Local stuff */ /* Local stuff */
/* type converters */ /* type converters */
static int getBool(WMPropList *, WMPropList *); static int getBool(WMPropList *, WMPropList *);
static char *getString(WMPropList *, WMPropList *); static char *getString(WMPropList *, WMPropList *);
static WMPropList *ANoTitlebar = NULL; static WMPropList *ANoTitlebar = NULL;
static WMPropList *ANoResizebar; static WMPropList *ANoResizebar;
static WMPropList *ANoMiniaturizeButton; static WMPropList *ANoMiniaturizeButton;
@@ -84,11 +79,8 @@ static WMPropList *ASharedAppIcon; /* app */
#ifdef XKB_BUTTON_HINT #ifdef XKB_BUTTON_HINT
static WMPropList *ANoLanguageButton; static WMPropList *ANoLanguageButton;
#endif #endif
static WMPropList *AStartWorkspace; static WMPropList *AStartWorkspace;
static WMPropList *AIcon; static WMPropList *AIcon;
static WMPropList *AnyWindow; static WMPropList *AnyWindow;
static WMPropList *No; static WMPropList *No;
@@ -321,7 +313,8 @@ wDefaultFillAttributes(WScreen * scr, char *instance, char *class,
WMPLSetCaseSensitive(False); WMPLSetCaseSensitive(False);
} }
WMPropList *get_generic_value(WScreen * scr, char *instance, char *class, WMPropList * option, Bool noDefault) static WMPropList *get_generic_value(WScreen *scr, char *instance, char *class,
WMPropList *option, Bool noDefault)
{ {
WMPropList *value, *key, *dict; WMPropList *value, *key, *dict;

View File

@@ -165,7 +165,7 @@ WWindow *wWindowFor(Window window)
return NULL; return NULL;
} }
WWindow *wWindowCreate() WWindow *wWindowCreate(void)
{ {
WWindow *wwin; WWindow *wwin;
@@ -675,7 +675,7 @@ WWindow *wManageWindow(WScreen *scr, Window window)
XSetWindowBorderWidth(dpy, window, 0); XSetWindowBorderWidth(dpy, window, 0);
/* get hints from GNUstep app */ /* get hints from GNUstep app */
if (wwin->wm_class != 0 && strcmp(wwin->wm_class, "GNUstep") == 0) { if (wwin->wm_class != NULL && strcmp(wwin->wm_class, "GNUstep") == 0) {
wwin->flags.is_gnustep = 1; wwin->flags.is_gnustep = 1;
} }
if (!PropGetGNUstepWMAttr(window, &wwin->wm_gnustep_attr)) { if (!PropGetGNUstepWMAttr(window, &wwin->wm_gnustep_attr)) {
@@ -2571,7 +2571,7 @@ WMagicNumber wWindowAddSavedState(char *instance, char *class, char *command, pi
wstate = malloc(sizeof(WWindowState)); wstate = malloc(sizeof(WWindowState));
if (!wstate) if (!wstate)
return 0; return NULL;
memset(wstate, 0, sizeof(WWindowState)); memset(wstate, 0, sizeof(WWindowState));
wstate->pid = pid; wstate->pid = pid;

View File

@@ -355,7 +355,7 @@ typedef void* WMagicNumber;
void wWindowDestroy(WWindow *wwin); void wWindowDestroy(WWindow *wwin);
WWindow *wWindowCreate(); WWindow *wWindowCreate(void);
#ifdef SHAPE #ifdef SHAPE
void wWindowSetShape(WWindow *wwin); void wWindowSetShape(WWindow *wwin);

View File

@@ -118,13 +118,10 @@ typedef struct InspectorPanel {
} InspectorPanel; } InspectorPanel;
extern Cursor wCursor[WCUR_LAST]; extern Cursor wCursor[WCUR_LAST];
extern WDDomain *WDWindowAttributes; extern WDDomain *WDWindowAttributes;
static InspectorPanel *panelList = NULL;
extern WPreferences wPreferences; extern WPreferences wPreferences;
static InspectorPanel *panelList = NULL;
static WMPropList *ANoTitlebar = NULL; static WMPropList *ANoTitlebar = NULL;
static WMPropList *ANoResizebar; static WMPropList *ANoResizebar;
static WMPropList *ANoMiniaturizeButton; static WMPropList *ANoMiniaturizeButton;
@@ -151,14 +148,11 @@ static WMPropList *ASharedAppIcon;
#ifdef XKB_BUTTON_HINT #ifdef XKB_BUTTON_HINT
static WMPropList *ANoLanguageButton; static WMPropList *ANoLanguageButton;
#endif #endif
static WMPropList *AStartWorkspace; static WMPropList *AStartWorkspace;
static WMPropList *AIcon; static WMPropList *AIcon;
/* application wide options */ /* application wide options */
static WMPropList *AStartHidden; static WMPropList *AStartHidden;
static WMPropList *AnyWindow; static WMPropList *AnyWindow;
static WMPropList *EmptyString; static WMPropList *EmptyString;
static WMPropList *Yes, *No; static WMPropList *Yes, *No;
@@ -167,14 +161,13 @@ static WMPropList *Yes, *No;
#define PHEIGHT 350 #define PHEIGHT 350
static char *spec_text; static char *spec_text;
static void applySettings(WMButton * button, InspectorPanel * panel); static void applySettings(WMButton * button, InspectorPanel * panel);
#define UNDEFINED_POS 0xffffff #define UNDEFINED_POS 0xffffff
static InspectorPanel *createInspectorForWindow(WWindow * wwin, int xpos, int ypos, Bool showSelectPanel); static InspectorPanel *createInspectorForWindow(WWindow * wwin, int xpos, int ypos, Bool showSelectPanel);
static void make_keys() static void make_keys(void)
{ {
if (ANoTitlebar != NULL) if (ANoTitlebar != NULL)
return; return;
@@ -258,7 +251,7 @@ static void destroyInspector(WCoreWindow * foo, void *data, XEvent * event)
freeInspector(panel); freeInspector(panel);
} }
void wDestroyInspectorPanels() void wDestroyInspectorPanels(void)
{ {
InspectorPanel *panel; InspectorPanel *panel;

View File

@@ -874,7 +874,7 @@ static Bool updateStrut(WWindow * wwin, Bool adding)
int fmt_ret; int fmt_ret;
unsigned long nitems_ret; unsigned long nitems_ret;
unsigned long bytes_after_ret; unsigned long bytes_after_ret;
long *data = 0; long *data = NULL;
if (XGetWindowProperty(dpy, wwin->client_win, net_wm_strut, 0, 4, False, if (XGetWindowProperty(dpy, wwin->client_win, net_wm_strut, 0, 4, False,
XA_CARDINAL, &type_ret, &fmt_ret, &nitems_ret, XA_CARDINAL, &type_ret, &fmt_ret, &nitems_ret,
@@ -1177,7 +1177,7 @@ static void updateWindowType(WWindow * wwin)
int fmt_ret; int fmt_ret;
unsigned long nitems_ret; unsigned long nitems_ret;
unsigned long bytes_after_ret; unsigned long bytes_after_ret;
long *data = 0; long *data = NULL;
int layer; int layer;
if (XGetWindowProperty(dpy, wwin->client_win, net_wm_window_type, 0, 1, if (XGetWindowProperty(dpy, wwin->client_win, net_wm_window_type, 0, 1,
False, XA_ATOM, &type_ret, &fmt_ret, &nitems_ret, False, XA_ATOM, &type_ret, &fmt_ret, &nitems_ret,
@@ -1207,7 +1207,7 @@ Bool wNETWMCheckClientHints(WWindow * wwin, int *layer, int *workspace)
int fmt_ret; int fmt_ret;
unsigned long nitems_ret; unsigned long nitems_ret;
unsigned long bytes_after_ret; unsigned long bytes_after_ret;
long *data = 0; long *data = NULL;
Bool hasState = False; Bool hasState = False;
int i; int i;
@@ -1268,7 +1268,7 @@ static Bool updateNetIconInfo(WWindow * wwin)
int fmt_ret; int fmt_ret;
unsigned long nitems_ret; unsigned long nitems_ret;
unsigned long bytes_after_ret; unsigned long bytes_after_ret;
long *data = 0; long *data = NULL;
Bool hasState = False; Bool hasState = False;
Bool old_state = wwin->flags.net_handle_icon; Bool old_state = wwin->flags.net_handle_icon;
@@ -1348,7 +1348,7 @@ static void handleDesktopNames(XClientMessageEvent * event, WScreen * scr)
return; return;
} }
if (data == 0) if (data == NULL)
return; return;
if (type_ret != utf8_string || fmt_ret != 8) if (type_ret != utf8_string || fmt_ret != 8)
@@ -1516,7 +1516,7 @@ int wNETWMGetPidForWindow(Window window)
int fmt_ret; int fmt_ret;
unsigned long nitems_ret; unsigned long nitems_ret;
unsigned long bytes_after_ret; unsigned long bytes_after_ret;
long *data = 0; long *data = NULL;
int pid; int pid;
if (XGetWindowProperty(dpy, window, net_wm_pid, 0, 1, False, if (XGetWindowProperty(dpy, window, net_wm_pid, 0, 1, False,

View File

@@ -25,8 +25,8 @@
#ifndef _WMSPEC_H_ #ifndef _WMSPEC_H_
#define _WMSPEC_H_ #define _WMSPEC_H_
#include <screen.h> #include "screen.h"
#include <window.h> #include "window.h"
#include <X11/Xlib.h> #include <X11/Xlib.h>
void wNETWMInitStuff(WScreen *scr); void wNETWMInitStuff(WScreen *scr);

View File

@@ -63,7 +63,7 @@ extern void ProcessPendingEvents();
static WMPropList *dWorkspaces = NULL; static WMPropList *dWorkspaces = NULL;
static WMPropList *dClip, *dName; static WMPropList *dClip, *dName;
static void make_keys() static void make_keys(void)
{ {
if (dWorkspaces != NULL) if (dWorkspaces != NULL)
return; return;

View File

@@ -34,6 +34,7 @@ Perpetrator: Sudish Joseph <sj@eng.mindspring.net>, Sept. 1997. */
#include <X11/keysym.h> #include <X11/keysym.h>
#include <WINGs/WUtil.h> #include <WINGs/WUtil.h>
#include "xmodifier.h"
extern Display *dpy; extern Display *dpy;