Updated logging functions for SDL3 naming convention

This commit is contained in:
Sam Lantinga
2024-05-16 10:00:50 -07:00
parent 241603b607
commit 4609af618a
74 changed files with 137 additions and 105 deletions

View File

@@ -50,7 +50,7 @@ int SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
}
}
if (SDL_LogGetPriority(SDL_LOG_CATEGORY_ERROR) <= SDL_LOG_PRIORITY_DEBUG) {
if (SDL_GetLogPriority(SDL_LOG_CATEGORY_ERROR) <= SDL_LOG_PRIORITY_DEBUG) {
/* If we are in debug mode, print out the error message */
SDL_LogDebug(SDL_LOG_CATEGORY_ERROR, "%s", error->str);
}

View File

@@ -117,14 +117,14 @@ void SDL_InitLog(void)
void SDL_QuitLog(void)
{
SDL_LogResetPriorities();
SDL_ResetLogPriorities();
if (log_function_mutex) {
SDL_DestroyMutex(log_function_mutex);
log_function_mutex = NULL;
}
}
void SDL_LogSetAllPriority(SDL_LogPriority priority)
void SDL_SetLogPriorities(SDL_LogPriority priority)
{
SDL_LogLevel *entry;
@@ -136,7 +136,7 @@ void SDL_LogSetAllPriority(SDL_LogPriority priority)
SDL_forced_priority_level = priority;
}
void SDL_LogSetPriority(int category, SDL_LogPriority priority)
void SDL_SetLogPriority(int category, SDL_LogPriority priority)
{
SDL_LogLevel *entry;
@@ -273,7 +273,7 @@ static SDL_LogPriority SDL_GetDefaultLogPriority(int category)
}
}
SDL_LogPriority SDL_LogGetPriority(int category)
SDL_LogPriority SDL_GetLogPriority(int category)
{
SDL_LogLevel *entry;
@@ -290,7 +290,7 @@ SDL_LogPriority SDL_LogGetPriority(int category)
return SDL_GetDefaultLogPriority(category);
}
void SDL_LogResetPriorities(void)
void SDL_ResetLogPriorities(void)
{
SDL_LogLevel *entry;
@@ -406,7 +406,7 @@ void SDL_LogMessageV(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_S
}
/* See if we want to do anything with this message */
if (priority < SDL_LogGetPriority(category)) {
if (priority < SDL_GetLogPriority(category)) {
return;
}

View File

@@ -555,13 +555,13 @@ SDL3_0.0.0 {
SDL_LogCritical;
SDL_LogDebug;
SDL_LogError;
SDL_LogGetPriority;
SDL_GetLogPriority;
SDL_LogInfo;
SDL_LogMessage;
SDL_LogMessageV;
SDL_LogResetPriorities;
SDL_LogSetAllPriority;
SDL_LogSetPriority;
SDL_ResetLogPriorities;
SDL_SetLogPriorities;
SDL_SetLogPriority;
SDL_LogVerbose;
SDL_LogWarn;
SDL_MapRGB;

View File

@@ -580,13 +580,13 @@
#define SDL_LogCritical SDL_LogCritical_REAL
#define SDL_LogDebug SDL_LogDebug_REAL
#define SDL_LogError SDL_LogError_REAL
#define SDL_LogGetPriority SDL_LogGetPriority_REAL
#define SDL_GetLogPriority SDL_GetLogPriority_REAL
#define SDL_LogInfo SDL_LogInfo_REAL
#define SDL_LogMessage SDL_LogMessage_REAL
#define SDL_LogMessageV SDL_LogMessageV_REAL
#define SDL_LogResetPriorities SDL_LogResetPriorities_REAL
#define SDL_LogSetAllPriority SDL_LogSetAllPriority_REAL
#define SDL_LogSetPriority SDL_LogSetPriority_REAL
#define SDL_ResetLogPriorities SDL_ResetLogPriorities_REAL
#define SDL_SetLogPriorities SDL_SetLogPriorities_REAL
#define SDL_SetLogPriority SDL_SetLogPriority_REAL
#define SDL_LogVerbose SDL_LogVerbose_REAL
#define SDL_LogWarn SDL_LogWarn_REAL
#define SDL_MapRGB SDL_MapRGB_REAL

View File

@@ -606,11 +606,11 @@ SDL_DYNAPI_PROC(void,SDL_LockSpinlock,(SDL_SpinLock *a),(a),)
SDL_DYNAPI_PROC(int,SDL_LockSurface,(SDL_Surface *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_LockTexture,(SDL_Texture *a, const SDL_Rect *b, void **c, int *d),(a,b,c,d),return)
SDL_DYNAPI_PROC(int,SDL_LockTextureToSurface,(SDL_Texture *a, const SDL_Rect *b, SDL_Surface **c),(a,b,c),return)
SDL_DYNAPI_PROC(SDL_LogPriority,SDL_LogGetPriority,(int a),(a),return)
SDL_DYNAPI_PROC(SDL_LogPriority,SDL_GetLogPriority,(int a),(a),return)
SDL_DYNAPI_PROC(void,SDL_LogMessageV,(int a, SDL_LogPriority b, SDL_PRINTF_FORMAT_STRING const char *c, va_list d),(a,b,c,d),)
SDL_DYNAPI_PROC(void,SDL_LogResetPriorities,(void),(),)
SDL_DYNAPI_PROC(void,SDL_LogSetAllPriority,(SDL_LogPriority a),(a),)
SDL_DYNAPI_PROC(void,SDL_LogSetPriority,(int a, SDL_LogPriority b),(a,b),)
SDL_DYNAPI_PROC(void,SDL_ResetLogPriorities,(void),(),)
SDL_DYNAPI_PROC(void,SDL_SetLogPriorities,(SDL_LogPriority a),(a),)
SDL_DYNAPI_PROC(void,SDL_SetLogPriority,(int a, SDL_LogPriority b),(a,b),)
SDL_DYNAPI_PROC(Uint32,SDL_MapRGB,(const SDL_PixelFormat *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return)
SDL_DYNAPI_PROC(Uint32,SDL_MapRGBA,(const SDL_PixelFormat *a, Uint8 b, Uint8 c, Uint8 d, Uint8 e),(a,b,c,d,e),return)
SDL_DYNAPI_PROC(int,SDL_MaximizeWindow,(SDL_Window *a),(a),return)

View File

@@ -181,31 +181,31 @@ int SDLTest_CommonArg(SDLTest_CommonState *state, int index)
return -1;
}
if (SDL_strcasecmp(argv[index], "all") == 0) {
SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE);
SDL_SetLogPriorities(SDL_LOG_PRIORITY_VERBOSE);
return 2;
}
if (SDL_strcasecmp(argv[index], "error") == 0) {
SDL_LogSetPriority(SDL_LOG_CATEGORY_ERROR, SDL_LOG_PRIORITY_VERBOSE);
SDL_SetLogPriority(SDL_LOG_CATEGORY_ERROR, SDL_LOG_PRIORITY_VERBOSE);
return 2;
}
if (SDL_strcasecmp(argv[index], "system") == 0) {
SDL_LogSetPriority(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_VERBOSE);
SDL_SetLogPriority(SDL_LOG_CATEGORY_SYSTEM, SDL_LOG_PRIORITY_VERBOSE);
return 2;
}
if (SDL_strcasecmp(argv[index], "audio") == 0) {
SDL_LogSetPriority(SDL_LOG_CATEGORY_AUDIO, SDL_LOG_PRIORITY_VERBOSE);
SDL_SetLogPriority(SDL_LOG_CATEGORY_AUDIO, SDL_LOG_PRIORITY_VERBOSE);
return 2;
}
if (SDL_strcasecmp(argv[index], "video") == 0) {
SDL_LogSetPriority(SDL_LOG_CATEGORY_VIDEO, SDL_LOG_PRIORITY_VERBOSE);
SDL_SetLogPriority(SDL_LOG_CATEGORY_VIDEO, SDL_LOG_PRIORITY_VERBOSE);
return 2;
}
if (SDL_strcasecmp(argv[index], "render") == 0) {
SDL_LogSetPriority(SDL_LOG_CATEGORY_RENDER, SDL_LOG_PRIORITY_VERBOSE);
SDL_SetLogPriority(SDL_LOG_CATEGORY_RENDER, SDL_LOG_PRIORITY_VERBOSE);
return 2;
}
if (SDL_strcasecmp(argv[index], "input") == 0) {
SDL_LogSetPriority(SDL_LOG_CATEGORY_INPUT, SDL_LOG_PRIORITY_VERBOSE);
SDL_SetLogPriority(SDL_LOG_CATEGORY_INPUT, SDL_LOG_PRIORITY_VERBOSE);
return 2;
}
return -1;