Commit 9fd73961 authored by conrad's avatar conrad
Browse files

Fix compile warnings throughout

parent b7dafff6
...@@ -84,7 +84,7 @@ debug_print_err (const char * func, int line, const char * fmt, ...) ...@@ -84,7 +84,7 @@ debug_print_err (const char * func, int line, const char * fmt, ...)
#undef MAXLINE #undef MAXLINE
#else #else
#define debug_printf(x,y...) #define debug_printf(x,...)
#endif #endif
#endif /* non-C99 */ #endif /* non-C99 */
......
...@@ -45,7 +45,7 @@ fish_sound_set_encoded_callback (FishSound * fsound, ...@@ -45,7 +45,7 @@ fish_sound_set_encoded_callback (FishSound * fsound,
if (fsound == NULL) return -1; if (fsound == NULL) return -1;
#if FS_ENCODE #if FS_ENCODE
fsound->callback.encoded = (void *)encoded; fsound->callback.encoded = encoded;
fsound->user_data = user_data; fsound->user_data = user_data;
#else #else
return FISH_SOUND_ERR_DISABLED; return FISH_SOUND_ERR_DISABLED;
......
...@@ -61,7 +61,7 @@ typedef struct _FishSoundFlacInfo { ...@@ -61,7 +61,7 @@ typedef struct _FishSoundFlacInfo {
FLAC__StreamEncoder *fse; FLAC__StreamEncoder *fse;
unsigned char * buffer; unsigned char * buffer;
char header; char header;
long bufferlength; unsigned long bufferlength;
unsigned long packetno; unsigned long packetno;
struct { struct {
unsigned char major, minor; unsigned char major, minor;
...@@ -106,7 +106,7 @@ fs_flac_command (FishSound * fsound, int command, void * data, int datasize) ...@@ -106,7 +106,7 @@ fs_flac_command (FishSound * fsound, int command, void * data, int datasize)
#if FS_DECODE #if FS_DECODE
static FLAC__StreamDecoderReadStatus static FLAC__StreamDecoderReadStatus
fs_flac_read_callback(const FLAC__StreamDecoder *decoder, fs_flac_read_callback(const FLAC__StreamDecoder *decoder,
FLAC__byte buffer[], unsigned *bytes, FLAC__byte buffer[], unsigned int *bytes,
void *client_data) void *client_data)
{ {
FishSound* fsound = (FishSound*)client_data; FishSound* fsound = (FishSound*)client_data;
...@@ -121,7 +121,7 @@ fs_flac_read_callback(const FLAC__StreamDecoder *decoder, ...@@ -121,7 +121,7 @@ fs_flac_read_callback(const FLAC__StreamDecoder *decoder,
} }
memcpy(buffer, fi->buffer, fi->bufferlength); memcpy(buffer, fi->buffer, fi->bufferlength);
*bytes = fi->bufferlength; *bytes = (unsigned int)fi->bufferlength;
fi->bufferlength = 0; fi->bufferlength = 0;
return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
} }
...@@ -500,7 +500,8 @@ fs_flac_encode_vorbiscomments (FishSound * fsound) ...@@ -500,7 +500,8 @@ fs_flac_encode_vorbiscomments (FishSound * fsound)
FishSoundFlacInfo * fi = fsound->codec_data; FishSoundFlacInfo * fi = fsound->codec_data;
FLAC__StreamMetadata * metadata = NULL; FLAC__StreamMetadata * metadata = NULL;
const FishSoundComment * comment; const FishSoundComment * comment;
unsigned int i=0, length=0, total_length; unsigned int length=0, total_length;
int i=0;
FLAC__VCEntry * comments; FLAC__VCEntry * comments;
/* libFLAC seems to require us to know the total length of the generated /* libFLAC seems to require us to know the total length of the generated
...@@ -710,8 +711,6 @@ fs_flac_delete (FishSound * fsound) ...@@ -710,8 +711,6 @@ fs_flac_delete (FishSound * fsound)
FishSoundFlacInfo * fi = (FishSoundFlacInfo *)fsound->codec_data; FishSoundFlacInfo * fi = (FishSoundFlacInfo *)fsound->codec_data;
int i; int i;
debug_printf("IN");
if (fsound->mode == FISH_SOUND_DECODE) { if (fsound->mode == FISH_SOUND_DECODE) {
if (fi->fsd) { if (fi->fsd) {
FLAC__stream_decoder_finish(fi->fsd); FLAC__stream_decoder_finish(fi->fsd);
......
...@@ -304,7 +304,7 @@ fs_speex_decode (FishSound * fsound, unsigned char * buf, long bytes) ...@@ -304,7 +304,7 @@ fs_speex_decode (FishSound * fsound, unsigned char * buf, long bytes)
* would wrap. In reality, frame_size is set by libspeex according to the * would wrap. In reality, frame_size is set by libspeex according to the
* mode index specified in the file header, and is usually equal to 320. * mode index specified in the file header, and is usually equal to 320.
*/ */
if (fss->frame_size > UINTPTR_MAX / (sizeof(float) * channels)) if ((unsigned int)fss->frame_size > UINTPTR_MAX / (sizeof(float) * channels))
return FISH_SOUND_ERR_GENERIC; return FISH_SOUND_ERR_GENERIC;
#endif #endif
...@@ -388,7 +388,7 @@ fs_speex_enc_headers (FishSound * fsound) ...@@ -388,7 +388,7 @@ fs_speex_enc_headers (FishSound * fsound)
SpeexMode * mode = NULL; SpeexMode * mode = NULL;
SpeexHeader header; SpeexHeader header;
unsigned char * header_buf = NULL, * comments_buf = NULL; unsigned char * header_buf = NULL, * comments_buf = NULL;
int header_bytes, comments_bytes; int header_bytes, comments_bytes=0;
size_t buflen; size_t buflen;
modeID = 1; modeID = 1;
...@@ -667,7 +667,7 @@ fs_speex_update (FishSound * fsound, int interleave) ...@@ -667,7 +667,7 @@ fs_speex_update (FishSound * fsound, int interleave)
* would wrap. In reality, frame_size is set by libspeex according to the * would wrap. In reality, frame_size is set by libspeex according to the
* mode index specified in the file header, and is usually equal to 320. * mode index specified in the file header, and is usually equal to 320.
*/ */
if (fss->frame_size > UINTPTR_MAX / pcm_size) if ((unsigned int)fss->frame_size > UINTPTR_MAX / pcm_size)
return FISH_SOUND_ERR_GENERIC; return FISH_SOUND_ERR_GENERIC;
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment