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
(cherry picked from commit 5750bcb174
)
This commit is contained in:
parent
5c4bc807f7
commit
b8d85c6939
764 changed files with 50598 additions and 54407 deletions
|
@ -12,8 +12,7 @@
|
|||
|
||||
#include "SDL.h"
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
SDL_AudioSpec spec;
|
||||
SDL_AudioCVT cvt;
|
||||
|
@ -57,7 +56,7 @@ main(int argc, char **argv)
|
|||
}
|
||||
|
||||
cvt.len = len;
|
||||
cvt.buf = (Uint8 *) SDL_malloc(len * cvt.len_mult);
|
||||
cvt.buf = (Uint8 *)SDL_malloc(len * cvt.len_mult);
|
||||
if (cvt.buf == NULL) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory.\n");
|
||||
SDL_FreeWAV(data);
|
||||
|
@ -88,19 +87,19 @@ main(int argc, char **argv)
|
|||
blockalign = (bitsize / 8) * cvtchans;
|
||||
avgbytes = cvtfreq * blockalign;
|
||||
|
||||
SDL_WriteLE32(io, 0x46464952); /* RIFF */
|
||||
SDL_WriteLE32(io, 0x46464952); /* RIFF */
|
||||
SDL_WriteLE32(io, cvt.len_cvt + 36);
|
||||
SDL_WriteLE32(io, 0x45564157); /* WAVE */
|
||||
SDL_WriteLE32(io, 0x20746D66); /* fmt */
|
||||
SDL_WriteLE32(io, 16); /* chunk size */
|
||||
SDL_WriteLE16(io, SDL_AUDIO_ISFLOAT(spec.format) ? 3 : 1); /* uncompressed */
|
||||
SDL_WriteLE16(io, cvtchans); /* channels */
|
||||
SDL_WriteLE32(io, cvtfreq); /* sample rate */
|
||||
SDL_WriteLE32(io, avgbytes); /* average bytes per second */
|
||||
SDL_WriteLE16(io, blockalign); /* block align */
|
||||
SDL_WriteLE16(io, bitsize); /* significant bits per sample */
|
||||
SDL_WriteLE32(io, 0x61746164); /* data */
|
||||
SDL_WriteLE32(io, cvt.len_cvt); /* size */
|
||||
SDL_WriteLE32(io, 0x45564157); /* WAVE */
|
||||
SDL_WriteLE32(io, 0x20746D66); /* fmt */
|
||||
SDL_WriteLE32(io, 16); /* chunk size */
|
||||
SDL_WriteLE16(io, SDL_AUDIO_ISFLOAT(spec.format) ? 3 : 1); /* uncompressed */
|
||||
SDL_WriteLE16(io, cvtchans); /* channels */
|
||||
SDL_WriteLE32(io, cvtfreq); /* sample rate */
|
||||
SDL_WriteLE32(io, avgbytes); /* average bytes per second */
|
||||
SDL_WriteLE16(io, blockalign); /* block align */
|
||||
SDL_WriteLE16(io, bitsize); /* significant bits per sample */
|
||||
SDL_WriteLE32(io, 0x61746164); /* data */
|
||||
SDL_WriteLE32(io, cvt.len_cvt); /* size */
|
||||
SDL_RWwrite(io, cvt.buf, cvt.len_cvt, 1);
|
||||
|
||||
if (SDL_RWclose(io) == -1) {
|
||||
|
@ -109,12 +108,12 @@ main(int argc, char **argv)
|
|||
SDL_FreeWAV(data);
|
||||
SDL_Quit();
|
||||
return 8;
|
||||
} /* if */
|
||||
} /* if */
|
||||
|
||||
SDL_free(cvt.buf);
|
||||
SDL_FreeWAV(data);
|
||||
SDL_Quit();
|
||||
return 0;
|
||||
} /* main */
|
||||
} /* main */
|
||||
|
||||
/* end of testresample.c ... */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue