Use retro_inline.h for remaining 'inline' instances

This commit is contained in:
twinaphex 2015-03-29 16:43:02 +02:00
parent 12a3e56a55
commit d374fb863c
5 changed files with 31 additions and 12 deletions

View File

@ -16,6 +16,8 @@
#ifndef RARCH_FFT_H__ #ifndef RARCH_FFT_H__
#define RARCH_FFT_H__ #define RARCH_FFT_H__
#include <retro_inline.h>
typedef struct fft fft_t; typedef struct fft fft_t;
// C99 <complex.h> would be nice. // C99 <complex.h> would be nice.
@ -25,7 +27,7 @@ typedef struct
float imag; float imag;
} fft_complex_t; } fft_complex_t;
static inline fft_complex_t fft_complex_mul(fft_complex_t a, static INLINE fft_complex_t fft_complex_mul(fft_complex_t a,
fft_complex_t b) fft_complex_t b)
{ {
fft_complex_t out = { fft_complex_t out = {
@ -37,7 +39,7 @@ static inline fft_complex_t fft_complex_mul(fft_complex_t a,
} }
static inline fft_complex_t fft_complex_add(fft_complex_t a, static INLINE fft_complex_t fft_complex_add(fft_complex_t a,
fft_complex_t b) fft_complex_t b)
{ {
fft_complex_t out = { fft_complex_t out = {
@ -49,7 +51,7 @@ static inline fft_complex_t fft_complex_add(fft_complex_t a,
} }
static inline fft_complex_t fft_complex_sub(fft_complex_t a, static INLINE fft_complex_t fft_complex_sub(fft_complex_t a,
fft_complex_t b) fft_complex_t b)
{ {
fft_complex_t out = { fft_complex_t out = {
@ -61,7 +63,7 @@ static inline fft_complex_t fft_complex_sub(fft_complex_t a,
} }
static inline fft_complex_t fft_complex_conj(fft_complex_t a) static INLINE fft_complex_t fft_complex_conj(fft_complex_t a)
{ {
fft_complex_t out = { fft_complex_t out = {
a.real, -a.imag, a.real, -a.imag,

View File

@ -69,6 +69,8 @@
#include <time.h> #include <time.h>
#include <errno.h> #include <errno.h>
#include <retro_inline.h>
/* /*
**************************************************************************** ****************************************************************************
Naming convention. Functions for use in API are called rsd_*(), * Naming convention. Functions for use in API are called rsd_*(), *
@ -155,19 +157,19 @@ static void rsnd_thread(void *thread_data);
/* Determine whether we're running big- or little endian */ /* Determine whether we're running big- or little endian */
static inline int rsnd_is_little_endian(void) static INLINE int rsnd_is_little_endian(void)
{ {
uint16_t i = 1; uint16_t i = 1;
return *((uint8_t*)&i); return *((uint8_t*)&i);
} }
/* Simple functions for swapping bytes */ /* Simple functions for swapping bytes */
static inline void rsnd_swap_endian_16 ( uint16_t * x ) static INLINE void rsnd_swap_endian_16 ( uint16_t * x )
{ {
*x = (*x>>8) | (*x<<8); *x = (*x>>8) | (*x<<8);
} }
static inline void rsnd_swap_endian_32 ( uint32_t * x ) static INLINE void rsnd_swap_endian_32 ( uint32_t * x )
{ {
*x = (*x >> 24 ) | *x = (*x >> 24 ) |
((*x<<8) & 0x00FF0000) | ((*x<<8) & 0x00FF0000) |
@ -175,7 +177,7 @@ static inline void rsnd_swap_endian_32 ( uint32_t * x )
(*x << 24); (*x << 24);
} }
static inline int rsnd_format_to_samplesize ( uint16_t fmt ) static INLINE int rsnd_format_to_samplesize ( uint16_t fmt )
{ {
switch(fmt) switch(fmt)
{ {

View File

@ -1,3 +1,18 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2015 - Ali Bouhlel
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma comment( lib, "comctl32" ) #pragma comment( lib, "comctl32" )
#endif #endif
@ -21,7 +36,7 @@
#include <commdlg.h> #include <commdlg.h>
#include <commctrl.h> #include <commctrl.h>
#include <string.h> #include <string.h>
#include <retro_inline.h>
#define IDI_ICON 1 #define IDI_ICON 1
@ -82,7 +97,7 @@ typedef struct
static shader_dlg_t g_shader_dlg = {0}; static shader_dlg_t g_shader_dlg = {0};
static inline void shader_dlg_refresh_trackbar_label(int index) static INLINE void shader_dlg_refresh_trackbar_label(int index)
{ {
char val_buffer[32]; char val_buffer[32];
struct video_shader* shader = video_shader_driver_get_current_shader(); struct video_shader* shader = video_shader_driver_get_current_shader();

View File

@ -9,7 +9,6 @@ extern "C" {
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
bool wgl_shader_dlg_init(void); bool wgl_shader_dlg_init(void);
void shader_dlg_show(HWND parent_hwnd); void shader_dlg_show(HWND parent_hwnd);
void shader_dlg_params_reload(void); void shader_dlg_params_reload(void);

View File

@ -24,6 +24,7 @@
#include "../menu.h" #include "../menu.h"
#include <compat/posix_string.h> #include <compat/posix_string.h>
#include <file/file_path.h> #include <file/file_path.h>
#include <retro_inline.h>
#include "../../gfx/drivers_font_renderer/bitmap.h" #include "../../gfx/drivers_font_renderer/bitmap.h"
@ -44,7 +45,7 @@
#define TITLE_COLOR(settings) (argb32_to_rgba4444(settings->menu.title_color)) #define TITLE_COLOR(settings) (argb32_to_rgba4444(settings->menu.title_color))
#endif #endif
static inline uint16_t argb32_to_rgba4444(uint32_t col) static INLINE uint16_t argb32_to_rgba4444(uint32_t col)
{ {
unsigned a = ((col >> 24) & 0xff) >> 4; unsigned a = ((col >> 24) & 0xff) >> 4;
unsigned r = ((col >> 16) & 0xff) >> 4; unsigned r = ((col >> 16) & 0xff) >> 4;