aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2017-07-10 08:56:00 -0700
committerPierre Ossman <ossman@cendio.se>2017-09-15 12:55:44 +0200
commit0c81bbb78d256f02287aa551f2cedeed6e2d3668 (patch)
treebe566a03361b2006efd9fc8881cd220cf5a4aebb /common
parentb3c9f7ba52dd3f832ac392e444d508ef5b6be6d8 (diff)
downloadtigervnc-0c81bbb78d256f02287aa551f2cedeed6e2d3668.tar.gz
tigervnc-0c81bbb78d256f02287aa551f2cedeed6e2d3668.zip
rfb: Avoid unused argument warnings in headers
Don't force users of these headers to squash compiler warnings about unused arguments, annotate with __unused_attr.
Diffstat (limited to 'common')
-rw-r--r--common/rfb/InputHandler.h10
-rw-r--r--common/rfb/PixelBuffer.h3
-rw-r--r--common/rfb/SDesktop.h8
-rw-r--r--common/rfb/util.h4
4 files changed, 18 insertions, 7 deletions
diff --git a/common/rfb/InputHandler.h b/common/rfb/InputHandler.h
index b5e5e879..727f69bb 100644
--- a/common/rfb/InputHandler.h
+++ b/common/rfb/InputHandler.h
@@ -25,15 +25,19 @@
#include <rdr/types.h>
#include <rfb/Rect.h>
+#include <rfb/util.h>
namespace rfb {
class InputHandler {
public:
virtual ~InputHandler() {}
- virtual void keyEvent(rdr::U32 key, bool down) {}
- virtual void pointerEvent(const Point& pos, int buttonMask) {}
- virtual void clientCutText(const char* str, int len) {}
+ virtual void keyEvent(rdr::U32 __unused_attr key,
+ bool __unused_attr down) { }
+ virtual void pointerEvent(const Point& __unused_attr pos,
+ int __unused_attr buttonMask) { }
+ virtual void clientCutText(const char* __unused_attr str,
+ int __unused_attr len) { }
};
}
diff --git a/common/rfb/PixelBuffer.h b/common/rfb/PixelBuffer.h
index 75caa63f..d89793f5 100644
--- a/common/rfb/PixelBuffer.h
+++ b/common/rfb/PixelBuffer.h
@@ -28,6 +28,7 @@
#include <rfb/PixelFormat.h>
#include <rfb/Rect.h>
#include <rfb/Pixel.h>
+#include <rfb/util.h>
namespace rfb {
@@ -85,7 +86,7 @@ namespace rfb {
// Ensure that the specified rectangle of buffer is up to date.
// Overridden by derived classes implementing framebuffer access
// to copy the required display data into place.
- virtual void grabRegion(const Region& region) {}
+ virtual void grabRegion(const Region& __unused_attr region) {}
protected:
PixelBuffer();
diff --git a/common/rfb/SDesktop.h b/common/rfb/SDesktop.h
index 833762ef..322fe320 100644
--- a/common/rfb/SDesktop.h
+++ b/common/rfb/SDesktop.h
@@ -42,6 +42,7 @@
#include <rfb/InputHandler.h>
#include <rfb/Exception.h>
#include <rfb/screenTypes.h>
+#include <rfb/util.h>
namespace rfb {
@@ -55,7 +56,7 @@ namespace rfb {
// set via the VNCServer's setPixelBuffer() method by the time this call
// returns.
- virtual void start(VNCServer* vs) {}
+ virtual void start(VNCServer* __unused_attr vs) {}
// stop() is called by the server when there are no longer any
// authenticated clients, and therefore the desktop can cease any
@@ -71,8 +72,9 @@ namespace rfb {
// setScreenLayout() requests to reconfigure the framebuffer and/or
// the layout of screens.
- virtual unsigned int setScreenLayout(int fb_width, int fb_height,
- const ScreenSet& layout) {
+ virtual unsigned int setScreenLayout(int __unused_attr fb_width,
+ int __unused_attr fb_height,
+ const ScreenSet& __unused_attr layout) {
return resultProhibited;
}
diff --git a/common/rfb/util.h b/common/rfb/util.h
index e9114c3d..0de64c4a 100644
--- a/common/rfb/util.h
+++ b/common/rfb/util.h
@@ -38,6 +38,10 @@ struct timeval;
# define __printf_attr(a, b)
#endif // __GNUC__
+#ifndef __unused_attr
+# define __unused_attr __attribute((__unused__))
+#endif
+
namespace rfb {
// -=- Class to handle cleanup of arrays of characters