diff options
author | Rob Kendrick (humdrum) <rob.kendrick@codethink.co.uk> | 2013-04-25 15:13:36 +0100 |
---|---|---|
committer | Rob Kendrick (humdrum) <rob.kendrick@codethink.co.uk> | 2013-04-25 15:13:36 +0100 |
commit | fb5c3f3169d3a8d1e85626914b55825733b5376c (patch) | |
tree | fcbd30f7b9c369b0c1dbf1930d87eb8e6029843e /src/surface/sdl.c | |
parent | 9aeab2e5176285583f8d669ba79ce6ff45b81a00 (diff) | |
download | libnsfb-rjek/clang-warnings.tar.gz libnsfb-rjek/clang-warnings.tar.bz2 |
Rationalise UNUSED macros. This changeset allows libnsfb to berjek/clang-warnings
built warning-free both with Clang 3.3 (from trunk) and GCC 4.7.
Remove the use of GCC-specific __attribute__ ((unused)) as this
only works on declarations, meaning there is no "fallback" to use
on compilers that are not GCC or clang. The (void)foo; approach
works with both clang and GCC, and hopefully other compilers
people might be using.
The alternative would to have been two UNUSED macros, one for use
in definitions, and one for use in function bodies.
Diffstat (limited to 'src/surface/sdl.c')
-rw-r--r-- | src/surface/sdl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/surface/sdl.c b/src/surface/sdl.c index 48052a8..8d2930e 100644 --- a/src/surface/sdl.c +++ b/src/surface/sdl.c @@ -502,7 +502,7 @@ static int sdl_initialise(nsfb_t *nsfb) static int sdl_finalise(nsfb_t *nsfb) { - nsfb=nsfb; + UNUSED(nsfb); SDL_Quit(); return 0; } @@ -510,8 +510,8 @@ static int sdl_finalise(nsfb_t *nsfb) static uint32_t wakeeventtimer(uint32_t ival, void *param) { SDL_Event event; - ival = ival; - param = param; + UNUSED(ival); + UNUSED(param); event.type = SDL_USEREVENT; event.user.code = 0; @@ -528,7 +528,7 @@ static bool sdl_input(nsfb_t *nsfb, nsfb_event_t *event, int timeout) int got_event; SDL_Event sdlevent; - nsfb = nsfb; /* unused */ + UNUSED(nsfb); if (timeout == 0) { got_event = SDL_PollEvent(&sdlevent); |