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, ...)
#undef MAXLINE
#else
#define debug_printf(x,y...)
#define debug_printf(x,...)
#endif
#endif /* non-C99 */
......
......@@ -45,7 +45,7 @@ fish_sound_set_encoded_callback (FishSound * fsound,
if (fsound == NULL) return -1;
#if FS_ENCODE
fsound->callback.encoded = (void *)encoded;
fsound->callback.encoded = encoded;
fsound->user_data = user_data;
#else
return FISH_SOUND_ERR_DISABLED;
......
......@@ -61,7 +61,7 @@ typedef struct _FishSoundFlacInfo {
FLAC__StreamEncoder *fse;
unsigned char * buffer;
char header;
long bufferlength;
unsigned long bufferlength;
unsigned long packetno;
struct {
unsigned char major, minor;
......@@ -106,7 +106,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 *bytes,
FLAC__byte buffer[], unsigned int *bytes,
void *client_data)
{
FishSound* fsound = (FishSound*)client_data;
......@@ -121,7 +121,7 @@ fs_flac_read_callback(const FLAC__StreamDecoder *decoder,
}
memcpy(buffer, fi->buffer, fi->bufferlength);
*bytes = fi->bufferlength;
*bytes = (unsigned int)fi->bufferlength;
fi->bufferlength = 0;
return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
}
......@@ -500,7 +500,8 @@ fs_flac_encode_vorbiscomments (FishSound * fsound)
FishSoundFlacInfo * fi = fsound->codec_data;
FLAC__StreamMetadata * metadata = NULL;
const FishSoundComment * comment;
unsigned int i=0, length=0, total_length;
unsigned int length=0, total_length;
int i=0;
FLAC__VCEntry * comments;
/* libFLAC seems to require us to know the total length of the generated
......@@ -710,8 +711,6 @@ fs_flac_delete (FishSound * fsound)
FishSoundFlacInfo * fi = (FishSoundFlacInfo *)fsound->codec_data;
int i;
debug_printf("IN");
if (fsound->mode == FISH_SOUND_DECODE) {
if (fi->fsd) {
FLAC__stream_decoder_finish(fi->fsd);
......
......@@ -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
* 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;
#endif
......@@ -388,7 +388,7 @@ fs_speex_enc_headers (FishSound * fsound)
SpeexMode * mode = NULL;
SpeexHeader header;
unsigned char * header_buf = NULL, * comments_buf = NULL;
int header_bytes, comments_bytes;
int header_bytes, comments_bytes=0;
size_t buflen;
modeID = 1;
......@@ -667,7 +667,7 @@ fs_speex_update (FishSound * fsound, int interleave)
* 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.
*/
if (fss->frame_size > UINTPTR_MAX / pcm_size)
if ((unsigned int)fss->frame_size > UINTPTR_MAX / pcm_size)
return FISH_SOUND_ERR_GENERIC;
#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