build: Silence a pile of set-but-not-used warnings with GCC16 in apps/

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]> Sun, 17 May 2026 08:04:00 -0400
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit cae433608f40be9fd2277c8cf264750ad2e6d450
Author: Solomon Peachy <[email protected]>
Date:   Sun May 17 08:02:17 2026 -0400

    build:  Silence a pile of set-but-not-used warnings with GCC16 in apps/
    
    The compiler is smart enough to optimize away dead stores but let's
    just get rid of them in the first place
    
    Change-Id: I5c85d7c05ef03b084205356a21248f7b049296b0

diff --git a/apps/misc.c b/apps/misc.c
index 0c5d73d2ee..22486ab949 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -1354,7 +1354,10 @@ const char *format_time_auto(char *buffer, int buf_len, long value,
     const char * const sign        = &"-"[value < 0 ? 0 : 1];
     bool               is_rtl      = lang_is_rtl();
     char               timebuf[25]; /* -2147483648:00:00.00\0 */
-    int                len, left_offset;
+    int                len;
+#if 0 /* unused */
+    int left_offset;
+#endif
     unsigned char      base_idx, max_idx;
 
     unsigned long  units_in[UNIT_IDX_TIME_COUNT];
@@ -1427,8 +1430,10 @@ const char *format_time_auto(char *buffer, int buf_len, long value,
 
         timebuf[offsets[base_idx] + fwidth[base_idx]] = '\0';
 
+#if 0 /* unused */
         left_offset  = -(offsets[max_idx]);
         left_offset += strlcpy(buffer, sign, buf_len);
+#endif
 
         /* trim leading zero on the max_idx */
         if ((unit_idx & UNIT_TRIM_ZERO) == UNIT_TRIM_ZERO &&
@@ -1456,7 +1461,9 @@ const char *format_time_auto(char *buffer, int buf_len, long value,
 
         fwidth[UNIT_IDX_HR] = len - offsets[UNIT_IDX_HR];
 
+#if 0 /* unused */
         left_offset = -(offsets[base_idx]);
+#endif
 
         /* trim leading zero on the max_idx */
         if ((unit_idx & UNIT_TRIM_ZERO) == UNIT_TRIM_ZERO &&
@@ -1471,7 +1478,9 @@ const char *format_time_auto(char *buffer, int buf_len, long value,
         if (!supress_unit)
         {
             strmemccpy(buffer, unit_strings_core[units[max_idx]], buf_len);
+#if 0 /* unused */
             left_offset += strlcat(buffer, " ", buf_len);
+#endif
             strlcat(buffer, &timebuf[offsets[base_idx]], buf_len);
         }
         else
diff --git a/apps/plugins/chip8.c b/apps/plugins/chip8.c
index fa6acea82a..bba14aa220 100644
--- a/apps/plugins/chip8.c
+++ b/apps/plugins/chip8.c
@@ -1376,7 +1376,7 @@ static void chip8_sound_off (void)
 /****************************************************************************/
 static void chip8_update_display(void)
 {
-    int x, lcd_x, y, i;
+    int x, y, i;
     byte w;
     byte* row;
     /* frame buffer in hardware fomat */
@@ -1385,7 +1385,7 @@ static void chip8_update_display(void)
     for (y=0;y<CHIP8_HEIGHT/8;++y)
     {
         row = lcd_framebuf[y];
-        for (x=0, lcd_x=0;x<CHIP8_WIDTH;++x,++lcd_x)
+        for (x=0;x<CHIP8_WIDTH;++x)
         {
             w = 0;
             for (i=0;i<8;i++)
diff --git a/apps/plugins/lastfm_scrobbler.c b/apps/plugins/lastfm_scrobbler.c
index 906888c957..919451bdc0 100644
--- a/apps/plugins/lastfm_scrobbler.c
+++ b/apps/plugins/lastfm_scrobbler.c
@@ -760,7 +760,9 @@ static int pbl_copyloop(int fd_copy, const char *src_filename,
     struct scrobbler_entry entry;
     long next_tick = *rb->current_tick;
     int count = 0;
+#ifdef LOGF_ENABLE
     int line_num = 0;
+#endif
     int lines_copied = 0;
     int fd_src = rb->open_utf8(src_filename, O_RDONLY);
     if (fd_src < 0)
@@ -773,7 +775,9 @@ static int pbl_copyloop(int fd_copy, const char *src_filename,
     while(rb->read_line(fd_src, buf, buf_sz) > 0)
     {
         char skipch = ' ';
+#ifdef LOGF_ENABLE
         line_num++;
+#endif
         do_timed_yield();
         if (buf[0] == '\0') /* skip empty lines */
             continue;
@@ -911,7 +915,9 @@ static int sbl_export(void)
 
         struct scrobbler_entry entry;
         int rd = 0;
+#ifdef LOGF_ENABLE
         int line_num = 0;
+#endif
 
         scrobbler_fd = sbl_open_create();
         if (scrobbler_fd >= 0)
@@ -921,7 +927,9 @@ static int sbl_export(void)
             {
                 if ((rd = rb->read_line(fd_copy, buf, sizeof(buf))) <= 0)
                     break;
+#ifdef LOGF_ENABLE
                 line_num++;
+#endif
                 if (buf[0] != ' ') /* skip culled entries comments and empty lines */
                     continue;
                 pbl_parse_valid_entry(&entry, buf);
diff --git a/apps/plugins/mp3_encoder.c b/apps/plugins/mp3_encoder.c
index 7e96ab81d9..b5790f3ae2 100644
--- a/apps/plugins/mp3_encoder.c
+++ b/apps/plugins/mp3_encoder.c
@@ -1863,11 +1863,12 @@ void window_subband2(short *x1, int a[SBLIMIT])
 {
   int   xr;
   short const *wp = enwindow;
-  short *x2 = x1 - 124;
+//  short *x2 = x1 - 124;
 
   wp += 27 * 15;
-  x1 -=  2 * 15;
-  x2 +=  2 * 15;
+//  x1 -=  2 * 15;
+//  x2 +=  2 * 15;
+  (void)x1;
 
   xr = a[28] - a[0];  a[0] += a[28];  a[28] = shft9(xr) * wp[-2*27+25];
   xr = a[29] - a[1];  a[1] += a[29];  a[29] = shft9(xr) * wp[-2*27+25];
diff --git a/apps/plugins/wavview.c b/apps/plugins/wavview.c
index 82e75e0427..fec81b7226 100644
--- a/apps/plugins/wavview.c
+++ b/apps/plugins/wavview.c
@@ -112,7 +112,7 @@ static int readwavpeaks(const char *filename)
     int hours;
     int minutes;
     int seconds;
-    uint32_t peakcount = 0;
+//    uint32_t peakcount = 0;
     struct peakstruct* peak = NULL;
 
     if(rb->strcasecmp (filename + rb->strlen (filename) - 3, "wav"))
@@ -207,7 +207,7 @@ static int readwavpeaks(const char *filename)
         sampleval = letoh16(*(sampleshort+1));
         peak->rmin = sampleval;
         peak->rmax = sampleval;
-    
+
         while(bytes_read)
         {
             sampleval = letoh16(*sampleshort++);
@@ -223,7 +223,7 @@ static int readwavpeaks(const char *filename)
                 peak->rmax = sampleval;
 
             bytes_read -= 4;
-            peakcount++;
+//            peakcount++;
             fppmp_count--;
             if(!fppmp_count)
             {
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs