aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Levand <geoff@infradead.org>2011-11-26 21:06:53 -0800
committerGeoff Levand <geoff@infradead.org>2011-12-11 15:06:22 -0800
commit5865101c6f04296c790467e7d12fcd75917f29e9 (patch)
treeac5edd704594f4c4504b0faea21fee9f82da54a9
parent0f572d200f620969b4ed486f1efdb7b0974420cc (diff)
downloadlibtwin-5865101c6f04296c790467e7d12fcd75917f29e9.tar.gz
Add preprocessor macro maybe_unused
Define a preprocessor macro maybe_unused and add it where needed to remove unused parameter build warnings. Signed-off-by: Geoff Levand <geoff@infradead.org>
-rw-r--r--libtwin/twin_hull.c3
-rw-r--r--libtwin/twin_linux_js.c6
-rw-r--r--libtwin/twin_linux_mouse.c4
-rw-r--r--libtwin/twin_screen.c3
-rw-r--r--libtwin/twin_x11.c6
-rw-r--r--libtwin/twinint.h2
6 files changed, 16 insertions, 8 deletions
diff --git a/libtwin/twin_hull.c b/libtwin/twin_hull.c
index 8bd974f..b93069d 100644
--- a/libtwin/twin_hull.c
+++ b/libtwin/twin_hull.c
@@ -156,7 +156,8 @@ _twin_hull_vertex_compare (const void *av, const void *bv)
}
static int
-_twin_hull_prev_valid (twin_hull_t *hull, int num_hull, int index)
+_twin_hull_prev_valid (twin_hull_t *hull, int maybe_unused num_hull,
+ int index)
{
do {
/* hull[0] is always valid, so don't test and wraparound */
diff --git a/libtwin/twin_linux_js.c b/libtwin/twin_linux_js.c
index 3108cb8..12e011a 100644
--- a/libtwin/twin_linux_js.c
+++ b/libtwin/twin_linux_js.c
@@ -31,6 +31,7 @@
#include <linux/joystick.h>
#include "twin.h"
+#include "twinint.h"
#include "twin_linux_js.h"
#define DEBUG(fmt...) printf(fmt)
@@ -40,8 +41,9 @@ struct twin_js_dev {
twin_screen_t *screen;
};
-static twin_bool_t twin_linux_js_events(int file, twin_file_op_t ops,
- void *closure)
+static twin_bool_t twin_linux_js_events(int maybe_unused file,
+ twin_file_op_t maybe_unused ops,
+ void *closure)
{
struct twin_js_dev *js = closure;
struct js_event js_event;
diff --git a/libtwin/twin_linux_mouse.c b/libtwin/twin_linux_mouse.c
index 085cb9a..d617c85 100644
--- a/libtwin/twin_linux_mouse.c
+++ b/libtwin/twin_linux_mouse.c
@@ -29,6 +29,7 @@
#include <fcntl.h>
#include <math.h>
+#include "twinint.h"
#include "twin_linux_mouse.h"
#define QUADRATIC_ACCELERATION 1
@@ -82,7 +83,8 @@ static void twin_linux_mouse_accel(twin_linux_mouse_t *tm, int *dx, int *dy)
*dy = twin_fixed_to_int(twin_fixed_mul(accel, twin_int_to_fixed(*dy)));
}
-static twin_bool_t twin_linux_mouse_events(int file, twin_file_op_t ops,
+static twin_bool_t twin_linux_mouse_events(int file,
+ twin_file_op_t maybe_unused ops,
void *closure)
{
twin_linux_mouse_t *tm = closure;
diff --git a/libtwin/twin_screen.c b/libtwin/twin_screen.c
index 26fddee..b34020f 100644
--- a/libtwin/twin_screen.c
+++ b/libtwin/twin_screen.c
@@ -141,7 +141,8 @@ twin_screen_damaged (twin_screen_t *screen)
}
static void
-twin_screen_span_pixmap(twin_screen_t *screen, twin_argb32_t *span,
+twin_screen_span_pixmap(twin_screen_t maybe_unused *screen,
+ twin_argb32_t *span,
twin_pixmap_t *p, twin_coord_t y,
twin_coord_t left, twin_coord_t right,
twin_src_op op16, twin_src_op op32)
diff --git a/libtwin/twin_x11.c b/libtwin/twin_x11.c
index ed3bfdc..193c52d 100644
--- a/libtwin/twin_x11.c
+++ b/libtwin/twin_x11.c
@@ -80,9 +80,9 @@ _twin_x11_put_span (twin_coord_t left,
}
static twin_bool_t
-twin_x11_read_events (int file,
- twin_file_op_t ops,
- void *closure)
+twin_x11_read_events (int maybe_unused file,
+ twin_file_op_t maybe_unused ops,
+ void *closure)
{
twin_x11_t *tx = closure;
diff --git a/libtwin/twinint.h b/libtwin/twinint.h
index a54d244..37b1704 100644
--- a/libtwin/twinint.h
+++ b/libtwin/twinint.h
@@ -26,6 +26,8 @@
#include "twin_def.h"
#include <string.h>
+#define maybe_unused __attribute__((unused))
+
/*
* Post-transformed points are stored in 12.4 fixed point
* values