Skip to content
Snippets Groups Projects
Commit 503cff86 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix GCC v10.2 warnings about ignored return values of 'write'

The return value of x11_event() isn't actually checked anywhere currently, but
still Deuce might want to adjust the new return value here (__LINE__ or -1?).

Some indicental trailing whitespace was auto-cleaned up part of this commit.
Unexpected as I thought this code had been uncrustified already.
parent a4bc8a82
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4491 passed
...@@ -1604,7 +1604,8 @@ static int x11_event(XEvent *ev) ...@@ -1604,7 +1604,8 @@ static int x11_event(XEvent *ev)
case ClientMessage: case ClientMessage:
if (ev->xclient.format == 32 && ev->xclient.data.l[0] == A(WM_DELETE_WINDOW) && A(WM_DELETE_WINDOW) != None) { if (ev->xclient.format == 32 && ev->xclient.data.l[0] == A(WM_DELETE_WINDOW) && A(WM_DELETE_WINDOW) != None) {
uint16_t key=CIO_KEY_QUIT; uint16_t key=CIO_KEY_QUIT;
write(key_pipe[1], &key, 2); if(write(key_pipe[1], &key, 2) != 2)
return errno;
} }
else if(ev->xclient.format == 32 && ev->xclient.data.l[0] == A(_NET_WM_PING) && A(_NET_WM_PING) != None) { else if(ev->xclient.format == 32 && ev->xclient.data.l[0] == A(_NET_WM_PING) && A(_NET_WM_PING) != None) {
ev->xclient.window = root; ev->xclient.window = root;
...@@ -1896,7 +1897,8 @@ static int x11_event(XEvent *ev) ...@@ -1896,7 +1897,8 @@ static int x11_event(XEvent *ev)
else else
ch = cpchar_from_unicode_cpoint(getcodepage(), wbuf[i], 0); ch = cpchar_from_unicode_cpoint(getcodepage(), wbuf[i], 0);
if (ch) { if (ch) {
write(key_pipe[1], &ch, 1); if(write(key_pipe[1], &ch, 1) != 1)
return errno;
} }
} }
break; break;
...@@ -2106,7 +2108,8 @@ static int x11_event(XEvent *ev) ...@@ -2106,7 +2108,8 @@ static int x11_event(XEvent *ev)
uint16_t key=scan; uint16_t key=scan;
if (key < 128) if (key < 128)
key = cpchar_from_unicode_cpoint(getcodepage(), key, key); key = cpchar_from_unicode_cpoint(getcodepage(), key, key);
write(key_pipe[1], &key, (scan&0xff)?1:2); if(write(key_pipe[1], &key, (scan&0xff)?1:2) < 1)
return errno;
} }
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment