From: Rodolfo García Peñas (kix) <[email protected]>

This patch fixes the unused variables warnings reported by the compiler
in the wtest code.
---
 test/wtest.c | 36 +++++++++++++++++++++++++++---------
 1 file changed, 27 insertions(+), 9 deletions(-)

diff --git a/test/wtest.c b/test/wtest.c
index 8490e9c..37f285d 100644
--- a/test/wtest.c
+++ b/test/wtest.c
@@ -29,18 +29,32 @@ Display *dpy;
 Window leader;
 WMAppContext *app;
 
-static void callback(void *foo, int item, Time time)
+static void callback(int item)
 {
        printf("pushed item %i\n", item);
 }
 
-static void quit(void *foo, int item, Time time)
+static void quit(int item)
 {
+       /*
+        * This parameter is not used, but because we're a call-back we have a 
fixed
+        * prototype, so we tell the compiler it is ok to avoid a spurious 
unused
+        * variable warning
+        */
+       (void) item;
+
        exit(0);
 }
 
-static void hide(void *foo, int item, Time time)
+static void hide(int item)
 {
+       /*
+        * This parameter is not used, but because we're a call-back we have a 
fixed
+        * prototype, so we tell the compiler it is ok to avoid a spurious 
unused
+        * variable warning
+        */
+       (void) item;
+
        WMHideApplication(app);
 }
 
@@ -52,12 +66,19 @@ WMMenu *menu;
 WMMenu *submenu;
 int wincount = 0;
 
-static void newwin(void *foo, int item, Time time)
+static void newwin(int item)
 {
        Window win;
        XClassHint classhint;
        char title[100];
 
+       /*
+        * This parameter is not used, but because we're a call-back we have a 
fixed
+        * prototype, so we tell the compiler it is ok to avoid a spurious 
unused
+        * variable warning
+        */
+       (void) item;
+
        wincount++;
        win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 10 * wincount, 
10 * wincount, 200, 100, 0, 0, 0);
        prots[0] = delete_win;
@@ -76,10 +97,6 @@ static void newwin(void *foo, int item, Time time)
        attr.miniaturize_pixmap = XCreateBitmapFromData(dpy, 
DefaultRootWindow(dpy), bits, 10, 10);
 
        attr.miniaturize_mask = XCreateBitmapFromData(dpy, 
DefaultRootWindow(dpy), mbits, 10, 10);
-       /*
-          attr.flags |= GSWindowStyleAttr;
-          attr.window_style = NSTitledWindowMask|NSClosableWindowMask;
-        */
 
        WMSetWindowAttributes(dpy, win, &attr);
 
@@ -106,6 +123,7 @@ int main(int argc, char **argv)
        miniaturize_win = XInternAtom(dpy, "_GNUSTEP_WM_MINIATURIZE_WINDOW", 
False);
 
        leader = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 10, 10, 10, 
10, 0, 0, 0);
+
        /* set class hint */
        classhint.res_name = "test";
        classhint.res_class = "Test";
@@ -138,7 +156,7 @@ int main(int argc, char **argv)
        XSetCommand(dpy, leader, argv, argc);
 
        /* create first window */
-       newwin(NULL, 0, 0);
+       newwin(0);
 
        XFlush(dpy);
        puts("Run xprop on the test window to see the properties defined");
-- 
1.8.5.3


-- 
To unsubscribe, send mail to [email protected].

Reply via email to