Made the names of format string arguments across the board consistent. Only the "public" functions in the testing library are kept expanded for documentation purposes.

This commit is contained in:
Pietro Gagliardi 2019-06-01 11:40:16 -04:00
parent 76fabb37cf
commit a8ad49fead
5 changed files with 12 additions and 13 deletions

View File

@ -22,14 +22,13 @@ bool uiInit(void *options, uiInitError *err)
return true;
}
// TODO rename all msgs to fmt
bool uiprivInitReturnErrorf(uiInitError *err, const char *msg, ...)
bool uiprivInitReturnErrorf(uiInitError *err, const char *fmt, ...)
{
int n;
va_list ap;
va_start(ap, msg);
n = uiprivVsnprintf(err->Message, 256, msg, ap);
va_start(ap, fmt);
n = uiprivVsnprintf(err->Message, 256, fmt, ap);
va_end(ap);
if (n < 0)
uiprivInternalError("encoding error returning initialization error; this means something is very very wrong with libui itself");

View File

@ -30,7 +30,7 @@ extern "C" {
// main.c
extern bool uiprivSysInit(void *options, uiInitError *err);
extern bool uiprivInitReturnErrorf(uiInitError *err, const char *msg, ...);
extern bool uiprivInitReturnErrorf(uiInitError *err, const char *fmt, ...);
extern void uiprivSysQueueMain(void (*f)(void *data), void *data);
extern bool uiprivCheckInitializedAndThreadImpl(const char *func);
#define uiprivCheckInitializedAndThread() uiprivCheckInitializedAndThreadImpl(uiprivFunc)

View File

@ -188,7 +188,7 @@ void testingprivTLogfFull(testingT *t, const char *file, long line, const char *
{
va_list ap;
va_start(ap, format);
va_start(ap, fmt);
testingprivTLogvfFull(t, file, line, format, ap);
va_end(ap);
}

View File

@ -31,23 +31,23 @@ void testingprivInternalError(const char *fmt, ...)
#undef sharedbitsStatic
#undef sharedbitsPrefix
int testingprivVsnprintf(char *s, size_t n, const char *format, va_list ap)
int testingprivVsnprintf(char *s, size_t n, const char *fmt, va_list ap)
{
int ret;
ret = testingprivImplVsnprintf(s, n, format, ap);
ret = testingprivImplVsnprintf(s, n, fmt, ap);
if (ret < 0)
testingprivInternalError("encoding error in vsnprintf(); this likely means your call to testingTLogf() and the like is invalid");
return ret;
}
int testingprivSnprintf(char *s, size_t n, const char *format, ...)
int testingprivSnprintf(char *s, size_t n, const char *fmt, ...)
{
va_list ap;
int ret;
va_start(ap, format);
ret = testingprivVsnprintf(s, n, format, ap);
va_start(ap, fmt);
ret = testingprivVsnprintf(s, n, fmt, ap);
va_end(ap);
return ret;
}

View File

@ -17,8 +17,8 @@ extern void testingprivInternalError(const char *fmt, ...);
#undef sharedbitsPrefix
extern int testingprivVsnprintf(char *s, size_t n, const char *format, va_list ap);
extern int testingprivSnprintf(char *s, size_t n, const char *format, ...);
extern int testingprivVsnprintf(char *s, size_t n, const char *fmt, va_list ap);
extern int testingprivSnprintf(char *s, size_t n, const char *fmt, ...);
extern char *testingprivStrdup(const char *s);
extern char *testingprivVsmprintf(const char *fmt, va_list ap);
extern char *testingprivSmprintf(const char *fmt, ...);