From f3eb48d1f557f41ef210517a3f9f7b634399dd07 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 22 Jul 2019 20:16:27 +0200 Subject: [PATCH] Fix MSVC warnings --- audio/drivers/xaudio.c | 1 - libretro-common/media/media_detect_cd.c | 7 +++---- libretro-common/vfs/vfs_implementation_cdrom.c | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/audio/drivers/xaudio.c b/audio/drivers/xaudio.c index 80d9ed9c9e..6808336a91 100644 --- a/audio/drivers/xaudio.c +++ b/audio/drivers/xaudio.c @@ -290,7 +290,6 @@ static void *xa_init(const char *device, unsigned rate, unsigned latency, static ssize_t xa_write(void *data, const void *buf, size_t size) { - size_t ret; unsigned bytes; xa_t *xa = (xa_t*)data; xaudio2_t *handle = xa->xa; diff --git a/libretro-common/media/media_detect_cd.c b/libretro-common/media/media_detect_cd.c index 985864d33c..a6b375de99 100644 --- a/libretro-common/media/media_detect_cd.c +++ b/libretro-common/media/media_detect_cd.c @@ -40,7 +40,7 @@ static void media_zero_trailing_spaces(char *buf, size_t len) static bool media_skip_spaces(const char **buf, size_t len) { bool found = false; - int i; + unsigned i; if (!buf || !*buf) return false; @@ -245,9 +245,8 @@ bool media_detect_cd_info(const char *path, media_detect_cd_info_t *info) /* Primary Volume Descriptor fields of ISO9660 */ else if (!memcmp(buf + offset + (16 * sector_size), "\1CD001\1\0PLAYSTATION", 19)) { - const char *title_pos; - const char *serial_pos; - bool title_found = false; + const char *title_pos = NULL; + bool title_found = false; info->system_id = MEDIA_CD_SYSTEM_PSX; diff --git a/libretro-common/vfs/vfs_implementation_cdrom.c b/libretro-common/vfs/vfs_implementation_cdrom.c index acf9d0d265..39292eaf80 100644 --- a/libretro-common/vfs/vfs_implementation_cdrom.c +++ b/libretro-common/vfs/vfs_implementation_cdrom.c @@ -340,7 +340,7 @@ int64_t retro_vfs_file_read_cdrom(libretro_vfs_implementation_file *stream, if (string_is_equal_noncase(ext, "cue")) { - if (len < stream->cdrom.cue_len - stream->cdrom.byte_pos) + if (len < (unsigned)(stream->cdrom.cue_len - stream->cdrom.byte_pos)) { #ifdef CDROM_DEBUG printf("[CDROM] Read: Reading %" PRIu64 " bytes from cuesheet starting at %" PRIu64 "...\n", len, stream->cdrom.byte_pos);