mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-01 22:02:08 +02:00
Updated source to match SDL function prototype style
This commit is contained in:
@@ -789,8 +789,7 @@ int SDL_GetNumAudioDrivers(void)
|
||||
return SDL_arraysize(bootstrap) - 1;
|
||||
}
|
||||
|
||||
const char *
|
||||
SDL_GetAudioDriver(int index)
|
||||
const char *SDL_GetAudioDriver(int index)
|
||||
{
|
||||
if (index >= 0 && index < SDL_GetNumAudioDrivers()) {
|
||||
return bootstrap[index]->name;
|
||||
@@ -893,8 +892,7 @@ int SDL_InitAudio(const char *driver_name)
|
||||
/*
|
||||
* Get the current audio driver name
|
||||
*/
|
||||
const char *
|
||||
SDL_GetCurrentAudioDriver(void)
|
||||
const char *SDL_GetCurrentAudioDriver(void)
|
||||
{
|
||||
return current_audio.name;
|
||||
}
|
||||
@@ -954,8 +952,7 @@ int SDL_GetNumAudioDevices(int iscapture)
|
||||
return retval;
|
||||
}
|
||||
|
||||
const char *
|
||||
SDL_GetAudioDeviceName(int index, int iscapture)
|
||||
const char *SDL_GetAudioDeviceName(int index, int iscapture)
|
||||
{
|
||||
SDL_AudioDeviceItem *item;
|
||||
int i;
|
||||
@@ -1412,8 +1409,7 @@ static SDL_AudioDeviceID open_audio_device(const char *devname, int iscapture,
|
||||
return device->id;
|
||||
}
|
||||
|
||||
SDL_AudioDeviceID
|
||||
SDL_OpenAudioDevice(const char *device, int iscapture,
|
||||
SDL_AudioDeviceID SDL_OpenAudioDevice(const char *device, int iscapture,
|
||||
const SDL_AudioSpec *desired, SDL_AudioSpec *obtained,
|
||||
int allowed_changes)
|
||||
{
|
||||
@@ -1421,8 +1417,7 @@ SDL_OpenAudioDevice(const char *device, int iscapture,
|
||||
allowed_changes, 2);
|
||||
}
|
||||
|
||||
SDL_AudioStatus
|
||||
SDL_GetAudioDeviceStatus(SDL_AudioDeviceID devid)
|
||||
SDL_AudioStatus SDL_GetAudioDeviceStatus(SDL_AudioDeviceID devid)
|
||||
{
|
||||
SDL_AudioDevice *device = get_audio_device(devid);
|
||||
SDL_AudioStatus status = SDL_AUDIO_STOPPED;
|
||||
|
||||
@@ -602,8 +602,7 @@ static int SetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioFormat src_for
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDL_AudioStream *
|
||||
SDL_CreateAudioStream(SDL_AudioFormat src_format,
|
||||
SDL_AudioStream *SDL_CreateAudioStream(SDL_AudioFormat src_format,
|
||||
int src_channels,
|
||||
int src_rate,
|
||||
SDL_AudioFormat dst_format,
|
||||
|
||||
@@ -2075,8 +2075,7 @@ static int WaveLoad(SDL_RWops *src, WaveFile *file, SDL_AudioSpec *spec, Uint8 *
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDL_AudioSpec *
|
||||
SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
|
||||
SDL_AudioSpec *SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
|
||||
{
|
||||
int result;
|
||||
WaveFile file;
|
||||
|
||||
@@ -202,7 +202,7 @@ static int load_pipewire_syms(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDL_FORCE_INLINE SDL_bool pipewire_version_at_least(int major, int minor, int patch)
|
||||
static SDL_bool pipewire_version_at_least(int major, int minor, int patch)
|
||||
{
|
||||
return (pipewire_version_major >= major) &&
|
||||
(pipewire_version_major > major || pipewire_version_minor >= minor) &&
|
||||
|
||||
@@ -73,15 +73,13 @@ uint32_t qsa_playback_devices;
|
||||
QSA_Device qsa_capture_device[QSA_MAX_DEVICES];
|
||||
uint32_t qsa_capture_devices;
|
||||
|
||||
static SDL_INLINE int
|
||||
QSA_SetError(const char *fn, int status)
|
||||
static int QSA_SetError(const char *fn, int status)
|
||||
{
|
||||
return SDL_SetError("QSA: %s() failed: %s", fn, snd_strerror(status));
|
||||
}
|
||||
|
||||
/* !!! FIXME: does this need to be here? Does the SDL version not work? */
|
||||
static void
|
||||
QSA_ThreadInit(SDL_AudioDevice *_this)
|
||||
static void QSA_ThreadInit(SDL_AudioDevice *_this)
|
||||
{
|
||||
/* Increase default 10 priority to 25 to avoid jerky sound */
|
||||
struct sched_param param;
|
||||
@@ -92,8 +90,7 @@ QSA_ThreadInit(SDL_AudioDevice *_this)
|
||||
}
|
||||
|
||||
/* PCM channel parameters initialize function */
|
||||
static void
|
||||
QSA_InitAudioParams(snd_pcm_channel_params_t * cpars)
|
||||
static void QSA_InitAudioParams(snd_pcm_channel_params_t * cpars)
|
||||
{
|
||||
SDL_zerop(cpars);
|
||||
cpars->channel = SND_PCM_CHANNEL_PLAYBACK;
|
||||
@@ -110,8 +107,7 @@ QSA_InitAudioParams(snd_pcm_channel_params_t * cpars)
|
||||
}
|
||||
|
||||
/* This function waits until it is possible to write a full sound buffer */
|
||||
static void
|
||||
QSA_WaitDevice(SDL_AudioDevice *_this)
|
||||
static void QSA_WaitDevice(SDL_AudioDevice *_this)
|
||||
{
|
||||
int result;
|
||||
|
||||
@@ -136,8 +132,7 @@ QSA_WaitDevice(SDL_AudioDevice *_this)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
QSA_PlayDevice(SDL_AudioDevice *_this)
|
||||
static void QSA_PlayDevice(SDL_AudioDevice *_this)
|
||||
{
|
||||
snd_pcm_channel_status_t cstatus;
|
||||
int written;
|
||||
@@ -229,14 +224,12 @@ QSA_PlayDevice(SDL_AudioDevice *_this)
|
||||
}
|
||||
}
|
||||
|
||||
static Uint8 *
|
||||
QSA_GetDeviceBuf(SDL_AudioDevice *_this)
|
||||
static Uint8 *QSA_GetDeviceBuf(SDL_AudioDevice *_this)
|
||||
{
|
||||
return _this->hidden->pcm_buf;
|
||||
}
|
||||
|
||||
static void
|
||||
QSA_CloseDevice(SDL_AudioDevice *_this)
|
||||
static void QSA_CloseDevice(SDL_AudioDevice *_this)
|
||||
{
|
||||
if (_this->hidden->audio_handle != NULL) {
|
||||
#if _NTO_VERSION < 710
|
||||
@@ -257,8 +250,7 @@ QSA_CloseDevice(SDL_AudioDevice *_this)
|
||||
SDL_free(_this->hidden);
|
||||
}
|
||||
|
||||
static int
|
||||
QSA_OpenDevice(SDL_AudioDevice *_this, const char *devname)
|
||||
static int QSA_OpenDevice(SDL_AudioDevice *_this, const char *devname)
|
||||
{
|
||||
#if 0
|
||||
/* !!! FIXME: SDL2 used to pass this handle. What's the alternative? */
|
||||
@@ -426,8 +418,7 @@ QSA_OpenDevice(SDL_AudioDevice *_this, const char *devname)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
QSA_DetectDevices(void)
|
||||
static void QSA_DetectDevices(void)
|
||||
{
|
||||
uint32_t it;
|
||||
uint32_t cards;
|
||||
@@ -572,8 +563,7 @@ QSA_DetectDevices(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
QSA_Deinitialize(void)
|
||||
static void QSA_Deinitialize(void)
|
||||
{
|
||||
/* Clear devices array on shutdown */
|
||||
/* !!! FIXME: we zero these on init...any reason to do it here? */
|
||||
@@ -583,8 +573,7 @@ QSA_Deinitialize(void)
|
||||
qsa_capture_devices = 0;
|
||||
}
|
||||
|
||||
static SDL_bool
|
||||
QSA_Init(SDL_AudioDriverImpl * impl)
|
||||
static SDL_bool QSA_Init(SDL_AudioDriverImpl * impl)
|
||||
{
|
||||
/* Clear devices array */
|
||||
SDL_zeroa(qsa_playback_device);
|
||||
|
||||
Reference in New Issue
Block a user