Fix warnings about static function and prototype

This commit is contained in:
Sylvain 2023-03-08 11:40:07 +01:00 committed by Sylvain Becker
parent 61309b4382
commit 16bb6a0b3d
30 changed files with 137 additions and 142 deletions

View file

@ -106,7 +106,7 @@ print_modifiers(char **text, size_t *maxlen)
} }
static void static void
PrintModifierState() PrintModifierState(void)
{ {
char message[512]; char message[512];
char *spot; char *spot;
@ -165,7 +165,7 @@ PrintText(const char *eventtype, const char *text)
SDL_Log("%s Text (%s): \"%s%s\"\n", eventtype, expanded, *text == '"' ? "\\" : "", text); SDL_Log("%s Text (%s): \"%s%s\"\n", eventtype, expanded, *text == '"' ? "\\" : "", text);
} }
void loop() static void loop(void)
{ {
SDL_Event event; SDL_Event event;
/* Check for events */ /* Check for events */

View file

@ -25,7 +25,7 @@
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_main.h> #include <SDL3/SDL_main.h>
int done; static int done;
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
static void static void
@ -103,7 +103,7 @@ print_modifiers(char **text, size_t *maxlen)
} }
static void static void
PrintModifierState() PrintModifierState(void)
{ {
char message[512]; char message[512];
char *spot; char *spot;
@ -162,7 +162,7 @@ PrintText(const char *eventtype, const char *text)
SDL_Log("%s Text (%s): \"%s%s\"\n", eventtype, expanded, *text == '"' ? "\\" : "", text); SDL_Log("%s Text (%s): \"%s%s\"\n", eventtype, expanded, *text == '"' ? "\\" : "", text);
} }
void loop() static void loop(void)
{ {
SDL_Event event; SDL_Event event;
/* Check for events */ /* Check for events */

View file

@ -705,7 +705,7 @@ WatchJoystick(SDL_Joystick *joystick)
SDL_DestroyRenderer(screen); SDL_DestroyRenderer(screen);
} }
static SDL_bool HasJoysticks() static SDL_bool HasJoysticks(void)
{ {
int num_joysticks = 0; int num_joysticks = 0;
SDL_JoystickID *joysticks; SDL_JoystickID *joysticks;

View file

@ -44,7 +44,7 @@ quit(int rc)
} }
static void static void
close_audio() close_audio(void)
{ {
if (device != 0) { if (device != 0) {
SDL_CloseAudioDevice(device); SDL_CloseAudioDevice(device);
@ -53,7 +53,7 @@ close_audio()
} }
static void static void
open_audio() open_audio(void)
{ {
/* Initialize fillerup() variables */ /* Initialize fillerup() variables */
device = SDL_OpenAudioDevice(NULL, SDL_FALSE, &wave.spec, NULL, 0); device = SDL_OpenAudioDevice(NULL, SDL_FALSE, &wave.spec, NULL, 0);
@ -68,14 +68,14 @@ open_audio()
} }
#ifndef __EMSCRIPTEN__ #ifndef __EMSCRIPTEN__
static void reopen_audio() static void reopen_audio(void)
{ {
close_audio(); close_audio();
open_audio(); open_audio();
} }
#endif #endif
void SDLCALL static void SDLCALL
fillerup(void *unused, Uint8 *stream, int len) fillerup(void *unused, Uint8 *stream, int len)
{ {
Uint8 *waveptr; Uint8 *waveptr;
@ -101,7 +101,7 @@ fillerup(void *unused, Uint8 *stream, int len)
static int done = 0; static int done = 0;
#ifdef __EMSCRIPTEN__ #ifdef __EMSCRIPTEN__
void loop() static void loop(void)
{ {
if (done || (SDL_GetAudioDeviceStatus(device) != SDL_AUDIO_PLAYING)) { if (done || (SDL_GetAudioDeviceStatus(device) != SDL_AUDIO_PLAYING)) {
emscripten_cancel_main_loop(); emscripten_cancel_main_loop();

View file

@ -43,14 +43,14 @@ quit(int rc)
} }
static int done = 0; static int done = 0;
void poked(int sig) static void poked(int sig)
{ {
done = 1; done = 1;
} }
static SDL_AudioDeviceID g_audio_id = 0; static SDL_AudioDeviceID g_audio_id = 0;
void loop() static void loop(void)
{ {
#ifdef __EMSCRIPTEN__ #ifdef __EMSCRIPTEN__
if (done || (SDL_GetAudioDeviceStatus(g_audio_id) != SDL_AUDIO_PLAYING)) { if (done || (SDL_GetAudioDeviceStatus(g_audio_id) != SDL_AUDIO_PLAYING)) {

View file

@ -41,7 +41,7 @@ quit(int rc)
exit(rc); exit(rc);
} }
void SDLCALL static void SDLCALL
fillerup(void *_pos, Uint8 *stream, int len) fillerup(void *_pos, Uint8 *stream, int len)
{ {
Uint32 pos = *((Uint32 *)_pos); Uint32 pos = *((Uint32 *)_pos);
@ -67,19 +67,18 @@ fillerup(void *_pos, Uint8 *stream, int len)
} }
static int done = 0; static int done = 0;
void poked(int sig)
static void poked(int sig)
{ {
done = 1; done = 1;
} }
static const char * static const char *devtypestr(int iscapture)
devtypestr(int iscapture)
{ {
return iscapture ? "capture" : "output"; return iscapture ? "capture" : "output";
} }
static void static void iteration(void)
iteration()
{ {
SDL_Event e; SDL_Event e;
SDL_AudioDeviceID dev; SDL_AudioDeviceID dev;
@ -122,7 +121,7 @@ iteration()
} }
#ifdef __EMSCRIPTEN__ #ifdef __EMSCRIPTEN__
void loop() static void loop(void)
{ {
if (done) if (done)
emscripten_cancel_main_loop(); emscripten_cancel_main_loop();

View file

@ -132,7 +132,7 @@ init_system_cursor(const char *image[])
} }
static SDLTest_CommonState *state; static SDLTest_CommonState *state;
int done; static int done;
static SDL_Cursor *cursors[1 + SDL_NUM_SYSTEM_CURSORS]; static SDL_Cursor *cursors[1 + SDL_NUM_SYSTEM_CURSORS];
static SDL_SystemCursor cursor_types[1 + SDL_NUM_SYSTEM_CURSORS]; static SDL_SystemCursor cursor_types[1 + SDL_NUM_SYSTEM_CURSORS];
static int num_cursors; static int num_cursors;
@ -147,7 +147,7 @@ quit(int rc)
exit(rc); exit(rc);
} }
void loop() static void loop(void)
{ {
int i; int i;
SDL_Event event; SDL_Event event;

View file

@ -36,9 +36,9 @@ static Uint64 next_fps_check;
static Uint32 frames; static Uint32 frames;
static const int fps_check_delay = 5000; static const int fps_check_delay = 5000;
int done; static int done;
void DrawPoints(SDL_Renderer *renderer) static void DrawPoints(SDL_Renderer *renderer)
{ {
int i; int i;
float x, y; float x, y;
@ -80,7 +80,7 @@ void DrawPoints(SDL_Renderer *renderer)
} }
} }
void DrawLines(SDL_Renderer *renderer) static void DrawLines(SDL_Renderer *renderer)
{ {
int i; int i;
float x1, y1, x2, y2; float x1, y1, x2, y2;
@ -131,7 +131,7 @@ void DrawLines(SDL_Renderer *renderer)
} }
} }
void DrawRects(SDL_Renderer *renderer) static void DrawRects(SDL_Renderer *renderer)
{ {
int i; int i;
SDL_FRect rect; SDL_FRect rect;
@ -175,7 +175,7 @@ void DrawRects(SDL_Renderer *renderer)
} }
} }
void loop() static void loop(void)
{ {
Uint64 now; Uint64 now;
int i; int i;

View file

@ -21,12 +21,13 @@
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_main.h> #include <SDL3/SDL_main.h>
SDL_Window *window; static SDL_Window *window;
SDL_Renderer *renderer; static SDL_Renderer *renderer;
SDL_Surface *surface; static SDL_Surface *surface;
int done; static int done;
void DrawChessBoard()
static void DrawChessBoard(void)
{ {
int row = 0, column = 0, x = 0; int row = 0, column = 0, x = 0;
SDL_FRect rect; SDL_FRect rect;
@ -57,7 +58,7 @@ void DrawChessBoard()
} }
} }
void loop() static void loop(void)
{ {
SDL_Event e; SDL_Event e;
while (SDL_PollEvent(&e)) { while (SDL_PollEvent(&e)) {

View file

@ -166,7 +166,7 @@ static void PrintJoystickInfo(SDL_JoystickID instance_id)
} }
} }
static void UpdateWindowTitle() static void UpdateWindowTitle(void)
{ {
if (window == NULL) { if (window == NULL) {
return; return;
@ -380,7 +380,7 @@ typedef struct
Uint8 ucLedBlue; /* 46 */ Uint8 ucLedBlue; /* 46 */
} DS5EffectsState_t; } DS5EffectsState_t;
static void CyclePS5TriggerEffect() static void CyclePS5TriggerEffect(void)
{ {
DS5EffectsState_t state; DS5EffectsState_t state;
@ -402,7 +402,7 @@ static void CyclePS5TriggerEffect()
SDL_SendGamepadEffect(gamepad, &state, sizeof(state)); SDL_SendGamepadEffect(gamepad, &state, sizeof(state));
} }
static SDL_bool ShowingFront() static SDL_bool ShowingFront(void)
{ {
SDL_bool showing_front = SDL_TRUE; SDL_bool showing_front = SDL_TRUE;
int i; int i;
@ -445,7 +445,7 @@ static int SDLCALL VirtualGamepadSetLED(void *userdata, Uint8 red, Uint8 green,
return 0; return 0;
} }
static void OpenVirtualGamepad() static void OpenVirtualGamepad(void)
{ {
SDL_VirtualJoystickDesc desc; SDL_VirtualJoystickDesc desc;
SDL_JoystickID virtual_id; SDL_JoystickID virtual_id;
@ -471,7 +471,7 @@ static void OpenVirtualGamepad()
} }
} }
static void CloseVirtualGamepad() static void CloseVirtualGamepad(void)
{ {
int i; int i;
SDL_JoystickID *joysticks = SDL_GetJoysticks(NULL); SDL_JoystickID *joysticks = SDL_GetJoysticks(NULL);
@ -617,7 +617,7 @@ static void VirtualGamepadMouseUp(float x, float y)
} }
} }
void loop(void *arg) static void loop(void *arg)
{ {
SDL_Event event; SDL_Event event;
int i; int i;

View file

@ -30,7 +30,7 @@ static SDL_BlendMode blendMode = SDL_BLENDMODE_NONE;
static float angle = 0.0f; static float angle = 0.0f;
static int sprite_w, sprite_h; static int sprite_w, sprite_h;
int done; static int done;
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
static void static void
@ -41,7 +41,7 @@ quit(int rc)
exit(rc); exit(rc);
} }
int LoadSprite(const char *file) static int LoadSprite(const char *file)
{ {
int i; int i;
@ -62,7 +62,7 @@ int LoadSprite(const char *file)
return 0; return 0;
} }
void loop() static void loop(void)
{ {
int i; int i;
SDL_Event event; SDL_Event event;

View file

@ -35,9 +35,9 @@ typedef struct GLES2_Context
} GLES2_Context; } GLES2_Context;
static SDL_Surface *g_surf_sdf = NULL; static SDL_Surface *g_surf_sdf = NULL;
GLenum g_texture; static GLenum g_texture;
GLenum g_texture_type = GL_TEXTURE_2D; static GLenum g_texture_type = GL_TEXTURE_2D;
GLfloat g_verts[24]; static GLfloat g_verts[24];
typedef enum typedef enum
{ {
GLES2_ATTRIBUTE_POSITION = 0, GLES2_ATTRIBUTE_POSITION = 0,
@ -53,7 +53,7 @@ typedef enum
GLES2_UNIFORM_COLOR, GLES2_UNIFORM_COLOR,
} GLES2_Uniform; } GLES2_Uniform;
GLint g_uniform_locations[16]; static GLint g_uniform_locations[16];
static SDLTest_CommonState *state; static SDLTest_CommonState *state;
static SDL_GLContext *context = NULL; static SDL_GLContext *context = NULL;
@ -122,7 +122,7 @@ quit(int rc)
* source: Passed-in shader source code. * source: Passed-in shader source code.
* shader_type: Passed to GL, e.g. GL_VERTEX_SHADER. * shader_type: Passed to GL, e.g. GL_VERTEX_SHADER.
*/ */
void process_shader(GLenum *shader, const char *source, GLenum shader_type) static void process_shader(GLenum *shader, const char *source, GLenum shader_type)
{ {
GLint status = GL_FALSE; GLint status = GL_FALSE;
const char *shaders[1] = { NULL }; const char *shaders[1] = { NULL };
@ -266,7 +266,7 @@ Render(int width, int height, shader_data *data)
GL_CHECK(ctx.glDrawArrays(GL_TRIANGLE_STRIP, 0, 4)); GL_CHECK(ctx.glDrawArrays(GL_TRIANGLE_STRIP, 0, 4));
} }
void renderCopy_angle(float degree_angle) static void renderCopy_angle(float degree_angle)
{ {
const float radian_angle = (float)(3.141592 * degree_angle) / 180.0f; const float radian_angle = (float)(3.141592 * degree_angle) / 180.0f;
const GLfloat s = (GLfloat)SDL_sin(radian_angle); const GLfloat s = (GLfloat)SDL_sin(radian_angle);
@ -282,7 +282,7 @@ void renderCopy_angle(float degree_angle)
*(verts++) = c; *(verts++) = c;
} }
void renderCopy_position(SDL_Rect *srcrect, SDL_Rect *dstrect) static void renderCopy_position(SDL_Rect *srcrect, SDL_Rect *dstrect)
{ {
GLfloat minx, miny, maxx, maxy; GLfloat minx, miny, maxx, maxy;
GLfloat minu, maxu, minv, maxv; GLfloat minu, maxu, minv, maxv;
@ -317,11 +317,11 @@ void renderCopy_position(SDL_Rect *srcrect, SDL_Rect *dstrect)
*(verts++) = maxv; *(verts++) = maxv;
} }
int done; static int done;
Uint32 frames; static Uint32 frames;
shader_data *datas; static shader_data *datas;
void loop() static void loop(void)
{ {
SDL_Event event; SDL_Event event;
int i; int i;

View file

@ -39,10 +39,10 @@ static int current_alpha = 255;
static int current_color = 255; static int current_color = 255;
static SDL_BlendMode blendMode = SDL_BLENDMODE_NONE; static SDL_BlendMode blendMode = SDL_BLENDMODE_NONE;
float mouse_begin_x = -1.0f, mouse_begin_y = -1.0f; static float mouse_begin_x = -1.0f, mouse_begin_y = -1.0f;
int done; static int done;
void DrawPoints(SDL_Renderer *renderer) static void DrawPoints(SDL_Renderer *renderer)
{ {
int i; int i;
float x, y; float x, y;
@ -85,10 +85,9 @@ void DrawPoints(SDL_Renderer *renderer)
} }
#define MAX_LINES 16 #define MAX_LINES 16
int num_lines = 0; static int num_lines = 0;
SDL_FRect lines[MAX_LINES]; static SDL_FRect lines[MAX_LINES];
static int static int add_line(float x1, float y1, float x2, float y2)
add_line(float x1, float y1, float x2, float y2)
{ {
if (num_lines >= MAX_LINES) { if (num_lines >= MAX_LINES) {
return 0; return 0;
@ -106,7 +105,7 @@ add_line(float x1, float y1, float x2, float y2)
return ++num_lines; return ++num_lines;
} }
void DrawLines(SDL_Renderer *renderer) static void DrawLines(SDL_Renderer *renderer)
{ {
int i; int i;
SDL_Rect viewport; SDL_Rect viewport;
@ -129,10 +128,9 @@ void DrawLines(SDL_Renderer *renderer)
} }
#define MAX_RECTS 16 #define MAX_RECTS 16
int num_rects = 0; static int num_rects = 0;
SDL_FRect rects[MAX_RECTS]; static SDL_FRect rects[MAX_RECTS];
static int static int add_rect(float x1, float y1, float x2, float y2)
add_rect(float x1, float y1, float x2, float y2)
{ {
if (num_rects >= MAX_RECTS) { if (num_rects >= MAX_RECTS) {
return 0; return 0;
@ -208,7 +206,7 @@ DrawRectRectIntersections(SDL_Renderer *renderer)
} }
} }
void loop() static void loop(void)
{ {
int i; int i;
SDL_Event event; SDL_Event event;

View file

@ -99,7 +99,7 @@ DrawRect(SDL_Renderer *r, const int x, const int y, const int w, const int h)
SDL_RenderFillRect(r, &area); SDL_RenderFillRect(r, &area);
} }
void loop(void *arg) static void loop(void *arg)
{ {
SDL_Event event; SDL_Event event;
int i; int i;

View file

@ -51,7 +51,7 @@ static float wheel_y = SCREEN_HEIGHT * 0.5f;
static SDL_bool done = SDL_FALSE; static SDL_bool done = SDL_FALSE;
void DrawObject(SDL_Renderer *renderer, Object *object) static void DrawObject(SDL_Renderer *renderer, Object *object)
{ {
SDL_SetRenderDrawColor(renderer, object->r, object->g, object->b, 255); SDL_SetRenderDrawColor(renderer, object->r, object->g, object->b, 255);
@ -80,7 +80,7 @@ void DrawObject(SDL_Renderer *renderer, Object *object)
} }
} }
void DrawObjects(SDL_Renderer *renderer) static void DrawObjects(SDL_Renderer *renderer)
{ {
Object *next = objects; Object *next = objects;
while (next != NULL) { while (next != NULL) {
@ -89,7 +89,7 @@ void DrawObjects(SDL_Renderer *renderer)
} }
} }
void AppendObject(Object *object) static void AppendObject(Object *object)
{ {
if (objects) { if (objects) {
Object *next = objects; Object *next = objects;
@ -102,7 +102,7 @@ void AppendObject(Object *object)
} }
} }
void loop(void *arg) static void loop(void *arg)
{ {
SDL_Renderer *renderer = (SDL_Renderer *)arg; SDL_Renderer *renderer = (SDL_Renderer *)arg;
SDL_Event event; SDL_Event event;

View file

@ -31,9 +31,9 @@ typedef struct
SDL_atomic_t done; SDL_atomic_t done;
} callback_data; } callback_data;
callback_data cbd[64]; static callback_data cbd[64];
void SDLCALL static void SDLCALL
play_through_once(void *arg, Uint8 *stream, int len) play_through_once(void *arg, Uint8 *stream, int len)
{ {
callback_data *cbdata = (callback_data *)arg; callback_data *cbdata = (callback_data *)arg;
@ -54,18 +54,18 @@ play_through_once(void *arg, Uint8 *stream, int len)
} }
} }
void loop() #ifdef __EMSCRIPTEN__
static void loop(void)
{ {
if (SDL_AtomicGet(&cbd[0].done)) { if (SDL_AtomicGet(&cbd[0].done)) {
#ifdef __EMSCRIPTEN__
emscripten_cancel_main_loop(); emscripten_cancel_main_loop();
#endif
SDL_PauseAudioDevice(cbd[0].dev); SDL_PauseAudioDevice(cbd[0].dev);
SDL_CloseAudioDevice(cbd[0].dev); SDL_CloseAudioDevice(cbd[0].dev);
SDL_free(sound); SDL_free(sound);
SDL_Quit(); SDL_Quit();
} }
} }
#endif
static void static void
test_multi_audio(int devcount) test_multi_audio(int devcount)

View file

@ -51,7 +51,7 @@ quit(int rc)
exit(rc); exit(rc);
} }
void MoveSprites(SDL_Renderer *renderer, SDL_Texture *sprite) static void MoveSprites(SDL_Renderer *renderer, SDL_Texture *sprite)
{ {
int sprite_w, sprite_h; int sprite_w, sprite_h;
int i; int i;

View file

@ -31,7 +31,7 @@ static int width = 640;
static int height = 480; static int height = 480;
static unsigned int max_frames = 200; static unsigned int max_frames = 200;
void draw() static void draw(void)
{ {
SDL_FRect rect; SDL_FRect rect;
@ -49,7 +49,7 @@ void draw()
SDL_RenderPresent(renderer); SDL_RenderPresent(renderer);
} }
void save_surface_to_bmp() static void save_surface_to_bmp(void)
{ {
SDL_Surface* surface; SDL_Surface* surface;
Uint32 pixel_format; Uint32 pixel_format;
@ -68,7 +68,7 @@ void save_surface_to_bmp()
SDL_DestroySurface(surface); SDL_DestroySurface(surface);
} }
void loop() static void loop(void)
{ {
SDL_Event event; SDL_Event event;

View file

@ -34,7 +34,7 @@
#define MOOSEFRAMES_COUNT 10 #define MOOSEFRAMES_COUNT 10
/* *INDENT-OFF* */ /* clang-format off */ /* *INDENT-OFF* */ /* clang-format off */
SDL_Color MooseColors[84] = { static SDL_Color MooseColors[84] = {
{49, 49, 49, SDL_ALPHA_OPAQUE} {49, 49, 49, SDL_ALPHA_OPAQUE}
, {66, 24, 0, SDL_ALPHA_OPAQUE} , {66, 24, 0, SDL_ALPHA_OPAQUE}
, {66, 33, 0, SDL_ALPHA_OPAQUE} , {66, 33, 0, SDL_ALPHA_OPAQUE}
@ -147,16 +147,16 @@ static Uint64 next_fps_check;
static Uint32 frames; static Uint32 frames;
static const Uint32 fps_check_delay = 5000; static const Uint32 fps_check_delay = 5000;
SDL_Surface *MooseYUVSurfaces[MOOSEFRAMES_COUNT]; static SDL_Surface *MooseYUVSurfaces[MOOSEFRAMES_COUNT];
SDL_Texture *MooseTexture = NULL; static SDL_Texture *MooseTexture = NULL;
SDL_FRect displayrect; static SDL_FRect displayrect;
int window_w; static int window_w;
int window_h; static int window_h;
int paused = 0; static int paused = 0;
int done = 0; static int done = 0;
static int fpsdelay; static int fpsdelay;
SDL_bool streaming = SDL_TRUE; static SDL_bool streaming = SDL_TRUE;
Uint8 *RawMooseData = NULL; static Uint8 *RawMooseData = NULL;
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
static void static void
@ -182,7 +182,7 @@ quit(int rc)
} }
} }
void MoveSprites(SDL_Renderer *renderer) static void MoveSprites(SDL_Renderer *renderer)
{ {
static int i = 0; static int i = 0;
@ -216,7 +216,7 @@ void MoveSprites(SDL_Renderer *renderer)
} }
void loop() static void loop(void)
{ {
Uint64 now; Uint64 now;
int i; int i;

View file

@ -33,8 +33,8 @@ typedef struct
int scale_direction; int scale_direction;
} DrawState; } DrawState;
DrawState *drawstates; static DrawState *drawstates;
int done; static int done;
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
static void static void
@ -44,7 +44,7 @@ quit(int rc)
exit(rc); exit(rc);
} }
void Draw(DrawState *s) static void Draw(DrawState *s)
{ {
SDL_Rect viewport; SDL_Rect viewport;
SDL_Texture *target; SDL_Texture *target;
@ -86,7 +86,7 @@ void Draw(DrawState *s)
/* SDL_Delay(10); */ /* SDL_Delay(10); */
} }
void loop() static void loop(void)
{ {
int i; int i;
SDL_Event event; SDL_Event event;

View file

@ -33,9 +33,9 @@ typedef struct
int scale_direction; int scale_direction;
} DrawState; } DrawState;
DrawState *drawstates; static DrawState *drawstates;
int done; static int done;
SDL_bool test_composite = SDL_FALSE; static SDL_bool test_composite = SDL_FALSE;
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
static void static void
@ -45,7 +45,7 @@ quit(int rc)
exit(rc); exit(rc);
} }
SDL_bool static SDL_bool
DrawComposite(DrawState *s) DrawComposite(DrawState *s)
{ {
SDL_Rect viewport; SDL_Rect viewport;
@ -129,7 +129,7 @@ DrawComposite(DrawState *s)
return SDL_TRUE; return SDL_TRUE;
} }
SDL_bool static SDL_bool
Draw(DrawState *s) Draw(DrawState *s)
{ {
SDL_Rect viewport; SDL_Rect viewport;
@ -173,7 +173,7 @@ Draw(DrawState *s)
return SDL_TRUE; return SDL_TRUE;
} }
void loop() static void loop(void)
{ {
int i; int i;
SDL_Event event; SDL_Event event;

View file

@ -21,9 +21,6 @@
#include <SDL3/SDL_main.h> #include <SDL3/SDL_main.h>
#include "testutils.h" #include "testutils.h"
#define WINDOW_WIDTH 640
#define WINDOW_HEIGHT 480
static SDLTest_CommonState *state; static SDLTest_CommonState *state;
typedef struct typedef struct
@ -36,8 +33,8 @@ typedef struct
int scale_direction; int scale_direction;
} DrawState; } DrawState;
DrawState *drawstates; static DrawState *drawstates;
int done; static int done;
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
static void static void
@ -47,7 +44,7 @@ quit(int rc)
exit(rc); exit(rc);
} }
void Draw(DrawState *s) static void Draw(DrawState *s)
{ {
SDL_Rect viewport; SDL_Rect viewport;
@ -77,7 +74,7 @@ void Draw(DrawState *s)
SDL_RenderPresent(s->renderer); SDL_RenderPresent(s->renderer);
} }
void loop() static void loop(void)
{ {
int i; int i;
SDL_Event event; SDL_Event event;

View file

@ -24,7 +24,7 @@
#define NUM_OVERHEAD_OPS_MULT 10 #define NUM_OVERHEAD_OPS_MULT 10
static SDL_sem *sem; static SDL_sem *sem;
int alive; static int alive;
typedef struct Thread_State typedef struct Thread_State
{ {

View file

@ -231,7 +231,7 @@ static void DestroyShaderProgram(ShaderData *data)
} }
} }
static SDL_bool InitShaders() static SDL_bool InitShaders(void)
{ {
int i; int i;
@ -285,7 +285,7 @@ static SDL_bool InitShaders()
return SDL_TRUE; return SDL_TRUE;
} }
static void QuitShaders() static void QuitShaders(void)
{ {
int i; int i;
@ -306,7 +306,7 @@ power_of_two(int input)
return value; return value;
} }
GLuint static GLuint
SDL_GL_LoadTexture(SDL_Surface *surface, GLfloat *texcoord) SDL_GL_LoadTexture(SDL_Surface *surface, GLfloat *texcoord)
{ {
GLuint texture; GLuint texture;
@ -356,7 +356,7 @@ SDL_GL_LoadTexture(SDL_Surface *surface, GLfloat *texcoord)
} }
/* A general OpenGL initialization function. Sets all of the initial parameters. */ /* A general OpenGL initialization function. Sets all of the initial parameters. */
void InitGL(int Width, int Height) /* We call this right after our OpenGL window is created. */ static void InitGL(int Width, int Height) /* We call this right after our OpenGL window is created. */
{ {
GLdouble aspect; GLdouble aspect;
@ -377,7 +377,7 @@ void InitGL(int Width, int Height) /* We call this right after our OpenGL window
} }
/* The main drawing function. */ /* The main drawing function. */
void DrawGLScene(SDL_Window *window, GLuint texture, GLfloat *texcoord) static void DrawGLScene(SDL_Window *window, GLuint texture, GLfloat *texcoord)
{ {
/* Texture coordinate lookup, to make it simple */ /* Texture coordinate lookup, to make it simple */
enum enum

View file

@ -47,7 +47,7 @@ static int use_rendergeometry = 0;
/* -1: infinite random moves (default); >=0: enables N deterministic moves */ /* -1: infinite random moves (default); >=0: enables N deterministic moves */
static int iterations = -1; static int iterations = -1;
int done; static int done;
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
static void static void
@ -65,7 +65,7 @@ quit(int rc)
} }
} }
int LoadSprite(const char *file) static int LoadSprite(const char *file)
{ {
int i, w, h; int i, w, h;
@ -88,7 +88,7 @@ int LoadSprite(const char *file)
return 0; return 0;
} }
void MoveSprites(SDL_Renderer *renderer, SDL_Texture *sprite) static void MoveSprites(SDL_Renderer *renderer, SDL_Texture *sprite)
{ {
int i; int i;
SDL_Rect viewport; SDL_Rect viewport;
@ -396,7 +396,7 @@ void MoveSprites(SDL_Renderer *renderer, SDL_Texture *sprite)
SDL_RenderPresent(renderer); SDL_RenderPresent(renderer);
} }
void loop() static void loop(void)
{ {
Uint64 now; Uint64 now;
int i; int i;

View file

@ -32,8 +32,8 @@ static SDL_FRect positions[NUM_SPRITES];
static SDL_FRect velocities[NUM_SPRITES]; static SDL_FRect velocities[NUM_SPRITES];
static int sprite_w, sprite_h; static int sprite_w, sprite_h;
SDL_Renderer *renderer; static SDL_Renderer *renderer;
int done; static int done;
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
static void static void
@ -43,7 +43,7 @@ quit(int rc)
exit(rc); exit(rc);
} }
void MoveSprites() static void MoveSprites(void)
{ {
int i; int i;
int window_w = WINDOW_WIDTH; int window_w = WINDOW_WIDTH;
@ -77,7 +77,7 @@ void MoveSprites()
SDL_RenderPresent(renderer); SDL_RenderPresent(renderer);
} }
void loop() static void loop(void)
{ {
SDL_Event event; SDL_Event event;

View file

@ -32,7 +32,7 @@
#define MOOSEFRAMES_COUNT 10 #define MOOSEFRAMES_COUNT 10
/* *INDENT-OFF* */ /* clang-format off */ /* *INDENT-OFF* */ /* clang-format off */
SDL_Color MooseColors[84] = { static SDL_Color MooseColors[84] = {
{49, 49, 49, 255}, {66, 24, 0, 255}, {66, 33, 0, 255}, {66, 66, 66, 255}, {49, 49, 49, 255}, {66, 24, 0, 255}, {66, 33, 0, 255}, {66, 66, 66, 255},
{66, 115, 49, 255}, {74, 33, 0, 255}, {74, 41, 16, 255}, {82, 33, 8, 255}, {66, 115, 49, 255}, {74, 33, 0, 255}, {74, 41, 16, 255}, {82, 33, 8, 255},
{82, 41, 8, 255}, {82, 49, 16, 255}, {82, 82, 82, 255}, {90, 41, 8, 255}, {82, 41, 8, 255}, {82, 49, 16, 255}, {82, 82, 82, 255}, {90, 41, 8, 255},
@ -57,20 +57,20 @@ SDL_Color MooseColors[84] = {
}; };
/* *INDENT-ON* */ /* clang-format on */ /* *INDENT-ON* */ /* clang-format on */
Uint8 MooseFrames[MOOSEFRAMES_COUNT][MOOSEFRAME_SIZE]; static Uint8 MooseFrames[MOOSEFRAMES_COUNT][MOOSEFRAME_SIZE];
SDL_Renderer *renderer; static SDL_Renderer *renderer;
int frame; static int frame;
SDL_Texture *MooseTexture; static SDL_Texture *MooseTexture;
SDL_bool done = SDL_FALSE; static SDL_bool done = SDL_FALSE;
void quit(int rc) static void quit(int rc)
{ {
SDL_Quit(); SDL_Quit();
exit(rc); exit(rc);
} }
void UpdateTexture(SDL_Texture *texture) static void UpdateTexture(SDL_Texture *texture)
{ {
SDL_Color *color; SDL_Color *color;
Uint8 *src; Uint8 *src;
@ -94,7 +94,7 @@ void UpdateTexture(SDL_Texture *texture)
SDL_UnlockTexture(texture); SDL_UnlockTexture(texture);
} }
void loop() static void loop(void)
{ {
SDL_Event event; SDL_Event event;

View file

@ -41,7 +41,7 @@ quit(int rc)
exit(rc); exit(rc);
} }
void DrawOnViewport(SDL_Renderer *renderer) static void DrawOnViewport(SDL_Renderer *renderer)
{ {
SDL_FRect rect; SDL_FRect rect;
SDL_Rect cliprect; SDL_Rect cliprect;
@ -102,7 +102,7 @@ void DrawOnViewport(SDL_Renderer *renderer)
SDL_SetRenderClipRect(renderer, NULL); SDL_SetRenderClipRect(renderer, NULL);
} }
void loop() static void loop(void)
{ {
SDL_Event event; SDL_Event event;
int i; int i;

View file

@ -21,7 +21,7 @@
#include <SDL3/SDL_main.h> #include <SDL3/SDL_main.h>
static SDLTest_CommonState *state; static SDLTest_CommonState *state;
int done; static int done;
static const char *cursorNames[] = { static const char *cursorNames[] = {
"arrow", "arrow",
@ -37,10 +37,10 @@ static const char *cursorNames[] = {
"NO", "NO",
"hand", "hand",
}; };
int system_cursor = -1; static int system_cursor = -1;
SDL_Cursor *cursor = NULL; static SDL_Cursor *cursor = NULL;
SDL_bool relative_mode = SDL_FALSE; static SDL_bool relative_mode = SDL_FALSE;
const SDL_DisplayMode *highlighted_mode = NULL; static const SDL_DisplayMode *highlighted_mode = NULL;
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
static void static void
@ -150,7 +150,7 @@ draw_modes_menu(SDL_Window *window, SDL_Renderer *renderer, SDL_FRect viewport)
} }
} }
void loop() static void loop(void)
{ {
int i; int i;
SDL_Event event; SDL_Event event;

View file

@ -30,7 +30,7 @@ quit(int rc)
exit(rc); exit(rc);
} }
int SDLCALL static int SDLCALL
SubThreadFunc(void *data) SubThreadFunc(void *data)
{ {
while (!*(int volatile *)data) { while (!*(int volatile *)data) {
@ -39,7 +39,7 @@ SubThreadFunc(void *data)
return 0; return 0;
} }
int SDLCALL static int SDLCALL
ThreadFunc(void *data) ThreadFunc(void *data)
{ {
SDL_Thread *sub_threads[NUMTHREADS]; SDL_Thread *sub_threads[NUMTHREADS];