From 9bc7c737b311fcbba71af11884b7f9111dba57ba Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Tue, 11 Sep 2018 22:41:30 -0500 Subject: libgcompat: Fix formatting inconsistencies (clang-format) Signed-off-by: Samuel Holland --- libgcompat/gnulib.c | 16 +++++++++------- libgcompat/internal.c | 3 +-- libgcompat/math.c | 13 +++++-------- libgcompat/resolv.c | 2 +- libgcompat/socket.c | 2 +- libgcompat/string.c | 9 ++++----- 6 files changed, 21 insertions(+), 24 deletions(-) diff --git a/libgcompat/gnulib.c b/libgcompat/gnulib.c index ccdec24..3f66963 100644 --- a/libgcompat/gnulib.c +++ b/libgcompat/gnulib.c @@ -1,16 +1,18 @@ #include #include "internal.h" -#define REASON_FD_SET_OVERFLOW \ - "Fault: Overflow in fd_set detected.\n" \ - "Description: This is caused by a programmer naively attempting to redefine FD_SETSIZE,\n" \ - " which is not allowed on POSIX platforms. The program must be either rebuilt\n" \ - " with the correct FD_SETSIZE definition, or preferably rewritten to avoid use\n" \ - " of select(2) in general. See also: poll(2).\n" \ +#define REASON_FD_SET_OVERFLOW \ + "Fault: Overflow in fd_set detected.\n" \ + "Description: This is caused by a programmer naively attempting to\n" \ + " redefine FD_SETSIZE, which is not allowed on POSIX platforms.\n" \ + " The program must either be rebuilt with the correct FD_SETSIZE\n" \ + " definition, or else be rewritten to avoid use of select(2) in \n" \ + " general. See also: poll(2).\n" \ " libgcompat believes FD_SETSIZE to be %zu.\n" unsigned long __fdelt_chk(unsigned long size) { - GCOMPAT__assert_with_reason(size < FD_SETSIZE, REASON_FD_SET_OVERFLOW, FD_SETSIZE); + GCOMPAT__assert_with_reason(size < FD_SETSIZE, REASON_FD_SET_OVERFLOW, + FD_SETSIZE); return size / (sizeof(unsigned long) << 3); } diff --git a/libgcompat/internal.c b/libgcompat/internal.c index 441b3cc..450c5e4 100644 --- a/libgcompat/internal.c +++ b/libgcompat/internal.c @@ -1,8 +1,7 @@ -#include #include +#include #include - void GCOMPAT__panic(const char *fmt, ...) { va_list va; diff --git a/libgcompat/math.c b/libgcompat/math.c index 83abbf4..793ff1a 100644 --- a/libgcompat/math.c +++ b/libgcompat/math.c @@ -1,8 +1,8 @@ -#define _GNU_SOURCE /* Extra maths functions */ -#include /* Literally everything */ +#define _GNU_SOURCE /* Extra maths functions */ +#include /* Literally everything */ -#include "alias.h" /* weak_alias */ -#include "internal.h" /* GCOMPAT__assert_with_reason */ +#include "alias.h" /* weak_alias */ +#include "internal.h" /* GCOMPAT__assert_with_reason */ /** * Multiplies the first argument x by FLT_RADIX (probably 2) to the power of y. @@ -14,7 +14,7 @@ long double scalbl(long double x, long double y) * 1) Good Enough(TM) * 2) scalbl is deprecated anyway * */ - return scalblnl(x, (long int)y); + return scalblnl(x, (long int) y); } /* @@ -144,7 +144,6 @@ int __isnan(double arg) } weak_alias(__isnan, isnan); - /** * Test for a NaN. * @@ -290,7 +289,6 @@ long double __asinl_finite(long double x) return res; } - /** * Returns the principal value of the arc tangent of x/y, expressed in radians. */ @@ -363,7 +361,6 @@ long double __atanhl_finite(long double x) return res; } - /** * Returns the hyperbolic cosine of x. */ diff --git a/libgcompat/resolv.c b/libgcompat/resolv.c index f70d913..0b81d0c 100644 --- a/libgcompat/resolv.c +++ b/libgcompat/resolv.c @@ -42,7 +42,7 @@ int __res_nclose(res_state statp) weak_alias(__res_nclose, res_nclose); int __res_search(const char *dname, int class, int type, unsigned char *answer, - int anslen) + int anslen) { return res_search(dname, class, type, answer, anslen); } diff --git a/libgcompat/socket.c b/libgcompat/socket.c index 9919ee0..e56199e 100644 --- a/libgcompat/socket.c +++ b/libgcompat/socket.c @@ -1,6 +1,6 @@ #include /* assert */ +#include /* poll, pollfd, nfds_t */ #include /* NULL */ -#include /* poll, pollfd, nfds_t */ #include /* recv, recvfrom */ /** diff --git a/libgcompat/string.c b/libgcompat/string.c index 9f1704b..f4e0620 100644 --- a/libgcompat/string.c +++ b/libgcompat/string.c @@ -2,10 +2,10 @@ #include /* assert */ #include /* NULL, size_t */ #include /* SIZE_MAX */ -#include /* memcpy, strcpy, strncat, strndup */ #include /* rand_r */ -#include /* getpid */ +#include /* memcpy, strcpy, strncat, strndup */ #include /* time */ +#include /* getpid */ #include "alias.h" /* weak_alias */ @@ -189,8 +189,7 @@ size_t __strcspn_c2(const char *str, int bad, int bad2) { size_t length = 0; const char *s = str; - while(*s != bad && *s != bad2 && *s != '\0') - { + while (*s != bad && *s != bad2 && *s != '\0') { length++; s++; } @@ -285,7 +284,7 @@ char *strfry(char *s) if (!len) return s; - seed += time(NULL) ^ getpid() ^ (uintptr_t)s; + seed += time(NULL) ^ getpid() ^ (uintptr_t) s; for (i = 0; i < len - 1; ++i) { j = rand_r(&seed) % (len - i) + i; -- cgit v1.2.3-70-g09d2