pcm: Fix up some compile warnings that show up under some sim builds

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]>
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit a84a38dd87ae300565087ec3af05607ed26e9b01
Author: Solomon Peachy <[email protected]>
Date:   Sat Mar 28 08:51:37 2026 -0400

    pcm:  Fix up some compile warnings that show up under some sim builds
    
    firmware/pcm_mixer.c:36:35: warning: conversion from ‘long unsigned int’ to ‘unsigned int’ changes value from ‘18446744073709551615’ to ‘4294967295’ [-Woverflow]
       36 | static unsigned int mixer_sampr = -1UL;
          |
    firmware/pcm_mixer.c:269:21: warning: comparison is always false due to limited range of data type [-Wtype-limits]
      269 |     if (mixer_sampr == -1UL)
          |                     ^~
    
    So drop the 'L' and everything is peachy.
    
    Change-Id: I9440d3300931be229c6c4b01bdc1d09b55c34d88

diff --git a/firmware/pcm.c b/firmware/pcm.c
index 766ec0491d..19c76a8a10 100644
--- a/firmware/pcm.c
+++ b/firmware/pcm.c
@@ -202,7 +202,7 @@ void pcm_do_peak_calculation(struct pcm_peaks *peaks, bool active,
     if (active)
     {
         struct pcm_sink* sink = sinks[cur_sink];
-        if (sink->configured_freq == -1UL)
+        if (sink->configured_freq == -1U)
         {
             logf("not configured yet");
             return;
@@ -250,7 +250,7 @@ void pcm_init(void)
     for(size_t i = 0; i < ARRAYLEN(sinks); i += 1) {
         struct pcm_sink* sink = sinks[i];
         sink->pending_freq = sink->caps.default_freq;
-        sink->configured_freq = -1UL;
+        sink->configured_freq = -1U;
         sink->pcm_is_ready = false;
         sink->ops.init();
     }
diff --git a/firmware/pcm_mixer.c b/firmware/pcm_mixer.c
index 92da971fb1..a0d26fc86d 100644
--- a/firmware/pcm_mixer.c
+++ b/firmware/pcm_mixer.c
@@ -33,7 +33,7 @@
    before the last samples are sent to the codec and so things are done in
    parallel (as much as possible) with sending-out data. */
 
-static unsigned int mixer_sampr = -1UL;
+static unsigned int mixer_sampr = -1U;
 static unsigned int mix_frame_size = MIX_FRAME_SAMPLES*4;
 
 /* Define this to nonzero to add a marker pulse at each frame start */
@@ -266,7 +266,7 @@ static void mixer_start_pcm(void)
 #endif
 
     /* Requires a shared global sample rate for all channels */
-    if (mixer_sampr == -1UL)
+    if (mixer_sampr == -1U)
         mixer_sampr = pcm_get_frequency();
     else
         pcm_set_frequency(mixer_sampr);
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.