commit ff10a7b
Devine Lu Linvega
·
2026-01-08 22:29:30 +0000 UTC
parent 1328521
Give the empty sprite an array size
1 files changed,
+6,
-6
+6,
-6
1@@ -1179,11 +1179,11 @@ get_button(KeySym sym)
2 static void
3 display_center(void)
4 {
5- Screen *screen = ScreenOfDisplay(emu_dpy, 0);
6- int w = screen_width * screen_zoom;
7- int h = screen_height * screen_zoom;
8- int x = screen->width / 2 - w / 2;
9- int y = screen->height / 2 - h / 2;
10+ Screen *screen = DefaultScreenOfDisplay(emu_dpy);
11+ const int w = screen_width * screen_zoom;
12+ const int h = screen_height * screen_zoom;
13+ const int x = screen->width / 2 - w / 2;
14+ const int y = screen->height / 2 - h / 2;
15 emu_win = XCreateSimpleWindow(emu_dpy, RootWindow(emu_dpy, 0), x, y, w, h, 1, 0, 0);
16 }
17
18@@ -1191,7 +1191,7 @@ static void
19 display_hidecursor(void)
20 {
21 XColor black = {0};
22- char empty[] = {0};
23+ static const char empty[1] = { 0 };
24 Pixmap bitmap = XCreateBitmapFromData(emu_dpy, emu_win, empty, 1, 1);
25 Cursor blank = XCreatePixmapCursor(emu_dpy, bitmap, bitmap, &black, &black, 0, 0);
26 XDefineCursor(emu_dpy, emu_win, blank);