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

@@ -136,7 +136,7 @@ char *SDL_SYS_GetUserFolder(SDL_Folder folder)
return NULL;
#else
char *result = NULL;
const char* base;
const char *base;
NSArray *array;
NSSearchPathDirectory dir;
NSString *str;

View File

@@ -111,7 +111,7 @@ char *SDL_SYS_GetPrefPath(const char *org, const char *app)
return NULL;
}
folderPath = (char*) SDL_malloc(MAX_PATH);
folderPath = (char *)SDL_malloc(MAX_PATH);
do {
result = XGameSaveFilesGetFolderWithUiResult(&block, MAX_PATH, folderPath);
} while (result == E_PENDING);

View File

@@ -20,7 +20,7 @@
*/
#include "SDL_internal.h"
extern void NGAGE_GetAppPath(char* path);
extern void NGAGE_GetAppPath(char *path);
char *SDL_SYS_GetBasePath(void)
{

View File

@@ -37,7 +37,7 @@ extern "C" {
extern "C" {
#endif
void NGAGE_GetAppPath(char* path)
void NGAGE_GetAppPath(char *path)
{
TBuf<512> aPath;
@@ -50,7 +50,7 @@ void NGAGE_GetAppPath(char* path)
CnvUtfConverter::ConvertFromUnicodeToUtf8(utf8Path, aPath);
// Copy UTF-8 data to the provided char* buffer.
strncpy(path, (const char*)utf8Path.Ptr(), utf8Path.Length());
strncpy(path, (const char *)utf8Path.Ptr(), utf8Path.Length());
path[utf8Path.Length()] = '\0';
// Replace backslashes with forward slashes.

View File

@@ -377,7 +377,7 @@ static char *xdg_user_dir_lookup_with_fallback (const char *type, const char *fa
if (!config_home || config_home[0] == 0)
{
l = SDL_strlen (home_dir) + SDL_strlen ("/.config/user-dirs.dirs") + 1;
config_file = (char*) SDL_malloc (l);
config_file = (char *)SDL_malloc (l);
if (!config_file)
goto error;
@@ -387,7 +387,7 @@ static char *xdg_user_dir_lookup_with_fallback (const char *type, const char *fa
else
{
l = SDL_strlen (config_home) + SDL_strlen ("/user-dirs.dirs") + 1;
config_file = (char*) SDL_malloc (l);
config_file = (char *)SDL_malloc (l);
if (!config_file)
goto error;
@@ -449,7 +449,7 @@ static char *xdg_user_dir_lookup_with_fallback (const char *type, const char *fa
if (relative)
{
l = SDL_strlen (home_dir) + 1 + SDL_strlen (p) + 1;
user_dir = (char*) SDL_malloc (l);
user_dir = (char *)SDL_malloc (l);
if (!user_dir)
goto error2;
@@ -458,7 +458,7 @@ static char *xdg_user_dir_lookup_with_fallback (const char *type, const char *fa
}
else
{
user_dir = (char*) SDL_malloc (SDL_strlen (p) + 1);
user_dir = (char *)SDL_malloc (SDL_strlen (p) + 1);
if (!user_dir)
goto error2;
@@ -503,7 +503,7 @@ static char *xdg_user_dir_lookup (const char *type)
// Special case desktop for historical compatibility
if (SDL_strcmp(type, "DESKTOP") == 0) {
size_t length = SDL_strlen(home_dir) + SDL_strlen("/Desktop") + 1;
user_dir = (char*) SDL_malloc(length);
user_dir = (char *)SDL_malloc(length);
if (!user_dir)
return NULL;