Fix style nits.

This commit is contained in:
Themaister 2011-11-02 19:31:36 +01:00
parent 95636d4f04
commit 0f010cf3d2
31 changed files with 58 additions and 58 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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)

View File

@ -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))
{

View File

@ -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

View File

@ -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.

View File

@ -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));

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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),

View File

@ -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)

View File

@ -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);

View File

@ -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)
{

View File

@ -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;

View File

@ -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

View File

@ -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);

2
file.c
View File

@ -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)

View File

@ -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;

View File

@ -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();

View File

@ -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)

View File

@ -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;

View File

@ -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); \

View File

@ -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,"

View File

@ -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;

View File

@ -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));

View File

@ -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)