taglib: fix narrowing issues on arm and ppc, unbreak the build.

Tested on macppc.

OK jca@
This commit is contained in:
cwen 2019-07-07 16:58:46 +00:00
parent f2c4db1359
commit 29813bc6c5
2 changed files with 33 additions and 4 deletions

View File

@ -1,8 +1,8 @@
# $OpenBSD: Makefile,v 1.44 2019/06/23 09:00:21 rapha Exp $
# $OpenBSD: Makefile,v 1.45 2019/07/07 16:58:46 cwen Exp $
COMMENT= managing meta-data of audio formats
DISTNAME= taglib-1.11.1
REVISION= 2
REVISION= 3
CATEGORIES= audio devel
@ -12,11 +12,11 @@ SHARED_LIBS += tag_c 3.0 # 0.0.0
HOMEPAGE= https://taglib.github.io/
# LGPLv2.1 / MPLv1.1
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE= Yes
WANTLIB= ${COMPILER_LIBCXX} m z
COMPILER = base-clang ports-gcc base-gcc
COMPILER = base-clang ports-gcc base-gcc
MASTER_SITES= https://taglib.github.io/releases/

View File

@ -0,0 +1,29 @@
$OpenBSD: patch-tests_test_synchdata_cpp,v 1.1 2019/07/07 16:58:46 cwen Exp $
Fix narrowing error on archs where char is unsigned by default (ppc,arm).
From:
https://github.com/taglib/taglib/commit/0b583bafd09c29695af9e84f7e7182280411a78e
Index: tests/test_synchdata.cpp
--- tests/test_synchdata.cpp.orig
+++ tests/test_synchdata.cpp
@@ -75,8 +75,8 @@ class TestID3v2SynchData : public CppUnit::TestFixture
void testToUIntBroken()
{
- char data[] = { 0, 0, 0, -1 };
- char data2[] = { 0, 0, -1, -1 };
+ char data[] = { 0, 0, 0, (char)-1 };
+ char data2[] = { 0, 0, (char)-1, (char)-1 };
CPPUNIT_ASSERT_EQUAL((unsigned int)255, ID3v2::SynchData::toUInt(ByteVector(data, 4)));
CPPUNIT_ASSERT_EQUAL((unsigned int)65535, ID3v2::SynchData::toUInt(ByteVector(data2, 4)));
@@ -84,7 +84,7 @@ class TestID3v2SynchData : public CppUnit::TestFixture
void testToUIntBrokenAndTooLarge()
{
- char data[] = { 0, 0, 0, -1, 0 };
+ char data[] = { 0, 0, 0, (char)-1, 0 };
ByteVector v(data, 5);
CPPUNIT_ASSERT_EQUAL((unsigned int)255, ID3v2::SynchData::toUInt(v));