mirror of
https://github.com/libretro/RetroArch
synced 2025-03-23 10:20:57 +00:00
Cleanups
This commit is contained in:
parent
3072342b2c
commit
7e597c3fd0
@ -33,12 +33,12 @@
|
|||||||
#if _MSC_VER < 1300
|
#if _MSC_VER < 1300
|
||||||
#define _vscprintf c89_vscprintf_retro__
|
#define _vscprintf c89_vscprintf_retro__
|
||||||
|
|
||||||
static int c89_vscprintf_retro__(const char *format, va_list pargs)
|
static int c89_vscprintf_retro__(const char *fmt, va_list pargs)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
va_list argcopy;
|
va_list argcopy;
|
||||||
va_copy(argcopy, pargs);
|
va_copy(argcopy, pargs);
|
||||||
retval = vsnprintf(NULL, 0, format, argcopy);
|
retval = vsnprintf(NULL, 0, fmt, argcopy);
|
||||||
va_end(argcopy);
|
va_end(argcopy);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@ -46,21 +46,21 @@ static int c89_vscprintf_retro__(const char *format, va_list pargs)
|
|||||||
|
|
||||||
/* http://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010 */
|
/* http://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010 */
|
||||||
|
|
||||||
int c99_vsnprintf_retro__(char *s, size_t len, const char *format, va_list ap)
|
int c99_vsnprintf_retro__(char *s, size_t len, const char *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
int count = -1;
|
int count = -1;
|
||||||
|
|
||||||
if (len != 0)
|
if (len != 0)
|
||||||
{
|
{
|
||||||
#if (_MSC_VER <= 1310)
|
#if (_MSC_VER <= 1310)
|
||||||
count = _vsnprintf(s, len - 1, format, ap);
|
count = _vsnprintf(s, len - 1, fmt, ap);
|
||||||
#else
|
#else
|
||||||
count = _vsnprintf_s(s, len, len - 1, format, ap);
|
count = _vsnprintf_s(s, len, len - 1, fmt, ap);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count == -1)
|
if (count == -1)
|
||||||
count = _vscprintf(format, ap);
|
count = _vscprintf(fmt, ap);
|
||||||
|
|
||||||
/* there was no room for a NULL, so truncate the last character */
|
/* there was no room for a NULL, so truncate the last character */
|
||||||
if (count == len && len)
|
if (count == len && len)
|
||||||
@ -69,13 +69,13 @@ int c99_vsnprintf_retro__(char *s, size_t len, const char *format, va_list ap)
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
int c99_snprintf_retro__(char *outBuf, size_t size, const char *format, ...)
|
int c99_snprintf_retro__(char *s, size_t len, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start(ap, format);
|
va_start(ap, fmt);
|
||||||
count = c99_vsnprintf_retro__(outBuf, size, format, ap);
|
count = c99_vsnprintf_retro__(s, len, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user