diff --git a/audio/audio_mixer.c b/audio/audio_mixer.c index c781297..0984fc2 100644 --- a/audio/audio_mixer.c +++ b/audio/audio_mixer.c @@ -667,7 +667,7 @@ static void audio_mixer_mix_ogg(float* buffer, size_t num_frames, int i; struct resampler_data info; float temp_buffer[AUDIO_MIXER_TEMP_OGG_BUFFER]; - unsigned buf_free = num_frames * 2; + unsigned buf_free = (unsigned)(num_frames * 2); unsigned temp_samples = 0; float* pcm = NULL; @@ -740,7 +740,7 @@ static void audio_mixer_mix_mod(float* buffer, size_t num_frames, float samplef = 0.0f; int samplei = 0; unsigned temp_samples = 0; - unsigned buf_free = num_frames * 2; + unsigned buf_free = (unsigned)(num_frames * 2); int* pcm = NULL; if (voice->types.mod.position == voice->types.mod.samples) diff --git a/formats/libchdr/chd.c b/formats/libchdr/chd.c index 78cac09..be35961 100644 --- a/formats/libchdr/chd.c +++ b/formats/libchdr/chd.c @@ -405,9 +405,10 @@ void *lzma_fast_alloc(void *p, size_t size) } /* alloc a new one and put it into the list */ - addr = (uint32_t *)malloc(sizeof(uint8_t) * (size + sizeof(uint32_t))); - if (addr==NULL) + addr = (uint32_t *)malloc(sizeof(uint32_t) * (size + sizeof(uint32_t))); + if (!addr) return NULL; + for (scan = 0; scan < MAX_LZMA_ALLOCS; scan++) { if (codec->allocptr[scan] == NULL) diff --git a/streams/file_stream.c b/streams/file_stream.c index 988ba73..aa3bda1 100644 --- a/streams/file_stream.c +++ b/streams/file_stream.c @@ -320,14 +320,14 @@ int filestream_putc(RFILE *stream, int c) int filestream_vprintf(RFILE *stream, const char* format, va_list args) { static char buffer[8 * 1024]; - int num_chars = vsprintf(buffer, format, args); + int64_t num_chars = vsprintf(buffer, format, args); if (num_chars < 0) return -1; else if (num_chars == 0) return 0; - return filestream_write(stream, buffer, num_chars); + return (int)filestream_write(stream, buffer, num_chars); } int filestream_printf(RFILE *stream, const char* format, ...) diff --git a/streams/file_stream_transforms.c b/streams/file_stream_transforms.c index 8796073..143db89 100644 --- a/streams/file_stream_transforms.c +++ b/streams/file_stream_transforms.c @@ -93,7 +93,7 @@ int rfseek(RFILE* stream, long offset, int origin) break; } - return filestream_seek(stream, offset, seek_position); + return (int)filestream_seek(stream, (ssize_t)offset, seek_position); } size_t rfread(void* buffer, diff --git a/streams/interface_stream.c b/streams/interface_stream.c index c61d122..a219a15 100644 --- a/streams/interface_stream.c +++ b/streams/interface_stream.c @@ -435,7 +435,7 @@ intfstream_t *intfstream_open_memory(void *data, info.type = INTFSTREAM_MEMORY; info.memory.buf.data = (uint8_t*)data; - info.memory.buf.size = size; + info.memory.buf.size = (unsigned)size; info.memory.writable = false; fd = (intfstream_t*)intfstream_init(&info); diff --git a/string/stdstring.c b/string/stdstring.c index 02f8dad..f864cea 100644 --- a/string/stdstring.c +++ b/string/stdstring.c @@ -169,7 +169,7 @@ char *word_wrap(char* buffer, const char *string, int line_width, bool unicode) } character = utf8skip(&string[i], 1); - char_len = character - &string[i]; + char_len = (unsigned)(character - &string[i]); if (!unicode) counter += char_len - 1;