From 08f59ddbff585ec844e669771749a0aec5c24ee2 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 15 Mar 2015 04:41:11 +0100 Subject: [PATCH] Use retro_inline.h --- audio/drivers/dsound.c | 10 ++++++---- audio/drivers/gx_audio.c | 3 ++- audio/drivers/sdl_audio.c | 3 ++- audio/drivers/xenon360_audio.c | 3 ++- performance.h | 5 +++-- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/audio/drivers/dsound.c b/audio/drivers/dsound.c index f30c0bad7e..9443e37429 100644 --- a/audio/drivers/dsound.c +++ b/audio/drivers/dsound.c @@ -19,6 +19,8 @@ #pragma comment(lib, "dxguid") #endif +#include + #ifdef _XBOX #define DSERR_BUFFERLOST MAKE_DSHRESULT(150) #define DSERR_INVALIDPARAM E_INVALIDARG @@ -73,12 +75,12 @@ typedef struct dsound volatile bool thread_alive; } dsound_t; -static inline unsigned write_avail(unsigned read_ptr, unsigned write_ptr, unsigned buffer_size) +static INLINE unsigned write_avail(unsigned read_ptr, unsigned write_ptr, unsigned buffer_size) { return (read_ptr + buffer_size - write_ptr) % buffer_size; } -static inline void get_positions(dsound_t *ds, DWORD *read_ptr, DWORD *write_ptr) +static INLINE void get_positions(dsound_t *ds, DWORD *read_ptr, DWORD *write_ptr) { IDirectSoundBuffer_GetCurrentPosition(ds->dsb, read_ptr, write_ptr); } @@ -93,7 +95,7 @@ struct audio_lock DWORD size2; }; -static inline bool grab_region(dsound_t *ds, DWORD write_ptr, +static INLINE bool grab_region(dsound_t *ds, DWORD write_ptr, struct audio_lock *region) { const char *err; @@ -140,7 +142,7 @@ static inline bool grab_region(dsound_t *ds, DWORD write_ptr, return true; } -static inline void release_region(dsound_t *ds, const struct audio_lock *region) +static INLINE void release_region(dsound_t *ds, const struct audio_lock *region) { IDirectSoundBuffer_Unlock(ds->dsb, region->chunk1, region->size1, region->chunk2, region->size2); } diff --git a/audio/drivers/gx_audio.c b/audio/drivers/gx_audio.c index 439ea8d0eb..07f3453b8c 100644 --- a/audio/drivers/gx_audio.c +++ b/audio/drivers/gx_audio.c @@ -19,6 +19,7 @@ #include #include "../../general.h" #include +#include #ifdef GEKKO #include @@ -116,7 +117,7 @@ static void *gx_audio_init(const char *device, } /* Wii uses silly R, L, R, L interleaving. */ -static inline void copy_swapped(uint32_t * restrict dst, +static INLINE void copy_swapped(uint32_t * restrict dst, const uint32_t * restrict src, size_t size) { do diff --git a/audio/drivers/sdl_audio.c b/audio/drivers/sdl_audio.c index ba2cca7cb6..a090916abf 100644 --- a/audio/drivers/sdl_audio.c +++ b/audio/drivers/sdl_audio.c @@ -27,6 +27,7 @@ #include "../../general.h" #include +#include typedef struct sdl_audio { @@ -51,7 +52,7 @@ static void sdl_audio_cb(void *data, Uint8 *stream, int len) memset(stream + write_size, 0, len - write_size); } -static inline int find_num_frames(int rate, int latency) +static INLINE int find_num_frames(int rate, int latency) { int frames = (rate * latency) / 1000; diff --git a/audio/drivers/xenon360_audio.c b/audio/drivers/xenon360_audio.c index 9e8d4b1336..f97698ace6 100644 --- a/audio/drivers/xenon360_audio.c +++ b/audio/drivers/xenon360_audio.c @@ -18,6 +18,7 @@ #include #include #include "../../general.h" +#include #include @@ -46,7 +47,7 @@ static void *xenon360_audio_init(const char *device, return calloc(1, sizeof(xenon_audio_t)); } -static inline uint32_t bswap_32(uint32_t val) +static INLINE uint32_t bswap_32(uint32_t val) { return (val >> 24) | (val << 24) | ((val >> 8) & 0xff00) | ((val << 8) & 0xff0000); diff --git a/performance.h b/performance.h index f47a87231b..e98e154003 100644 --- a/performance.h +++ b/performance.h @@ -18,6 +18,7 @@ #define _RARCH_PERF_H #include "general.h" +#include #ifdef __cplusplus extern "C" { @@ -85,7 +86,7 @@ void retro_perf_log(void); * * Start performance counter. **/ -static inline void rarch_perf_start(struct retro_perf_counter *perf) +static INLINE void rarch_perf_start(struct retro_perf_counter *perf) { if (!g_extern.perfcnt_enable || !perf) return; @@ -100,7 +101,7 @@ static inline void rarch_perf_start(struct retro_perf_counter *perf) * * Stop performance counter. **/ -static inline void rarch_perf_stop(struct retro_perf_counter *perf) +static INLINE void rarch_perf_stop(struct retro_perf_counter *perf) { if (!g_extern.perfcnt_enable || !perf) return;