From a8ad49feade7555574c5a3f16ac9c2ffa950cdeb Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 1 Jun 2019 11:40:16 -0400 Subject: [PATCH] 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. --- common/main.c | 7 +++---- common/uipriv.h | 2 +- test/lib/testing.c | 2 +- test/lib/testingpriv.c | 10 +++++----- test/lib/testingpriv.h | 4 ++-- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/common/main.c b/common/main.c index f4b9c3a2..5654fd4f 100644 --- a/common/main.c +++ b/common/main.c @@ -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"); diff --git a/common/uipriv.h b/common/uipriv.h index 3924ce6e..44b493f0 100644 --- a/common/uipriv.h +++ b/common/uipriv.h @@ -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) diff --git a/test/lib/testing.c b/test/lib/testing.c index cb06084e..877b91a5 100644 --- a/test/lib/testing.c +++ b/test/lib/testing.c @@ -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); } diff --git a/test/lib/testingpriv.c b/test/lib/testingpriv.c index 3891cf84..64fd2658 100644 --- a/test/lib/testingpriv.c +++ b/test/lib/testingpriv.c @@ -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; } diff --git a/test/lib/testingpriv.h b/test/lib/testingpriv.h index 8bf04ac7..5be4fd2d 100644 --- a/test/lib/testingpriv.h +++ b/test/lib/testingpriv.h @@ -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, ...);