summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabiano FidĂȘncio <fidencio@redhat.com>2014-09-02 14:12:30 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2014-09-18 13:15:29 +0200
commitc8b4c5ec49f4dbf497d9ff92211cfeb9fbd2c4fb (patch)
treeffb5edeee0f657f52c20ae82e00103abe8f638d3
parentdde1c62a9166f337722785b7b4f38c8b2dbbd495 (diff)
common: Fix -Wunused-parameter
-rw-r--r--common/canvas_utils.c3
-rw-r--r--common/lines.c19
-rw-r--r--common/marshaller.c2
-rw-r--r--common/pixman_utils.c12
-rw-r--r--common/quic.c2
-rw-r--r--common/quic_rgb_tmpl.c8
-rw-r--r--common/quic_tmpl.c8
-rw-r--r--common/rop3.c14
8 files changed, 46 insertions, 22 deletions
diff --git a/common/canvas_utils.c b/common/canvas_utils.c
index 297b8ce..d52292b 100644
--- a/common/canvas_utils.c
+++ b/common/canvas_utils.c
@@ -32,7 +32,8 @@
static int gdi_handlers = 0;
#endif
-static void release_data(pixman_image_t *image, void *release_data)
+static void release_data(SPICE_GNUC_UNUSED pixman_image_t *image,
+ void *release_data)
{
PixmanData *data = (PixmanData *)release_data;
diff --git a/common/lines.c b/common/lines.c
index e345b95..726a350 100644
--- a/common/lines.c
+++ b/common/lines.c
@@ -1824,7 +1824,7 @@ miFillRectPolyHelper (GCPtr pGC, Boolean foreground, SpanDataPtr spanData, int x
}
static int
-miPolyBuildEdge (double x0, double y0, double k, /* x0 * dy - y0 * dx */
+miPolyBuildEdge (SPICE_GNUC_UNUSED double x0, double y0, double k, /* x0 * dy - y0 * dx */
int dx, int dy, int xi, int yi, int left, PolyEdgePtr edge)
{
int x, y, e;
@@ -1959,7 +1959,11 @@ miPolyBuildPoly (PolyVertexPtr vertices,
}
static void
-miLineOnePoint (GCPtr pGC, Boolean foreground, SpanDataPtr spanData, int x, int y)
+miLineOnePoint (GCPtr pGC,
+ Boolean foreground,
+ SPICE_GNUC_UNUSED SpanDataPtr spanData,
+ int x,
+ int y)
{
DDXPointRec pt;
int wid;
@@ -2490,9 +2494,14 @@ miLineArc (GCPtr pGC,
}
static void
-miLineProjectingCap (GCPtr pGC, Boolean foreground,
- SpanDataPtr spanData, LineFacePtr face, Boolean isLeft,
- double xorg, double yorg, Boolean isInt)
+miLineProjectingCap (GCPtr pGC,
+ Boolean foreground,
+ SpanDataPtr spanData,
+ LineFacePtr face,
+ Boolean isLeft,
+ SPICE_GNUC_UNUSED double xorg,
+ SPICE_GNUC_UNUSED double yorg,
+ Boolean isInt)
{
int xorgi = 0, yorgi = 0;
int lw;
diff --git a/common/marshaller.c b/common/marshaller.c
index 3d889a4..bd012d7 100644
--- a/common/marshaller.c
+++ b/common/marshaller.c
@@ -564,7 +564,7 @@ void *spice_marshaller_add_uint32(SpiceMarshaller *m, uint32_t v)
return (void *)ptr;
}
-void spice_marshaller_set_uint32(SpiceMarshaller *m, void *ref, uint32_t v)
+void spice_marshaller_set_uint32(SPICE_GNUC_UNUSED SpiceMarshaller *m, void *ref, uint32_t v)
{
write_uint32((uint8_t *)ref, v);
}
diff --git a/common/pixman_utils.c b/common/pixman_utils.c
index db7a67f..27ab155 100644
--- a/common/pixman_utils.c
+++ b/common/pixman_utils.c
@@ -28,9 +28,19 @@
#include <stdio.h>
#include "mem.h"
+/*
+ * src is used for most OPs, hidden within _equation attribute. For some
+ * operations (such as "clear" and "noop") src is not used and then we have
+ * to add SPICE_GNUC_UNUSED, that's just a __attribute__((__unused__)), to
+ * make GCC happy.
+ * Also, according to GCC documentation [0], the unused attribute "(...) means
+ * that the variable is meant to be possibly unused. GCC does not produce a
+ * warning for this variable.". So, we are safe adding it, even if src is used
+ * for most OPs.
+ */
#define SOLID_RASTER_OP(_name, _size, _type, _equation) \
static void \
-solid_rop_ ## _name ## _ ## _size (_type *ptr, int len, _type src) \
+solid_rop_ ## _name ## _ ## _size (_type *ptr, int len, SPICE_GNUC_UNUSED _type src) \
{ \
while (len--) { \
_type dst = *ptr; \
diff --git a/common/quic.c b/common/quic.c
index 90ea47b..16290d4 100644
--- a/common/quic.c
+++ b/common/quic.c
@@ -840,7 +840,7 @@ typedef uint16_t rgb16_pixel_t;
#endif
-static void fill_model_structures(Encoder *encoder, FamilyStat *family_stat,
+static void fill_model_structures(SPICE_GNUC_UNUSED Encoder *encoder, FamilyStat *family_stat,
unsigned int rep_first, unsigned int first_size,
unsigned int rep_next, unsigned int mul_size,
unsigned int levels, unsigned int ncounters,
diff --git a/common/quic_rgb_tmpl.c b/common/quic_rgb_tmpl.c
index 19cc348..f807a0c 100644
--- a/common/quic_rgb_tmpl.c
+++ b/common/quic_rgb_tmpl.c
@@ -223,7 +223,7 @@ static void FNAME(compress_row0_seg)(Encoder *encoder, int i,
const PIXEL * const cur_row,
const int end,
const unsigned int waitmask,
- const unsigned int bpc,
+ SPICE_GNUC_UNUSED const unsigned int bpc,
const unsigned int bpc_mask)
{
Channel * const channel_r = encoder->channels;
@@ -331,7 +331,7 @@ static void FNAME(compress_row_seg)(Encoder *encoder, int i,
const PIXEL * const cur_row,
const int end,
const unsigned int waitmask,
- const unsigned int bpc,
+ SPICE_GNUC_UNUSED const unsigned int bpc,
const unsigned int bpc_mask)
{
Channel * const channel_r = encoder->channels;
@@ -478,7 +478,7 @@ static void FNAME(uncompress_row0_seg)(Encoder *encoder, int i,
PIXEL * const cur_row,
const int end,
const unsigned int waitmask,
- const unsigned int bpc,
+ SPICE_GNUC_UNUSED const unsigned int bpc,
const unsigned int bpc_mask)
{
Channel * const channel_r = encoder->channels;
@@ -594,7 +594,7 @@ static void FNAME(uncompress_row_seg)(Encoder *encoder,
PIXEL * const cur_row,
int i,
const int end,
- const unsigned int bpc,
+ SPICE_GNUC_UNUSED const unsigned int bpc,
const unsigned int bpc_mask)
{
Channel * const channel_r = encoder->channels;
diff --git a/common/quic_tmpl.c b/common/quic_tmpl.c
index b1ddbc4..e839346 100644
--- a/common/quic_tmpl.c
+++ b/common/quic_tmpl.c
@@ -152,7 +152,7 @@ static void FNAME(compress_row0_seg)(Encoder *encoder, Channel *channel, int i,
const PIXEL * const cur_row,
const int end,
const unsigned int waitmask,
- const unsigned int bpc,
+ SPICE_GNUC_UNUSED const unsigned int bpc,
const unsigned int bpc_mask)
{
BYTE * const decorelate_drow = channel->correlate_row;
@@ -243,7 +243,7 @@ static void FNAME(compress_row_seg)(Encoder *encoder, Channel *channel, int i,
const PIXEL * const cur_row,
const int end,
const unsigned int waitmask,
- const unsigned int bpc,
+ SPICE_GNUC_UNUSED const unsigned int bpc,
const unsigned int bpc_mask)
{
BYTE * const decorelate_drow = channel->correlate_row;
@@ -385,7 +385,7 @@ static void FNAME(uncompress_row0_seg)(Encoder *encoder, Channel *channel, int i
PIXEL * const cur_row,
const int end,
const unsigned int waitmask,
- const unsigned int bpc,
+ SPICE_GNUC_UNUSED const unsigned int bpc,
const unsigned int bpc_mask)
{
int stopidx;
@@ -486,7 +486,7 @@ static void FNAME(uncompress_row_seg)(Encoder *encoder, Channel *channel,
PIXEL * const cur_row,
int i,
const int end,
- const unsigned int bpc,
+ SPICE_GNUC_UNUSED const unsigned int bpc,
const unsigned int bpc_mask)
{
const unsigned int waitmask = bppmask[channel->state.wmidx];
diff --git a/common/rop3.c b/common/rop3.c
index d5b46db..97bfe0c 100644
--- a/common/rop3.c
+++ b/common/rop3.c
@@ -43,15 +43,19 @@ static rop3_test_handler_t rop3_test_handlers_32[ROP3_NUM_OPS];
static rop3_test_handler_t rop3_test_handlers_16[ROP3_NUM_OPS];
-static void default_rop3_with_pattern_handler(pixman_image_t *d, pixman_image_t *s,
- SpicePoint *src_pos, pixman_image_t *p,
- SpicePoint *pat_pos)
+static void default_rop3_with_pattern_handler(SPICE_GNUC_UNUSED pixman_image_t *d,
+ SPICE_GNUC_UNUSED pixman_image_t *s,
+ SPICE_GNUC_UNUSED SpicePoint *src_pos,
+ SPICE_GNUC_UNUSED pixman_image_t *p,
+ SPICE_GNUC_UNUSED SpicePoint *pat_pos)
{
spice_critical("not implemented");
}
-static void default_rop3_withe_color_handler(pixman_image_t *d, pixman_image_t *s, SpicePoint *src_pos,
- uint32_t rgb)
+static void default_rop3_withe_color_handler(SPICE_GNUC_UNUSED pixman_image_t *d,
+ SPICE_GNUC_UNUSED pixman_image_t *s,
+ SPICE_GNUC_UNUSED SpicePoint *src_pos,
+ SPICE_GNUC_UNUSED uint32_t rgb)
{
spice_critical("not implemented");
}