From 95f7965d09a6eb4447c0de5a679114492cac3f37 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Sun, 9 Feb 2020 14:21:56 +0200 Subject: *: Remove parenthesis on return for constants Signed-off-by: Donatas Abraitis --- lib/printf/printf-pos.c | 36 ++++++++++++++++++------------------ lib/printf/vfprintf.c | 6 +++--- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'lib/printf') diff --git a/lib/printf/printf-pos.c b/lib/printf/printf-pos.c index 45e4f86229..20a58eacdc 100644 --- a/lib/printf/printf-pos.c +++ b/lib/printf/printf-pos.c @@ -125,11 +125,11 @@ _ensurespace(struct typetable *types) if (types->nextarg >= types->tablesize) { if (__grow_type_table(types)) - return (-1); + return -1; } if (types->nextarg > types->tablemax) types->tablemax = types->nextarg; - return (0); + return 0; } /* @@ -141,9 +141,9 @@ addtype(struct typetable *types, enum typeid type) { if (_ensurespace(types)) - return (-1); + return -1; types->table[types->nextarg++] = type; - return (0); + return 0; } static inline int @@ -151,7 +151,7 @@ addsarg(struct typetable *types, int flags) { if (_ensurespace(types)) - return (-1); + return -1; if (flags & LONGDBL) types->table[types->nextarg++] = T_INT64T; else if (flags & INTMAXT) @@ -166,7 +166,7 @@ addsarg(struct typetable *types, int flags) types->table[types->nextarg++] = T_LONG; else types->table[types->nextarg++] = T_INT; - return (0); + return 0; } static inline int @@ -174,7 +174,7 @@ adduarg(struct typetable *types, int flags) { if (_ensurespace(types)) - return (-1); + return -1; if (flags & LONGDBL) types->table[types->nextarg++] = T_UINT64T; else if (flags & INTMAXT) @@ -189,7 +189,7 @@ adduarg(struct typetable *types, int flags) types->table[types->nextarg++] = T_U_LONG; else types->table[types->nextarg++] = T_U_INT; - return (0); + return 0; } /* @@ -211,14 +211,14 @@ addaster(struct typetable *types, char **fmtp) u_int hold = types->nextarg; types->nextarg = n2; if (addtype(types, T_INT)) - return (-1); + return -1; types->nextarg = hold; *fmtp = ++cp; } else { if (addtype(types, T_INT)) - return (-1); + return -1; } - return (0); + return 0; } #ifdef WCHAR_SUPPORT @@ -238,14 +238,14 @@ addwaster(struct typetable *types, wchar_t **fmtp) u_int hold = types->nextarg; types->nextarg = n2; if (addtype(types, T_INT)) - return (-1); + return -1; types->nextarg = hold; *fmtp = ++cp; } else { if (addtype(types, T_INT)) - return (-1); + return -1; } - return (0); + return 0; } #endif /* WCHAR_SUPPORT */ @@ -652,19 +652,19 @@ __grow_type_table(struct typetable *types) /* Detect overflow */ if (types->nextarg > MAX_POSARG) - return (-1); + return -1; newsize = oldsize * 2; if (newsize < types->nextarg + 1) newsize = types->nextarg + 1; if (oldsize == STATIC_ARG_TBL_SIZE) { if ((newtable = malloc(newsize * sizeof(enum typeid))) == NULL) - return (-1); + return -1; bcopy(oldtable, newtable, oldsize * sizeof(enum typeid)); } else { newtable = realloc(oldtable, newsize * sizeof(enum typeid)); if (newtable == NULL) - return (-1); + return -1; } for (n = oldsize; n < newsize; n++) newtable[n] = T_UNUSED; @@ -672,7 +672,7 @@ __grow_type_table(struct typetable *types) types->table = newtable; types->tablesize = newsize; - return (0); + return 0; } /* diff --git a/lib/printf/vfprintf.c b/lib/printf/vfprintf.c index 07df6dd8fe..6ffccb3811 100644 --- a/lib/printf/vfprintf.c +++ b/lib/printf/vfprintf.c @@ -94,7 +94,7 @@ __wcsconv(wchar_t *wcsarg, int prec) mbs = initial; nbytes = wcsrtombs(NULL, (const wchar_t **)&p, 0, &mbs); if (nbytes == (size_t)-1) - return (NULL); + return NULL; } else { /* * Optimisation: if the output precision is small enough, @@ -117,7 +117,7 @@ __wcsconv(wchar_t *wcsarg, int prec) } } if ((convbuf = malloc(nbytes + 1)) == NULL) - return (NULL); + return NULL; /* Fill the output buffer. */ p = wcsarg; @@ -125,7 +125,7 @@ __wcsconv(wchar_t *wcsarg, int prec) if ((nbytes = wcsrtombs(convbuf, (const wchar_t **)&p, nbytes, &mbs)) == (size_t)-1) { free(convbuf); - return (NULL); + return NULL; } convbuf[nbytes] = '\0'; return (convbuf); -- cgit v1.2.3