1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-01 18:43:33 +02:00

Mark all vlog functions with printf attributes

This ensures that compiler warnings about format strings will apply to
all calls of these functions as well.
This commit is contained in:
Misa 2021-09-27 20:49:09 -07:00
parent 5533215019
commit 3decf54dbc
2 changed files with 10 additions and 8 deletions

View File

@ -83,7 +83,7 @@ void vlog_toggle_error(const int enable_error)
error_enabled = enable_error;
}
int vlog_debug(const char* text, ...)
SDL_PRINTF_VARARG_FUNC(1) int vlog_debug(const char* text, ...)
{
va_list list;
int retval;
@ -107,7 +107,7 @@ int vlog_debug(const char* text, ...)
return retval;
}
int vlog_info(const char* text, ...)
SDL_PRINTF_VARARG_FUNC(1) int vlog_info(const char* text, ...)
{
va_list list;
int retval;
@ -131,7 +131,7 @@ int vlog_info(const char* text, ...)
return retval;
}
int vlog_warn(const char* text, ...)
SDL_PRINTF_VARARG_FUNC(1) int vlog_warn(const char* text, ...)
{
va_list list;
int retval;
@ -155,7 +155,7 @@ int vlog_warn(const char* text, ...)
return retval;
}
int vlog_error(const char* text, ...)
SDL_PRINTF_VARARG_FUNC(1) int vlog_error(const char* text, ...)
{
va_list list;
int retval;

View File

@ -6,6 +6,8 @@ extern "C"
{
#endif
#include <SDL_stdinc.h>
void vlog_init(void);
void vlog_toggle_output(int enable_output);
@ -20,13 +22,13 @@ void vlog_toggle_warn(int enable_warn);
void vlog_toggle_error(int enable_error);
int vlog_debug(const char* text, ...);
SDL_PRINTF_VARARG_FUNC(1) int vlog_debug(const char* text, ...);
int vlog_info(const char* text, ...);
SDL_PRINTF_VARARG_FUNC(1) int vlog_info(const char* text, ...);
int vlog_warn(const char* text, ...);
SDL_PRINTF_VARARG_FUNC(1) int vlog_warn(const char* text, ...);
int vlog_error(const char* text, ...);
SDL_PRINTF_VARARG_FUNC(1) int vlog_error(const char* text, ...);
#ifdef __cplusplus
} /* extern "C" */