src/dynapi/SDL_dynapi.c
changeset 8820 0e935d5b193a
parent 8149 681eb46b8ac4
child 9305 0c66e0df64f6
     1.1 --- a/src/dynapi/SDL_dynapi.c	Wed Jun 04 10:56:43 2014 -0700
     1.2 +++ b/src/dynapi/SDL_dynapi.c	Wed Jun 04 10:56:56 2014 -0700
     1.3 @@ -56,38 +56,38 @@
     1.4  #if DISABLE_JUMP_MAGIC
     1.5  /* Can't use the macro for varargs nonsense. This is atrocious. */
     1.6  #define SDL_DYNAPI_VARARGS_LOGFN(_static, name, initcall, logname, prio) \
     1.7 -    _static void SDL_Log##logname##name(int category, const char *fmt, ...) { \
     1.8 +    _static void SDL_Log##logname##name(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \
     1.9          va_list ap; initcall; va_start(ap, fmt); \
    1.10          jump_table.SDL_LogMessageV(category, SDL_LOG_PRIORITY_##prio, fmt, ap); \
    1.11          va_end(ap); \
    1.12      }
    1.13  
    1.14  #define SDL_DYNAPI_VARARGS(_static, name, initcall) \
    1.15 -    _static int SDL_SetError##name(const char *fmt, ...) { \
    1.16 +    _static int SDL_SetError##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \
    1.17          char buf[512]; /* !!! FIXME: dynamic allocation */ \
    1.18          va_list ap; initcall; va_start(ap, fmt); \
    1.19          jump_table.SDL_vsnprintf(buf, sizeof (buf), fmt, ap); \
    1.20          va_end(ap); \
    1.21          return jump_table.SDL_SetError("%s", buf); \
    1.22      } \
    1.23 -    _static int SDL_sscanf##name(const char *buf, const char *fmt, ...) { \
    1.24 +    _static int SDL_sscanf##name(const char *buf, SDL_SCANF_FORMAT_STRING const char *fmt, ...) { \
    1.25          int retval; va_list ap; initcall; va_start(ap, fmt); \
    1.26          retval = jump_table.SDL_vsscanf(buf, fmt, ap); \
    1.27          va_end(ap); \
    1.28          return retval; \
    1.29      } \
    1.30 -    _static int SDL_snprintf##name(char *buf, size_t buflen, const char *fmt, ...) { \
    1.31 +    _static int SDL_snprintf##name(SDL_OUT_Z_CAP(maxlen) char *buf, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \
    1.32          int retval; va_list ap; initcall; va_start(ap, fmt); \
    1.33 -        retval = jump_table.SDL_vsnprintf(buf, buflen, fmt, ap); \
    1.34 +        retval = jump_table.SDL_vsnprintf(buf, maxlen, fmt, ap); \
    1.35          va_end(ap); \
    1.36          return retval; \
    1.37      } \
    1.38 -    _static void SDL_Log##name(const char *fmt, ...) { \
    1.39 +    _static void SDL_Log##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \
    1.40          va_list ap; initcall; va_start(ap, fmt); \
    1.41          jump_table.SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, fmt, ap); \
    1.42          va_end(ap); \
    1.43      } \
    1.44 -    _static void SDL_LogMessage##name(int category, SDL_LogPriority priority, const char *fmt, ...) { \
    1.45 +    _static void SDL_LogMessage##name(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) { \
    1.46          va_list ap; initcall; va_start(ap, fmt); \
    1.47          jump_table.SDL_LogMessageV(category, priority, fmt, ap); \
    1.48          va_end(ap); \