From 0f9d14a48a40ad0395f56afa0f02ae183be6e7c8 Mon Sep 17 00:00:00 2001 From: q66 Date: Mon, 1 Jun 2020 00:19:19 +0200 Subject: [PATCH] mpg123: fix build on BE --- srcpkgs/mpg123/patches/be.patch | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 srcpkgs/mpg123/patches/be.patch diff --git a/srcpkgs/mpg123/patches/be.patch b/srcpkgs/mpg123/patches/be.patch new file mode 100644 index 0000000000..63f61e9ef0 --- /dev/null +++ b/srcpkgs/mpg123/patches/be.patch @@ -0,0 +1,49 @@ +From 56faaffd2d67d48ea746bdbdf3dbddc57ed342de Mon Sep 17 00:00:00 2001 +From: q66 +Date: Mon, 1 Jun 2020 00:17:31 +0200 +Subject: [PATCH] big endian fixes from upstream + +--- + src/libmpg123/sample.h | 2 +- + src/libout123/hextxt.c | 5 ++--- + 2 files changed, 3 insertions(+), 4 deletions(-) + +diff --git src/libmpg123/sample.h src/libmpg123/sample.h +index 5a98fe0..4d244fe 100644 +--- src/libmpg123/sample.h ++++ src/libmpg123/sample.h +@@ -185,7 +185,7 @@ static inline int16_t ftoi16(float x) + #ifdef WORDS_BIGENDIAN + /* Highest byte first. Drop last. */ + #define DROP4BYTE(w,r) {(w)[0]=(r)[0]; (w)[1]=(r)[1]; (w)[2]=(r)[2];} +-#define ADD4BYTE(w,r) {(w)[0]=(r)[0]; (w)[1]=(r)[1]; (w)[2]=(r)[2]; (w)[3]=0} ++#define ADD4BYTE(w,r) {(w)[0]=(r)[0]; (w)[1]=(r)[1]; (w)[2]=(r)[2]; (w)[3]=0;} + #else + /* Lowest byte first, drop that. */ + #define DROP4BYTE(w,r) {(w)[0]=(r)[1]; (w)[1]=(r)[2]; (w)[2]=(r)[3];} +diff --git src/libout123/hextxt.c src/libout123/hextxt.c +index 45c8134..9e9010e 100644 +--- src/libout123/hextxt.c ++++ src/libout123/hextxt.c +@@ -194,7 +194,7 @@ int txt_write(out123_handle *ao, unsigned char *buf, int len) + #define CHANPRINT24(type, ptype, fmt) \ + { \ + unsigned char *ff = f; \ +- for(c=0; cchannels; ++c) \ ++ for(int c=0; cchannels; ++c) \ + { \ + uint32_t tmp = 0; \ + tmp |= ((uint32_t)(*(ff++))) << 24; \ +@@ -208,8 +208,7 @@ int txt_write(out123_handle *ao, unsigned char *buf, int len) + #define CHANPRINT24(type, ptype, fmt) \ + { \ + unsigned char *ff = f; \ +- int c; \ +- for(c=0; cchannels; ++c) \ ++ for(int c=0; cchannels; ++c) \ + { \ + uint32_t tmp = 0; \ + tmp |= ((uint32_t)(*(ff++))) << 8; \ +-- +2.25.1 +