commit f62fbc5

uint  ·  2026-06-06 16:20:49 +0000 UTC
parent 07d0fa9
Change maus_close->bool to maus_close->void
2 files changed,  +3, -5
M maus.h
M maus.h
+1, -1
1@@ -91,7 +91,7 @@ typedef struct {
2 } MausEvent;
3 
4 /* close a Maus. returns false on fail */
5-bool maus_close(Maus* mw);
6+void maus_close(Maus* mw);
7 
8 /* close a window without the whole Maus. returns false on fail */
9 bool maus_close_window(Maus* mw);
+2, -4
 1@@ -310,7 +310,7 @@ static MausKey keysym_to_mauskey(KeySym sym)
 2 }
 3 
 4 
 5-bool maus_close(Maus* mw)
 6+void maus_close(Maus* mw)
 7 {
 8 	fb_destroy(mw);
 9 	if (mw->win != None) {
10@@ -318,8 +318,6 @@ bool maus_close(Maus* mw)
11 	}
12 	if (mw->display)
13 		XCloseDisplay(mw->display);
14-
15-	return true;
16 }
17 
18 bool maus_close_window(Maus* mw)
19@@ -417,7 +415,7 @@ Maus* maus_init(const char* title, int x, int y, int width, int height)
20 	mw->shm.shmaddr = NULL;
21 	if (!fb_create(mw)) {
22 		maus_log(stderr, "failed to create framebuffer");
23-		(void) maus_close(mw); /* TODO change to `void maus_close` */
24+		maus_close(mw);
25 		free(mw);
26 		return NULL;
27 	}