From 108127f0b54205035b24b740b454eabaa397bd7c Mon Sep 17 00:00:00 2001 From: Vladimir Nadvornik Date: Tue, 17 Feb 2009 11:55:33 +0100 Subject: [PATCH] Miscellaneous fixes from OpenSuse These are some of the fixes sent to the wmaker-dev list by Vladimir Nadvornik, with minor modifications to address Dan Pascu's concerns. Original-post: http://lists.windowmaker.info/dev/msg00293.html --- WINGs/Examples/puzzle.c | 2 +- WINGs/WINGs/WUtil.h | 13 ++++++++----- WINGs/wcolorpanel.c | 4 +++- src/cycling.c | 1 + src/xdnd.c | 2 +- util/wmsetup.c | 1 + 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/WINGs/Examples/puzzle.c b/WINGs/Examples/puzzle.c index 7e8b7997..85e59563 100644 --- a/WINGs/Examples/puzzle.c +++ b/WINGs/Examples/puzzle.c @@ -8,7 +8,7 @@ WMWindow *win; WMButton *Button[MAX_SIZE]; -char Map[MAX_SIZE]; +signed char Map[MAX_SIZE]; int Size = 4; int MoveCount; diff --git a/WINGs/WINGs/WUtil.h b/WINGs/WINGs/WUtil.h index 1a76b174..7c3f2de4 100644 --- a/WINGs/WINGs/WUtil.h +++ b/WINGs/WINGs/WUtil.h @@ -28,6 +28,9 @@ # endif #endif +#ifndef __GNUC__ +#define __attribute__(x) /*NOTHING*/ +#endif #ifdef NDEBUG @@ -216,11 +219,11 @@ waborthandler* wsetabort(waborthandler* handler); /* don't free the returned string */ char* wstrerror(int errnum); -void wmessage(const char *msg, ...); -void wwarning(const char *msg, ...); -void wfatal(const char *msg, ...); -void wsyserror(const char *msg, ...); -void wsyserrorwithcode(int error, const char *msg, ...); +void wmessage(const char *msg, ...) __attribute__((__format__(printf,1,2))); +void wwarning(const char *msg, ...) __attribute__((__format__(printf,1,2))); +void wfatal(const char *msg, ...) __attribute__((__format__(printf,1,2))); +void wsyserror(const char *msg, ...) __attribute__((__format__(printf,1,2))); +void wsyserrorwithcode(int error, const char *msg, ...) __attribute__((__format__(printf,2,3))); char* wfindfile(char *paths, char *file); diff --git a/WINGs/wcolorpanel.c b/WINGs/wcolorpanel.c index 4ad0fa24..8612e5e7 100644 --- a/WINGs/wcolorpanel.c +++ b/WINGs/wcolorpanel.c @@ -1160,7 +1160,7 @@ static void readConfiguration(W_ColorPanel * panel) } if (!(dPtr = opendir(panel->configurationPath))) { - wwarning(_("Color Panel: Could not find file"), "%s", panel->configurationPath); + wwarning("%s: %s", _("Color Panel: Could not find file"), panel->configurationPath); return; } @@ -3439,6 +3439,7 @@ RColor ulongToRColor(WMScreen * scr, unsigned long value) color.red = 0; color.green = 0; color.blue = 0; + color.alpha = 0; return color; } @@ -3448,6 +3449,7 @@ RColor ulongToRColor(WMScreen * scr, unsigned long value) color.red = xcolor->red >> 8; color.green = xcolor->green >> 8; color.blue = xcolor->blue >> 8; + color.alpha = 0; wfree(xcolor); diff --git a/src/cycling.c b/src/cycling.c index 1f3cb1f2..2510d2f5 100644 --- a/src/cycling.c +++ b/src/cycling.c @@ -22,6 +22,7 @@ #include "wconfig.h" +#include #include #include #include diff --git a/src/xdnd.c b/src/xdnd.c index c8119fad..86c35536 100644 --- a/src/xdnd.c +++ b/src/xdnd.c @@ -178,7 +178,7 @@ Bool wXDNDProcessSelection(XEvent * event) wfree(scr->xdestring); /* this xdestring is not from Xlib (no XFree) */ } - /* why doesn't this function return anything ? -Dan */ + return True; } Bool isAwareXDND(Window window) diff --git a/util/wmsetup.c b/util/wmsetup.c index e4db9e93..243bd372 100644 --- a/util/wmsetup.c +++ b/util/wmsetup.c @@ -20,6 +20,7 @@ #if 1 int main() { + return 0; } #else #define PROG_VERSION "wmsetup 0.0 (Window Maker)"