Browse code

Enable and fix more warnings

Robert Cranston authored on 27/02/2024 02:27:44
Showing 2 changed files

... ...
@@ -18,7 +18,10 @@ CPPFLAGS += \
18 18
 	-Icommon/$(OS) \
19 19
 	-DGL_GLEXT_PROTOTYPES
20 20
 CXXFLAGS += \
21
-	-Wall
21
+	-Wall \
22
+	-Wextra \
23
+	-Wpedantic \
24
+	-Wshadow
22 25
 LDLIBS_Windows += \
23 26
 	-lopengl32
24 27
 LDLIBS_Linux += \
... ...
@@ -83,6 +83,8 @@ static char gRunning = 1;
83 83
 
84 84
 void glutInit(int *argc, char *argv[])
85 85
 {
86
+	(void)argc;
87
+	(void)argv;
86 88
 	gettimeofday(&timeStart, NULL);
87 89
 	memset(gKeymap, 0, sizeof(gKeymap));
88 90
 }
... ...
@@ -110,16 +112,13 @@ static void checktimers();
110 112
  */
111 113
 
112 114
 static void
113
-make_window( Display *dpy, const char *name,
114
-             int x, int y, int width, int height,
115
-             Window *winRet, GLXContext *ctxRet)
115
+make_window( const char *name,
116
+             int x, int y, int width, int height)
116 117
 {
117 118
    int scrnum;
118 119
    XSetWindowAttributes attr;
119 120
    unsigned long mask;
120 121
    Window root;
121
-   Window win;
122
-   GLXContext ctx;
123 122
    XVisualInfo *visinfo;
124 123
 
125 124
    scrnum = DefaultScreen( dpy );
... ...
@@ -305,9 +304,6 @@ make_window( Display *dpy, const char *name,
305 304
    }
306 305
 
307 306
    XFree(visinfo);
308
-
309
-   *winRet = win;
310
-   *ctxRet = ctx;
311 307
 }
312 308
 
313 309
 void glutCreateWindow(const char *windowTitle)
... ...
@@ -319,7 +315,7 @@ void glutCreateWindow(const char *windowTitle)
319 315
 	     windowTitle ? windowTitle : getenv("DISPLAY"));
320 316
    }
321 317
 
322
-   make_window(dpy, windowTitle, winPosX, winPosY, winWidth, winHeight, &win, &ctx);
318
+   make_window(windowTitle, winPosX, winPosY, winWidth, winHeight);
323 319
    
324 320
    XMapWindow(dpy, win);
325 321
    glXMakeCurrent(dpy, win, ctx);
... ...
@@ -455,6 +451,7 @@ void doKeyboardEvent(XEvent event, void (*keyProc)(unsigned char key, int x, int
455 451
 
456 452
 void internaltimer(int x)
457 453
 {
454
+	(void)x;
458 455
 	glutPostRedisplay();
459 456
 }
460 457