mirror of
https://github.com/libretro/RetroArch
synced 2025-02-20 06:40:18 +00:00
Use retro_inline.h
This commit is contained in:
parent
26f2bd4cbf
commit
08f59ddbff
@ -19,6 +19,8 @@
|
||||
#pragma comment(lib, "dxguid")
|
||||
#endif
|
||||
|
||||
#include <retro_inline.h>
|
||||
|
||||
#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);
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <boolean.h>
|
||||
#include "../../general.h"
|
||||
#include <string.h>
|
||||
#include <retro_inline.h>
|
||||
|
||||
#ifdef GEKKO
|
||||
#include <gccore.h>
|
||||
@ -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
|
||||
|
@ -27,6 +27,7 @@
|
||||
|
||||
#include "../../general.h"
|
||||
#include <queues/fifo_buffer.h>
|
||||
#include <retro_inline.h>
|
||||
|
||||
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;
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <boolean.h>
|
||||
#include "../../general.h"
|
||||
#include <retro_inline.h>
|
||||
|
||||
#include <xenon_sound/sound.h>
|
||||
|
||||
@ -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);
|
||||
|
@ -18,6 +18,7 @@
|
||||
#define _RARCH_PERF_H
|
||||
|
||||
#include "general.h"
|
||||
#include <retro_inline.h>
|
||||
|
||||
#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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user