diff options
author | 2024-03-17 03:56:38 +0000 | |
---|---|---|
committer | 2024-03-17 03:56:38 +0000 | |
commit | a1e6a1e46d905e7bf728bb8ecfed0f342f460ae6 (patch) | |
tree | 83c9d71110b9419641543e5b4b292047a6c76f45 /media-libs/libfishsound/files/libfishsound-1.0.0-c99.patch | |
parent | dev-ruby/ruby-gtk3: fix modern C issue (diff) | |
download | gentoo-a1e6a1e46d905e7bf728bb8ecfed0f342f460ae6.tar.gz gentoo-a1e6a1e46d905e7bf728bb8ecfed0f342f460ae6.tar.bz2 gentoo-a1e6a1e46d905e7bf728bb8ecfed0f342f460ae6.zip |
media-libs/libfishsound: fix modern C issue
Closes: https://bugs.gentoo.org/883393
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-libs/libfishsound/files/libfishsound-1.0.0-c99.patch')
-rw-r--r-- | media-libs/libfishsound/files/libfishsound-1.0.0-c99.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/media-libs/libfishsound/files/libfishsound-1.0.0-c99.patch b/media-libs/libfishsound/files/libfishsound-1.0.0-c99.patch new file mode 100644 index 000000000000..d010eb75ac0b --- /dev/null +++ b/media-libs/libfishsound/files/libfishsound-1.0.0-c99.patch @@ -0,0 +1,65 @@ +https://bugs.gentoo.org/883393 +https://gitlab.xiph.org/xiph/libfishsound/-/merge_requests/1 + +From 8eb391d772cb3c3dbfb68b2216e095af705b0229 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Martin=20Stegh=C3=B6fer?= <martin@steghoefer.eu> +Date: Wed, 22 Oct 2014 22:03:15 +0200 +Subject: [PATCH] Fix incompatible flac callback types. + +Bug-Debian: https://bugs.debian.org/766394 + +Starting from libflac 1.1.3 the flac API uses "size_t" as parameter type for the number of bytes in all callback functions. +--- a/src/libfishsound/flac.c ++++ b/src/libfishsound/flac.c +@@ -56,6 +56,13 @@ + + #define BITS_PER_SAMPLE 24 + ++#if defined(HAVE_FLAC_1_1_3) ++# define flac_callback_bytes_type size_t ++#else ++# define flac_callback_bytes_type unsigned int ++#endif ++ ++ + typedef struct _FishSoundFlacInfo { + FLAC__StreamDecoder *fsd; + FLAC__StreamEncoder *fse; +@@ -106,7 +113,7 @@ fs_flac_command (FishSound * fsound, int command, void * data, int datasize) + #if FS_DECODE + static FLAC__StreamDecoderReadStatus + fs_flac_read_callback(const FLAC__StreamDecoder *decoder, +- FLAC__byte buffer[], unsigned int *bytes, ++ FLAC__byte buffer[], flac_callback_bytes_type *bytes, + void *client_data) + { + FishSound* fsound = (FishSound*)client_data; +@@ -121,7 +128,7 @@ fs_flac_read_callback(const FLAC__StreamDecoder *decoder, + } + + memcpy(buffer, fi->buffer, fi->bufferlength); +- *bytes = (unsigned int)fi->bufferlength; ++ *bytes = (flac_callback_bytes_type)fi->bufferlength; + fi->bufferlength = 0; + return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; + } +@@ -346,7 +353,7 @@ dec_err: + #if FS_ENCODE + static FLAC__StreamEncoderWriteStatus + fs_flac_enc_write_callback(const FLAC__StreamEncoder *encoder, +- const FLAC__byte buffer[], unsigned bytes, ++ const FLAC__byte buffer[], flac_callback_bytes_type bytes, + unsigned samples, unsigned current_frame, + void *client_data) + { +@@ -354,7 +361,7 @@ fs_flac_enc_write_callback(const FLAC__StreamEncoder *encoder, + FishSoundFlacInfo *fi = fsound->codec_data; + + debug_printf(1, "IN"); +- debug_printf(1, "bytes: %d, samples: %d", bytes, samples); ++ debug_printf(1, "bytes: %lld, samples: %d", (long long) bytes, samples); + + if (fsound->callback.encoded) { + FishSoundEncoded encoded = (FishSoundEncoded) fsound->callback.encoded; +-- +GitLab |