summaryrefslogtreecommitdiff
path: root/src/Cursor.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-11-19 10:47:24 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-11-19 10:48:42 -0800
commit5129fc91b8483ec3a11e18280eac00857311edfa (patch)
tree69fada0e79f150e4208bbce099617a9a641222ce /src/Cursor.c
parentaba73d85ce4a2fc1a5fb0ec27b15415eed21ebae (diff)
Quiet -Wconditional-uninitialized warnings from clang
I believe these were false positives, as the variables were initialized unless the image = NULL -> if (!image) return NULL code path was followed, but this makes clang stop warning. Cursor.c:144:8: warning: variable 'nbytes' may be uninitialized when used here [-Wconditional-uninitialized] if(nbytes > nread) ^~~~~~ Cursor.c:80:21: note: initialize the variable 'nbytes' to silence this warning size_t nbytes , nread ; ^ = 0 Cursor.c:144:17: warning: variable 'nread' may be uninitialized when used here [-Wconditional-uninitialized] if(nbytes > nread) ^~~~~ Cursor.c:80:29: note: initialize the variable 'nread' to silence this warning size_t nbytes , nread ; ^ = 0 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/Cursor.c')
-rw-r--r--src/Cursor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Cursor.c b/src/Cursor.c
index 5faf681..2b177b8 100644
--- a/src/Cursor.c
+++ b/src/Cursor.c
@@ -77,7 +77,7 @@ XFixesGetCursorImage (Display *dpy)
xXFixesGetCursorImageAndNameReply rep;
size_t npixels;
size_t nbytes_name;
- size_t nbytes, nread;
+ size_t nbytes = 0, nread = 0;
XFixesCursorImage *image;
char *name;