hi,

here are two patches.

0001-Adapt-for-libpng-changes.patch tweaks wrlib/png.c a bit to 
accomodate for (not so) recent libpng changes; this is likely safe and 
can get in with minimal testing.

0002-Remove-warnings.patch is a monster fixing gcc46 warnings; this 
needs some testing love, though things generally appear to work. 
carlos, if it more or less works for you as well, next can probably 
take it (i've only tested it on freebsd now, so you'll do linux now :)

-- 
[-]

mkdir /nonexistent
From d2c422ea86af937241ddc013e79b5c82f1060930 Mon Sep 17 00:00:00 2001
From: Tamas TEVESZ <[email protected]>
Date: Mon, 21 Mar 2011 18:40:01 +0100
Subject: [PATCH 1/2] Adapt for libpng changes

---
 wrlib/png.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/wrlib/png.c b/wrlib/png.c
index b4d62cf..5cb9918 100644
--- a/wrlib/png.c
+++ b/wrlib/png.c
@@ -76,7 +76,11 @@ RImage *RLoadPNG(RContext * context, char *file)
 	}
 
 	RErrorCode = RERR_INTERNAL;
+#if PNG_LIBPNG_VER - 0 < 10400
 	if (setjmp(png->jmpbuf)) {
+#else
+	if (setjmp(png_jmpbuf(png))) {
+#endif
 		fclose(f);
 		png_destroy_read_struct(&png, &pinfo, &einfo);
 		if (image)
-- 
1.7.4.1

From ba79b3cedc854807068550bac2b1115312d1d3a1 Mon Sep 17 00:00:00 2001
From: Tamas TEVESZ <[email protected]>
Date: Mon, 21 Mar 2011 18:40:14 +0100
Subject: [PATCH 2/2] Remove warnings

* Remove assigned but not used variables (GCC 4.6)
* Bump _XOPEN_SOURCE to 600, ridding of FreeBSD warnings (this needs to be generalized
  to be effective throughout the whole tree, not just individual files)
---
 WINGs/proplist.c                |    7 ++---
 WINGs/wcolorpanel.c             |    5 +--
 WINGs/wlist.c                   |    3 --
 WINGs/wpopupbutton.c            |    3 +-
 WINGs/wsplitview.c              |    3 --
 WINGs/wtextfield.c              |    8 +------
 WPrefs.app/Appearance.c         |    6 -----
 WPrefs.app/Menu.c               |   18 ++++++--------
 WPrefs.app/TexturePanel.c       |    3 --
 WPrefs.app/main.c               |    3 +-
 WPrefs.app/xmodifier.c          |   17 ++++----------
 src/application.c               |    2 -
 src/defaults.c                  |    5 +---
 src/dialog.c                    |    5 +---
 src/dock.c                      |    3 +-
 src/icon.c                      |    4 +--
 src/main.c                      |    6 +----
 src/menu.c                      |    7 +-----
 src/misc.c                      |    2 -
 src/moveres.c                   |   13 +---------
 src/rootmenu.c                  |    5 +---
 src/workspace.c                 |    6 +---
 src/xmodifier.c                 |   46 ++++----------------------------------
 util/getstyle.c                 |    2 +-
 util/seticons.c                 |    3 +-
 util/wdwrite.c                  |    3 +-
 util/wmagnify.c                 |    3 --
 util/wmgenmenu.c                |    1 +
 util/wmmenugen.c                |    8 +++---
 util/wmmenugen_parse_wmconfig.c |    8 +++---
 util/wmmenugen_parse_xdg.c      |    7 ++---
 31 files changed, 52 insertions(+), 163 deletions(-)

diff --git a/WINGs/proplist.c b/WINGs/proplist.c
index 9e0d12b..2e25e39 100644
--- a/WINGs/proplist.c
+++ b/WINGs/proplist.c
@@ -1,8 +1,7 @@
 
-#if __GLIBC__ && \
-    (_XOPEN_SOURCE && _XOPEN_SOURCE < 500) || \
-    !_XOPEN_SOURCE
-#define _XOPEN_SOURCE 500		/* nftw */
+#if !defined(_XOPEN_SOURCE) || _XOPEN_SOURCE - 0 < 600
+#undef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 600
 #endif
 
 #include <sys/types.h>
diff --git a/WINGs/wcolorpanel.c b/WINGs/wcolorpanel.c
index ee419aa..7ebe8ba 100644
--- a/WINGs/wcolorpanel.c
+++ b/WINGs/wcolorpanel.c
@@ -2725,7 +2725,6 @@ static void customSetPalette(W_ColorPanel * panel)
 	W_Screen *scr = WMWidgetScreen(panel->win);
 	RImage *scaledImg;
 	Pixmap image;
-	int item;
 
 	image = XCreatePixmap(scr->display, W_DRAWABLE(scr), customPaletteWidth, customPaletteHeight, scr->depth);
 	scaledImg = RScaleImage(panel->customPaletteImg, customPaletteWidth, customPaletteHeight);
@@ -2751,7 +2750,7 @@ static void customSetPalette(W_ColorPanel * panel)
 	panel->palXRatio = (double)(panel->customPaletteImg->width) / (double)(customPaletteWidth);
 	panel->palYRatio = (double)(panel->customPaletteImg->height) / (double)(customPaletteHeight);
 
-	item = WMGetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn);
+	WMGetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn);
 }
 
 static void customPalettePositionSelection(W_ColorPanel * panel, int x, int y)
@@ -3366,7 +3365,7 @@ static int fetchFile(char *toPath, char *srcFile, char *destFile)
 			break;
 
 		RETRY( nwritten = fwrite(buf, 1, nread, dst) )
-		if (ferror(dst) || feof(src))
+		if (ferror(dst) || feof(src) || nread != nwritten)
 			break;
 
 	} while (1);
diff --git a/WINGs/wlist.c b/WINGs/wlist.c
index b58d68d..e855754 100644
--- a/WINGs/wlist.c
+++ b/WINGs/wlist.c
@@ -390,12 +390,9 @@ static void scrollByAmount(WMList * lPtr, int amount)
 static void vScrollCallBack(WMWidget * scroller, void *self)
 {
 	WMList *lPtr = (WMList *) self;
-	int height;
 	int oldTopItem = lPtr->topItem;
 	int itemCount = WMGetArrayItemCount(lPtr->items);
 
-	height = lPtr->view->size.height - 4;
-
 	switch (WMGetScrollerHitPart((WMScroller *) scroller)) {
 	case WSDecrementLine:
 		scrollByAmount(lPtr, -1);
diff --git a/WINGs/wpopupbutton.c b/WINGs/wpopupbutton.c
index 648039a..9982cc7 100644
--- a/WINGs/wpopupbutton.c
+++ b/WINGs/wpopupbutton.c
@@ -330,7 +330,7 @@ static void paintMenuEntry(PopUpButton * bPtr, int index, int highlight)
 {
 	W_Screen *scr = bPtr->view->screen;
 	int yo;
-	int width, height, itemHeight, itemCount;
+	int width, itemHeight, itemCount;
 	char *title;
 
 	itemCount = WMGetArrayItemCount(bPtr->items);
@@ -339,7 +339,6 @@ static void paintMenuEntry(PopUpButton * bPtr, int index, int highlight)
 
 	itemHeight = bPtr->view->size.height;
 	width = bPtr->view->size.width;
-	height = itemHeight * itemCount;
 	yo = (itemHeight - WMFontHeight(scr->normalFont)) / 2;
 
 	if (!highlight) {
diff --git a/WINGs/wsplitview.c b/WINGs/wsplitview.c
index 7568a37..e1dcd81 100644
--- a/WINGs/wsplitview.c
+++ b/WINGs/wsplitview.c
@@ -722,13 +722,10 @@ void WMRemoveSplitViewSubview(WMSplitView * sPtr, WMView * view)
 
 void WMRemoveSplitViewSubviewAt(WMSplitView * sPtr, int index)
 {
-	W_SplitViewSubview *p;
-
 	CHECK_CLASS(sPtr, WC_SplitView);
 
 	/* TODO: same about rewrite */
 	if (index >= 0 && index < _GetSubviewsCount()) {
-		p = _GetPSubviewStructAt(index);
 		WMDeleteFromArray(sPtr->subviews, index);
 		sPtr->flags.adjustOnPaint = 1;
 		paintSplitView(sPtr);
diff --git a/WINGs/wtextfield.c b/WINGs/wtextfield.c
index 67cc230..4d4c645 100644
--- a/WINGs/wtextfield.c
+++ b/WINGs/wtextfield.c
@@ -755,7 +755,7 @@ static void paintTextField(TextField * tPtr)
 	W_Screen *screen = tPtr->view->screen;
 	W_View *view = tPtr->view;
 	W_View viewbuffer;
-	int tx, ty, tw, th;
+	int tx, ty, tw;
 	int rx;
 	int bd;
 	int totalWidth;
@@ -792,8 +792,6 @@ static void paintTextField(TextField * tPtr)
 	if (tPtr->textLen > 0) {
 		tw = WMWidthOfString(tPtr->font, &(text[tPtr->viewPosition]), tPtr->textLen - tPtr->viewPosition);
 
-		th = WMFontHeight(tPtr->font);
-
 		ty = tPtr->offsetWidth;
 		switch (tPtr->flags.alignment) {
 		case WALeft:
@@ -1334,7 +1332,6 @@ static void pasteText(WMView * view, Atom selection, Atom target, Time timestamp
 static void handleTextFieldActionEvents(XEvent * event, void *data)
 {
 	TextField *tPtr = (TextField *) data;
-	static int move = 0;
 	static Time lastButtonReleasedEvent = 0;
 	static Time lastButtonReleasedEvent2 = 0;
 	Display *dpy = event->xany.display;
@@ -1406,7 +1403,6 @@ static void handleTextFieldActionEvents(XEvent * event, void *data)
 			break;
 		}
 
-		move = 1;
 		switch (tPtr->flags.alignment) {
 			int textWidth;
 		case WARight:
@@ -1485,8 +1481,6 @@ static void handleTextFieldActionEvents(XEvent * event, void *data)
 			XStoreBuffer(dpy, &tPtr->text[start], count, 0);
 		}
 
-		move = 0;
-
 		if (!tPtr->flags.secure &&
 		    event->xbutton.time - lastButtonReleasedEvent <= WINGsConfiguration.doubleClickDelay) {
 
diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c
index 005db34..f266382 100644
--- a/WPrefs.app/Appearance.c
+++ b/WPrefs.app/Appearance.c
@@ -1060,8 +1060,6 @@ static void changePage(WMWidget * w, void *data)
 {
 	_Panel *panel = (_Panel *) data;
 	int section;
-	WMListItem *item;
-	TextureListItem *titem;
 	WMScreen *scr = WMWidgetScreen(panel->box);
 	RContext *rc = WMScreenRContext(scr);
 	static WMPoint positions[] = {
@@ -1080,10 +1078,6 @@ static void changePage(WMWidget * w, void *data)
 		WMSelectListItem(panel->texLs, panel->textureIndex[section]);
 
 		WMSetListPosition(panel->texLs, panel->textureIndex[section] - 2);
-
-		item = WMGetListItem(panel->texLs, panel->textureIndex[section]);
-
-		titem = (TextureListItem *) item->clientData;
 	}
 	{
 		WMColor *color;
diff --git a/WPrefs.app/Menu.c b/WPrefs.app/Menu.c
index c179e68..66b24d1 100644
--- a/WPrefs.app/Menu.c
+++ b/WPrefs.app/Menu.c
@@ -466,20 +466,18 @@ static void createPanel(_Panel * p)
 
 	{
 		WEditMenu *pad;
-		WEditMenu *smenu;
-		ItemData *data;
 
 		pad = makeFactoryMenu(panel->box, 150);
 		WMMoveWidget(pad, 10, 40);
 
-		data = putNewItem(panel, pad, ExecInfo, _("Run Program"));
-		data = putNewItem(panel, pad, CommandInfo, _("Internal Command"));
-		smenu = putNewSubmenu(pad, _("Submenu"));
-		data = putNewItem(panel, pad, ExternalInfo, _("External Submenu"));
-		data = putNewItem(panel, pad, PipeInfo, _("Generated Submenu"));
-		data = putNewItem(panel, pad, DirectoryInfo, _("Directory Contents"));
-		data = putNewItem(panel, pad, WSMenuInfo, _("Workspace Menu"));
-		data = putNewItem(panel, pad, WWindowListInfo, _("Window List Menu"));
+		putNewItem(panel, pad, ExecInfo, _("Run Program"));
+		putNewItem(panel, pad, CommandInfo, _("Internal Command"));
+		putNewSubmenu(pad, _("Submenu"));
+		putNewItem(panel, pad, ExternalInfo, _("External Submenu"));
+		putNewItem(panel, pad, PipeInfo, _("Generated Submenu"));
+		putNewItem(panel, pad, DirectoryInfo, _("Directory Contents"));
+		putNewItem(panel, pad, WSMenuInfo, _("Workspace Menu"));
+		putNewItem(panel, pad, WWindowListInfo, _("Window List Menu"));
 
 		panel->itemPad[0] = pad;
 	}
diff --git a/WPrefs.app/TexturePanel.c b/WPrefs.app/TexturePanel.c
index 15dd890..ae3ee64 100644
--- a/WPrefs.app/TexturePanel.c
+++ b/WPrefs.app/TexturePanel.c
@@ -427,7 +427,6 @@ static void paintGradListItem(WMList * lPtr, int index, Drawable d, char *text,
 	WMColor *white = WMWhiteColor(scr);
 	WMColor *black = WMBlackColor(scr);
 	WMColor *gray = WMGrayColor(scr);
-	WMListItem *item;
 	int width, height, x, y;
 	Display *dpy;
 
@@ -443,8 +442,6 @@ static void paintGradListItem(WMList * lPtr, int index, Drawable d, char *text,
 	else
 		XFillRectangle(dpy, d, WMColorGC(gray), x, y, width, height);
 
-	item = WMGetListItem(lPtr, index);
-
 	if (panel->gimage) {
 		XCopyArea(WMScreenDisplay(scr), panel->gimage, d, WMColorGC(white),
 			  0, height * index, 30, height, x + 5, y);
diff --git a/WPrefs.app/main.c b/WPrefs.app/main.c
index 40e0134..9204e89 100644
--- a/WPrefs.app/main.c
+++ b/WPrefs.app/main.c
@@ -88,7 +88,7 @@ int main(int argc, char **argv)
 {
 	Display *dpy;
 	WMScreen *scr;
-	char *locale, *path;
+	char *path;
 	int i;
 	char *display_name = "";
 
@@ -131,7 +131,6 @@ int main(int argc, char **argv)
 		}
 	}
 
-	locale = getenv("LANG");
 	setlocale(LC_ALL, "");
 
 #ifdef I18N
diff --git a/WPrefs.app/xmodifier.c b/WPrefs.app/xmodifier.c
index 7bcb9d4..a83e19c 100644
--- a/WPrefs.app/xmodifier.c
+++ b/WPrefs.app/xmodifier.c
@@ -110,9 +110,6 @@ static const char *index_to_name(int indice)
 static void x_reset_modifier_mapping(Display * display)
 {
 	int modifier_index, modifier_key, column, mkpm;
-	int warned_about_overlapping_modifiers = 0;
-	int warned_about_predefined_modifiers = 0;
-	int warned_about_duplicate_modifiers = 0;
 	int meta_bit = 0;
 	int hyper_bit = 0;
 	int super_bit = 0;
@@ -122,26 +119,22 @@ static void x_reset_modifier_mapping(Display * display)
 
 #define modwarn(name,old,other)							\
     wwarning ("%s (0x%x) generates %s, which is generated by %s.",		\
-    name, code, index_to_name (old), other),					\
-    warned_about_overlapping_modifiers = 1
+    name, code, index_to_name (old), other)
 
 #define modbarf(name,other)							\
     wwarning ("%s (0x%x) generates %s, which is nonsensical.",			\
-    name, code, other),								\
-    warned_about_predefined_modifiers = 1
+    name, code, other)
 
 #define check_modifier(name,mask)						\
     if ((1<<modifier_index) != mask)						\
     wwarning ("%s (0x%x) generates %s, which is nonsensical.",			\
-    name, code, index_to_name (modifier_index)),				\
-    warned_about_predefined_modifiers = 1
+    name, code, index_to_name (modifier_index))
 
 #define store_modifier(name,old)						\
     if (old && old != modifier_index)						\
     wwarning ("%s (0x%x) generates both %s and %s, which is nonsensical.",	\
     name, code, index_to_name (old),						\
-    index_to_name (modifier_index)),						\
-    warned_about_duplicate_modifiers = 1;					\
+    index_to_name (modifier_index));						\
     if (modifier_index == ShiftMapIndex) modbarf (name,"ModShift");		\
     else if (modifier_index == LockMapIndex) modbarf (name,"ModLock");		\
     else if (modifier_index == ControlMapIndex) modbarf (name,"ModControl");	\
@@ -253,7 +246,7 @@ static void x_reset_modifier_mapping(Display * display)
 			warn = "Alt", alt_bit = 0;
 		if (warn) {
 			wwarning("%s is being used for both Mode_switch and %s.",
-			     index_to_name(mode_bit), warn), warned_about_overlapping_modifiers = 1;
+			     index_to_name(mode_bit), warn);
 		}
 	}
 
diff --git a/src/application.c b/src/application.c
index f3993ff..8f64770 100644
--- a/src/application.c
+++ b/src/application.c
@@ -377,7 +377,6 @@ WApplication *wApplicationCreate(WWindow * wwin)
 
 void wApplicationDestroy(WApplication * wapp)
 {
-	Window main_window;
 	WWindow *wwin;
 	WScreen *scr;
 
@@ -400,7 +399,6 @@ void wApplicationDestroy(WApplication * wapp)
 	}
 
 	scr = wapp->main_window_desc->screen_ptr;
-	main_window = wapp->main_window;
 
 	if (wapp == scr->wapp_list) {
 		if (wapp->next)
diff --git a/src/defaults.c b/src/defaults.c
index 9f953b1..3de5761 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -1009,14 +1009,12 @@ void wReadDefaults(WScreen * scr, WMPropList * new_dict)
 {
 	WMPropList *plvalue, *old_value;
 	WDefaultEntry *entry;
-	unsigned int i, must_update;
+	unsigned int i;
 	int update_workspace_back = 0;	/* kluge :/ */
 	unsigned int needs_refresh;
 	void *tdata;
 	WMPropList *old_dict = (WDWindowMaker->dictionary != new_dict ? WDWindowMaker->dictionary : NULL);
 
-	must_update = 0;
-
 	needs_refresh = 0;
 
 	for (i = 0; i < sizeof(optionList) / sizeof(WDefaultEntry); i++) {
@@ -1037,7 +1035,6 @@ void wReadDefaults(WScreen * scr, WMPropList * new_dict)
 			plvalue = entry->plvalue;
 			if (plvalue && new_dict) {
 				WMPutInPLDictionary(new_dict, entry->plkey, plvalue);
-				must_update = 1;
 			}
 		} else if (!plvalue) {
 			/* value was deleted from DB. Keep current value */
diff --git a/src/dialog.c b/src/dialog.c
index 576220d..904eac3 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -808,7 +808,6 @@ static void keyPressHandler(XEvent * event, void *data)
 {
 	IconPanel *panel = (IconPanel *) data;
 	char buffer[32];
-	int count;
 	KeySym ksym;
 	int iidx;
 	int didx;
@@ -819,7 +818,7 @@ static void keyPressHandler(XEvent * event, void *data)
 		return;
 
 	buffer[0] = 0;
-	count = XLookupString(&event->xkey, buffer, sizeof(buffer), &ksym, NULL);
+	XLookupString(&event->xkey, buffer, sizeof(buffer), &ksym, NULL);
 
 	iidx = WMGetListSelectedItemRow(panel->iconList);
 	didx = WMGetListSelectedItemRow(panel->dirList);
@@ -1103,7 +1102,6 @@ void wShowInfoPanel(WScreen * scr)
 {
 	InfoPanel *panel;
 	WMPixmap *logo;
-	WMSize size;
 	WMFont *font;
 	char *strbuf = NULL;
 	char buffer[256];
@@ -1142,7 +1140,6 @@ void wShowInfoPanel(WScreen * scr)
 		logo = WMRetainPixmap(WMGetApplicationIconPixmap(scr->wmscreen));
 	}
 	if (logo) {
-		size = WMGetPixmapSize(logo);
 		panel->logoL = WMCreateLabel(panel->win);
 		WMResizeWidget(panel->logoL, 64, 64);
 		WMMoveWidget(panel->logoL, 30, 20);
diff --git a/src/dock.c b/src/dock.c
index 736823c..5afd9db 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -2262,10 +2262,9 @@ Bool wDockSnapIcon(WDock * dock, WAppIcon * icon, int req_x, int req_y, int *ret
 	int i, offset = ICON_SIZE / 2;
 	WAppIcon *aicon = NULL;
 	WAppIcon *nicon = NULL;
-	int max_y_icons, max_x_icons;
+	int max_y_icons;
 
 	/* TODO: XINERAMA, for these */
-	max_x_icons = scr->scr_width / ICON_SIZE;
 	max_y_icons = scr->scr_height / ICON_SIZE - 1;
 
 	if (wPreferences.flags.noupdates)
diff --git a/src/icon.c b/src/icon.c
index 9f45e8f..5660d6b 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -625,7 +625,7 @@ void wIconUpdate(WIcon * icon)
 		int x, y;
 		unsigned int w, h;
 		Window jw;
-		int ji, dotitle;
+		int ji;
 		unsigned int ju, d;
 		Pixmap pixmap;
 
@@ -646,7 +646,6 @@ void wIconUpdate(WIcon * icon)
 
 		if (icon->show_title && (title_height < wPreferences.icon_size)) {
 			drawIconTitle(scr, pixmap, title_height);
-			dotitle = 1;
 
 			if (h > wPreferences.icon_size - title_height - 2) {
 				h = wPreferences.icon_size - title_height - 2;
@@ -655,7 +654,6 @@ void wIconUpdate(WIcon * icon)
 				y = (wPreferences.icon_size - h - title_height) / 2 + title_height + 1;
 			}
 		} else {
-			dotitle = 0;
 			if (w > wPreferences.icon_size)
 				w = wPreferences.icon_size;
 			y = (wPreferences.icon_size - h) / 2;
diff --git a/src/main.c b/src/main.c
index 41c011b..c17dcef 100644
--- a/src/main.c
+++ b/src/main.c
@@ -592,10 +592,9 @@ int main(int argc, char **argv)
 
 static int real_main(int argc, char **argv)
 {
-	int i, restart = 0;
+	int i;
 	char *pos;
 	int d, s;
-	int flag;
 
 	setlocale(LC_ALL, "");
 	wsetabort(wAbort);
@@ -603,7 +602,6 @@ static int real_main(int argc, char **argv)
 	/* for telling WPrefs what's the name of the wmaker binary being ran */
 	setenv("WMAKER_BIN_NAME", argv[0], 1);
 
-	flag = 0;
 	ArgCount = argc;
 	Arguments = wmalloc(sizeof(char *) * (ArgCount + 1));
 	for (i = 0; i < argc; i++) {
@@ -619,8 +617,6 @@ static int real_main(int argc, char **argv)
 	else
 		ProgName++;
 
-	restart = 0;
-
 	if (argc > 1) {
 		for (i = 1; i < argc; i++) {
 #ifdef USECPP
diff --git a/src/menu.c b/src/menu.c
index dafdbdd..11e6a7f 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -802,7 +802,7 @@ static void move_menus(WMenu * menu, int x, int y)
 static void makeVisible(WMenu * menu)
 {
 	WScreen *scr = menu->frame->screen_ptr;
-	int x1, y1, x2, y2, new_x, new_y, move;
+	int x1, y1, x2, y2, new_x, new_y;
 	WMRect rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
 
 	if (menu->entry_no < 0)
@@ -815,22 +815,17 @@ static void makeVisible(WMenu * menu)
 
 	new_x = x1;
 	new_y = y1;
-	move = 0;
 
 	if (x1 < rect.pos.x) {
 		new_x = rect.pos.x;
-		move = 1;
 	} else if (x2 >= rect.pos.x + rect.size.width) {
 		new_x = rect.pos.x + rect.size.width - MENUW(menu) - 1;
-		move = 1;
 	}
 
 	if (y1 < rect.pos.y) {
 		new_y = rect.pos.y;
-		move = 1;
 	} else if (y2 >= rect.pos.y + rect.size.height) {
 		new_y = rect.pos.y + rect.size.height - menu->entry_height - 1;
-		move = 1;
 	}
 
 	new_y = new_y - menu->frame->top_width - menu->selected_entry * menu->entry_height;
diff --git a/src/misc.c b/src/misc.c
index 0502297..3b53a6f 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -92,14 +92,12 @@ static char *username(void)
 
 char *MakeCPPArgs(char *path)
 {
-	int i;
 	char buffer[MAXLINE], *buf, *line;
 	Visual *visual;
 	char *tmp;
 
 	line = wmalloc(MAXLINE);
 	*line = 0;
-	i = 1;
 	if ((buf = getenv("HOSTNAME")) != NULL) {
 		if (buf[0] == '(') {
 			wwarning(_("your machine is misconfigured. HOSTNAME is set to %s"), buf);
diff --git a/src/moveres.c b/src/moveres.c
index c0bf039..2ac3fbe 100644
--- a/src/moveres.c
+++ b/src/moveres.c
@@ -902,14 +902,11 @@ updateWindowPosition(WWindow * wwin, MoveData * data, Bool doResistance,
 	int winL, winR, winT, winB;	/* requested new window position */
 	int newX, newY;		/* actual new window position */
 	Bool hresist, vresist;
-	Bool updateIndex;
 	Bool attract;
 
 	hresist = False;
 	vresist = False;
 
-	updateIndex = False;
-
 	/* check the direction of the movement */
 	dx = newMouseX - data->mouseX;
 	dy = newMouseY - data->mouseY;
@@ -1211,7 +1208,7 @@ int wKeyboardMoveResizeWindow(WWindow * wwin)
 	int done, off_x, off_y, ww, wh;
 	int kspeed = _KS;
 	Time lastTime = 0;
-	KeyCode shiftl, shiftr, ctrll, ctrlmode;
+	KeyCode shiftl, shiftr, ctrlmode;
 	KeySym keysym = NoSymbol;
 	int moment = 0;
 	int modes = ((IS_MOVABLE(wwin) ? MOVABLE_BIT : 0) | (IS_RESIZABLE(wwin) ? RESIZABLE_BIT : 0));
@@ -1221,7 +1218,6 @@ int wKeyboardMoveResizeWindow(WWindow * wwin)
 
 	shiftl = XKeysymToKeycode(dpy, XK_Shift_L);
 	shiftr = XKeysymToKeycode(dpy, XK_Shift_R);
-	ctrll = XKeysymToKeycode(dpy, XK_Control_L);
 	ctrlmode = done = off_x = off_y = 0;
 
 	if (modes == RESIZABLE_BIT) {
@@ -1851,7 +1847,6 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
 	int rx1, ry1, rx2, ry2;
 	int res = 0;
 	KeyCode shiftl, shiftr;
-	int h = 0;
 	int orig_fx = fx;
 	int orig_fy = fy;
 	int orig_fw = fw;
@@ -1878,11 +1873,7 @@ void wMouseResizeWindow(WWindow * wwin, XEvent * ev)
 	ry2 = fy + fh - 1;
 	shiftl = XKeysymToKeycode(dpy, XK_Shift_L);
 	shiftr = XKeysymToKeycode(dpy, XK_Shift_R);
-	if (HAS_TITLEBAR(wwin))
-		h = WMFontHeight(wwin->screen_ptr->title_font) + (wPreferences.window_title_clearance +
-								  TITLEBAR_EXTEND_SPACE) * 2;
-	else
-		h = 0;
+
 	while (1) {
 		WMMaskEvent(dpy, KeyPressMask | ButtonMotionMask
 			    | ButtonReleaseMask | PointerMotionHintMask | ButtonPressMask | ExposureMask, &event);
diff --git a/src/rootmenu.c b/src/rootmenu.c
index 1730688..25f3d88 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -1151,7 +1151,7 @@ static WMenu *readMenuFile(WScreen * scr, char *file_name)
 		}
 	}
 
-#ifdef CPP
+#ifdef USECPP
 	if (cpp) {
 		if (pclose(file) == -1) {
 			werror(_("error reading preprocessed menu data"));
@@ -1183,7 +1183,6 @@ static WMenu *readMenuPipe(WScreen * scr, char **file_name)
 	int i;
 #ifdef USECPP
 	char *args;
-	int cpp = 0;
 #endif
 
 	flat_file[0] = '\0';
@@ -1206,8 +1205,6 @@ static WMenu *readMenuPipe(WScreen * scr, char **file_name)
 			file = popen(command, "r");
 			if (!file) {
 				werror(_("%s:could not open/preprocess menu file"), filename);
-			} else {
-				cpp = 1;
 			}
 		}
 	}
diff --git a/src/workspace.c b/src/workspace.c
index bfe85e8..b726f7f 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -647,12 +647,11 @@ static void newWSCommand(WMenu * menu, WMenuEntry * foo)
 
 static char *cropline(char *line)
 {
-	char *start, *end;
+	char *end;
 
 	if (strlen(line) == 0)
 		return line;
 
-	start = line;
 	end = &(line[strlen(line)]) - 1;
 	while (isspace(*line) && *line != 0)
 		line++;
@@ -821,7 +820,7 @@ void wWorkspaceSaveState(WScreen * scr, WMPropList * old_state)
 void wWorkspaceRestoreState(WScreen * scr)
 {
 	WMPropList *parr, *pstr, *wks_state, *clip_state;
-	int i, j, wscount;
+	int i, j;
 
 	make_keys();
 
@@ -833,7 +832,6 @@ void wWorkspaceRestoreState(WScreen * scr)
 	if (!parr)
 		return;
 
-	wscount = scr->workspace_count;
 	for (i = 0; i < WMIN(WMGetPropListItemCount(parr), MAX_WORKSPACES); i++) {
 		wks_state = WMGetFromPLArray(parr, i);
 		if (WMIsPLDictionary(wks_state))
diff --git a/src/xmodifier.c b/src/xmodifier.c
index 0298f62..1080f0a 100644
--- a/src/xmodifier.c
+++ b/src/xmodifier.c
@@ -111,9 +111,6 @@ static const char *index_to_name(int indice)
 static void x_reset_modifier_mapping(Display * display)
 {
 	int modifier_index, modifier_key, column, mkpm;
-	int warned_about_overlapping_modifiers = 0;
-	int warned_about_predefined_modifiers = 0;
-	int warned_about_duplicate_modifiers = 0;
 	int meta_bit = 0;
 	int hyper_bit = 0;
 	int super_bit = 0;
@@ -123,26 +120,22 @@ static void x_reset_modifier_mapping(Display * display)
 
 #define modwarn(name,old,other)							\
     wwarning ("%s (0x%x) generates %s, which is generated by %s.",		\
-    name, code, index_to_name (old), other),					\
-    warned_about_overlapping_modifiers = 1
+    name, code, index_to_name (old), other)
 
 #define modbarf(name,other)							\
     wwarning ("%s (0x%x) generates %s, which is nonsensical.",			\
-    name, code, other),								\
-    warned_about_predefined_modifiers = 1
+    name, code, other)
 
 #define check_modifier(name,mask)						\
     if ((1<<modifier_index) != mask)						\
     wwarning ("%s (0x%x) generates %s, which is nonsensical.",			\
-    name, code, index_to_name (modifier_index)),				\
-    warned_about_predefined_modifiers = 1
+    name, code, index_to_name (modifier_index))
 
 #define store_modifier(name,old)						\
     if (old && old != modifier_index)						\
     wwarning ("%s (0x%x) generates both %s and %s, which is nonsensical.",	\
     name, code, index_to_name (old),						\
-    index_to_name (modifier_index)),						\
-    warned_about_duplicate_modifiers = 1;					\
+    index_to_name (modifier_index));						\
     if (modifier_index == ShiftMapIndex) modbarf (name,"ModShift");		\
     else if (modifier_index == LockMapIndex) modbarf (name,"ModLock");		\
     else if (modifier_index == ControlMapIndex) modbarf (name,"ModControl");	\
@@ -254,7 +247,7 @@ static void x_reset_modifier_mapping(Display * display)
 			warn = "Alt", alt_bit = 0;
 		if (warn) {
 			wwarning("%s is being used for both Mode_switch and %s.",
-			     index_to_name(mode_bit), warn), warned_about_overlapping_modifiers = 1;
+			     index_to_name(mode_bit), warn);
 		}
 	}
 
@@ -264,35 +257,6 @@ static void x_reset_modifier_mapping(Display * display)
 	AltMask = (alt_bit ? (1 << alt_bit) : 0);
 	ModeMask = (mode_bit ? (1 << mode_bit) : 0);	/* unused */
 
-#if 0
-	if (warned_about_overlapping_modifiers)
-		wwarning("\n"
-			 "	Two distinct modifier keys (such as Meta and Hyper) cannot generate\n"
-			 "	the same modifier bit, because Emacs won't be able to tell which\n"
-			 "	modifier was actually held down when some other key is pressed.  It\n"
-			 "	won't be able to tell Meta-x and Hyper-x apart, for example.  Change\n"
-			 "	one of these keys to use some other modifier bit.  If you intend for\n"
-			 "	these keys to have the same behavior, then change them to have the\n"
-			 "	same keysym as well as the same modifier bit.\n");
-
-	if (warned_about_predefined_modifiers)
-		wwarning("\n"
-			 "	The semantics of the modifier bits ModShift, ModLock, and ModControl\n"
-			 "	are predefined.  It does not make sense to assign ModControl to any\n"
-			 "	keysym other than Control_L or Control_R, or to assign any modifier\n"
-			 "	bits to the \"control\" keysyms other than ModControl.  You can't\n"
-			 "	turn a \"control\" key into a \"meta\" key (or vice versa) by simply\n"
-			 "	assigning the key a different modifier bit.  You must also make that\n"
-			 "	key generate an appropriate keysym (Control_L, Meta_L, etc).\n");
-
-	/* No need to say anything more for warned_about_duplicate_modifiers. */
-
-	if (warned_about_overlapping_modifiers || warned_about_predefined_modifiers)
-		wwarning("\n"
-			 "	The meanings of the modifier bits Mod1 through Mod5 are determined\n"
-			 "	by the keysyms used to control those bits.  Mod1 does NOT always\n"
-			 "	mean Meta, although some non-ICCCM-compliant programs assume that.\n");
-#endif
 	XFreeModifiermap(x_modifier_keymap);
 }
 
diff --git a/util/getstyle.c b/util/getstyle.c
index a29b1a9..214ff23 100644
--- a/util/getstyle.c
+++ b/util/getstyle.c
@@ -216,7 +216,7 @@ void copyFile(char *dir, char *file)
 			break;
 
 		RETRY( nwritten = fwrite(buf, 1, nread, dst) )
-		if (ferror(dst) || feof(src))
+		if (ferror(dst) || feof(src) || nread != nwritten)
 			break;
 
 	} while (1);
diff --git a/util/seticons.c b/util/seticons.c
index 87bdf4f..d70b828 100644
--- a/util/seticons.c
+++ b/util/seticons.c
@@ -48,7 +48,7 @@ void print_help(int print_usage, int exitval)
 
 int main(int argc, char **argv)
 {
-	WMPropList *window_name, *icon_key, *window_attrs, *icon_value;
+	WMPropList *window_name, *window_attrs, *icon_value;
 	WMPropList *all_windows, *iconset, *keylist;
 	int i, ch;
 	char *path = NULL;
@@ -96,7 +96,6 @@ int main(int argc, char **argv)
 	}
 
 	keylist = WMGetPLDictionaryKeys(iconset);
-	icon_key = WMCreatePLString("Icon");
 
 	for (i = 0; i < WMGetPropListItemCount(keylist); i++) {
 		window_name = WMGetFromPLArray(keylist, i);
diff --git a/util/wdwrite.c b/util/wdwrite.c
index a8b83e4..e494c0a 100644
--- a/util/wdwrite.c
+++ b/util/wdwrite.c
@@ -56,7 +56,7 @@ void print_help(int print_usage, int exitval)
 int main(int argc, char **argv)
 {
 	char path[PATH_MAX];
-	WMPropList *dom, *key, *value, *dict;
+	WMPropList *key, *value, *dict;
 	int ch;
 
 	struct option longopts[] = {
@@ -87,7 +87,6 @@ int main(int argc, char **argv)
 	if (argc != 3)
 		print_help(0, 1);
 
-	dom = WMCreatePLString(argv[0]);
 	key = WMCreatePLString(argv[1]);
 	value = WMCreatePropListFromDescription(argv[2]);
 	if (!value) {
diff --git a/util/wmagnify.c b/util/wmagnify.c
index d65d540..7b085b5 100644
--- a/util/wmagnify.c
+++ b/util/wmagnify.c
@@ -397,7 +397,6 @@ static BufferData *newWindow(int magfactor)
 
 int main(int argc, char **argv)
 {
-	BufferData *data;
 	int i;
 	char *display = "";
 	char *vdisplay = NULL;
@@ -481,8 +480,6 @@ int main(int argc, char **argv)
 	cursorColor1 = WMCreateNamedColor(scr, "#ff0000", False);
 	cursorColor2 = WMCreateNamedColor(scr, "#00ff00", False);
 
-	data = newWindow(magfactor);
-
 	WMScreenMainLoop(scr);
 
 	return 0;
diff --git a/util/wmgenmenu.c b/util/wmgenmenu.c
index b7793cf..18aba9a 100644
--- a/util/wmgenmenu.c
+++ b/util/wmgenmenu.c
@@ -4,6 +4,7 @@
 #define _GNU_SOURCE		/* getopt_long */
 #endif
 
+#include <ctype.h>
 #include <getopt.h>
 #include <limits.h>
 #include <locale.h>
diff --git a/util/wmmenugen.c b/util/wmmenugen.c
index c6d5099..b5417cd 100644
--- a/util/wmmenugen.c
+++ b/util/wmmenugen.c
@@ -18,10 +18,10 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#if __GLIBC__ && \
-    (_XOPEN_SOURCE && _XOPEN_SOURCE < 500) || \
-    !_XOPEN_SOURCE
-#define _XOPEN_SOURCE 500		/* nftw */
+#if (_GLIBC__ || __FreeBSD__) && \
+    (!defined(_XOPEN_SOURCE) || _XOPEN_SOURCE - 0 < 600)
+#undef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 600
 #endif
 
 #include <sys/types.h>
diff --git a/util/wmmenugen_parse_wmconfig.c b/util/wmmenugen_parse_wmconfig.c
index bc73b29..59672f4 100644
--- a/util/wmmenugen_parse_wmconfig.c
+++ b/util/wmmenugen_parse_wmconfig.c
@@ -20,10 +20,10 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#if __GLIBC__ && \
-    (_XOPEN_SOURCE && _XOPEN_SOURCE < 500) || \
-    !_XOPEN_SOURCE
-#define _XOPEN_SOURCE 500		/* nftw */
+#if (_GLIBC__ || __FreeBSD__) && \
+    (!defined(_XOPEN_SOURCE) || _XOPEN_SOURCE - 0 < 600)
+#undef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 600
 #endif
 
 #include <sys/types.h>
diff --git a/util/wmmenugen_parse_xdg.c b/util/wmmenugen_parse_xdg.c
index f68834f..00a360e 100644
--- a/util/wmmenugen_parse_xdg.c
+++ b/util/wmmenugen_parse_xdg.c
@@ -36,10 +36,9 @@
  * Basic validation of the .desktop file is done.
  */
 
-#if __GLIBC__ && \
-    (_XOPEN_SOURCE && _XOPEN_SOURCE < 500) || \
-    !_XOPEN_SOURCE
-#define _XOPEN_SOURCE 500		/* nftw */
+#if !defined(_XOPEN_SOURCE) || _XOPEN_SOURCE - 0 < 600
+#undef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 600
 #endif
 
 #include <sys/types.h>
-- 
1.7.4.1

Reply via email to