pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/audio/portaudio



Module Name:    pkgsrc
Committed By:   tnn
Date:           Fri Mar 27 18:43:51 UTC 2026

Modified Files:
        pkgsrc/audio/portaudio: distinfo
Added Files:
        pkgsrc/audio/portaudio/patches: patch-src_common_pa__converters.c

Log Message:
portaudio: fix build with clang


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 pkgsrc/audio/portaudio/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/audio/portaudio/patches/patch-src_common_pa__converters.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/audio/portaudio/distinfo
diff -u pkgsrc/audio/portaudio/distinfo:1.30 pkgsrc/audio/portaudio/distinfo:1.31
--- pkgsrc/audio/portaudio/distinfo:1.30        Tue Jul 16 11:40:16 2024
+++ pkgsrc/audio/portaudio/distinfo     Fri Mar 27 18:43:50 2026
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.30 2024/07/16 11:40:16 adam Exp $
+$NetBSD: distinfo,v 1.31 2026/03/27 18:43:50 tnn Exp $
 
 BLAKE2s (pa_stable_v190700_20210406.tgz) = 570e46ea4a81c83cedbbc1a96d9402b0aa4f6d0d6b04df204937e7dbc851407d
 SHA512 (pa_stable_v190700_20210406.tgz) = 77393bf0628ad9c9d5fb1b0d9b1732d403e23513b1332553964bdafcc80878b2798141011d2615688150d753a594285e718cf716e990b2396f1d8dea7babd02d
@@ -8,6 +8,7 @@ SHA1 (patch-bindings_cpp_Makefile.am) = 
 SHA1 (patch-configure.in) = bd0ce61a170bc3c440748a41b36ac7cda5a7d2ed
 SHA1 (patch-include_pa__unix__oss.h) = 8e4ede09d5bf730bf8c2e8ca4aca6f700f58f2f7
 SHA1 (patch-include_portaudio.h) = 9a2e4aeb126056aded5cc49c40cde40e16738757
+SHA1 (patch-src_common_pa__converters.c) = 5e37dc91d9098b65c7e2958a611c72f65a487d65
 SHA1 (patch-src_common_pa__front.c) = cdddb6f537f803b55873ad6bfa936a6bff47556d
 SHA1 (patch-src_common_pa__stream.c) = 58e6ab2a61957208973a59be2f1140abc922f360
 SHA1 (patch-src_common_pa__stream.h) = 94781a9ae79ea1340eea8caadc106416c019cf74

Added files:

Index: pkgsrc/audio/portaudio/patches/patch-src_common_pa__converters.c
diff -u /dev/null pkgsrc/audio/portaudio/patches/patch-src_common_pa__converters.c:1.1
--- /dev/null   Fri Mar 27 18:43:51 2026
+++ pkgsrc/audio/portaudio/patches/patch-src_common_pa__converters.c    Fri Mar 27 18:43:51 2026
@@ -0,0 +1,50 @@
+$NetBSD: patch-src_common_pa__converters.c,v 1.1 2026/03/27 18:43:51 tnn Exp $
+
+clang complains:
+      conversion from 'int' to 'float' changes value from 2147483647 to
+      2147483648 [-Werror,-Wimplicit-const-int-float-conversion]
+
+In the expressions, 0x7FFFFFFF gets implicitly converted and rounded
+to (float)0x80000000 which seems not what the code intends here.
+In order to avoid clipping it may be more correct to use 0x7FFFFF80 which
+is the nearest smaller integer that converts exactly into an IEEE 32-bit float.
+That said; in order to not change existing behaviour just add explicit casts.
+
+--- src/common/pa_converters.c.orig    2026-03-27 18:10:20.809295041 +0000
++++ src/common/pa_converters.c
+@@ -344,10 +344,10 @@ static void Float32_To_Int32(
+     {
+         /* REVIEW */
+ #ifdef PA_USE_C99_LRINTF
+-        float scaled = *src * 0x7FFFFFFF;
++        float scaled = *src * (float)0x7FFFFFFF;
+         *dest = lrintf(scaled-0.5f);
+ #else
+-        double scaled = *src * 0x7FFFFFFF;
++        double scaled = *src * (double)0x7FFFFFFF;
+         *dest = (PaInt32) scaled;
+ #endif
+ 
+@@ -400,11 +400,11 @@ static void Float32_To_Int32_Clip(
+     {
+         /* REVIEW */
+ #ifdef PA_USE_C99_LRINTF
+-        float scaled = *src * 0x7FFFFFFF;
++        float scaled = *src * (float)0x7FFFFFFF;
+         PA_CLIP_( scaled, -2147483648.f, 2147483647.f  );
+         *dest = lrintf(scaled-0.5f);
+ #else
+-        double scaled = *src * 0x7FFFFFFF;
++        double scaled = *src * (double)0x7FFFFFFF;
+         PA_CLIP_( scaled, -2147483648., 2147483647.  );
+         *dest = (PaInt32) scaled;
+ #endif
+@@ -532,7 +532,7 @@ static void Float32_To_Int24_Clip(
+     while( count-- )
+     {
+         /* convert to 32 bit and drop the low 8 bits */
+-        double scaled = *src * 0x7FFFFFFF;
++        double scaled = *src * (double)0x7FFFFFFF;
+         PA_CLIP_( scaled, -2147483648., 2147483647.  );
+         temp = (PaInt32) scaled;
+ 



Home | Main Index | Thread Index | Old Index