From 471342933b19bb0648d4f339be6e160545013f51 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 18 Jan 2019 22:10:54 +0100 Subject: Fix: clang does not know about gnu_printf Found via Travis CI --- nxcompshad/src/Logger.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nxcompshad/src/Logger.h b/nxcompshad/src/Logger.h index 876cb0432..e0b9997d7 100644 --- a/nxcompshad/src/Logger.h +++ b/nxcompshad/src/Logger.h @@ -46,17 +46,17 @@ class Logger { public: - void user(const char *format, ...) __attribute__((format(gnu_printf, 2, 3))); + void user(const char *format, ...) __attribute__((format(printf, 2, 3))); void error(const char *name, int error); - void warning(const char *name, const char *format, ...) __attribute__((format(gnu_printf, 3, 4))); + void warning(const char *name, const char *format, ...) __attribute__((format(printf, 3, 4))); - void test(const char *name, const char *format, ...) __attribute__((format(gnu_printf, 3, 4))); + void test(const char *name, const char *format, ...) __attribute__((format(printf, 3, 4))); void trace(const char *name); - void debug(const char *name, const char *format, ...) __attribute__((format(gnu_printf, 3, 4))); + void debug(const char *name, const char *format, ...) __attribute__((format(printf, 3, 4))); void dump(const char *name, const char *data, int size); }; -- cgit v1.2.3 From 0e481f8aaf5faf0aed4cf5ea9bdbb7d458d9efdc Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 18 Jan 2019 22:38:31 +0100 Subject: nxcomp: fix unused variable --- nxcomp/src/Timestamp.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/nxcomp/src/Timestamp.cpp b/nxcomp/src/Timestamp.cpp index 4a9dd3347..273f2823b 100644 --- a/nxcomp/src/Timestamp.cpp +++ b/nxcomp/src/Timestamp.cpp @@ -49,7 +49,6 @@ std::string strTimestamp(const T_timestamp &ts) std::string ret; char ctime_now[26] = { }; - bool err = true; #if HAVE_CTIME_S errno_t retval = ::ctime_s(ctime_now, sizeof(ctime_now), static_cast(&ts.tv_sec)); -- cgit v1.2.3 From 0934b1e673d002c69a0c6fa846931df62acd5fb8 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 18 Jan 2019 22:41:05 +0100 Subject: nxcomp: fix unused variables --- nxcomp/src/TranslateCoords.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nxcomp/src/TranslateCoords.h b/nxcomp/src/TranslateCoords.h index 997d079e1..fd9b1590b 100644 --- a/nxcomp/src/TranslateCoords.h +++ b/nxcomp/src/TranslateCoords.h @@ -84,10 +84,10 @@ class TranslateCoordsMessage : public Message unsigned int src_x; unsigned int src_y; - unsigned char r_same_screen; - unsigned int r_child_window; - unsigned int r_dst_x; - unsigned int r_dst_y; + // unsigned char r_same_screen; + // unsigned int r_child_window; + // unsigned int r_dst_x; + // unsigned int r_dst_y; }; class TranslateCoordsStore : public MessageStore -- cgit v1.2.3 From e1f2a24f637cb1727667f68076fbe66fe9c1660e Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 18 Jan 2019 22:44:21 +0100 Subject: xlib: remove superflous parens --- nx-X11/lib/src/xkb/XKBBind.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/lib/src/xkb/XKBBind.c b/nx-X11/lib/src/xkb/XKBBind.c index c679dc552..068e8f2a0 100644 --- a/nx-X11/lib/src/xkb/XKBBind.c +++ b/nx-X11/lib/src/xkb/XKBBind.c @@ -165,7 +165,7 @@ XKeysymToKeycode(Display *dpy, KeySym ks) for (i = dpy->min_keycode; i <= dpy->max_keycode; i++) { if (j < (int) XkbKeyNumSyms(xkb, i)) { gotOne = 1; - if ((XkbKeySym(xkb, i, j) == ks)) + if (XkbKeySym(xkb, i, j) == ks) return i; } } -- cgit v1.2.3 From a8ed28234ab8f5bdedc18a60c37e7f427090e8b1 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 18 Jan 2019 22:47:38 +0100 Subject: Xlib: remove register keywords storage class specifier is deprecated and incompatible with C++17 --- nx-X11/lib/include/X11/Xlibint.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/nx-X11/lib/include/X11/Xlibint.h b/nx-X11/lib/include/X11/Xlibint.h index d38c87ee3..ce20b9a3d 100644 --- a/nx-X11/lib/include/X11/Xlibint.h +++ b/nx-X11/lib/include/X11/Xlibint.h @@ -709,12 +709,12 @@ extern void _XFlushGCCache(Display *dpy, GC gc); #define Data32(dpy, data, len) _XData32(dpy, (_Xconst long *)data, len) extern int _XData32( Display *dpy, - register _Xconst long *data, + _Xconst long *data, unsigned len ); extern void _XRead32( Display *dpy, - register long *data, + long *data, long len ); #else @@ -1415,10 +1415,10 @@ extern int _XF86LoadQueryLocaleFont( ); extern void _XProcessWindowAttributes ( - register Display *dpy, + Display *dpy, xChangeWindowAttributesReq *req, - register unsigned long valuemask, - register XSetWindowAttributes *attributes); + unsigned long valuemask, + XSetWindowAttributes *attributes); extern int _XDefaultError( Display *dpy, @@ -1428,7 +1428,7 @@ extern int _XDefaultIOError( Display *dpy); extern void _XSetClipRectangles ( - register Display *dpy, + Display *dpy, GC gc, int clip_x_origin, int clip_y_origin, XRectangle *rectangles, @@ -1436,13 +1436,13 @@ extern void _XSetClipRectangles ( int ordering); Status _XGetWindowAttributes( - register Display *dpy, + Display *dpy, Window w, XWindowAttributes *attr); int _XPutBackEvent ( - register Display *dpy, - register XEvent *event); + Display *dpy, + XEvent *event); extern Bool _XIsEventCookie( Display *dpy, -- cgit v1.2.3 From 74fe99dab760eb1bc2aa7b64ab32a19bd26baabc Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 18 Jan 2019 22:51:40 +0100 Subject: xcompshad: remove unused variables --- nxcompshad/src/X11.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/nxcompshad/src/X11.h b/nxcompshad/src/X11.h index 87dd31fea..0fe8ca0de 100644 --- a/nxcompshad/src/X11.h +++ b/nxcompshad/src/X11.h @@ -77,10 +77,6 @@ class Poller : public CorePoller Damage damage_; - Region repair_; - - char damageChanges_; - XShmSegmentInfo *shminfo_; XImage *image_; -- cgit v1.2.3 From a53c655474c96fc24e38009804291882793c2a3f Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 18 Jan 2019 23:44:47 +0100 Subject: Logger.h: fix missing compiler attribute --- nxcompshad/src/Logger.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nxcompshad/src/Logger.h b/nxcompshad/src/Logger.h index e0b9997d7..88908f717 100644 --- a/nxcompshad/src/Logger.h +++ b/nxcompshad/src/Logger.h @@ -68,7 +68,7 @@ static inline void logError(const char *name, int error) \ __attribute__((__unused__)); static inline void logWarning(const char *name, const char *format, ...) \ - __attribute__((__unused__)); + __attribute__((format(printf, 2, 3))) __attribute__((__unused__)); static inline void logTest(const char *name, const char *format, ...) \ __attribute__((format(printf, 2, 3))) __attribute__((__unused__)); -- cgit v1.2.3 From 059028ce72267de69cb6b1983fc3599ee6491d9d Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 18 Jan 2019 23:45:26 +0100 Subject: Logger.h: remove pragma, correct attributes Instead of using a pragma which will be valid for the whole file this only affects the functions where it is actually required and supresses "format string is not a string literal" warnings. According to GCC documentation the second attribute parameter should be 0: "For functions where the arguments are not available to be checked (such as vprintf), specify the third parameter as zero". --- nxcompshad/src/Logger.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/nxcompshad/src/Logger.h b/nxcompshad/src/Logger.h index 88908f717..8436c5f15 100644 --- a/nxcompshad/src/Logger.h +++ b/nxcompshad/src/Logger.h @@ -29,9 +29,6 @@ #include #include -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" - // // Error handling macros. // @@ -46,17 +43,17 @@ class Logger { public: - void user(const char *format, ...) __attribute__((format(printf, 2, 3))); + void user(const char *format, ...) __attribute__((format(printf, 2, 0))); void error(const char *name, int error); - void warning(const char *name, const char *format, ...) __attribute__((format(printf, 3, 4))); + void warning(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0))); - void test(const char *name, const char *format, ...) __attribute__((format(printf, 3, 4))); + void test(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0))); void trace(const char *name); - void debug(const char *name, const char *format, ...) __attribute__((format(printf, 3, 4))); + void debug(const char *name, const char *format, ...) __attribute__((format(printf, 3, 0))); void dump(const char *name, const char *data, int size); }; @@ -167,6 +164,4 @@ static inline void logDump(const char *name, const char *data, int size) #endif } -#pragma GCC diagnostic pop - #endif /* Logger_H */ -- cgit v1.2.3 From 7c8214f31fd3d83e641067941573ebb89f4f4ddb Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 18 Jan 2019 23:57:04 +0100 Subject: GenericReply.h: remove unused variable --- nxcomp/src/GenericReply.h | 1 - 1 file changed, 1 deletion(-) diff --git a/nxcomp/src/GenericReply.h b/nxcomp/src/GenericReply.h index e899b8467..2b352357f 100644 --- a/nxcomp/src/GenericReply.h +++ b/nxcomp/src/GenericReply.h @@ -83,7 +83,6 @@ class GenericReplyMessage : public Message private: unsigned char byte_data; - unsigned int int_data[6]; unsigned short short_data[12]; }; -- cgit v1.2.3