From 6082f2d2438b0bf8a4e1718f4cbf61894f6926cc Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Thu, 8 Apr 2010 14:43:49 -0400 Subject: [PATCH] Fix trivial warnings * Format string integer size warnings * Missing or non-value returns in non-void functions * A missing #include in WPrefs.app/MouseSettings.c --- WINGs/dragcommon.c | 2 +- WINGs/proplist.c | 1 + WPrefs.app/MouseSettings.c | 1 + src/appmenu.c | 22 +++++++++++----------- src/dock.c | 2 +- src/rootmenu.c | 2 +- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/WINGs/dragcommon.c b/WINGs/dragcommon.c index feb2e87a..8cce2eec 100644 --- a/WINGs/dragcommon.c +++ b/WINGs/dragcommon.c @@ -135,7 +135,7 @@ W_SendDnDClientMessage(Display * dpy, Window win, Atom message, #endif if (!windowExists(dpy, win)) { - wwarning("xdnd message target %d does no longer exist.", win); + wwarning("xdnd message target %lu does no longer exist.", win); return False; /* message not sent */ } diff --git a/WINGs/proplist.c b/WINGs/proplist.c index 476fa659..7d6d3c45 100644 --- a/WINGs/proplist.c +++ b/WINGs/proplist.c @@ -1746,4 +1746,5 @@ int wrmdirhier(const char *path) } + return 1; } diff --git a/WPrefs.app/MouseSettings.c b/WPrefs.app/MouseSettings.c index ab240617..418680e2 100644 --- a/WPrefs.app/MouseSettings.c +++ b/WPrefs.app/MouseSettings.c @@ -25,6 +25,7 @@ #include +#include #include /* double-click tester */ diff --git a/src/appmenu.c b/src/appmenu.c index 0e182c62..5778caba 100644 --- a/src/appmenu.c +++ b/src/appmenu.c @@ -96,11 +96,11 @@ static WMenu *parseMenuCommand(WScreen * scr, Window win, char **slist, int coun char rtext[300]; if (strlen(slist[*index]) > 300) { - wwarning("appmenu: menu command size exceeded in window %x", win); + wwarning("appmenu: menu command size exceeded in window %lx", win); return NULL; } if (sscanf(slist[*index], "%i %i %n", &command, &code, &pos) < 2 || command != wmBeginMenu) { - wwarning("appmenu: bad menu entry \"%s\" in window %x", slist[*index], win); + wwarning("appmenu: bad menu entry \"%s\" in window %lx", slist[*index], win); return NULL; } strcpy(title, &slist[*index][pos]); @@ -113,7 +113,7 @@ static WMenu *parseMenuCommand(WScreen * scr, Window win, char **slist, int coun if (sscanf(slist[*index], "%i", &command) != 1) { wMenuDestroy(menu, True); - wwarning("appmenu: bad menu entry \"%s\" in window %x", slist[*index], win); + wwarning("appmenu: bad menu entry \"%s\" in window %lx", slist[*index], win); return NULL; } @@ -129,7 +129,7 @@ static WMenu *parseMenuCommand(WScreen * scr, Window win, char **slist, int coun if (sscanf(slist[*index], "%i %i %i %i %n", &command, &ecode, &etag, &enab, &pos) != 4 || ecode != code) { wMenuDestroy(menu, True); - wwarning("appmenu: bad menu entry \"%s\" in window %x", + wwarning("appmenu: bad menu entry \"%s\" in window %lx", slist[*index], win); return NULL; } @@ -139,14 +139,14 @@ static WMenu *parseMenuCommand(WScreen * scr, Window win, char **slist, int coun if (sscanf(slist[*index], "%i %i %i %i %s %n", &command, &ecode, &etag, &enab, rtext, &pos) != 5 || ecode != code) { wMenuDestroy(menu, True); - wwarning("appmenu: bad menu entry \"%s\" in window %x", + wwarning("appmenu: bad menu entry \"%s\" in window %lx", slist[*index], win); return NULL; } strcpy(title, &slist[*index][pos]); } if (!(data = malloc(sizeof(WAppMenuData)))) { - wwarning("appmenu: out of memory making menu for window %x", win); + wwarning("appmenu: out of memory making menu for window %lx", win); wMenuDestroy(menu, True); return NULL; } @@ -156,7 +156,7 @@ static WMenu *parseMenuCommand(WScreen * scr, Window win, char **slist, int coun entry = wMenuAddCallback(menu, title, notifyClient, data); if (!entry) { wMenuDestroy(menu, True); - wwarning("appmenu: out of memory creating menu for window %x", slist[*index], win); + wwarning("appmenu: out of memory creating menu for window %lx", win); wfree(data); return NULL; } @@ -175,7 +175,7 @@ static WMenu *parseMenuCommand(WScreen * scr, Window win, char **slist, int coun if (sscanf(slist[*index], "%i %i %i %i %i %n", &command, &ecode, &etag, &enab, &ncode, &pos) != 5 || ecode != code) { wMenuDestroy(menu, True); - wwarning("appmenu: bad menu entry \"%s\" in window %x", slist[*index], win); + wwarning("appmenu: bad menu entry \"%s\" in window %lx", slist[*index], win); return NULL; } @@ -189,7 +189,7 @@ static WMenu *parseMenuCommand(WScreen * scr, Window win, char **slist, int coun if (!entry) { wMenuDestroy(menu, True); wMenuDestroy(submenu, True); - wwarning("appmenu: out of memory creating menu for window %x", slist[*index], win); + wwarning("appmenu: out of memory creating menu for window %lx", win); return NULL; } @@ -197,7 +197,7 @@ static WMenu *parseMenuCommand(WScreen * scr, Window win, char **slist, int coun } else { wMenuDestroy(menu, True); - wwarning("appmenu: bad menu entry \"%s\" in window %x", slist[*index], win); + wwarning("appmenu: bad menu entry \"%s\" in window %lx", slist[*index], win); return NULL; } } @@ -221,7 +221,7 @@ WMenu *wAppMenuGet(WScreen * scr, Window window) } XFree(text_prop.value); if (strcmp(slist[0], "WMMenu 0") != 0) { - wwarning("appmenu: unknown version of WMMenu in window %x: %s", window, slist[0]); + wwarning("appmenu: unknown version of WMMenu in window %lx: %s", window, slist[0]); XFreeStringList(slist); return NULL; } diff --git a/src/dock.c b/src/dock.c index 00f19341..e4a6022e 100644 --- a/src/dock.c +++ b/src/dock.c @@ -3514,7 +3514,7 @@ static Bool handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event) Bool hasMoved = False; if (wPreferences.flags.noupdates) - return; + return hasMoved; if (XGrabPointer(dpy, icon->core->window, True, ButtonMotionMask | ButtonReleaseMask | ButtonPressMask, GrabModeAsync, diff --git a/src/rootmenu.c b/src/rootmenu.c index 29687a94..02388b2b 100644 --- a/src/rootmenu.c +++ b/src/rootmenu.c @@ -1212,7 +1212,7 @@ static WMenu *readMenuPipe(WScreen * scr, char **file_name) separateline(line, title, command, params, shortcut); if (!command[0]) { - wwarning(_("%s:missing command in menu config: %s"), file_name, line); + wwarning(_("%s:missing command in menu config: %s"), filename, line); break; } if (strcasecmp(command, "MENU") == 0) {