aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2011-05-08 09:08:07 -0700
committerUlrich Sibiller <uli42@gmx.de>2016-10-19 21:40:26 +0200
commitc19cda6d6c63d1889b0d7fd97794ac45cd4e5fca (patch)
tree3fa8044c8f32d4b6866a83452f05269f5e522cbe /nx-X11/lib
parentc300a430d36e1f35335896bb7a8a47f3ca8ba863 (diff)
downloadnx-libs-c19cda6d6c63d1889b0d7fd97794ac45cd4e5fca.tar.gz
nx-libs-c19cda6d6c63d1889b0d7fd97794ac45cd4e5fca.tar.bz2
nx-libs-c19cda6d6c63d1889b0d7fd97794ac45cd4e5fca.zip
Silence clang static analysis warnings for SetReqLen
This provides a simplified version of the SetReqLen macro when using clang for static analysis. Prior to this change, we would see many Idempotent operation warnings inside this macro due to the common case of calling with arg2 and arg3 being the same variable. This has no effect on code produced during compilation, but it silences a number of false positives in static analysis. XIPassiveGrab.c:170:5: warning: Assigned value is always the same as the existing value SetReqLen(req, num_modifiers, num_modifiers); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from XIPassiveGrab.c:26: .../nx-X11/lib/X11/Xlibint.h:580:8: note: instantiated from: n = badlen; \ ^ Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/lib')
-rw-r--r--nx-X11/lib/X11/Xlibint.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h
index 8a7144959..cd42913f0 100644
--- a/nx-X11/lib/X11/Xlibint.h
+++ b/nx-X11/lib/X11/Xlibint.h
@@ -558,6 +558,7 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);
* Do not use SetReqLen if "req" does not already have data after the
* xReq header. req->length must already be >= 2.
*/
+#ifndef __clang_analyzer__
#define SetReqLen(req,n,badlen) \
if ((req->length + n) > (unsigned)65535) { \
if (dpy->bigreq_size) { \
@@ -568,6 +569,10 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);
} \
} else \
req->length += n
+#else
+#define SetReqLen(req,n,badlen) \
+ req->length += n
+#endif
#define SyncHandle() \
if (dpy->synchandler) (*dpy->synchandler)(dpy)