On 27/01/2026 19.24, [email protected] wrote:
From: Marc-AndrĂ© Lureau <[email protected]>

The endianness field used an int to represent a boolean concept, with
0 meaning little-endian and 1 meaning big-endian. This required runtime
validation to reject invalid values and made the code less readable.

Replace with a bool big_endian field that is self-documenting and
type-safe. The compiler now enforces valid values, eliminating the
need for the validation check in audio_validate_settings().

Signed-off-by: Marc-AndrĂ© Lureau <[email protected]>
---
...
diff --git a/audio/sndioaudio.c b/audio/sndioaudio.c
index be491895532..69fa9d8ba54 100644
--- a/audio/sndioaudio.c
+++ b/audio/sndioaudio.c
@@ -387,7 +387,7 @@ static int sndio_init(SndioVoice *self,
      }
if (req.bits > 8) {
-        req.le = as->endianness ? 0 : 1;
+        req.le = as->big_endian ? 0 : 1;
      }
You could change it to:

        req.le = !as->big_endian;

... but it's just a nit, so:

Reviewed-by: Thomas Huth <[email protected]>


Reply via email to