From 2cade632b475ecc1a115692ec44bbb36a447ce8b Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 27 Dec 2017 23:54:34 +0100 Subject: nxcompshad: silence GCC warnings Fixes ArcticaProject/nx-libs#572 --- nxcompshad/src/Core.cpp | 18 ++++++++++++++---- nxcompshad/src/Logger.h | 5 +++++ 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'nxcompshad') diff --git a/nxcompshad/src/Core.cpp b/nxcompshad/src/Core.cpp index f92f85c41..39ac4a3b2 100644 --- a/nxcompshad/src/Core.cpp +++ b/nxcompshad/src/Core.cpp @@ -337,7 +337,10 @@ int CorePoller::isChanged(int (*checkIfInputCallback)(void *), void *arg, int *s } } - XRectangle rect = {0, curLine, width_, 1}; + XRectangle rect = {0, + static_cast(curLine), + static_cast(width_), + 1}; char *buffer; @@ -443,9 +446,13 @@ int CorePoller::isChanged(int (*checkIfInputCallback)(void *), void *arg, int *s break; } - if ((curWorkLine - last > minSliceHeight_) || (last - start > maxSliceHeight_)) + if ((curWorkLine - last > minSliceHeight_) || + (last - start > maxSliceHeight_)) { - XRectangle rect = {left, start, right - left + 1, last - start + 1}; + XRectangle rect = {static_cast(left), + static_cast(start), + static_cast(right - left + 1), + static_cast(last - start + 1)}; XUnionRectWithRegion(&rect, lastUpdatedRegion_, lastUpdatedRegion_); @@ -477,7 +484,10 @@ int CorePoller::isChanged(int (*checkIfInputCallback)(void *), void *arg, int *s if (last >= start) { - XRectangle rect = {left, start, right - left + 1, last - start + 1}; + XRectangle rect = {static_cast(left), + static_cast(start), + static_cast(right - left + 1), + static_cast(last - start + 1)}; XUnionRectWithRegion(&rect, lastUpdatedRegion_, lastUpdatedRegion_); } diff --git a/nxcompshad/src/Logger.h b/nxcompshad/src/Logger.h index 37b378cb2..876cb0432 100644 --- a/nxcompshad/src/Logger.h +++ b/nxcompshad/src/Logger.h @@ -29,6 +29,9 @@ #include #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" + // // Error handling macros. // @@ -164,4 +167,6 @@ static inline void logDump(const char *name, const char *data, int size) #endif } +#pragma GCC diagnostic pop + #endif /* Logger_H */ -- cgit v1.2.3