mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-15 14:26:01 +00:00
Update for SDL3 coding style (#6717)
I updated .clang-format and ran clang-format 14 over the src and test directories to standardize the code base. In general I let clang-format have it's way, and added markup to prevent formatting of code that would break or be completely unreadable if formatted. The script I ran for the src directory is added as build-scripts/clang-format-src.sh This fixes: #6592 #6593 #6594
This commit is contained in:
@@ -41,8 +41,7 @@ extern "C"
|
||||
|
||||
/* !!! FIXME: have the callback call the higher level to avoid code dupe. */
|
||||
/* The Haiku callback for handling the audio buffer */
|
||||
static void
|
||||
FillSound(void *device, void *stream, size_t len,
|
||||
static void FillSound(void *device, void *stream, size_t len,
|
||||
const media_raw_audio_format & format)
|
||||
{
|
||||
SDL_AudioDevice *audio = (SDL_AudioDevice *) device;
|
||||
@@ -84,8 +83,7 @@ FillSound(void *device, void *stream, size_t len,
|
||||
SDL_UnlockMutex(audio->mixer_lock);
|
||||
}
|
||||
|
||||
static void
|
||||
HAIKUAUDIO_CloseDevice(_THIS)
|
||||
static void HAIKUAUDIO_CloseDevice(_THIS)
|
||||
{
|
||||
if (_this->hidden->audio_obj) {
|
||||
_this->hidden->audio_obj->Stop();
|
||||
@@ -99,8 +97,7 @@ static const int sig_list[] = {
|
||||
SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGWINCH, 0
|
||||
};
|
||||
|
||||
static inline void
|
||||
MaskSignals(sigset_t * omask)
|
||||
static inline void MaskSignals(sigset_t * omask)
|
||||
{
|
||||
sigset_t mask;
|
||||
int i;
|
||||
@@ -112,15 +109,13 @@ MaskSignals(sigset_t * omask)
|
||||
sigprocmask(SIG_BLOCK, &mask, omask);
|
||||
}
|
||||
|
||||
static inline void
|
||||
UnmaskSignals(sigset_t * omask)
|
||||
static inline void UnmaskSignals(sigset_t * omask)
|
||||
{
|
||||
sigprocmask(SIG_SETMASK, omask, NULL);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
HAIKUAUDIO_OpenDevice(_THIS, const char *devname)
|
||||
static int HAIKUAUDIO_OpenDevice(_THIS, const char *devname)
|
||||
{
|
||||
media_raw_audio_format format;
|
||||
SDL_AudioFormat test_format;
|
||||
@@ -207,14 +202,12 @@ HAIKUAUDIO_OpenDevice(_THIS, const char *devname)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
HAIKUAUDIO_Deinitialize(void)
|
||||
static void HAIKUAUDIO_Deinitialize(void)
|
||||
{
|
||||
SDL_QuitBeApp();
|
||||
}
|
||||
|
||||
static SDL_bool
|
||||
HAIKUAUDIO_Init(SDL_AudioDriverImpl * impl)
|
||||
static SDL_bool HAIKUAUDIO_Init(SDL_AudioDriverImpl * impl)
|
||||
{
|
||||
/* Initialize the Be Application, if it's not already started */
|
||||
if (SDL_InitBeApp() < 0) {
|
||||
|
Reference in New Issue
Block a user