Use consistent style for pointer declarations and casts

This commit is contained in:
Sam Lantinga
2025-06-18 09:26:51 -07:00
parent 390fe65323
commit d7939abf42
105 changed files with 339 additions and 346 deletions

View File

@@ -94,7 +94,7 @@ bool SDL_HasMainCallbacks(void)
return false;
}
SDL_AppResult SDL_InitMainCallbacks(int argc, char* argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
SDL_AppResult SDL_InitMainCallbacks(int argc, char *argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
{
SDL_main_iteration_callback = appiter;
SDL_main_event_callback = appevent;

View File

@@ -24,7 +24,7 @@
* If not, you can special case it here by appending || defined(__YOUR_PLATFORM__) */
#if ( !defined(SDL_MAIN_NEEDED) && !defined(SDL_MAIN_AVAILABLE) ) || defined(SDL_PLATFORM_ANDROID)
int SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
int SDL_RunApp(int argc, char *argv[], SDL_main_func mainFunction, void * reserved)
{
(void)reserved;
@@ -32,7 +32,7 @@ int SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserv
{
// make sure argv isn't NULL, in case some user code doesn't like that
static char dummyargv0[] = { 'S', 'D', 'L', '_', 'a', 'p', 'p', '\0' };
static char* argvdummy[2] = { dummyargv0, NULL };
static char *argvdummy[2] = { dummyargv0, NULL };
argc = 1;
argv = argvdummy;
}

View File

@@ -34,7 +34,7 @@ static void EmscriptenInternalMainloop(void)
}
}
int SDL_EnterAppMainCallbacks(int argc, char* argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
int SDL_EnterAppMainCallbacks(int argc, char *argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
{
const SDL_AppResult rc = SDL_InitMainCallbacks(argc, argv, appinit, appiter, appevent, appquit);
if (rc == SDL_APP_CONTINUE) {

View File

@@ -26,7 +26,7 @@
EM_JS_DEPS(sdlrunapp, "$dynCall,$stringToNewUTF8");
int SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
int SDL_RunApp(int argc, char *argv[], SDL_main_func mainFunction, void * reserved)
{
(void)reserved;

View File

@@ -40,7 +40,7 @@ static BOOL OutOfMemory(void)
/* Gets the arguments with GetCommandLine, converts them to argc and argv
and calls SDL_main */
extern "C"
int SDL_RunApp(int, char**, SDL_main_func mainFunction, void *reserved)
int SDL_RunApp(int, char **, SDL_main_func mainFunction, void *reserved)
{
LPWSTR *argvw;
char **argv;

View File

@@ -51,7 +51,7 @@ static SDL_AppResult GenericIterateMainCallbacks(void)
return SDL_IterateMainCallbacks(!iterate_after_waitevent);
}
int SDL_EnterAppMainCallbacks(int argc, char* argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
int SDL_EnterAppMainCallbacks(int argc, char *argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
{
SDL_AppResult rc = SDL_InitMainCallbacks(argc, argv, appinit, appiter, appevent, appquit);
if (rc == 0) {

View File

@@ -64,7 +64,7 @@ static SDLIosMainCallbacksDisplayLink *globalDisplayLink;
// SDL_RunApp will land in UIApplicationMain, which calls SDL_main from postFinishLaunch, which calls this.
// When we return from here, we're living in the RunLoop, and a CADisplayLink is firing regularly for us.
int SDL_EnterAppMainCallbacks(int argc, char* argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
int SDL_EnterAppMainCallbacks(int argc, char *argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
{
SDL_AppResult rc = SDL_InitMainCallbacks(argc, argv, appinit, appiter, appevent, appquit);
if (rc == SDL_APP_CONTINUE) {

View File

@@ -25,7 +25,7 @@
#include <3ds.h>
int SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
int SDL_RunApp(int argc, char *argv[], SDL_main_func mainFunction, void * reserved)
{
int result;
// init

View File

@@ -22,7 +22,7 @@
#ifdef SDL_PLATFORM_NGAGE
int SDL_EnterAppMainCallbacks(int argc, char* argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
int SDL_EnterAppMainCallbacks(int argc, char *argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
{
// Intentionally does nothing; Callbacks are called using the RunL() method.
return 0;

View File

@@ -24,10 +24,10 @@ extern "C" {
#include "SDL_internal.h"
extern SDL_AppResult SDL_AppInit(void** appstate, int argc, char* argv[]);
extern SDL_AppResult SDL_AppEvent(void* appstate, SDL_Event* event);
extern SDL_AppResult SDL_AppIterate(void* appstate);
extern void SDL_AppQuit(void* appstate, SDL_AppResult result);
extern SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[]);
extern SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event);
extern SDL_AppResult SDL_AppIterate(void *appstate);
extern void SDL_AppQuit(void *appstate, SDL_AppResult result);
#ifdef __cplusplus
}
@@ -48,14 +48,14 @@ GLDEF_C TInt E32Main()
{
// Get args and environment.
int argc = 1;
char* argv[] = { "game", NULL };
char** envp = NULL;
char *argv[] = { "game", NULL };
char **envp = NULL;
// Create lvalue variables for __crt0 arguments.
char** argv_lvalue = argv;
char** envp_lvalue = envp;
char **argv_lvalue = argv;
char **envp_lvalue = envp;
CTrapCleanup* cleanup = CTrapCleanup::New();
CTrapCleanup *cleanup = CTrapCleanup::New();
if (!cleanup)
{
return KErrNoMemory;
@@ -63,7 +63,7 @@ GLDEF_C TInt E32Main()
TRAPD(err,
{
CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
CActiveScheduler *scheduler = new (ELeave) CActiveScheduler();
CleanupStack::PushL(scheduler);
CActiveScheduler::Install(scheduler);
@@ -77,7 +77,7 @@ GLDEF_C TInt E32Main()
__crt0(argc, argv_lvalue, envp_lvalue);
// Increase heap size.
RHeap* newHeap = User::ChunkHeap(NULL, 7500000, 7500000, KMinHeapGrowBy);
RHeap *newHeap = User::ChunkHeap(NULL, 7500000, 7500000, KMinHeapGrowBy);
if (!newHeap)
{
SDL_Log("Error: Failed to create new heap");
@@ -85,7 +85,7 @@ GLDEF_C TInt E32Main()
}
CleanupStack::PushL(newHeap);
RHeap* oldHeap = User::SwitchHeap(newHeap);
RHeap *oldHeap = User::SwitchHeap(newHeap);
TInt targetLatency = 225;
InitAudio(&targetLatency);
@@ -101,7 +101,7 @@ GLDEF_C TInt E32Main()
CleanupStack::PushL(gRenderer);
// Create and start the SDL main runner.
CSDLmain* mainApp = CSDLmain::NewL();
CSDLmain *mainApp = CSDLmain::NewL();
CleanupStack::PushL(mainApp);
mainApp->Start();
@@ -125,9 +125,9 @@ GLDEF_C TInt E32Main()
return err;
}
CSDLmain* CSDLmain::NewL()
CSDLmain *CSDLmain::NewL()
{
CSDLmain* self = new (ELeave) CSDLmain();
CSDLmain *self = new (ELeave) CSDLmain();
CleanupStack::PushL(self);
self->ConstructL();
CleanupStack::Pop(self);
@@ -149,7 +149,7 @@ CSDLmain::~CSDLmain()
void CSDLmain::Start()
{
SetActive();
TRequestStatus* status = &iStatus;
TRequestStatus *status = &iStatus;
User::RequestComplete(status, KErrNone);
}

View File

@@ -28,7 +28,7 @@
class CSDLmain : public CActive
{
public:
static CSDLmain* NewL();
static CSDLmain *NewL();
~CSDLmain();
void Start();

View File

@@ -64,7 +64,7 @@ static void deinit_drivers(void)
deinit_ps2_filesystem_driver();
}
int SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
int SDL_RunApp(int argc, char *argv[], SDL_main_func mainFunction, void * reserved)
{
int res;
(void)reserved;

View File

@@ -69,7 +69,7 @@ int sdl_psp_setup_callbacks(void)
return thid;
}
int SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
int SDL_RunApp(int argc, char *argv[], SDL_main_func mainFunction, void * reserved)
{
(void)reserved;
sdl_psp_setup_callbacks();

View File

@@ -36,7 +36,7 @@ static int OutOfMemory(void)
return -1;
}
int MINGW32_FORCEALIGN SDL_RunApp(int _argc, char* _argv[], SDL_main_func mainFunction, void * reserved)
int MINGW32_FORCEALIGN SDL_RunApp(int _argc, char *_argv[], SDL_main_func mainFunction, void * reserved)
{
/* Gets the arguments with GetCommandLine, converts them to argc and argv
and calls SDL_main */