From 8e5639bc3da6c24c45620505a2bf3533478b1e60 Mon Sep 17 00:00:00 2001 From: notaz Date: Thu, 15 Aug 2013 02:49:14 +0300 Subject: [PATCH] fix some warnings --- platform/common/mp3.c | 5 +++-- platform/libretro.c | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/platform/common/mp3.c b/platform/common/mp3.c index 9b347e8..25c5c92 100644 --- a/platform/common/mp3.c +++ b/platform/common/mp3.c @@ -90,8 +90,9 @@ int mp3_get_bitrate(void *f_, int len) if (ret <= 0) { // try to read somewhere around the middle fseek(f, len / 2, SEEK_SET); - fread(buf, 1, sizeof(buf), f); - ret = try_get_bitrate(buf, sizeof(buf)); + ret = fread(buf, 1, sizeof(buf), f); + if (ret == sizeof(buf)) + ret = try_get_bitrate(buf, sizeof(buf)); } if (ret > 0) retval = ret; diff --git a/platform/libretro.c b/platform/libretro.c index c02b206..b2697ce 100644 --- a/platform/libretro.c +++ b/platform/libretro.c @@ -28,10 +28,6 @@ #include "common/version.h" #include "libretro.h" -#ifndef MAP_ANONYMOUS -#define MAP_ANONYMOUS MAP_ANON -#endif - static retro_video_refresh_t video_cb; static retro_input_poll_t input_poll_cb; static retro_input_state_t input_state_cb; @@ -167,6 +163,11 @@ static void munmap(void *addr, size_t length) /* ruh-ro, we leaked handle from CreateFileMapping() ... */ } #endif + +#ifndef MAP_ANONYMOUS +#define MAP_ANONYMOUS MAP_ANON +#endif + void *plat_mmap(unsigned long addr, size_t size, int need_exec, int is_fixed) { int flags = MAP_PRIVATE | MAP_ANONYMOUS; -- 2.39.2