libmad: backport time_t format fix

Needed to fix -Wformat under 32-bit.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2024-06-29 16:53:32 -07:00
parent ff66b52da3
commit 865b4dc207
2 changed files with 30 additions and 1 deletions

View 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)

View File

@@ -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);