From aeb898d88cddc17cefc7738940b4917e9ee27933 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 25 Mar 2010 07:48:14 +0100 Subject: [PATCH] Minor formatting changes. --- ChangeLog | 44 ++++++++++++++++++++++++++++ lib/acosl.c | 20 ++++++------- lib/argp-help.c | 10 +++---- lib/argp-namefrob.h | 2 +- lib/argz.c | 2 +- lib/asinl.c | 18 ++++++------ lib/cosl.c | 68 ++++++++++++++++++++++++-------------------- lib/expl.c | 18 ++++++------ lib/file-set.h | 2 +- lib/gen-uni-tables.c | 2 +- lib/getaddrinfo.c | 9 +++--- lib/gettext.h | 2 +- lib/glthread/lock.h | 20 ++++++------- lib/ldexpl.c | 4 +-- lib/localename.c | 5 ++-- lib/logl.c | 4 +-- lib/memcmp.c | 10 +++---- lib/netdb.in.h | 8 +++--- lib/parse-duration.c | 2 +- lib/parse-duration.h | 2 +- lib/poll.c | 2 +- lib/safe-alloc.h | 10 +++---- lib/select.c | 2 +- lib/sinl.c | 20 ++++++------- lib/sqrtl.c | 4 +-- lib/tanl.c | 14 ++++----- lib/trim.c | 6 ++-- lib/trim.h | 2 +- lib/tsearch.c | 2 +- lib/uniname/uniname.c | 6 ++-- tests/test-argp.c | 8 +++--- tests/test-base64.c | 2 +- tests/test-idpriv-drop.c | 4 +-- tests/test-idpriv-droptemp.c | 4 +-- tests/test-lock.c | 12 ++++---- tests/test-tls.c | 8 +++--- tests/test-usleep.c | 2 +- 37 files changed, 206 insertions(+), 154 deletions(-) diff --git a/ChangeLog b/ChangeLog index d8a8843fe..f30bdbf6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,47 @@ +2010-03-25 Bruno Haible + + Minor formatting changes. + * lib/acosl.c: Insert space before function argument list. + * lib/argz.c: Likewise. + * lib/asinl.c: Likewise. + * lib/expl.c: Likewise. + * lib/gen-uni-tables.c: Likewise. + * lib/gettext.h: Likewise. + * lib/glthread/lock.h: Likewise. + * lib/tanl.c: Likewise. + * lib/uniname/uniname.c: Likewise. + * tests/test-idpriv-drop.c: Likewise. + * tests/test-idpriv-droptemp.c: Likewise. + * tests/test-lock.c: Likewise. + * tests/test-tls.c: Likewise. + * lib/argp-help.c: Insert space before function-like macro argument + list. + * lib/memcmp.c: Likewise. + * tests/test-base64.c: Likewise. + * lib/localename.c: Insert space before sizeof's argument list. + * lib/safe-alloc.h: Likewise. + * lib/file-set.h: Insert space before macro argument list. + * tests/test-argp.c: Likewise. + * lib/argp-namefrob.h: Insert space before function parameter list. + * lib/getaddrinfo.c: Likewise. + * lib/netdb.in.h: Likewise. + * lib/parse-duration.h: Likewise. + * lib/parse-duration.c: Likewise. + * lib/poll.c: Likewise. + * lib/select.c: Likewise. + * lib/trim.h: Likewise. + * tests/test-usleep.c: Likewise. + * lib/ldexpl.c: Insert space before function parameter list and before + function argument list. + * lib/logl.c: Likewise. + * lib/sqrtl.c: Likewise. + * lib/trim.c: Likewise. + * lib/cosl.c: Use GNU style indentation. Insert space before function + argument list. + * lib/sinl.c: Likewise. + * lib/tsearch.c: Insert space after 'for'. + Reported by Jim Meyering. + 2010-03-23 Pádraig Brady (tiny change) * maint.mk (sc_Wundef_boolean): Check for the presence of the diff --git a/lib/acosl.c b/lib/acosl.c index 109104ac7..260a4370e 100644 --- a/lib/acosl.c +++ b/lib/acosl.c @@ -108,7 +108,7 @@ acosl (long double x) if (x < 0.0L) { - t = pi - acosl(-x); + t = pi - acosl (-x); if (huge + x > one) /* return with inexact */ return t; } @@ -183,7 +183,7 @@ acosl (long double x) return (pio2_hi - asinr5625) - (p / q - pio2_lo); } else - return 2 * asinl(sqrtl((1-x)/2)); + return 2 * asinl (sqrtl ((1 - x) / 2)); } #if 0 @@ -191,35 +191,35 @@ int main (void) { printf ("%.18Lg %.18Lg\n", - acosl(1.0L), + acosl (1.0L), 1.5707963267948966192313216916397514420984L - 1.5707963267948966192313216916397514420984L); printf ("%.18Lg %.18Lg\n", - acosl(0.7071067811865475244008443621048490392848L), + acosl (0.7071067811865475244008443621048490392848L), 1.5707963267948966192313216916397514420984L - 0.7853981633974483096156608458198757210492L); printf ("%.18Lg %.18Lg\n", - acosl(0.5L), + acosl (0.5L), 1.5707963267948966192313216916397514420984L - 0.5235987755982988730771072305465838140328L); printf ("%.18Lg %.18Lg\n", - acosl(0.3090169943749474241022934171828190588600L), + acosl (0.3090169943749474241022934171828190588600L), 1.5707963267948966192313216916397514420984L - 0.3141592653589793238462643383279502884196L); printf ("%.18Lg %.18Lg\n", - acosl(-1.0L), + acosl (-1.0L), 1.5707963267948966192313216916397514420984L - -1.5707963267948966192313216916397514420984L); printf ("%.18Lg %.18Lg\n", - acosl(-0.7071067811865475244008443621048490392848L), + acosl (-0.7071067811865475244008443621048490392848L), 1.5707963267948966192313216916397514420984L - -0.7853981633974483096156608458198757210492L); printf ("%.18Lg %.18Lg\n", - acosl(-0.5L), + acosl (-0.5L), 1.5707963267948966192313216916397514420984L - -0.5235987755982988730771072305465838140328L); printf ("%.18Lg %.18Lg\n", - acosl(-0.3090169943749474241022934171828190588600L), + acosl (-0.3090169943749474241022934171828190588600L), 1.5707963267948966192313216916397514420984L - -0.3141592653589793238462643383279502884196L); } diff --git a/lib/argp-help.c b/lib/argp-help.c index 8f96c63b9..5b6d950be 100644 --- a/lib/argp-help.c +++ b/lib/argp-help.c @@ -764,7 +764,7 @@ hol_entry_cmp (const struct hol_entry *entry1, else /* Both entries are in clusters, we can just compare the clusters. */ return (rc = hol_cluster_cmp (entry1->cluster, entry2->cluster)) ? - rc : HOL_ENTRY_PTRCMP(entry1, entry2); + rc : HOL_ENTRY_PTRCMP (entry1, entry2); } else if (group1 == group2) /* The entries are both in the same cluster and group, so compare them @@ -789,7 +789,7 @@ hol_entry_cmp (const struct hol_entry *entry1, else if (!short1 && !short2 && long1 && long2) /* Only long options. */ return (rc = __strcasecmp (long1, long2)) ? - rc : HOL_ENTRY_PTRCMP(entry1, entry2); + rc : HOL_ENTRY_PTRCMP (entry1, entry2); else /* Compare short/short, long/short, short/long, using the first character of long options. Entries without *any* valid @@ -805,14 +805,14 @@ hol_entry_cmp (const struct hol_entry *entry1, /* Compare ignoring case, except when the options are both the same letter, in which case lower-case always comes first. */ return lower_cmp ? lower_cmp : - (rc = first2 - first1) ? - rc : HOL_ENTRY_PTRCMP(entry1, entry2); + (rc = first2 - first1) ? + rc : HOL_ENTRY_PTRCMP (entry1, entry2); } } else /* Within the same cluster, but not the same group, so just compare groups. */ - return group_cmp (group1, group2, HOL_ENTRY_PTRCMP(entry1, entry2)); + return group_cmp (group1, group2, HOL_ENTRY_PTRCMP (entry1, entry2)); } /* Version of hol_entry_cmp with correct signature for qsort. */ diff --git a/lib/argp-namefrob.h b/lib/argp-namefrob.h index 38a35f1c4..24581a626 100644 --- a/lib/argp-namefrob.h +++ b/lib/argp-namefrob.h @@ -144,7 +144,7 @@ #if defined GNULIB_ARGP_DISABLE_DIRNAME # define __argp_base_name(arg) arg #elif defined GNULIB_ARGP_EXTERN_BASENAME -extern char *__argp_base_name(const char *arg); +extern char *__argp_base_name (const char *arg); #else # include "dirname.h" # define __argp_base_name last_component diff --git a/lib/argz.c b/lib/argz.c index 485bf977f..35899b29a 100644 --- a/lib/argz.c +++ b/lib/argz.c @@ -220,7 +220,7 @@ argz_count (const char *argz, size_t len) size_t count = 0; while (len > 0) { - size_t part_len = strlen(argz); + size_t part_len = strlen (argz); argz += part_len + 1; len -= part_len + 1; count++; diff --git a/lib/asinl.c b/lib/asinl.c index 5dee0cbc8..cda04c8ae 100644 --- a/lib/asinl.c +++ b/lib/asinl.c @@ -183,7 +183,7 @@ asinl (long double x) t = asinr5625 + p / q; } else - t = pio2_hi + pio2_lo - 2 * asinl(sqrtl((1-y)/2)); + t = pio2_hi + pio2_lo - 2 * asinl (sqrtl ((1 - y) / 2)); return t * sign; } @@ -193,28 +193,28 @@ int main (void) { printf ("%.18Lg %.18Lg\n", - asinl(1.0L), + asinl (1.0L), 1.5707963267948966192313216916397514420984L); printf ("%.18Lg %.18Lg\n", - asinl(0.7071067811865475244008443621048490392848L), + asinl (0.7071067811865475244008443621048490392848L), 0.7853981633974483096156608458198757210492L); printf ("%.18Lg %.18Lg\n", - asinl(0.5L), + asinl (0.5L), 0.5235987755982988730771072305465838140328L); printf ("%.18Lg %.18Lg\n", - asinl(0.3090169943749474241022934171828190588600L), + asinl (0.3090169943749474241022934171828190588600L), 0.3141592653589793238462643383279502884196L); printf ("%.18Lg %.18Lg\n", - asinl(-1.0L), + asinl (-1.0L), -1.5707963267948966192313216916397514420984L); printf ("%.18Lg %.18Lg\n", - asinl(-0.7071067811865475244008443621048490392848L), + asinl (-0.7071067811865475244008443621048490392848L), -0.7853981633974483096156608458198757210492L); printf ("%.18Lg %.18Lg\n", - asinl(-0.5L), + asinl (-0.5L), -0.5235987755982988730771072305465838140328L); printf ("%.18Lg %.18Lg\n", - asinl(-0.3090169943749474241022934171828190588600L), + asinl (-0.3090169943749474241022934171828190588600L), -0.3141592653589793238462643383279502884196L); } #endif diff --git a/lib/cosl.c b/lib/cosl.c index 884cec8c6..d23c15f02 100644 --- a/lib/cosl.c +++ b/lib/cosl.c @@ -51,48 +51,54 @@ #include "trigl.h" -long double cosl(long double x) +long double +cosl (long double x) { - long double y[2],z=0.0L; - int n; + long double y[2],z=0.0L; + int n; - /* cosl(NaN) is NaN */ - if (isnanl (x)) - return x; + /* cosl(NaN) is NaN */ + if (isnanl (x)) + return x; - /* |x| ~< pi/4 */ - if(x >= -0.7853981633974483096156608458198757210492 && - x <= 0.7853981633974483096156608458198757210492) - return kernel_cosl(x, z); + /* |x| ~< pi/4 */ + if (x >= -0.7853981633974483096156608458198757210492 + && x <= 0.7853981633974483096156608458198757210492) + return kernel_cosl(x, z); - /* cosl(Inf) is NaN, cosl(0) is 1 */ - else if (x + x == x && x != 0.0) - return x-x; /* NaN */ + /* cosl(Inf) is NaN, cosl(0) is 1 */ + else if (x + x == x && x != 0.0) + return x - x; /* NaN */ - /* argument reduction needed */ - else { - n = ieee754_rem_pio2l(x,y); - switch(n&3) { - case 0: return kernel_cosl(y[0],y[1]); - case 1: return -kernel_sinl(y[0],y[1],1); - case 2: return -kernel_cosl(y[0],y[1]); - default: - return kernel_sinl(y[0],y[1],1); - } + /* argument reduction needed */ + else + { + n = ieee754_rem_pio2l (x, y); + switch (n & 3) + { + case 0: + return kernel_cosl (y[0], y[1]); + case 1: + return -kernel_sinl (y[0], y[1], 1); + case 2: + return -kernel_cosl (y[0], y[1]); + default: + return kernel_sinl (y[0], y[1], 1); } + } } #if 0 int main (void) { - printf ("%.16Lg\n", cosl(0.7853981633974483096156608458198757210492)); - printf ("%.16Lg\n", cosl(0.7853981633974483096156608458198757210492 *29)); - printf ("%.16Lg\n", cosl(0.7853981633974483096156608458198757210492 *2)); - printf ("%.16Lg\n", cosl(0.7853981633974483096156608458198757210492 *30)); - printf ("%.16Lg\n", cosl(0.7853981633974483096156608458198757210492 *4)); - printf ("%.16Lg\n", cosl(0.7853981633974483096156608458198757210492 *32)); - printf ("%.16Lg\n", cosl(0.7853981633974483096156608458198757210492 *2/3)); - printf ("%.16Lg\n", cosl(0.7853981633974483096156608458198757210492 *4/3)); + printf ("%.16Lg\n", cosl (0.7853981633974483096156608458198757210492)); + printf ("%.16Lg\n", cosl (0.7853981633974483096156608458198757210492 *29)); + printf ("%.16Lg\n", cosl (0.7853981633974483096156608458198757210492 *2)); + printf ("%.16Lg\n", cosl (0.7853981633974483096156608458198757210492 *30)); + printf ("%.16Lg\n", cosl (0.7853981633974483096156608458198757210492 *4)); + printf ("%.16Lg\n", cosl (0.7853981633974483096156608458198757210492 *32)); + printf ("%.16Lg\n", cosl (0.7853981633974483096156608458198757210492 *2/3)); + printf ("%.16Lg\n", cosl (0.7853981633974483096156608458198757210492 *4/3)); } #endif diff --git a/lib/expl.c b/lib/expl.c index 97ad8e384..407da5fb8 100644 --- a/lib/expl.c +++ b/lib/expl.c @@ -122,14 +122,14 @@ expl (long double x) int main (void) { - printf ("%.16Lg\n", expl(1.0L)); - printf ("%.16Lg\n", expl(-1.0L)); - printf ("%.16Lg\n", expl(2.0L)); - printf ("%.16Lg\n", expl(4.0L)); - printf ("%.16Lg\n", expl(-2.0L)); - printf ("%.16Lg\n", expl(-4.0L)); - printf ("%.16Lg\n", expl(0.0625L)); - printf ("%.16Lg\n", expl(0.3L)); - printf ("%.16Lg\n", expl(0.6L)); + printf ("%.16Lg\n", expl (1.0L)); + printf ("%.16Lg\n", expl (-1.0L)); + printf ("%.16Lg\n", expl (2.0L)); + printf ("%.16Lg\n", expl (4.0L)); + printf ("%.16Lg\n", expl (-2.0L)); + printf ("%.16Lg\n", expl (-4.0L)); + printf ("%.16Lg\n", expl (0.0625L)); + printf ("%.16Lg\n", expl (0.3L)); + printf ("%.16Lg\n", expl (0.6L)); } #endif diff --git a/lib/file-set.h b/lib/file-set.h index 1e9365f87..28d42fecf 100644 --- a/lib/file-set.h +++ b/lib/file-set.h @@ -6,7 +6,7 @@ extern void record_file (Hash_table *ht, char const *file, struct stat const *stats) - __attribute__((nonnull(2, 3))); + __attribute__ ((nonnull (2, 3))); extern bool seen_file (Hash_table const *ht, char const *file, struct stat const *stats); diff --git a/lib/gen-uni-tables.c b/lib/gen-uni-tables.c index 502b9ff5f..8080b1f26 100644 --- a/lib/gen-uni-tables.c +++ b/lib/gen-uni-tables.c @@ -210,7 +210,7 @@ fill_attributes (const char *unicodedata_filename) i = strtoul (field0, NULL, 16); if (field1[0] == '<' && strlen (field1) >= 9 - && strcmp (field1 + strlen(field1) - 8, ", First>") == 0) + && strcmp (field1 + strlen (field1) - 8, ", First>") == 0) { /* Deal with a range. */ lineno++; diff --git a/lib/getaddrinfo.c b/lib/getaddrinfo.c index 9109a8051..76dc19e6c 100644 --- a/lib/getaddrinfo.c +++ b/lib/getaddrinfo.c @@ -351,10 +351,11 @@ freeaddrinfo (struct addrinfo *ai) } } -int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen, - char *restrict node, socklen_t nodelen, - char *restrict service, socklen_t servicelen, - int flags) +int +getnameinfo (const struct sockaddr *restrict sa, socklen_t salen, + char *restrict node, socklen_t nodelen, + char *restrict service, socklen_t servicelen, + int flags) { #ifdef WIN32_NATIVE if (use_win32_p ()) diff --git a/lib/gettext.h b/lib/gettext.h index 6b98c3b65..6a069c448 100644 --- a/lib/gettext.h +++ b/lib/gettext.h @@ -81,7 +81,7 @@ ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) # undef dcngettext # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ - ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N)) + ((void) (Category), dngettext (Domainname, Msgid1, Msgid2, N)) # undef textdomain # define textdomain(Domainname) ((const char *) (Domainname)) # undef bindtextdomain diff --git a/lib/glthread/lock.h b/lib/glthread/lock.h index 9de88a81b..5994645ea 100644 --- a/lib/glthread/lock.h +++ b/lib/glthread/lock.h @@ -418,11 +418,11 @@ typedef pth_mutex_t gl_lock_t; # define gl_lock_initializer \ PTH_MUTEX_INIT # define glthread_lock_init(LOCK) \ - (pth_in_use() && !pth_mutex_init (LOCK) ? errno : 0) + (pth_in_use () && !pth_mutex_init (LOCK) ? errno : 0) # define glthread_lock_lock(LOCK) \ - (pth_in_use() && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0) + (pth_in_use () && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0) # define glthread_lock_unlock(LOCK) \ - (pth_in_use() && !pth_mutex_release (LOCK) ? errno : 0) + (pth_in_use () && !pth_mutex_release (LOCK) ? errno : 0) # define glthread_lock_destroy(LOCK) \ ((void)(LOCK), 0) @@ -436,13 +436,13 @@ typedef pth_rwlock_t gl_rwlock_t; # define gl_rwlock_initializer \ PTH_RWLOCK_INIT # define glthread_rwlock_init(LOCK) \ - (pth_in_use() && !pth_rwlock_init (LOCK) ? errno : 0) + (pth_in_use () && !pth_rwlock_init (LOCK) ? errno : 0) # define glthread_rwlock_rdlock(LOCK) \ - (pth_in_use() && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RD, 0, NULL) ? errno : 0) + (pth_in_use () && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RD, 0, NULL) ? errno : 0) # define glthread_rwlock_wrlock(LOCK) \ - (pth_in_use() && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RW, 0, NULL) ? errno : 0) + (pth_in_use () && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RW, 0, NULL) ? errno : 0) # define glthread_rwlock_unlock(LOCK) \ - (pth_in_use() && !pth_rwlock_release (LOCK) ? errno : 0) + (pth_in_use () && !pth_rwlock_release (LOCK) ? errno : 0) # define glthread_rwlock_destroy(LOCK) \ ((void)(LOCK), 0) @@ -457,11 +457,11 @@ typedef pth_mutex_t gl_recursive_lock_t; # define gl_recursive_lock_initializer \ PTH_MUTEX_INIT # define glthread_recursive_lock_init(LOCK) \ - (pth_in_use() && !pth_mutex_init (LOCK) ? errno : 0) + (pth_in_use () && !pth_mutex_init (LOCK) ? errno : 0) # define glthread_recursive_lock_lock(LOCK) \ - (pth_in_use() && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0) + (pth_in_use () && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0) # define glthread_recursive_lock_unlock(LOCK) \ - (pth_in_use() && !pth_mutex_release (LOCK) ? errno : 0) + (pth_in_use () && !pth_mutex_release (LOCK) ? errno : 0) # define glthread_recursive_lock_destroy(LOCK) \ ((void)(LOCK), 0) diff --git a/lib/ldexpl.c b/lib/ldexpl.c index a18045ad8..b8e225b9f 100644 --- a/lib/ldexpl.c +++ b/lib/ldexpl.c @@ -27,7 +27,7 @@ #include "fpucw.h" long double -ldexpl(long double x, int exp) +ldexpl (long double x, int exp) { long double factor; int bit; @@ -72,6 +72,6 @@ main (void) long double x; int y; for (y = 0; y < 29; y++) - printf ("%5d %.16Lg %.16Lg\n", y, ldexpl(0.8L, y), ldexpl(0.8L, -y) * ldexpl(0.8L, y)); + printf ("%5d %.16Lg %.16Lg\n", y, ldexpl (0.8L, y), ldexpl (0.8L, -y) * ldexpl (0.8L, y)); } #endif diff --git a/lib/localename.c b/lib/localename.c index d2554fd96..d62ae6682 100644 --- a/lib/localename.c +++ b/lib/localename.c @@ -2866,7 +2866,7 @@ gl_locale_name_default (void) CFLocaleRef locale = CFLocaleCopyCurrent (); CFStringRef name = CFLocaleGetIdentifier (locale); - if (CFStringGetCString (name, namebuf, sizeof(namebuf), + if (CFStringGetCString (name, namebuf, sizeof (namebuf), kCFStringEncodingASCII)) { gl_locale_name_canonicalize (namebuf); @@ -2879,7 +2879,8 @@ gl_locale_name_default (void) kCFPreferencesCurrentApplication); if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID () - && CFStringGetCString ((CFStringRef)value, namebuf, sizeof(namebuf), + && CFStringGetCString ((CFStringRef)value, + namebuf, sizeof (namebuf), kCFStringEncodingASCII)) { gl_locale_name_canonicalize (namebuf); diff --git a/lib/logl.c b/lib/logl.c index 2b5141268..de46bd357 100644 --- a/lib/logl.c +++ b/lib/logl.c @@ -185,7 +185,7 @@ static const long double ln2b = 1.4286068203094172321214581765680755001344E-6L; long double -logl(long double x) +logl (long double x) { long double z, y, w; long double t; @@ -215,7 +215,7 @@ logl(long double x) } /* Extract exponent and reduce domain to 0.703125 <= u < 1.40625 */ - x = frexpl(x, &e); + x = frexpl (x, &e); if (x < 0.703125L) { x += x; diff --git a/lib/memcmp.c b/lib/memcmp.c index 0c7ce5e80..25f9b2a1e 100644 --- a/lib/memcmp.c +++ b/lib/memcmp.c @@ -259,28 +259,28 @@ memcmp_not_common_alignment (uintptr_t srcp1, uintptr_t srcp2, size_t len) { a0 = ((op_t *) srcp1)[0]; b0 = ((op_t *) srcp2)[0]; - x = MERGE(a2, shl, a3, shr); + x = MERGE (a2, shl, a3, shr); if (x != b3) return CMP_LT_OR_GT (x, b3); do3: a1 = ((op_t *) srcp1)[1]; b1 = ((op_t *) srcp2)[1]; - x = MERGE(a3, shl, a0, shr); + x = MERGE (a3, shl, a0, shr); if (x != b0) return CMP_LT_OR_GT (x, b0); do2: a2 = ((op_t *) srcp1)[2]; b2 = ((op_t *) srcp2)[2]; - x = MERGE(a0, shl, a1, shr); + x = MERGE (a0, shl, a1, shr); if (x != b1) return CMP_LT_OR_GT (x, b1); do1: a3 = ((op_t *) srcp1)[3]; b3 = ((op_t *) srcp2)[3]; - x = MERGE(a1, shl, a2, shr); + x = MERGE (a1, shl, a2, shr); if (x != b2) return CMP_LT_OR_GT (x, b2); @@ -293,7 +293,7 @@ memcmp_not_common_alignment (uintptr_t srcp1, uintptr_t srcp2, size_t len) /* This is the right position for do0. Please don't move it into the loop. */ do0: - x = MERGE(a2, shl, a3, shr); + x = MERGE (a2, shl, a3, shr); if (x != b3) return CMP_LT_OR_GT (x, b3); return 0; diff --git a/lib/netdb.in.h b/lib/netdb.in.h index 2edd98bd2..c7bc92920 100644 --- a/lib/netdb.in.h +++ b/lib/netdb.in.h @@ -171,10 +171,10 @@ extern const char *gai_strerror (int ecode); /* Convert socket address to printable node and service names. For more details, see the POSIX:2001 specification . */ -extern int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen, - char *restrict node, socklen_t nodelen, - char *restrict service, socklen_t servicelen, - int flags) +extern int getnameinfo (const struct sockaddr *restrict sa, socklen_t salen, + char *restrict node, socklen_t nodelen, + char *restrict service, socklen_t servicelen, + int flags) _GL_ARG_NONNULL ((1)); # endif diff --git a/lib/parse-duration.c b/lib/parse-duration.c index 2f1085382..8952a8fae 100644 --- a/lib/parse-duration.c +++ b/lib/parse-duration.c @@ -452,7 +452,7 @@ parse_period (cch_t * in_pz) } static time_t -parse_non_iso8601(cch_t * pz) +parse_non_iso8601 (cch_t * pz) { whats_done_t whatd_we_do = NOTHING_IS_DONE; diff --git a/lib/parse-duration.h b/lib/parse-duration.h index ea551840c..fbc1882cf 100644 --- a/lib/parse-duration.h +++ b/lib/parse-duration.h @@ -85,6 +85,6 @@ /* Parses the given string. If it has the syntax of a valid duration, this duration is returned. Otherwise, the return value is BAD_TIME, and errno is set to either EINVAL (bad syntax) or ERANGE (out of range). */ -extern time_t parse_duration(char const * in_pz); +extern time_t parse_duration (char const * in_pz); #endif /* GNULIB_PARSE_DURATION_H */ diff --git a/lib/poll.c b/lib/poll.c index 90d99d92d..49c41591e 100644 --- a/lib/poll.c +++ b/lib/poll.c @@ -70,7 +70,7 @@ #define IsConsoleHandle(h) (((long) (h) & 3) == 3) static BOOL -IsSocketHandle(HANDLE h) +IsSocketHandle (HANDLE h) { WSANETWORKEVENTS ev; diff --git a/lib/safe-alloc.h b/lib/safe-alloc.h index fb53db31c..7d7e9aa5a 100644 --- a/lib/safe-alloc.h +++ b/lib/safe-alloc.h @@ -59,7 +59,7 @@ safe_alloc_realloc_n (void *ptrptr, size_t size, size_t count) * Return -1 on failure to allocate, zero on success */ # define ALLOC(ptr) \ - safe_alloc_alloc_n (&(ptr), sizeof(*(ptr)), 1, 1) + safe_alloc_alloc_n (&(ptr), sizeof (*(ptr)), 1, 1) /** * ALLOC_N: @@ -73,7 +73,7 @@ safe_alloc_realloc_n (void *ptrptr, size_t size, size_t count) * Return -1 on failure, 0 on success */ # define ALLOC_N(ptr, count) \ - safe_alloc_alloc_n (&(ptr), sizeof(*(ptr)), (count), 1) + safe_alloc_alloc_n (&(ptr), sizeof (*(ptr)), (count), 1) /** * ALLOC_N_UNINITIALIZED: @@ -87,7 +87,7 @@ safe_alloc_realloc_n (void *ptrptr, size_t size, size_t count) * Return -1 on failure to allocate, zero on success */ # define ALLOC_N_UNINITIALIZED(ptr, count) \ - safe_alloc_alloc_n (&(ptr), sizeof(*(ptr)), (count), 0) + safe_alloc_alloc_n (&(ptr), sizeof (*(ptr)), (count), 0) /** * REALLOC_N: @@ -101,7 +101,7 @@ safe_alloc_realloc_n (void *ptrptr, size_t size, size_t count) * Return -1 on failure to reallocate, zero on success */ # define REALLOC_N(ptr, count) \ - safe_alloc_realloc_n (&(ptr), sizeof(*(ptr)), (count)) + safe_alloc_realloc_n (&(ptr), sizeof (*(ptr)), (count)) /** * FREE: @@ -116,6 +116,6 @@ safe_alloc_realloc_n (void *ptrptr, size_t size, size_t count) free (ptr); \ (ptr) = NULL; \ } \ - while(0) + while (0) #endif /* SAFE_ALLOC_H_ */ diff --git a/lib/select.c b/lib/select.c index 35645669d..773689cf9 100644 --- a/lib/select.c +++ b/lib/select.c @@ -80,7 +80,7 @@ typedef DWORD (WINAPI *PNtQueryInformationFile) #define IsConsoleHandle(h) (((long) (h) & 3) == 3) static BOOL -IsSocketHandle(HANDLE h) +IsSocketHandle (HANDLE h) { WSANETWORKEVENTS ev; diff --git a/lib/sinl.c b/lib/sinl.c index d8a0e7a1b..b0106b4fa 100644 --- a/lib/sinl.c +++ b/lib/sinl.c @@ -62,8 +62,8 @@ sinl (long double x) return x; /* |x| ~< pi/4 */ - if (x >= -0.7853981633974483096156608458198757210492 && - x <= 0.7853981633974483096156608458198757210492) + if (x >= -0.7853981633974483096156608458198757210492 + && x <= 0.7853981633974483096156608458198757210492) return kernel_sinl (x, z, 0); /* sinl(Inf) is NaN, sinl(0) is 0 */ @@ -92,13 +92,13 @@ sinl (long double x) int main (void) { - printf ("%.16Lg\n", sinl(0.7853981633974483096156608458198757210492)); - printf ("%.16Lg\n", sinl(0.7853981633974483096156608458198757210492 *29)); - printf ("%.16Lg\n", sinl(0.7853981633974483096156608458198757210492 *2)); - printf ("%.16Lg\n", sinl(0.7853981633974483096156608458198757210492 *30)); - printf ("%.16Lg\n", sinl(0.7853981633974483096156608458198757210492 *4)); - printf ("%.16Lg\n", sinl(0.7853981633974483096156608458198757210492 *32)); - printf ("%.16Lg\n", sinl(0.7853981633974483096156608458198757210492 *2/3)); - printf ("%.16Lg\n", sinl(0.7853981633974483096156608458198757210492 *4/3)); + printf ("%.16Lg\n", sinl (0.7853981633974483096156608458198757210492)); + printf ("%.16Lg\n", sinl (0.7853981633974483096156608458198757210492 *29)); + printf ("%.16Lg\n", sinl (0.7853981633974483096156608458198757210492 *2)); + printf ("%.16Lg\n", sinl (0.7853981633974483096156608458198757210492 *30)); + printf ("%.16Lg\n", sinl (0.7853981633974483096156608458198757210492 *4)); + printf ("%.16Lg\n", sinl (0.7853981633974483096156608458198757210492 *32)); + printf ("%.16Lg\n", sinl (0.7853981633974483096156608458198757210492 *2/3)); + printf ("%.16Lg\n", sinl (0.7853981633974483096156608458198757210492 *4/3)); } #endif diff --git a/lib/sqrtl.c b/lib/sqrtl.c index 8c492f2bb..3ebee4dee 100644 --- a/lib/sqrtl.c +++ b/lib/sqrtl.c @@ -27,7 +27,7 @@ /* A simple Newton-Raphson method. */ long double -sqrtl(long double x) +sqrtl (long double x) { long double delta, y; int exponent; @@ -38,7 +38,7 @@ sqrtl(long double x) /* Check for negative numbers */ if (x < 0.0L) - return (long double) sqrt(-1); + return (long double) sqrt (-1); /* Check for zero and infinites */ if (x + x == x) diff --git a/lib/tanl.c b/lib/tanl.c index 6a6dc6d85..07fbc0945 100644 --- a/lib/tanl.c +++ b/lib/tanl.c @@ -212,12 +212,12 @@ tanl (long double x) int main (void) { - printf ("%.16Lg\n", tanl(0.7853981633974483096156608458198757210492)); - printf ("%.16Lg\n", tanl(-0.7853981633974483096156608458198757210492)); - printf ("%.16Lg\n", tanl(0.7853981633974483096156608458198757210492 *3)); - printf ("%.16Lg\n", tanl(-0.7853981633974483096156608458198757210492 *31)); - printf ("%.16Lg\n", tanl(0.7853981633974483096156608458198757210492 / 2)); - printf ("%.16Lg\n", tanl(0.7853981633974483096156608458198757210492 * 3/2)); - printf ("%.16Lg\n", tanl(0.7853981633974483096156608458198757210492 * 5/2)); + printf ("%.16Lg\n", tanl (0.7853981633974483096156608458198757210492)); + printf ("%.16Lg\n", tanl (-0.7853981633974483096156608458198757210492)); + printf ("%.16Lg\n", tanl (0.7853981633974483096156608458198757210492 *3)); + printf ("%.16Lg\n", tanl (-0.7853981633974483096156608458198757210492 *31)); + printf ("%.16Lg\n", tanl (0.7853981633974483096156608458198757210492 / 2)); + printf ("%.16Lg\n", tanl (0.7853981633974483096156608458198757210492 * 3/2)); + printf ("%.16Lg\n", tanl (0.7853981633974483096156608458198757210492 * 5/2)); } #endif diff --git a/lib/trim.c b/lib/trim.c index 62f8ebffe..c8b0c7fe4 100644 --- a/lib/trim.c +++ b/lib/trim.c @@ -38,14 +38,14 @@ #endif char * -trim2(const char *s, int how) +trim2 (const char *s, int how) { char *d; - d = strdup(s); + d = strdup (s); if (!d) - xalloc_die(); + xalloc_die (); if (MB_CUR_MAX > 1) { diff --git a/lib/trim.h b/lib/trim.h index c70a16fba..aa777e499 100644 --- a/lib/trim.h +++ b/lib/trim.h @@ -30,4 +30,4 @@ /* Removes leading whitespaces. */ #define trim_leading(s) trim2(s, TRIM_LEADING) -char *trim2(const char *, int); +char *trim2 (const char *, int); diff --git a/lib/tsearch.c b/lib/tsearch.c index 64c0c2567..8eb92c5c6 100644 --- a/lib/tsearch.c +++ b/lib/tsearch.c @@ -162,7 +162,7 @@ check_tree (node root) if (root == NULL) return; root->red = 0; - for(p = root->left; p; p = p->left) + for (p = root->left; p; p = p->left) cnt += !p->red; check_tree_recurse (root, 0, cnt); } diff --git a/lib/uniname/uniname.c b/lib/uniname/uniname.c index cf2be15cc..e4b81cc3f 100644 --- a/lib/uniname/uniname.c +++ b/lib/uniname/uniname.c @@ -388,19 +388,19 @@ unicode_name_character (const char *name) unsigned int index1; for (index1 = 0; index1 < 19; index1++) - if (memcmp(jamo_initial_short_name[index1], p1, n1) == 0 + if (memcmp (jamo_initial_short_name[index1], p1, n1) == 0 && jamo_initial_short_name[index1][n1] == '\0') { unsigned int index2; for (index2 = 0; index2 < 21; index2++) - if (memcmp(jamo_medial_short_name[index2], p2, n2) == 0 + if (memcmp (jamo_medial_short_name[index2], p2, n2) == 0 && jamo_medial_short_name[index2][n2] == '\0') { unsigned int index3; for (index3 = 0; index3 < 28; index3++) - if (memcmp(jamo_final_short_name[index3], p3, n3) == 0 + if (memcmp (jamo_final_short_name[index3], p3, n3) == 0 && jamo_final_short_name[index3][n3] == '\0') { return 0xAC00 + (index1 * 21 + index2) * 28 + index3; diff --git a/tests/test-argp.c b/tests/test-argp.c index 675951fbd..7af1af81a 100644 --- a/tests/test-argp.c +++ b/tests/test-argp.c @@ -262,20 +262,20 @@ struct argp test_argp = { #define INIT_TEST_COMMON(n) \ int argc = NARGS (argv); \ struct test_args test_args; \ - init_args(test_args); \ + init_args (test_args); \ test_number = n; #define INIT_TEST1(n, arg1) \ char *argv[] = { ARGV0, arg1, NULL }; \ - INIT_TEST_COMMON(n) + INIT_TEST_COMMON (n) #define INIT_TEST2(n, arg1, arg2) \ char *argv[] = { ARGV0, arg1, arg2, NULL }; \ - INIT_TEST_COMMON(n) + INIT_TEST_COMMON (n) #define INIT_TEST3(n, arg1, arg2, arg3) \ char *argv[] = { ARGV0, arg1, arg2, arg3, NULL }; \ - INIT_TEST_COMMON(n) + INIT_TEST_COMMON (n) int test_number; unsigned failure_count = 0; diff --git a/tests/test-base64.c b/tests/test-base64.c index 95c26ae0a..06f0b0257 100644 --- a/tests/test-base64.c +++ b/tests/test-base64.c @@ -39,7 +39,7 @@ main (void) memset (out, 0x42, sizeof (out)); base64_encode (in, 0, out, 0); - ASSERT(out[0] == '\x42'); + ASSERT (out[0] == '\x42'); memset (out, 0x42, sizeof (out)); base64_encode (in, 1, out, 1); diff --git a/tests/test-idpriv-drop.c b/tests/test-idpriv-drop.c index bbc937cd7..85f5fe35b 100644 --- a/tests/test-idpriv-drop.c +++ b/tests/test-idpriv-drop.c @@ -38,7 +38,7 @@ show_uids () (int) real, (int) effective, (int) saved); #elif HAVE_GETEUID printf ("uids: real=%d effective=%d", - (int) getuid (), (int) geteuid()); + (int) getuid (), (int) geteuid ()); #elif HAVE_GETUID printf ("uids: real=%d", (int) getuid ()); @@ -57,7 +57,7 @@ show_gids () (int) real, (int) effective, (int) saved); #elif HAVE_GETEGID printf ("gids: real=%d effective=%d", - (int) getgid (), (int) getegid()); + (int) getgid (), (int) getegid ()); #elif HAVE_GETGID printf ("gids: real=%d", (int) getgid ()); diff --git a/tests/test-idpriv-droptemp.c b/tests/test-idpriv-droptemp.c index eff1b247d..7a3a91dc4 100644 --- a/tests/test-idpriv-droptemp.c +++ b/tests/test-idpriv-droptemp.c @@ -38,7 +38,7 @@ show_uids () (int) real, (int) effective, (int) saved); #elif HAVE_GETEUID printf ("uids: real=%d effective=%d", - (int) getuid (), (int) geteuid()); + (int) getuid (), (int) geteuid ()); #elif HAVE_GETUID printf ("uids: real=%d", (int) getuid ()); @@ -57,7 +57,7 @@ show_gids () (int) real, (int) effective, (int) saved); #elif HAVE_GETEGID printf ("gids: real=%d effective=%d", - (int) getgid (), (int) getegid()); + (int) getgid (), (int) getegid ()); #elif HAVE_GETGID printf ("gids: real=%d", (int) getgid ()); diff --git a/tests/test-lock.c b/tests/test-lock.c index aaa4cd35e..7792dcafa 100644 --- a/tests/test-lock.c +++ b/tests/test-lock.c @@ -1,5 +1,5 @@ /* Test of locking in multithreaded situations. - Copyright (C) 2005, 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2005, 2008-2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -110,7 +110,7 @@ static int account[ACCOUNT_COUNT]; static int random_account (void) { - return ((unsigned int) rand() >> 3) % ACCOUNT_COUNT; + return ((unsigned int) rand () >> 3) % ACCOUNT_COUNT; } static void @@ -149,7 +149,7 @@ lock_mutator_thread (void *arg) i1 = random_account (); i2 = random_account (); - value = ((unsigned int) rand() >> 3) % 10; + value = ((unsigned int) rand () >> 3) % 10; account[i1] += value; account[i2] -= value; @@ -239,7 +239,7 @@ rwlock_mutator_thread (void *arg) i1 = random_account (); i2 = random_account (); - value = ((unsigned int) rand() >> 3) % 10; + value = ((unsigned int) rand () >> 3) % 10; account[i1] += value; account[i2] -= value; @@ -321,12 +321,12 @@ recshuffle (void) i1 = random_account (); i2 = random_account (); - value = ((unsigned int) rand() >> 3) % 10; + value = ((unsigned int) rand () >> 3) % 10; account[i1] += value; account[i2] -= value; /* Recursive with probability 0.5. */ - if (((unsigned int) rand() >> 3) % 2) + if (((unsigned int) rand () >> 3) % 2) recshuffle (); dbgprintf ("Mutator %p before unlock\n", gl_thread_self ()); diff --git a/tests/test-tls.c b/tests/test-tls.c index 172cdb316..354376184 100644 --- a/tests/test-tls.c +++ b/tests/test-tls.c @@ -1,5 +1,5 @@ /* Test of thread-local storage in multithreaded situations. - Copyright (C) 2005, 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2005, 2008-2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -94,7 +94,7 @@ worker_thread (void *arg) /* Initialize the per-thread storage. */ for (i = 0; i < KEYS_COUNT; i++) { - values[i] = (((unsigned int) rand() >> 3) % 1000000) * THREAD_COUNT + id; + values[i] = (((unsigned int) rand () >> 3) % 1000000) * THREAD_COUNT + id; /* Hopefully no arithmetic overflow. */ if ((values[i] % THREAD_COUNT) != id) abort (); @@ -124,8 +124,8 @@ worker_thread (void *arg) for (repeat = REPEAT_COUNT; repeat > 0; repeat--) { dbgprintf ("Worker %p doing value swapping\n", gl_thread_self ()); - i = ((unsigned int) rand() >> 3) % KEYS_COUNT; - j = ((unsigned int) rand() >> 3) % KEYS_COUNT; + i = ((unsigned int) rand () >> 3) % KEYS_COUNT; + j = ((unsigned int) rand () >> 3) % KEYS_COUNT; if (i != j) { void *vi = gl_tls_get (mykeys[i]); diff --git a/tests/test-usleep.c b/tests/test-usleep.c index 38c8cdc0d..58fdc7c4b 100644 --- a/tests/test-usleep.c +++ b/tests/test-usleep.c @@ -28,7 +28,7 @@ SIGNATURE_CHECK (usleep, int, (useconds_t)); #include "macros.h" int -main(void) +main (void) { time_t start = time (NULL); ASSERT (usleep (1000000) == 0); -- 2.11.0