5
5
#include "xwm.h"
6
6
#include "config.h"
7
7
8
+ #define UNUSED (x ) (void)(x)
9
+
8
10
static xcb_connection_t * dpy ;
9
11
static xcb_screen_t * scre ;
10
12
static xcb_drawable_t win ;
@@ -13,10 +15,12 @@ static uint32_t min_x = WINDOW_MIN_X;
13
15
static uint32_t min_y = WINDOW_MIN_Y ;
14
16
15
17
static void killclient (char * * com ) {
18
+ UNUSED (com );
16
19
xcb_kill_client (dpy , win );
17
20
}
18
21
19
22
static void closewm (char * * com ) {
23
+ UNUSED (com );
20
24
if (dpy != NULL ) {
21
25
xcb_disconnect (dpy );
22
26
}
@@ -53,6 +57,7 @@ static void handleButtonPress(xcb_generic_event_t * ev) {
53
57
}
54
58
55
59
static void handleMotionNotify (xcb_generic_event_t * ev ) {
60
+ UNUSED (ev );
56
61
xcb_query_pointer_cookie_t coord = xcb_query_pointer (dpy , scre -> root );
57
62
xcb_query_pointer_reply_t * poin = xcb_query_pointer_reply (dpy , coord , 0 );
58
63
uint32_t val [2 ] = {1 , 3 };
@@ -149,13 +154,10 @@ static void handleEnterNotify(xcb_generic_event_t * ev) {
149
154
}
150
155
151
156
static void handleButtonRelease (xcb_generic_event_t * ev ) {
157
+ UNUSED (ev );
152
158
xcb_ungrab_pointer (dpy , XCB_CURRENT_TIME );
153
159
}
154
160
155
- static void handleKeyRelease (xcb_generic_event_t * ev ) {
156
- /* nothing to see here, carry on */
157
- }
158
-
159
161
static void handleDestroyNotify (xcb_generic_event_t * ev ) {
160
162
xcb_destroy_notify_event_t * e = (xcb_destroy_notify_event_t * ) ev ;
161
163
xcb_kill_client (dpy , e -> window );
@@ -232,8 +234,12 @@ static int die(char * errstr) {
232
234
while ((* (p ++ )) != 0 ) {
233
235
++ n ;
234
236
}
235
- write (STDERR_FILENO , errstr , n );
236
- return 1 ;
237
+ ssize_t o = write (STDERR_FILENO , errstr , n );
238
+ int ret = 1 ;
239
+ if (o < 0 ) {
240
+ ret = -1 ;
241
+ }
242
+ return ret ;
237
243
}
238
244
239
245
static int strcmp_c (char * str1 , char * str2 ) {
@@ -250,7 +256,7 @@ static int strcmp_c(char * str1, char * str2) {
250
256
int main (int argc , char * argv []) {
251
257
int ret = 0 ;
252
258
if ((argc == 2 ) && (strcmp_c ("-v" , argv [1 ]) == 0 )) {
253
- ret = die ("xwm-0.1.0 , © 2020 Michael Czigler, see LICENSE for details\n" );
259
+ ret = die ("xwm-0.1.1 , © 2020 Michael Czigler, see LICENSE for details\n" );
254
260
}
255
261
if ((ret == 0 ) && (argc != 1 )) {
256
262
ret = die ("usage: xwm [-v]\n" );
0 commit comments