audio/chromaprint: fix compilation on unsigned char arches

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

audio/chromaprint: fix compilation on unsigned char arches

Peter Hessler
test_bit_string_* both use constructs like:

  char data[] = { -28 };

which won't work on arches where char is unsigned, such as aarch64.

This unblocks a lot of packages.  No bump because none of the test files
are ran, only compiled.

OK?


Index: audio/chromaprint/patches/patch-tests_CMakeLists_txt
===================================================================
RCS file: /cvs/ports/audio/chromaprint/patches/patch-tests_CMakeLists_txt,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-tests_CMakeLists_txt
--- audio/chromaprint/patches/patch-tests_CMakeLists_txt 9 May 2014 09:00:19 -0000 1.1
+++ audio/chromaprint/patches/patch-tests_CMakeLists_txt 12 Aug 2019 22:41:33 -0000
@@ -1,6 +1,10 @@
 $OpenBSD: patch-tests_CMakeLists_txt,v 1.1 2014/05/09 09:00:19 sthen Exp $
---- tests/CMakeLists.txt.orig Sat Nov 23 16:43:42 2013
-+++ tests/CMakeLists.txt Wed May  7 15:12:15 2014
+
+test-bit_string_*.cpp depends on signed char, failing on aarch64
+
+Index: tests/CMakeLists.txt
+--- tests/CMakeLists.txt.orig
++++ tests/CMakeLists.txt
 @@ -3,7 +3,6 @@ include_directories(
  ${Boost_INCLUDE_DIRS}
  ${CMAKE_CURRENT_SOURCE_DIR}/../src
@@ -9,3 +13,12 @@ $OpenBSD: patch-tests_CMakeLists_txt,v 1
 
  set(tests_SOURCES
  main.cpp
+@@ -15,8 +14,6 @@ set(tests_SOURCES
+ test_integral_image.cpp
+ test_lloyds.cpp
+ test_audio_processor.cpp
+- test_bit_string_reader.cpp
+- test_bit_string_writer.cpp
+ test_chromaprint.cpp
+ test_chroma.cpp
+ test_chroma_filter.cpp



--
The probability of someone watching you is proportional to the
stupidity of your action.

Reply | Threaded
Open this post in threaded view
|

Re: audio/chromaprint: fix compilation on unsigned char arches

Charlene Wendling
Hi,

On Tue, 13 Aug 2019 08:14:24 +0200
Peter Hessler wrote:

> test_bit_string_* both use constructs like:
>
>   char data[] = { -28 };
>
> which won't work on arches where char is unsigned, such as aarch64.
>
> This unblocks a lot of packages.  No bump because none of the test
> files are ran, only compiled.
>
> OK?

So that's why chromaprint vanished from the aarch64 build failures (:

It works as well on macppc.

If people have objections, properly fixing the code was non trivial
(at least to me) and updating to 1.4.3 was simpler. I've an update
almost ready for submission [0], that fixes the build and can
run all the tests.

It took some time to get OKs for a needed audio/clementine fix, so
i prefer to test the update again on macppc (it's fine on amd64),
before submitting it here. That could take a few more days if it goes
bad.

Meanwhile, OK cwen@

[0]
https://github.com/jasperla/openbsd-wip/tree/master/audio/chromaprint

>
> Index: audio/chromaprint/patches/patch-tests_CMakeLists_txt
> ===================================================================
> RCS
> file: /cvs/ports/audio/chromaprint/patches/patch-tests_CMakeLists_txt,v
> retrieving revision 1.1 diff -u -p -u -p -r1.1
> patch-tests_CMakeLists_txt
> --- audio/chromaprint/patches/patch-tests_CMakeLists_txt 9 May
> 2014 09:00:19 -0000 1.1 +++
> audio/chromaprint/patches/patch-tests_CMakeLists_txt 12 Aug
> 2019 22:41:33 -0000 @@ -1,6 +1,10 @@ $OpenBSD:
> patch-tests_CMakeLists_txt,v 1.1 2014/05/09 09:00:19 sthen Exp $
> ---- tests/CMakeLists.txt.orig Sat Nov 23 16:43:42 2013
> -+++ tests/CMakeLists.txt Wed May  7 15:12:15 2014
> +
> +test-bit_string_*.cpp depends on signed char, failing on aarch64
> +
> +Index: tests/CMakeLists.txt
> +--- tests/CMakeLists.txt.orig
> ++++ tests/CMakeLists.txt
>  @@ -3,7 +3,6 @@ include_directories(
>   ${Boost_INCLUDE_DIRS}
>   ${CMAKE_CURRENT_SOURCE_DIR}/../src
> @@ -9,3 +13,12 @@ $OpenBSD: patch-tests_CMakeLists_txt,v 1
>  
>   set(tests_SOURCES
>   main.cpp
> +@@ -15,8 +14,6 @@ set(tests_SOURCES
> + test_integral_image.cpp
> + test_lloyds.cpp
> + test_audio_processor.cpp
> +- test_bit_string_reader.cpp
> +- test_bit_string_writer.cpp
> + test_chromaprint.cpp
> + test_chroma.cpp
> + test_chroma_filter.cpp
>
>
>
> --
> The probability of someone watching you is proportional to the
> stupidity of your action.
>