common: Fix -Wunused-parameter

This commit is contained in:
Fabiano Fidêncio 2014-09-02 14:12:30 +02:00 committed by Christophe Fergeau
parent dde1c62a91
commit c8b4c5ec49
8 changed files with 46 additions and 22 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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);
}

View File

@ -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; \

View File

@ -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,

View File

@ -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;

View File

@ -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];

View File

@ -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");
}