diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-05-14 00:05:04 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-05-14 08:20:48 +0200 |
commit | 402b19dbfca724a20488d1f15964f10b8459b597 (patch) | |
tree | e2e69f51821f4ed5f176e5bfbda2fc754a9708a8 /lib/mprintf.c | |
parent | e0d04e0c5fb970f4b7a117dcb8b481e077014ac3 (diff) | |
download | curl-bagder/remove-typedef-structs.tar.gz |
source cleanup: remove all custom typedef structsbagder/remove-typedef-structs
- Stick to a single unified way to use structs
- Make checksrc complain on 'typedef struct {'
- Allow them in tests, public headers and examples
- Let MD4_CTX, MD5_CTX, and SHA256_CTX typedefs remain as they actually
typedef different types/structs depending on build conditions.
Diffstat (limited to 'lib/mprintf.c')
-rw-r--r-- | lib/mprintf.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/mprintf.c b/lib/mprintf.c index d6d836c02..63c9d11a5 100644 --- a/lib/mprintf.c +++ b/lib/mprintf.c @@ -146,7 +146,7 @@ enum { FLAGS_FLOATG = 1<<19 /* %g or %G */ }; -typedef struct { +struct va_stack { FormatType type; int flags; long width; /* width OR width parameter number */ @@ -160,7 +160,7 @@ typedef struct { } num; double dnum; } data; -} va_stack_t; +}; struct nsprintf { char *buffer; @@ -223,8 +223,8 @@ static bool dprintf_IsQualifierNoDollar(const char *fmt) * ******************************************************************/ -static int dprintf_Pass1(const char *format, va_stack_t *vto, char **endpos, - va_list arglist) +static int dprintf_Pass1(const char *format, struct va_stack *vto, + char **endpos, va_list arglist) { char *fmt = (char *)format; int param_num = 0; @@ -570,13 +570,11 @@ static int dprintf_formatf( long param; /* current parameter to read */ long param_num = 0; /* parameter counter */ - va_stack_t vto[MAX_PARAMETERS]; + struct va_stack vto[MAX_PARAMETERS]; char *endpos[MAX_PARAMETERS]; char **end; - char work[BUFFSIZE]; - - va_stack_t *p; + struct va_stack *p; /* 'workend' points to the final buffer byte position, but with an extra byte as margin to avoid the (false?) warning Coverity gives us |