Marked unused parameters in the SDL interface as UNUSED to placate -Wextra.
authorDavid Griffith <dave@661.org>
Fri, 5 May 2023 04:46:06 +0000 (21:46 -0700)
committerDavid Griffith <dave@661.org>
Fri, 5 May 2023 04:46:06 +0000 (21:46 -0700)
src/sdl/sf_font3.c
src/sdl/sf_fonts.c
src/sdl/sf_images.c
src/sdl/sf_osfdlg.c
src/sdl/sf_resource.c
src/sdl/sf_sig.c
src/sdl/sf_sound.c
src/sdl/sf_util.c
src/sdl/sf_video.c

index a3e6bfe1bd52a805247ab877e9ff2108695f392b..eeb55f3a6dfbcb160369c3a1c2d774423c169a08 100644 (file)
@@ -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) {
index f5c5ef4b827a116325484f46d741ba1490ee2755..017f014dbcc079bdc28d622b5e60262145d6dffa 100644 (file)
@@ -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 */
 }
 
 
index 36507387dea0ba9b766f6dcbef7e84eb9aa451a4..eac912e9d97a7a4d3d7fe7500c47a160dfc67fce 100644 (file)
@@ -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];
index 82f80dc8fe0badc7fbdc962d27353a704c0193bd..0ddaf8db8751d8e47ade615506ae196c3edd08ea 100644 (file)
@@ -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)
index 4927192e635907ca67bdaed40b53920801619cb1..b5900f65569e961be07917e8778080ec841ea803 100644 (file)
@@ -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)
        {
index f33ac19baf18e1f829a51979ad2ebaaaad4cf51e..a688319472c8cfe9ff4d54a6ec956a91952b32ba 100644 (file)
@@ -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];
index 5316bd1c9447e4396a13d7acd6368eef5bfe4715..096ae44d7daaebec82a31da7b7b107bd65bb76cc 100644 (file)
@@ -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;
index 068cda21249919bead5e20d0c09ab2d4bd755398..5c2670c00821e894bb7c32a6ca84e60c71c9df16 100644 (file)
@@ -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 */
index 886be8ec288786dc456167a2b69f245a0442bc8f..cb6548238d33f9881b0246760caee7a1845b27b2 100644 (file)
@@ -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};