From 913a0e0136e49fca9933b5d07ee96cbdc5c263ec Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Thu, 16 Oct 2025 10:52:25 +0000 Subject: [PATCH] fix warnings git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@363 b9cfdab3-6d41-4d17-bbe4-086880011989 --- GNUmakefile | 4 ++-- examples/basic/listbox.c | 3 +++ examples/basic/messagebox.c | 12 ++++++++++++ examples/basic/viewport.c | 3 +++ examples/gldemos/clock.c | 8 ++++++++ examples/gldemos/glutlayer.c | 4 +++- examples/gldemos/tripaint.c | 13 +++++++++++++ src/widget/listbox.c | 13 +++++++++++++ 8 files changed, 57 insertions(+), 3 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index fc60802..0511b56 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -11,7 +11,7 @@ USE_STB_IMAGE = 1 CC = $(GCC)gcc CXX = $(GCC)g++ -CFLAGS = -Wall -Wextra -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-unused-value -Wno-sign-compare -Iinclude +CFLAGS = -Wall -Wextra -Wno-implicit-fallthrough -Wno-sign-compare -Iinclude LDFLAGS = LIBS = @@ -199,7 +199,7 @@ oosrc/%.o: oosrc/%.cc $(CXX) $(OOL_CXXFLAGS) -fno-exceptions -fno-rtti -c -o $@ $< external/%.o: external/%.c - $(CC) $(L_CFLAGS) -c -o $@ $< + $(CC) $(L_CFLAGS) -Wno-unused-value -Wno-unused-parameter -c -o $@ $< examples/%.o: examples/%.c $(CC) $(E_CFLAGS) -c -o $@ $< diff --git a/examples/basic/listbox.c b/examples/basic/listbox.c index 4ccd9c1..2b4bc09 100644 --- a/examples/basic/listbox.c +++ b/examples/basic/listbox.c @@ -14,6 +14,9 @@ void destroy(MwWidget handle, void* user, void* call) { void activate(MwWidget handle, void* user, void* call) { char msg[256]; MwWidget msgbox; + + (void)user; + sprintf(msg, "You pressed: %s", MwListBoxGet(handle, *(int*)call)); msgbox = MwMessageBox(wmain, msg, "wow", MwMB_ICONINFO | MwMB_BUTTONOK); diff --git a/examples/basic/messagebox.c b/examples/basic/messagebox.c index 86bb044..ca4cf51 100644 --- a/examples/basic/messagebox.c +++ b/examples/basic/messagebox.c @@ -9,16 +9,28 @@ void ok(MwWidget handle, void* user, void* call) { void spawn(MwWidget handle, void* user, void* call) { MwWidget mb = MwMessageBox(user, "news has arrived!", "title", MwMB_ICONNEWS | MwMB_BUTTONOK); + + (void)handle; + (void)call; + MwAddUserHandler(MwMessageBoxGetChild(mb, MwMB_BUTTONOK), MwNactivateHandler, ok, mb); } void spawn2(MwWidget handle, void* user, void* call) { MwWidget mb = MwMessageBox(user, "something went wrong!", "title", MwMB_ICONERROR | MwMB_BUTTONOK); + + (void)handle; + (void)call; + MwAddUserHandler(MwMessageBoxGetChild(mb, MwMB_BUTTONOK), MwNactivateHandler, ok, mb); } void spawn3(MwWidget handle, void* user, void* call) { int i; + + (void)handle; + (void)call; + for(i = 0; i <= 6; i++) { MwWidget mb = MwMessageBox(user, "messagebox test", "title", i | MwMB_BUTTONOK); MwAddUserHandler(MwMessageBoxGetChild(mb, MwMB_BUTTONOK), MwNactivateHandler, ok, mb); diff --git a/examples/basic/viewport.c b/examples/basic/viewport.c index 4bdfb47..35f84d7 100644 --- a/examples/basic/viewport.c +++ b/examples/basic/viewport.c @@ -7,6 +7,9 @@ static void resize(MwWidget handle, void* user, void* call) { int w = MwGetInteger(handle, MwNwidth); int h = MwGetInteger(handle, MwNheight); + (void)user; + (void)call; + MwVaApply(vp, MwNwidth, w - 10, MwNheight, h - 10, diff --git a/examples/gldemos/clock.c b/examples/gldemos/clock.c index 182743f..9c88960 100644 --- a/examples/gldemos/clock.c +++ b/examples/gldemos/clock.c @@ -21,6 +21,11 @@ void tick(MwWidget handle, void* user, void* call) { int render = 0; int w = MwGetInteger(opengl, MwNwidth); int h = MwGetInteger(opengl, MwNheight); + + (void)handle; + (void)user; + (void)call; + if(last != t) { char* wday[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; char* mon[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; @@ -104,6 +109,9 @@ void resize(MwWidget handle, void* user, void* call) { int w = MwGetInteger(handle, MwNwidth); int h = MwGetInteger(handle, MwNheight); + (void)user; + (void)call; + MwVaApply(opengl, MwNwidth, w / 5 * 2, MwNheight, h, diff --git a/examples/gldemos/glutlayer.c b/examples/gldemos/glutlayer.c index 4d061d8..ee8efce 100644 --- a/examples/gldemos/glutlayer.c +++ b/examples/gldemos/glutlayer.c @@ -23,7 +23,6 @@ static void tick(MwWidget handle, void* user, void* client) { static void resize(MwWidget handle, void* user, void* client) { int ww, wh; - (void)handle; (void)user; (void)client; @@ -39,6 +38,9 @@ static void resize(MwWidget handle, void* user, void* client) { } static void key_pressed(MwWidget handle, void* user, void* client) { + (void)handle; + (void)user; + key(*(int*)client); } diff --git a/examples/gldemos/tripaint.c b/examples/gldemos/tripaint.c index ae93c09..62ed07c 100644 --- a/examples/gldemos/tripaint.c +++ b/examples/gldemos/tripaint.c @@ -23,6 +23,10 @@ static void tick(MwWidget handle, void* user, void* call) { int w = MwGetInteger(opengl, MwNwidth); int h = MwGetInteger(opengl, MwNheight); + (void)handle; + (void)user; + (void)call; + MwOpenGLMakeCurrent(opengl); glClear(GL_COLOR_BUFFER_BIT); @@ -49,6 +53,10 @@ static void tick(MwWidget handle, void* user, void* call) { static void mouse(MwWidget handle, void* user, void* call) { MwLLMouse* mouse = call; + + (void)handle; + (void)user; + if(mouse->button == MwLLMouseLeft) { t[ct].points[click * 2 + 0] = mouse->point.x; t[ct].points[click * 2 + 1] = mouse->point.y; @@ -86,8 +94,13 @@ static void mouse(MwWidget handle, void* user, void* call) { static void mouse_move(MwWidget handle, void* user, void* call) { MwPoint* point = call; + + (void)handle; + (void)user; + mx = point->x; my = point->y; + if(click == 2) { t[ct].points[2 * 2 + 0] = point->x; t[ct].points[2 * 2 + 1] = point->y; diff --git a/src/widget/listbox.c b/src/widget/listbox.c index 77a8a41..b0f8a45 100644 --- a/src/widget/listbox.c +++ b/src/widget/listbox.c @@ -14,12 +14,19 @@ static int get_first_entry(MwListBox lb) { static void vscroll_changed(MwWidget handle, void* user, void* call) { MwListBox lb = handle->parent->internal; + + (void)user; + (void)call; + MwForceRender(lb->frame); } static void frame_mouse_down(MwWidget handle, void* user, void* call) { MwListBox lb = handle->parent->internal; MwLLMouse* m = call; + + (void)user; + if(m->button == MwLLMouseLeft) { int st = 0; int i; @@ -47,6 +54,9 @@ static void frame_mouse_down(MwWidget handle, void* user, void* call) { static void frame_mouse_up(MwWidget handle, void* user, void* call) { MwListBox lb = handle->parent->internal; MwLLMouse* m = call; + + (void)user; + if(m->button == MwLLMouseLeft) { lb->pressed = 0; } @@ -55,6 +65,9 @@ static void frame_mouse_up(MwWidget handle, void* user, void* call) { static void frame_mouse_move(MwWidget handle, void* user, void* call) { MwListBox lb = handle->parent->internal; MwPoint* p = call; + + (void)user; + if(lb->pressed) { int st = 0; int i;