libmad: backport time_t format fix
authorRosen Penev <rosenp@gmail.com>
Sat, 29 Jun 2024 23:53:32 +0000 (16:53 -0700)
committerRosen Penev <rosenp@gmail.com>
Fri, 12 Jul 2024 20:15:49 +0000 (13:15 -0700)
Needed to fix -Wformat under 32-bit.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
libs/libmad/Makefile
libs/libmad/patches/010-format.patch [new file with mode: 0644]

index 79d66bdeb730b18a4732d02c90be67a98935f9e8..bdd536064b55487518fedfe9692fbc2a50966343 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libmad
 PKG_VERSION:=0.16.4
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=$(PKG_VERSION)
diff --git a/libs/libmad/patches/010-format.patch b/libs/libmad/patches/010-format.patch
new file mode 100644 (file)
index 0000000..c1d0562
--- /dev/null
@@ -0,0 +1,29 @@
+From cb1e56cb691e0f9ebcad595632ef484389830431 Mon Sep 17 00:00:00 2001
+From: Mangix <mangixjohn@icloud.com>
+Date: Thu, 27 Jun 2024 20:13:07 +0000
+Subject: [PATCH] minimad: fix format under 32-bit
+
+This is pointer subtraction. Use proper macro for this. 32-bit needs to be %d.
+---
+ minimad.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/minimad.c
++++ b/minimad.c
+@@ -19,6 +19,7 @@
+  * $Id: minimad.c,v 1.4 2004/01/23 09:41:32 rob Exp $
+  */
++# include <inttypes.h>
+ # include <stdio.h>
+ # include <unistd.h>
+ # include <sys/stat.h>
+@@ -174,7 +175,7 @@ enum mad_flow error(void *data,
+ {
+   struct buffer *buffer = data;
+-  fprintf(stderr, "decoding error 0x%04x (%s) at byte offset %u\n",
++  fprintf(stderr, "decoding error 0x%04x (%s) at byte offset %" PRIdPTR "\n",
+         stream->error, mad_stream_errorstr(stream),
+         stream->this_frame - buffer->start);