From 8cc50e2f7bf5433bca9d3332a09b5ec9f3b06c9d Mon Sep 17 00:00:00 2001 From: David Griffith Date: Thu, 4 May 2023 21:46:06 -0700 Subject: [PATCH] Marked unused parameters in the SDL interface as UNUSED to placate -Wextra. --- src/sdl/sf_font3.c | 24 ++++++++++++------------ src/sdl/sf_fonts.c | 7 ++++--- src/sdl/sf_images.c | 12 ++++++------ src/sdl/sf_osfdlg.c | 8 ++++---- src/sdl/sf_resource.c | 2 +- src/sdl/sf_sig.c | 2 +- src/sdl/sf_sound.c | 8 ++++---- src/sdl/sf_util.c | 6 +++--- src/sdl/sf_video.c | 9 +++++---- 9 files changed, 40 insertions(+), 38 deletions(-) diff --git a/src/sdl/sf_font3.c b/src/sdl/sf_font3.c index a3e6bfe..eeb55f3 100644 --- a/src/sdl/sf_font3.c +++ b/src/sdl/sf_font3.c @@ -127,19 +127,19 @@ static struct { zbyte bitmap[16]; } myglyph = {8,8,8,0,-2}; -static void nodestroy(SFONT *s){} -static int myheight(SFONT *s){ return 8;} -static int myascent(SFONT *s){ return 6;} -static int mydescent(SFONT *s){ return 2;} -static int myminchar(SFONT *s){ return 32;} -static int mymaxchar(SFONT *s){ return 126;} -static int myhasglyph(SFONT *s, zword c, int allowdef) +static void nodestroy(SFONT * UNUSED (s)){} +static int myheight(SFONT * UNUSED (s)){ return 8;} +static int myascent(SFONT * UNUSED (s)){ return 6;} +static int mydescent(SFONT * UNUSED (s)){ return 2;} +static int myminchar(SFONT * UNUSED (s)){ return 32;} +static int mymaxchar(SFONT * UNUSED (s)){ return 126;} +static int myhasglyph(SFONT * UNUSED (s), zword c, int allowdef) { return (c >= 32 && c <= 126) || allowdef; } -static SF_glyph * mygetglyph(SFONT *s, zword c, int allowdef) +static SF_glyph * mygetglyph(SFONT * UNUSED (s), zword c, int allowdef) { zbyte *src; if (c < 32 || c > 126) { @@ -170,10 +170,10 @@ static SFONT myfont3 = { SFONT * SF_font3 = &myfont3; -static int myheight2(SFONT *s){ return 16;} -static int myascent2(SFONT *s){ return 14;} -static int mydescent2(SFONT *s){ return 2;} -static SF_glyph * mygetglyph2(SFONT *s, zword c, int allowdef) +static int myheight2(SFONT * UNUSED (s)){ return 16;} +static int myascent2(SFONT * UNUSED (s)){ return 14;} +static int mydescent2(SFONT * UNUSED (s)){ return 2;} +static SF_glyph * mygetglyph2(SFONT * UNUSED (s), zword c, int allowdef) { zbyte *src, *dst; int i; if (c < 32 || c > 126) { diff --git a/src/sdl/sf_fonts.c b/src/sdl/sf_fonts.c index f5c5ef4..017f014 100644 --- a/src/sdl/sf_fonts.c +++ b/src/sdl/sf_fonts.c @@ -525,7 +525,7 @@ void sf_poptextsettings(void) * * */ -int os_check_unicode(int font, zchar c) +int os_check_unicode(int UNUSED (font), zchar c) { return ((current.font->hasglyph(current.font, c, 0) != 0) ? 3 : 2); } @@ -780,7 +780,7 @@ int os_buffer_screen(int mode) * Return non-zero if the window should have text wrapped. * */ -int os_wrap_window(int win) +int os_wrap_window(int UNUSED (win)) { return 1; } @@ -792,8 +792,9 @@ int os_wrap_window(int win) * Called when the height of a window is changed. * */ -void os_window_height(int win, int height) +void os_window_height(int UNUSED (win), int UNUSED (height)) { + /* Not implemented */ } diff --git a/src/sdl/sf_images.c b/src/sdl/sf_images.c index 3650738..eac912e 100644 --- a/src/sdl/sf_images.c +++ b/src/sdl/sf_images.c @@ -89,7 +89,7 @@ static void readPNGData(png_structp png_ptr, png_bytep data, png_size_t length) } /* readPNGData */ -static int loadpng(zbyte * data, int length, sf_picture * graphic) +static int loadpng(zbyte * data, int UNUSED (length), sf_picture * graphic) { png_bytep *rowPointers = NULL; png_structp png_ptr = NULL; @@ -227,7 +227,7 @@ static int loadpng(zbyte * data, int length, sf_picture * graphic) free(rowPointers); return 1; -} /* loadpng * / +} /* loadpng */ /**************************************************************************** @@ -260,13 +260,13 @@ static void outputJPEGMessage(j_common_ptr cinfo) /* Memory Data Source */ -static void memJPEGInit(j_decompress_ptr unused) +static void memJPEGInit(j_decompress_ptr UNUSED (unused)) { /* Nothing here */ } /* memJPEGInit */ -static int memJPEGFillInput(j_decompress_ptr unused) +static int memJPEGFillInput(j_decompress_ptr UNUSED (unused)) { return 0; } /* memJPEGFillInput */ @@ -284,7 +284,7 @@ static void memJPEGSkipInput(j_decompress_ptr cinfo, long num_bytes) } /* memJPEGSkipInput */ -static void memJPEGTerm(j_decompress_ptr unused) +static void memJPEGTerm(j_decompress_ptr UNUSED (unused)) { /* Nothing here */ } /* memJPEGTerm */ @@ -368,7 +368,7 @@ static int loadjpeg(zbyte * data, int length, sf_picture * graphic) **************************************************************************** */ -static int loadrect(zbyte * data, int length, sf_picture * graphic) +static int loadrect(zbyte * data, int UNUSED (length), sf_picture * graphic) { graphic->width = (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3]; diff --git a/src/sdl/sf_osfdlg.c b/src/sdl/sf_osfdlg.c index 82f80dc..0ddaf8d 100644 --- a/src/sdl/sf_osfdlg.c +++ b/src/sdl/sf_osfdlg.c @@ -317,20 +317,20 @@ STATIC zword checkmouse(int i0) } /* checkmouse */ -STATIC zword Zup(int x, int y) +STATIC zword Zup(int UNUSED (x), int UNUSED (y)) { goup(); return 0; } /* Zup */ -STATIC zword Zok(int x, int y) +STATIC zword Zok(int UNUSED (x), int UNUSED (y)) { return ZC_RETURN; } /* Zok */ -STATIC zword Zcanc(int x, int y) +STATIC zword Zcanc(int UNUSED (x), int UNUSED (y)) { return ZC_ESCAPE; } /* Zcanc */ @@ -558,7 +558,7 @@ void sf_setdialog(void) /* simplified fnmatch - only allows a single * at beginning */ -STATIC int myfnmatch(const char *pattern, const char *p, int dummy) +STATIC int myfnmatch(const char *pattern, const char *p, int UNUSED (dummy)) { int lpat, lp; if (!pattern) diff --git a/src/sdl/sf_resource.c b/src/sdl/sf_resource.c index 4927192..b5900f6 100644 --- a/src/sdl/sf_resource.c +++ b/src/sdl/sf_resource.c @@ -261,7 +261,7 @@ int os_picture_data(int picture, int *height, int *width) * MENU_REMOVE - Remove the menu at the given index * */ -void os_menu(int action, int menu, const zword * text) +void os_menu(int UNUSED (action), int UNUSED (menu), const zword * UNUSED (text)) { /* switch (action) { diff --git a/src/sdl/sf_sig.c b/src/sdl/sf_sig.c index f33ac19..a688319 100644 --- a/src/sdl/sf_sig.c +++ b/src/sdl/sf_sig.c @@ -109,7 +109,7 @@ static char *getsigname(int s) return NULL; } /* getsigname */ -static void bt_sighandler(int sig, siginfo_t * info, void *secret) +static void bt_sighandler(int sig, siginfo_t * info, void * UNUSED (secret)) { void *trace[16]; diff --git a/src/sdl/sf_sound.c b/src/sdl/sf_sound.c index 5316bd1..096ae44 100644 --- a/src/sdl/sf_sound.c +++ b/src/sdl/sf_sound.c @@ -228,7 +228,7 @@ static void startmodule(void) } /* startmodule */ -static EFFECT *getaiff(FILE * f, size_t pos, int len, int num) +static EFFECT *getaiff(FILE * f, size_t pos, int UNUSED (len), int num) { EFFECT *res = NULL; @@ -245,7 +245,7 @@ static EFFECT *getaiff(FILE * f, size_t pos, int len, int num) } /* getaiff */ -static EFFECT *getmodule(FILE * f, size_t pos, int len, int num) +static EFFECT *getmodule(FILE * f, size_t pos, int UNUSED (len), int num) { EFFECT *res; zbyte h[2]; @@ -320,7 +320,7 @@ static EFFECT *geteffect(int num) * or low-pitched (number == 2). * */ -void os_beep(int number) +void os_beep(int UNUSED (number)) { if (m_no_sound) return; @@ -353,7 +353,7 @@ void os_finish_with_sample(int number) * Load the given sample from the disk. * */ -void os_prepare_sample(int number) +void os_prepare_sample(int UNUSED (number)) { if (!SFaudiorunning) return; diff --git a/src/sdl/sf_util.c b/src/sdl/sf_util.c index 068cda2..5c2670c 100644 --- a/src/sdl/sf_util.c +++ b/src/sdl/sf_util.c @@ -591,7 +591,7 @@ static bool newfile(int flag) static char buf[FILENAME_MAX]; -static const char *getnumbername(const char *def, char *ext) +static const char *getnumbername(const char * UNUSED(def), char *ext) { int len, number = 0; strcpy(buf, f_setup.story_name); @@ -605,7 +605,7 @@ static const char *getnumbername(const char *def, char *ext) } /* getnumbername */ -static const char *getdatename(const char *def, char *ext) +static const char *getdatename(const char * UNUSED (def), char *ext) { int len; @@ -1041,7 +1041,7 @@ char *sf_GetProfileString(const char *sect, const char *id, char *def) #define pshort( b) (((int)((b)[1]) << 8) + (int)((b)[0])) -static unsigned myin(void *d, zbyte ** b) +static unsigned myin(void * UNUSED (d), zbyte ** UNUSED (b)) { return 0; } /* myin */ diff --git a/src/sdl/sf_video.c b/src/sdl/sf_video.c index 886be8e..cb65482 100644 --- a/src/sdl/sf_video.c +++ b/src/sdl/sf_video.c @@ -348,7 +348,7 @@ void sf_flushtext(void) * being erased. * */ -void os_erase_area(int top, int left, int bottom, int right, int win) +void os_erase_area(int top, int left, int bottom, int right, int UNUSED (win)) { sf_flushtext(); sf_fillrect((sf_curtextsetting())->back, left - 1, top - 1, @@ -445,8 +445,9 @@ void os_scroll_area(int top, int left, int bottom, int right, int units) } /* os_scroll_area */ -bool os_repaint_window(int win, int ypos_old, int ypos_new, int xpos, - int ysize, int xsize) +bool os_repaint_window(int UNUSED (win), int UNUSED (ypos_old), + int UNUSED (ypos_new), int UNUSED (xpos), + int UNUSED (ysize), int UNUSED (xsize)) { /* TODO */ return FALSE; @@ -458,7 +459,7 @@ static SDL_atomic_t SFticked = {0}; static SDL_TimerID timerid = 0; static Uint32 refreshEventType = 0; -static Uint32 SDLCALL mytimer(Uint32 inter, void *parm) +static Uint32 SDLCALL mytimer(Uint32 inter, void * UNUSED (parm)) { SDL_AtomicSet(&SFticked, 1); SDL_Event event = {0}; -- 2.34.1