mirror of
https://github.com/libretro/RetroArch
synced 2025-03-23 10:20:57 +00:00
(libretro-common) Use retro_inline.h everywhere
This commit is contained in:
parent
e7e09d3b8f
commit
12a3e56a55
libretro-common
gfx/scaler
include
rthreads
@ -25,6 +25,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <retro_inline.h>
|
||||
|
||||
#ifdef SCALER_NO_SIMD
|
||||
#undef __SSE2__
|
||||
@ -384,7 +385,7 @@ void conv_rgba4444_rgb565(void *output_, const void *input_,
|
||||
|
||||
#if defined(__SSE2__)
|
||||
/* :( TODO: Make this saner. */
|
||||
static inline void store_bgr24_sse2(void *output, __m128i a,
|
||||
static INLINE void store_bgr24_sse2(void *output, __m128i a,
|
||||
__m128i b, __m128i c, __m128i d)
|
||||
{
|
||||
const __m128i mask_0 = _mm_set_epi32(0, 0, 0, 0x00ffffff);
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <retro_inline.h>
|
||||
|
||||
static bool allocate_filters(struct scaler_ctx *ctx)
|
||||
{
|
||||
@ -109,7 +110,7 @@ static bool gen_filter_bilinear(struct scaler_ctx *ctx)
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline double filter_sinc(double phase)
|
||||
static INLINE double filter_sinc(double phase)
|
||||
{
|
||||
if (fabs(phase) < 0.0001)
|
||||
return 1.0;
|
||||
|
@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include <gfx/scaler/scaler_int.h>
|
||||
#include <retro_inline.h>
|
||||
|
||||
#ifdef SCALER_NO_SIMD
|
||||
#undef __SSE2__
|
||||
@ -198,7 +199,7 @@ void scaler_argb8888_horiz(const struct scaler_ctx *ctx, const void *input_, int
|
||||
}
|
||||
}
|
||||
#else
|
||||
static inline uint64_t build_argb64(uint16_t a, uint16_t r, uint16_t g, uint16_t b)
|
||||
static INLINE uint64_t build_argb64(uint16_t a, uint16_t r, uint16_t g, uint16_t b)
|
||||
{
|
||||
return ((uint64_t)a << 48) | ((uint64_t)r << 32) | ((uint64_t)g << 16) | ((uint64_t)b << 0);
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
#define _LIBRETRO_SDK_CLAMPING_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <retro_inline.h>
|
||||
|
||||
/**
|
||||
* clamp_float:
|
||||
@ -35,7 +36,7 @@
|
||||
*
|
||||
* Returns: a clamped value of initial float value @val.
|
||||
*/
|
||||
static inline float clamp_float(float val, float lower, float upper)
|
||||
static INLINE float clamp_float(float val, float lower, float upper)
|
||||
{
|
||||
if (val < lower)
|
||||
return lower;
|
||||
@ -52,7 +53,7 @@ static inline float clamp_float(float val, float lower, float upper)
|
||||
*
|
||||
* Returns: a clamped value of initial unsigned 8-bit value @val.
|
||||
*/
|
||||
static inline uint8_t clamp_8bit(int val)
|
||||
static INLINE uint8_t clamp_8bit(int val)
|
||||
{
|
||||
if (val > 255)
|
||||
return 255;
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
#include <boolean.h>
|
||||
#include <stdint.h>
|
||||
#include <retro_inline.h>
|
||||
|
||||
#if defined(__cplusplus) && !defined(_MSC_VER)
|
||||
extern "C" {
|
||||
@ -191,7 +192,7 @@ void scond_signal(scond_t *cond);
|
||||
*
|
||||
* Sleeps for a specified amount of milliseconds (@msec).
|
||||
**/
|
||||
static inline void retro_sleep(unsigned msec)
|
||||
static INLINE void retro_sleep(unsigned msec)
|
||||
{
|
||||
#if defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)
|
||||
sys_timer_usleep(1000 * msec);
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <ogcsys.h>
|
||||
#include <gccore.h>
|
||||
#include <ogc/cond.h>
|
||||
#include <retro_inline.h>
|
||||
|
||||
#ifndef OSThread
|
||||
#define OSThread lwp_t
|
||||
@ -98,7 +99,7 @@ typedef int pthread_attr_t;
|
||||
typedef OSCond pthread_cond_t;
|
||||
typedef OSCond pthread_condattr_t;
|
||||
|
||||
static inline int pthread_create(pthread_t *thread,
|
||||
static INLINE int pthread_create(pthread_t *thread,
|
||||
const pthread_attr_t *attr, void *(*start_routine)(void*), void *arg)
|
||||
{
|
||||
*thread = 0;
|
||||
@ -106,80 +107,80 @@ static inline int pthread_create(pthread_t *thread,
|
||||
0, STACKSIZE, 64, 0 /* unused */);
|
||||
}
|
||||
|
||||
static inline int pthread_mutex_init(pthread_mutex_t *mutex,
|
||||
static INLINE int pthread_mutex_init(pthread_mutex_t *mutex,
|
||||
const pthread_mutexattr_t *attr)
|
||||
{
|
||||
return OSInitMutex(mutex);
|
||||
}
|
||||
|
||||
static inline int pthread_mutex_destroy(pthread_mutex_t *mutex)
|
||||
static INLINE int pthread_mutex_destroy(pthread_mutex_t *mutex)
|
||||
{
|
||||
return LWP_MutexDestroy(*mutex);
|
||||
}
|
||||
|
||||
static inline int pthread_mutex_lock(pthread_mutex_t *mutex)
|
||||
static INLINE int pthread_mutex_lock(pthread_mutex_t *mutex)
|
||||
{
|
||||
return OSLockMutex(*mutex);
|
||||
}
|
||||
|
||||
static inline int pthread_mutex_unlock(pthread_mutex_t *mutex)
|
||||
static INLINE int pthread_mutex_unlock(pthread_mutex_t *mutex)
|
||||
{
|
||||
return OSUnlockMutex(*mutex);
|
||||
}
|
||||
|
||||
static inline void pthread_exit(void *retval)
|
||||
static INLINE void pthread_exit(void *retval)
|
||||
{
|
||||
/* FIXME: No LWP equivalent for this? */
|
||||
(void)retval;
|
||||
}
|
||||
|
||||
static inline int pthread_detach(pthread_t thread)
|
||||
static INLINE int pthread_detach(pthread_t thread)
|
||||
{
|
||||
/* FIXME: pthread_detach equivalent missing? */
|
||||
(void)thread;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int pthread_join(pthread_t thread, void **retval)
|
||||
static INLINE int pthread_join(pthread_t thread, void **retval)
|
||||
{
|
||||
return OSJoinThread(thread, retval);
|
||||
}
|
||||
|
||||
static inline int pthread_mutex_trylock(pthread_mutex_t *mutex)
|
||||
static INLINE int pthread_mutex_trylock(pthread_mutex_t *mutex)
|
||||
{
|
||||
return OSTryLockMutex(*mutex);
|
||||
}
|
||||
|
||||
static inline int pthread_cond_wait(pthread_cond_t *cond,
|
||||
static INLINE int pthread_cond_wait(pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex)
|
||||
{
|
||||
return OSWaitCond(*cond, *mutex);
|
||||
}
|
||||
|
||||
static inline int pthread_cond_timedwait(pthread_cond_t *cond,
|
||||
static INLINE int pthread_cond_timedwait(pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex, const struct timespec *abstime)
|
||||
{
|
||||
return LWP_CondTimedWait(*cond, *mutex, abstime);
|
||||
}
|
||||
|
||||
static inline int pthread_cond_init(pthread_cond_t *cond,
|
||||
static INLINE int pthread_cond_init(pthread_cond_t *cond,
|
||||
const pthread_condattr_t *attr)
|
||||
{
|
||||
return OSInitCond(cond);
|
||||
}
|
||||
|
||||
static inline int pthread_cond_signal(pthread_cond_t *cond)
|
||||
static INLINE int pthread_cond_signal(pthread_cond_t *cond)
|
||||
{
|
||||
OSSignalCond(*cond);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
static INLINE int pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
{
|
||||
return LWP_CondBroadcast(*cond);
|
||||
}
|
||||
|
||||
static inline int pthread_cond_destroy(pthread_cond_t *cond)
|
||||
static INLINE int pthread_cond_destroy(pthread_cond_t *cond)
|
||||
{
|
||||
return LWP_CondDestroy(*cond);
|
||||
}
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <pspthreadman.h>
|
||||
#include <pspthreadman_kernel.h>
|
||||
#include <stdio.h>
|
||||
#include <retro_inline.h>
|
||||
|
||||
#define STACKSIZE (64 * 1024)
|
||||
|
||||
@ -57,7 +58,7 @@ static int psp_thread_wrap(SceSize args, void *argp)
|
||||
return (int)sthread_args->start_routine(sthread_args->arg);
|
||||
}
|
||||
|
||||
static inline int pthread_create(pthread_t *thread,
|
||||
static INLINE int pthread_create(pthread_t *thread,
|
||||
const pthread_attr_t *attr, void *(*start_routine)(void*), void *arg)
|
||||
{
|
||||
sprintf(name_buffer, "0x%08X", (uint32_t) thread);
|
||||
@ -72,7 +73,7 @@ static inline int pthread_create(pthread_t *thread,
|
||||
return sceKernelStartThread(*thread, sizeof(sthread_args), &sthread_args);
|
||||
}
|
||||
|
||||
static inline int pthread_mutex_init(pthread_mutex_t *mutex,
|
||||
static INLINE int pthread_mutex_init(pthread_mutex_t *mutex,
|
||||
const pthread_mutexattr_t *attr)
|
||||
{
|
||||
sprintf(name_buffer, "0x%08X", (uint32_t) mutex);
|
||||
@ -80,25 +81,25 @@ static inline int pthread_mutex_init(pthread_mutex_t *mutex,
|
||||
return *mutex = sceKernelCreateSema(name_buffer, 0, 1, 1, NULL);
|
||||
}
|
||||
|
||||
static inline int pthread_mutex_destroy(pthread_mutex_t *mutex)
|
||||
static INLINE int pthread_mutex_destroy(pthread_mutex_t *mutex)
|
||||
{
|
||||
return sceKernelDeleteSema(*mutex);
|
||||
}
|
||||
|
||||
static inline int pthread_mutex_lock(pthread_mutex_t *mutex)
|
||||
static INLINE int pthread_mutex_lock(pthread_mutex_t *mutex)
|
||||
{
|
||||
//FIXME: stub
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int pthread_mutex_unlock(pthread_mutex_t *mutex)
|
||||
static INLINE int pthread_mutex_unlock(pthread_mutex_t *mutex)
|
||||
{
|
||||
//FIXME: stub
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static inline int pthread_join(pthread_t thread, void **retval)
|
||||
static INLINE int pthread_join(pthread_t thread, void **retval)
|
||||
{
|
||||
SceUInt timeout = (SceUInt)-1;
|
||||
sceKernelWaitThreadEnd(thread, &timeout);
|
||||
@ -107,58 +108,58 @@ static inline int pthread_join(pthread_t thread, void **retval)
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
static inline int pthread_mutex_trylock(pthread_mutex_t *mutex)
|
||||
static INLINE int pthread_mutex_trylock(pthread_mutex_t *mutex)
|
||||
{
|
||||
//FIXME: stub
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int pthread_cond_wait(pthread_cond_t *cond,
|
||||
static INLINE int pthread_cond_wait(pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex)
|
||||
{
|
||||
sceKernelDelayThread(10000);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int pthread_cond_timedwait(pthread_cond_t *cond,
|
||||
static INLINE int pthread_cond_timedwait(pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex, const struct timespec *abstime)
|
||||
{
|
||||
//FIXME: stub
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int pthread_cond_init(pthread_cond_t *cond,
|
||||
static INLINE int pthread_cond_init(pthread_cond_t *cond,
|
||||
const pthread_condattr_t *attr)
|
||||
{
|
||||
//FIXME: stub
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int pthread_cond_signal(pthread_cond_t *cond)
|
||||
static INLINE int pthread_cond_signal(pthread_cond_t *cond)
|
||||
{
|
||||
//FIXME: stub
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
static INLINE int pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
{
|
||||
//FIXME: stub
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int pthread_cond_destroy(pthread_cond_t *cond)
|
||||
static INLINE int pthread_cond_destroy(pthread_cond_t *cond)
|
||||
{
|
||||
//FIXME: stub
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static inline int pthread_detach(pthread_t thread)
|
||||
static INLINE int pthread_detach(pthread_t thread)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline void pthread_exit(void *retval)
|
||||
static INLINE void pthread_exit(void *retval)
|
||||
{
|
||||
(void)retval;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user