diff --git a/audio/alsa.c b/audio/alsa.c index 7132631696..584e82eb10 100644 --- a/audio/alsa.c +++ b/audio/alsa.c @@ -49,7 +49,7 @@ static bool find_float_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) return false; } -static void* __alsa_init(const char* device, unsigned rate, unsigned latency) +static void *__alsa_init(const char *device, unsigned rate, unsigned latency) { alsa_t *alsa = calloc(1, sizeof(alsa_t)); if (!alsa) diff --git a/audio/coreaudio.c b/audio/coreaudio.c index a49040acff..28232d076a 100644 --- a/audio/coreaudio.c +++ b/audio/coreaudio.c @@ -95,7 +95,7 @@ static OSStatus audio_cb(void *userdata, AudioUnitRenderActionFlags *action_flag return noErr; } -static void* coreaudio_init(const char* device, unsigned rate, unsigned latency) +static void *coreaudio_init(const char *device, unsigned rate, unsigned latency) { (void)device; @@ -210,7 +210,7 @@ error: return NULL; } -static ssize_t coreaudio_write(void* data, const void* buf_, size_t size) +static ssize_t coreaudio_write(void *data, const void *buf_, size_t size) { coreaudio_t *dev = data; diff --git a/audio/dsound.c b/audio/dsound.c index a962ffa292..57dfd512d2 100644 --- a/audio/dsound.c +++ b/audio/dsound.c @@ -249,7 +249,7 @@ static void dsound_free(void *data) } } -static void* dsound_init(const char *device, unsigned rate, unsigned latency) +static void *dsound_init(const char *device, unsigned rate, unsigned latency) { dsound_t *ds = calloc(1, sizeof(*ds)); if (!ds) diff --git a/audio/ext.c b/audio/ext.c index 5b03deaf3b..20773747de 100644 --- a/audio/ext.c +++ b/audio/ext.c @@ -45,7 +45,7 @@ static void audio_ext_free(void *data) } } -static void* audio_ext_init(const char *device, unsigned rate, unsigned latency) +static void *audio_ext_init(const char *device, unsigned rate, unsigned latency) { if (!(*g_settings.audio.external_driver)) { diff --git a/audio/ext/ssnes_audio.h b/audio/ext/ssnes_audio.h index b9c32f1d47..a992c1c6b9 100644 --- a/audio/ext/ssnes_audio.h +++ b/audio/ext/ssnes_audio.h @@ -61,7 +61,7 @@ typedef struct ssnes_audio_driver_info typedef struct ssnes_audio_driver { // Initializes the device. - void* (*init)(const ssnes_audio_driver_info_t *info); + void *(*init)(const ssnes_audio_driver_info_t *info); // Write data in buffer to audio driver. // A frame here is defined as one combined sample of left and right diff --git a/audio/ext/ssnes_dsp.h b/audio/ext/ssnes_dsp.h index f60776aa4c..128cab0310 100644 --- a/audio/ext/ssnes_dsp.h +++ b/audio/ext/ssnes_dsp.h @@ -87,7 +87,7 @@ typedef struct ssnes_dsp_input typedef struct ssnes_dsp_plugin { // Creates a handle of the plugin. Returns NULL if failed. - void* (*init)(const ssnes_dsp_info_t *info); + void *(*init)(const ssnes_dsp_info_t *info); // Processes input data. // The plugin is allowed to return variable sizes for output data. diff --git a/audio/ext/ssnes_iir_filter.c b/audio/ext/ssnes_iir_filter.c index 2f4a248b91..171730be66 100644 --- a/audio/ext/ssnes_iir_filter.c +++ b/audio/ext/ssnes_iir_filter.c @@ -207,7 +207,7 @@ static void generate_filter_coeffs(float * restrict fir_out, float * restrict ii } -static void* dsp_init(const ssnes_dsp_info_t *info) +static void *dsp_init(const ssnes_dsp_info_t *info) { (void)info; dsp_state *state = calloc(1, sizeof(*state)); diff --git a/audio/jack.c b/audio/jack.c index 39a493f93d..05e66d45b6 100644 --- a/audio/jack.c +++ b/audio/jack.c @@ -124,7 +124,7 @@ static size_t find_buffersize(jack_t *jd, int latency) return buffer_frames * sizeof(jack_default_audio_sample_t); } -static void* __jack_init(const char* device, unsigned rate, unsigned latency) +static void *__jack_init(const char *device, unsigned rate, unsigned latency) { jack_t *jd = calloc(1, sizeof(jack_t)); if (!jd) @@ -246,7 +246,7 @@ static size_t write_buffer(jack_t *jd, const float *buf, size_t size) return written * sizeof(float) * 2; } -static ssize_t __jack_write(void* data, const void* buf, size_t size) +static ssize_t __jack_write(void *data, const void *buf, size_t size) { jack_t *jd = data; diff --git a/audio/openal.c b/audio/openal.c index b71652a930..ca3c915a7b 100644 --- a/audio/openal.c +++ b/audio/openal.c @@ -56,7 +56,7 @@ typedef struct al } al_t; -static void* __al_init(const char* device, unsigned rate, unsigned latency) +static void *__al_init(const char *device, unsigned rate, unsigned latency) { (void)device; al_t *al = calloc(1, sizeof(al_t)); @@ -153,7 +153,7 @@ static bool al_get_buffer(al_t *al, ALuint *buffer) return true; } -static size_t al_fill_internal_buf(al_t *al, const void* buf, size_t size) +static size_t al_fill_internal_buf(al_t *al, const void *buf, size_t size) { size_t read_size = (BUFSIZE - al->tmpbuf_ptr > size) ? size : (BUFSIZE - al->tmpbuf_ptr); memcpy(al->tmpbuf + al->tmpbuf_ptr, buf, read_size); @@ -161,7 +161,7 @@ static size_t al_fill_internal_buf(al_t *al, const void* buf, size_t size) return read_size; } -static ssize_t __al_write(void* data, const void* buf, size_t size) +static ssize_t __al_write(void *data, const void *buf, size_t size) { al_t *al = data; diff --git a/audio/oss.c b/audio/oss.c index d34a91351a..a380e25f20 100644 --- a/audio/oss.c +++ b/audio/oss.c @@ -41,7 +41,7 @@ #define DEFAULT_OSS_DEV "/dev/dsp" #endif -static void* __oss_init(const char* device, unsigned rate, unsigned latency) +static void *__oss_init(const char *device, unsigned rate, unsigned latency) { int *fd = calloc(1, sizeof(int)); if (fd == NULL) @@ -96,7 +96,7 @@ static void* __oss_init(const char* device, unsigned rate, unsigned latency) return fd; } -static ssize_t __oss_write(void* data, const void* buf, size_t size) +static ssize_t __oss_write(void *data, const void *buf, size_t size) { int *fd = data; diff --git a/audio/pulse.c b/audio/pulse.c index e1fdfb17ce..8784246f2f 100644 --- a/audio/pulse.c +++ b/audio/pulse.c @@ -103,7 +103,7 @@ static void stream_latency_update_cb(pa_stream *s, void *data) pa_threaded_mainloop_signal(pa->mainloop, 0); } -static void* __pulse_init(const char* device, unsigned rate, unsigned latency) +static void *__pulse_init(const char *device, unsigned rate, unsigned latency) { pa_t *pa = calloc(1, sizeof(*pa)); if (!pa) @@ -172,7 +172,7 @@ error: return NULL; } -static ssize_t __pulse_write(void* data, const void* buf, size_t size) +static ssize_t __pulse_write(void *data, const void *buf, size_t size) { pa_t *pa = data; diff --git a/audio/roar.c b/audio/roar.c index dcb98bfaed..1e0bf82974 100644 --- a/audio/roar.c +++ b/audio/roar.c @@ -30,7 +30,7 @@ typedef struct bool nonblocking; } roar_t; -static void* __roar_init(const char* device, unsigned rate, unsigned latency) +static void *__roar_init(const char *device, unsigned rate, unsigned latency) { int err; roar_t *roar = calloc(1, sizeof(roar_t)); @@ -51,7 +51,7 @@ static void* __roar_init(const char* device, unsigned rate, unsigned latency) return roar; } -static ssize_t __roar_write(void* data, const void* buf, size_t size) +static ssize_t __roar_write(void *data, const void *buf, size_t size) { roar_t *roar = data; ssize_t rc; diff --git a/audio/rsound.c b/audio/rsound.c index a623e88686..fd59d2092a 100644 --- a/audio/rsound.c +++ b/audio/rsound.c @@ -54,7 +54,7 @@ static void err_cb(void *userdata) SDL_CondSignal(rsd->cond); } -static void* __rsd_init(const char* device, unsigned rate, unsigned latency) +static void *__rsd_init(const char *device, unsigned rate, unsigned latency) { rsd_t *rsd = calloc(1, sizeof(rsd_t)); if (!rsd) @@ -98,7 +98,7 @@ static void* __rsd_init(const char* device, unsigned rate, unsigned latency) return rsd; } -static ssize_t __rsd_write(void* data, const void* buf, size_t size) +static ssize_t __rsd_write(void *data, const void *buf, size_t size) { rsd_t *rsd = data; diff --git a/audio/sdl.c b/audio/sdl.c index f853c3b280..6474c40521 100644 --- a/audio/sdl.c +++ b/audio/sdl.c @@ -58,7 +58,7 @@ static inline int find_num_frames(int rate, int latency) return next_pow2(frames); } -static void* sdl_audio_init(const char* device, unsigned rate, unsigned latency) +static void *sdl_audio_init(const char *device, unsigned rate, unsigned latency) { (void)device; if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) @@ -109,7 +109,7 @@ static void* sdl_audio_init(const char* device, unsigned rate, unsigned latency) return sdl; } -static ssize_t sdl_audio_write(void* data, const void* buf, size_t size) +static ssize_t sdl_audio_write(void *data, const void *buf, size_t size) { sdl_audio_t *sdl = data; diff --git a/audio/xaudio-c/xaudio2.hpp b/audio/xaudio-c/xaudio2.hpp index 243f615794..ae4b094e8c 100755 --- a/audio/xaudio-c/xaudio2.hpp +++ b/audio/xaudio-c/xaudio2.hpp @@ -146,7 +146,7 @@ typedef struct XAUDIO2_BUFFER UINT32 LoopBegin; UINT32 LoopLength; UINT32 LoopCount; - void* pContext; + void *pContext; } XAUDIO2_BUFFER; typedef struct XAUDIO2_BUFFER_WMA @@ -157,7 +157,7 @@ typedef struct XAUDIO2_BUFFER_WMA typedef struct XAUDIO2_VOICE_STATE { - void* pCurrentBufferContext; + void *pCurrentBufferContext; UINT32 BuffersQueued; UINT64 SamplesPlayed; } XAUDIO2_VOICE_STATE; @@ -201,10 +201,10 @@ DECLARE_INTERFACE(IXAudio2VoiceCallback) STDMETHOD_(void, OnVoiceProcessingPassStart) (THIS_ UINT32 BytesRequired) PURE; STDMETHOD_(void, OnVoiceProcessingPassEnd) (THIS) PURE; STDMETHOD_(void, OnStreamEnd) (THIS) PURE; - STDMETHOD_(void, OnBufferStart) (THIS_ void* pBufferContext) PURE; - STDMETHOD_(void, OnBufferEnd) (THIS_ void* pBufferContext) PURE; - STDMETHOD_(void, OnLoopEnd) (THIS_ void* pBufferContext) PURE; - STDMETHOD_(void, OnVoiceError) (THIS_ void* pBufferContext, HRESULT Error) PURE; + STDMETHOD_(void, OnBufferStart) (THIS_ void *pBufferContext) PURE; + STDMETHOD_(void, OnBufferEnd) (THIS_ void *pBufferContext) PURE; + STDMETHOD_(void, OnLoopEnd) (THIS_ void *pBufferContext) PURE; + STDMETHOD_(void, OnVoiceError) (THIS_ void *pBufferContext, HRESULT Error) PURE; }; DECLARE_INTERFACE(IXAudio2Voice) @@ -219,10 +219,10 @@ DECLARE_INTERFACE(IXAudio2Voice) UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ STDMETHOD_(void, GetEffectState) (THIS_ UINT32 EffectIndex, BOOL* pEnabled) PURE; \ STDMETHOD(SetEffectParameters) (THIS_ UINT32 EffectIndex, \ - const void* pParameters, \ + const void *pParameters, \ UINT32 ParametersByteSize, \ UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ - STDMETHOD(GetEffectParameters) (THIS_ UINT32 EffectIndex, void* pParameters, \ + STDMETHOD(GetEffectParameters) (THIS_ UINT32 EffectIndex, void *pParameters, \ UINT32 ParametersByteSize) PURE; \ STDMETHOD(SetFilterParameters) (THIS_ const XAUDIO2_FILTER_PARAMETERS* pParameters, \ UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ @@ -304,7 +304,7 @@ DECLARE_INTERFACE_(IXAudio2, IUnknown) STDMETHOD(CommitChanges) (THIS_ UINT32 OperationSet) PURE; STDMETHOD_(void, GetPerformanceData) (THIS_ XAUDIO2_PERFORMANCE_DATA* pPerfData) PURE; STDMETHOD_(void, SetDebugConfiguration) (THIS_ const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration, - void* pReserved X2DEFAULT(NULL)) PURE; + void *pReserved X2DEFAULT(NULL)) PURE; }; static inline HRESULT XAudio2Create(IXAudio2** ppXAudio2, UINT32 Flags X2DEFAULT(0), diff --git a/audio/xaudio.c b/audio/xaudio.c index 89dd8411ef..f4c0bf73b3 100644 --- a/audio/xaudio.c +++ b/audio/xaudio.c @@ -26,7 +26,7 @@ typedef struct bool nonblock; } xa_t; -static void* __xa_init(const char* device, unsigned rate, unsigned latency) +static void *__xa_init(const char *device, unsigned rate, unsigned latency) { if (latency < 8) latency = 8; // Do not allow shenanigans. @@ -49,7 +49,7 @@ static void* __xa_init(const char* device, unsigned rate, unsigned latency) return xa; } -static ssize_t __xa_write(void* data, const void* buf, size_t size) +static ssize_t __xa_write(void *data, const void *buf, size_t size) { xa_t *xa = data; if (xa->nonblock) diff --git a/cheats.c b/cheats.c index 629265da49..f2600f1a09 100644 --- a/cheats.c +++ b/cheats.c @@ -51,7 +51,7 @@ struct cheat_manager unsigned buf_size; }; -static char* strcat_alloc(char *dest, const char *input) +static char *strcat_alloc(char *dest, const char *input) { size_t dest_len = dest ? strlen(dest) : 0; size_t input_len = strlen(input); diff --git a/conf/config_file.c b/conf/config_file.c index db86feaf11..8c1cea1052 100644 --- a/conf/config_file.c +++ b/conf/config_file.c @@ -89,7 +89,7 @@ static char *getaline(FILE *file) return newline; } -static char* extract_value(char *line, bool is_value) +static char *extract_value(char *line, bool is_value) { if (is_value) { diff --git a/config.def.h b/config.def.h index ba4a8b3b70..c8755a59ae 100644 --- a/config.def.h +++ b/config.def.h @@ -174,7 +174,7 @@ static const float in_rate = 31980.0; static const float audio_rate_step = 0.25; // Audio device (e.g. hw:0,0 or /dev/audio). If NULL, will use defaults. -static const char* audio_device = NULL; +static const char *audio_device = NULL; // Desired audio latency in milliseconds. Might not be honored if driver can't provide given latency. static const int out_latency = 64; diff --git a/dynamic.c b/dynamic.c index de92fb8873..236b61f3ae 100644 --- a/dynamic.c +++ b/dynamic.c @@ -259,7 +259,7 @@ function_t dylib_proc(dylib_t lib, const char *proc) } } - // Dirty hack to workaround the non-legality of void* -> fn-pointer casts. + // Dirty hack to workaround the non-legality of void *-> fn-pointer casts. function_t sym; memcpy(&sym, &ptr_sym, sizeof(void*)); #endif diff --git a/dynamic.h b/dynamic.h index 4ed107bdb3..b08e329758 100644 --- a/dynamic.h +++ b/dynamic.h @@ -41,7 +41,7 @@ extern void (*psnes_set_input_state)(snes_input_state_t); extern void (*psnes_cheat_reset)(void); extern void (*psnes_cheat_set)(unsigned, bool, const char*); -extern const char* (*psnes_library_id)(void); +extern const char *(*psnes_library_id)(void); extern unsigned (*psnes_library_revision_minor)(void); extern unsigned (*psnes_library_revision_major)(void); diff --git a/file.c b/file.c index 11c52ddb24..87540635b9 100644 --- a/file.c +++ b/file.c @@ -531,7 +531,7 @@ void save_ram_file(const char *path, int type) } } -static char* load_xml_map(const char *path) +static char *load_xml_map(const char *path) { char *xml_buf = NULL; if (*path) diff --git a/gfx/ext/ssnes_video.h b/gfx/ext/ssnes_video.h index d906763bf3..bf31c3d04f 100644 --- a/gfx/ext/ssnes_video.h +++ b/gfx/ext/ssnes_video.h @@ -181,20 +181,20 @@ typedef struct ssnes_input_driver // The range of this is [0, 1], // where 0 means any displacement will register, // and 1 means the axis has to be pressed all the way to register. - void* (*init)(const int joypad_index[5], float axis_threshold); + void *(*init)(const int joypad_index[5], float axis_threshold); // Polls input. Called once every frame. - void (*poll)(void* data); + void (*poll)(void *data); // Queries input state for a certain key on a certain player. // Players are 1 - 5. // For digital inputs, pressed key is 1, not pressed key is 0. // Analog values have same range as a signed 16-bit integer. - int (*input_state)(void* data, const struct ssnes_keybind *bind, + int (*input_state)(void *data, const struct ssnes_keybind *bind, unsigned player); // Frees the input struct. - void (*free)(void* data); + void (*free)(void *data); // Human readable indentification string. const char *ident; @@ -208,7 +208,7 @@ typedef struct ssnes_video_driver // Should the video driver request that a certain input driver is used, // it is possible to set the driver to *input. // If no certain driver is desired, set *input to NULL. - void* (*init)(const ssnes_video_info_t *video, + void *(*init)(const ssnes_video_info_t *video, const ssnes_input_driver_t **input); // Updates frame on the screen. @@ -218,13 +218,13 @@ typedef struct ssnes_video_driver // // When msg is non-NULL, // it's a message that should be displayed to the user. - int (*frame)(void* data, const void* frame, + int (*frame)(void *data, const void *frame, unsigned width, unsigned height, unsigned pitch, const char *msg); // Requests nonblocking operation. // True = VSync is turned off. // False = VSync is turned on. - void (*set_nonblock_state)(void* data, int toggle); + void (*set_nonblock_state)(void *data, int toggle); // This must return false when the user exits the emulator. int (*alive)(void *data); @@ -233,7 +233,7 @@ typedef struct ssnes_video_driver int (*focus)(void *data); // Frees the video driver. - void (*free)(void* data); + void (*free)(void *data); // A human-readable identification of the video driver. const char *ident; diff --git a/gfx/gl.c b/gfx/gl.c index 069809d2e1..ff7989b0d8 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -847,7 +847,7 @@ static void check_window(gl_t *gl) gl->should_resize = true; } -static bool gl_frame(void *data, const void* frame, unsigned width, unsigned height, unsigned pitch, const char *msg) +static bool gl_frame(void *data, const void *frame, unsigned width, unsigned height, unsigned pitch, const char *msg) { gl_t *gl = data; @@ -1150,7 +1150,7 @@ static void gl_set_nonblock_state(void *data, bool state) } } -static void* gl_init(const video_info_t *video, const input_driver_t **input, void **input_data) +static void *gl_init(const video_info_t *video, const input_driver_t **input, void **input_data) { #ifdef _WIN32 gfx_set_dwm(); diff --git a/gfx/py_state/py_state.c b/gfx/py_state/py_state.c index 91e542c3be..c79e3701fc 100644 --- a/gfx/py_state/py_state.c +++ b/gfx/py_state/py_state.c @@ -200,7 +200,7 @@ static char *dupe_newline(const char *str) } // Need to make sure that first-line indentation is 0. :( -static char* align_program(const char *program) +static char *align_program(const char *program) { char *prog = strdup(program); if (!prog) diff --git a/gfx/sdl.c b/gfx/sdl.c index 065b710458..3d2381de45 100644 --- a/gfx/sdl.c +++ b/gfx/sdl.c @@ -244,7 +244,7 @@ static void sdl_render_msg_32(sdl_video_t *vid, SDL_Surface *buffer, const char #endif } -static void* sdl_gfx_init(const video_info_t *video, const input_driver_t **input, void **input_data) +static void *sdl_gfx_init(const video_info_t *video, const input_driver_t **input, void **input_data) { #ifdef _WIN32 gfx_set_dwm(); @@ -464,7 +464,7 @@ static void check_window(sdl_video_t *vid) } } -static bool sdl_gfx_frame(void *data, const void* frame, unsigned width, unsigned height, unsigned pitch, const char *msg) +static bool sdl_gfx_frame(void *data, const void *frame, unsigned width, unsigned height, unsigned pitch, const char *msg) { sdl_video_t *vid = data; diff --git a/gfx/sdlwrap.h b/gfx/sdlwrap.h index a835d953cb..45bc81fc5a 100644 --- a/gfx/sdlwrap.h +++ b/gfx/sdlwrap.h @@ -33,7 +33,7 @@ #define SDL_MODERN 0 #endif -// Not legal to cast void* to fn-pointer. Need workaround to be compliant. +// Not legal to cast void *to fn-pointer. Need workaround to be compliant. #define SDL_SYM_WRAP(sym, symbol) { \ assert(sizeof(void*) == sizeof(void (*)(void))); \ void *sym__ = SDL_GL_GetProcAddress(symbol); \ diff --git a/gfx/shader_cg.c b/gfx/shader_cg.c index a8ce7fa6bf..17c0196924 100644 --- a/gfx/shader_cg.c +++ b/gfx/shader_cg.c @@ -32,7 +32,7 @@ //#define SSNES_CG_DEBUG // Used when we call deactivate() since just unbinding the program didn't seem to work... :( -static const char* stock_cg_program = +static const char *stock_cg_program = "void main_vertex" "(" " float4 position : POSITION," diff --git a/gfx/xvideo.c b/gfx/xvideo.c index 1af865d69e..6d52e1273d 100644 --- a/gfx/xvideo.c +++ b/gfx/xvideo.c @@ -693,7 +693,7 @@ static void xv_render_msg(xv_t *xv, const char *msg, unsigned width, unsigned he #endif } -static bool xv_frame(void *data, const void* frame, unsigned width, unsigned height, unsigned pitch, const char *msg) +static bool xv_frame(void *data, const void *frame, unsigned width, unsigned height, unsigned pitch, const char *msg) { xv_t *xv = data; diff --git a/input/sdl.c b/input/sdl.c index 227e74ac5f..e0d54f1712 100644 --- a/input/sdl.c +++ b/input/sdl.c @@ -123,7 +123,7 @@ static void init_lut(void) keysym_lut[lut_binds[i].sk] = lut_binds[i].sdl; } -static void* sdl_input_init(void) +static void *sdl_input_init(void) { init_lut(); sdl_input_t *sdl = calloc(1, sizeof(*sdl)); diff --git a/input/x11_input.c b/input/x11_input.c index 75936ad006..4e8267684d 100644 --- a/input/x11_input.c +++ b/input/x11_input.c @@ -133,7 +133,7 @@ static void init_lut(void) keysym_lut[lut_binds[i].sk] = lut_binds[i].x; } -static void* x_input_init(void) +static void *x_input_init(void) { x11_input_t *x11 = calloc(1, sizeof(*x11)); if (!x11)