aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2019-02-27 13:55:45 +0000
committerJoseph Myers <joseph@codesourcery.com>2019-02-27 13:55:45 +0000
commitc4f50205e10b066654cf59ecde4fd1c2a674f19e (patch)
treea0f3f40e959a0b0c98d125ed9728ecd6c3d90e4a
parent457208b1e9498c1238b7af4387529388df0414c1 (diff)
downloadglibc-c4f50205e10b066654cf59ecde4fd1c2a674f19e.tar.xz
glibc-c4f50205e10b066654cf59ecde4fd1c2a674f19e.zip
Add some spaces before '('.
This patch fixes various places where a space should have been present before '(' in accordance with the GNU Coding Standards. Most but not all of the fixes in this patch are for calls to sizeof (but it's not exhaustive regarding such calls that should be fixed). Tested for x86_64, and with build-many-glibcs.py. * benchtests/bench-strcpy.c (do_test): Use space before '('. * benchtests/bench-string.h (cmdline_process_function): Likewise. * benchtests/bench-strlen.c (do_test): Likewise. (test_main): Likewise. * catgets/gencat.c (read_old): Likewise. * elf/cache.c (load_aux_cache): Likewise. * iconvdata/bug-iconv8.c (do_test): Likewise. * math/test-tgmath-ret.c (do_test): Likewise. * nis/nis_call.c (rec_dirsearch): Likewise. * nis/nis_findserv.c (__nis_findfastest_with_timeout): Likewise. * nptl/tst-audit-threads.c (do_test): Likewise. * nptl/tst-cancel4-common.h (set_socket_buffer): Likewise. * nss/nss_test1.c (init): Likewise. * nss/test-netdb.c (test_hosts): Likewise. * posix/execvpe.c (maybe_script_execute): Likewise. * stdio-common/tst-fmemopen4.c (do_test): Likewise. * stdio-common/tst-printf.c (do_test): Likewise. * stdio-common/vfscanf-internal.c (__vfscanf_internal): Likewise. * stdlib/fmtmsg.c (NKEYWORDS): Likewise. * stdlib/qsort.c (STACK_SIZE): Likewise. * stdlib/test-canon.c (do_test): Likewise. * stdlib/tst-swapcontext1.c (do_test): Likewise. * string/memcmp.c (OPSIZ): Likewise. * string/test-strcpy.c (do_test): Likewise. (do_random_tests): Likewise. * string/test-strlen.c (do_test): Likewise. (test_main): Likewise. * string/test-strrchr.c (do_test): Likewise. (do_random_tests): Likewise. * string/tester.c (test_memrchr): Likewise. (test_memchr): Likewise. * sysdeps/generic/memcopy.h (OPSIZ): Likewise. * sysdeps/generic/unwind-dw2.c (execute_stack_op): Likewise. * sysdeps/generic/unwind-pe.h (read_sleb128): Likewise. (read_encoded_value_with_base): Likewise. * sysdeps/hppa/dl-machine.h (elf_machine_runtime_setup): Likewise. * sysdeps/hppa/fpu/feupdateenv.c (__feupdateenv): Likewise. * sysdeps/ia64/fpu/sfp-machine.h (TI_BITS): Likewise. * sysdeps/mach/hurd/spawni.c (__spawni): Likewise. * sysdeps/posix/spawni.c (maybe_script_execute): Likewise. * sysdeps/powerpc/fpu/tst-setcontext-fpscr.c (query_auxv): Likewise. * sysdeps/unix/sysv/linux/aarch64/bits/procfs.h (ELF_NGREG): Likewise. * sysdeps/unix/sysv/linux/arm/bits/procfs.h (ELF_NGREG): Likewise. * sysdeps/unix/sysv/linux/arm/ioperm.c (init_iosys): Likewise. * sysdeps/unix/sysv/linux/csky/bits/procfs.h (ELF_NGREG): Likewise. * sysdeps/unix/sysv/linux/m68k/bits/procfs.h (ELF_NGREG): Likewise. * sysdeps/unix/sysv/linux/nios2/bits/procfs.h (ELF_NGREG): Likewise. * sysdeps/unix/sysv/linux/spawni.c (maybe_script_execute): Likewise. * sysdeps/unix/sysv/linux/x86/bits/procfs.h (ELF_NGREG): Likewise. * sysdeps/unix/sysv/linux/x86/bits/sigcontext.h (FP_XSTATE_MAGIC2_SIZE): Likewise. * sysdeps/x86/fpu/sfp-machine.h (TI_BITS): Likewise. * time/test_time.c (main): Likewise.
-rw-r--r--ChangeLog62
-rw-r--r--benchtests/bench-strcpy.c7
-rw-r--r--benchtests/bench-string.h2
-rw-r--r--benchtests/bench-strlen.c10
-rw-r--r--catgets/gencat.c2
-rw-r--r--elf/cache.c4
-rw-r--r--iconvdata/bug-iconv8.c4
-rw-r--r--math/test-tgmath-ret.c2
-rw-r--r--nis/nis_call.c2
-rw-r--r--nis/nis_findserv.c2
-rw-r--r--nptl/tst-audit-threads.c2
-rw-r--r--nptl/tst-cancel4-common.h4
-rw-r--r--nss/nss_test1.c2
-rw-r--r--nss/test-netdb.c2
-rw-r--r--posix/execvpe.c2
-rw-r--r--stdio-common/tst-fmemopen4.c6
-rw-r--r--stdio-common/tst-printf.c2
-rw-r--r--stdio-common/vfscanf-internal.c4
-rw-r--r--stdlib/fmtmsg.c2
-rw-r--r--stdlib/qsort.c2
-rw-r--r--stdlib/test-canon.c4
-rw-r--r--stdlib/tst-swapcontext1.c4
-rw-r--r--string/memcmp.c2
-rw-r--r--string/test-strcpy.c8
-rw-r--r--string/test-strlen.c12
-rw-r--r--string/test-strrchr.c4
-rw-r--r--string/tester.c12
-rw-r--r--sysdeps/generic/memcopy.h2
-rw-r--r--sysdeps/generic/unwind-dw2.c2
-rw-r--r--sysdeps/generic/unwind-pe.h4
-rw-r--r--sysdeps/hppa/dl-machine.h2
-rw-r--r--sysdeps/hppa/fpu/feupdateenv.c2
-rw-r--r--sysdeps/ia64/fpu/sfp-machine.h2
-rw-r--r--sysdeps/mach/hurd/spawni.c2
-rw-r--r--sysdeps/posix/spawni.c2
-rw-r--r--sysdeps/powerpc/fpu/tst-setcontext-fpscr.c2
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/bits/procfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/bits/procfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/ioperm.c2
-rw-r--r--sysdeps/unix/sysv/linux/csky/bits/procfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/bits/procfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/nios2/bits/procfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/spawni.c2
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/procfs.h2
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/sigcontext.h2
-rw-r--r--sysdeps/x86/fpu/sfp-machine.h2
-rw-r--r--time/test_time.c2
47 files changed, 138 insertions, 75 deletions
diff --git a/ChangeLog b/ChangeLog
index 9ab66cf735..34e4558bb5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,65 @@
+2019-02-27 Joseph Myers <joseph@codesourcery.com>
+
+ * benchtests/bench-strcpy.c (do_test): Use space before '('.
+ * benchtests/bench-string.h (cmdline_process_function): Likewise.
+ * benchtests/bench-strlen.c (do_test): Likewise.
+ (test_main): Likewise.
+ * catgets/gencat.c (read_old): Likewise.
+ * elf/cache.c (load_aux_cache): Likewise.
+ * iconvdata/bug-iconv8.c (do_test): Likewise.
+ * math/test-tgmath-ret.c (do_test): Likewise.
+ * nis/nis_call.c (rec_dirsearch): Likewise.
+ * nis/nis_findserv.c (__nis_findfastest_with_timeout): Likewise.
+ * nptl/tst-audit-threads.c (do_test): Likewise.
+ * nptl/tst-cancel4-common.h (set_socket_buffer): Likewise.
+ * nss/nss_test1.c (init): Likewise.
+ * nss/test-netdb.c (test_hosts): Likewise.
+ * posix/execvpe.c (maybe_script_execute): Likewise.
+ * stdio-common/tst-fmemopen4.c (do_test): Likewise.
+ * stdio-common/tst-printf.c (do_test): Likewise.
+ * stdio-common/vfscanf-internal.c (__vfscanf_internal): Likewise.
+ * stdlib/fmtmsg.c (NKEYWORDS): Likewise.
+ * stdlib/qsort.c (STACK_SIZE): Likewise.
+ * stdlib/test-canon.c (do_test): Likewise.
+ * stdlib/tst-swapcontext1.c (do_test): Likewise.
+ * string/memcmp.c (OPSIZ): Likewise.
+ * string/test-strcpy.c (do_test): Likewise.
+ (do_random_tests): Likewise.
+ * string/test-strlen.c (do_test): Likewise.
+ (test_main): Likewise.
+ * string/test-strrchr.c (do_test): Likewise.
+ (do_random_tests): Likewise.
+ * string/tester.c (test_memrchr): Likewise.
+ (test_memchr): Likewise.
+ * sysdeps/generic/memcopy.h (OPSIZ): Likewise.
+ * sysdeps/generic/unwind-dw2.c (execute_stack_op): Likewise.
+ * sysdeps/generic/unwind-pe.h (read_sleb128): Likewise.
+ (read_encoded_value_with_base): Likewise.
+ * sysdeps/hppa/dl-machine.h (elf_machine_runtime_setup): Likewise.
+ * sysdeps/hppa/fpu/feupdateenv.c (__feupdateenv): Likewise.
+ * sysdeps/ia64/fpu/sfp-machine.h (TI_BITS): Likewise.
+ * sysdeps/mach/hurd/spawni.c (__spawni): Likewise.
+ * sysdeps/posix/spawni.c (maybe_script_execute): Likewise.
+ * sysdeps/powerpc/fpu/tst-setcontext-fpscr.c (query_auxv):
+ Likewise.
+ * sysdeps/unix/sysv/linux/aarch64/bits/procfs.h (ELF_NGREG):
+ Likewise.
+ * sysdeps/unix/sysv/linux/arm/bits/procfs.h (ELF_NGREG): Likewise.
+ * sysdeps/unix/sysv/linux/arm/ioperm.c (init_iosys): Likewise.
+ * sysdeps/unix/sysv/linux/csky/bits/procfs.h (ELF_NGREG):
+ Likewise.
+ * sysdeps/unix/sysv/linux/m68k/bits/procfs.h (ELF_NGREG):
+ Likewise.
+ * sysdeps/unix/sysv/linux/nios2/bits/procfs.h (ELF_NGREG):
+ Likewise.
+ * sysdeps/unix/sysv/linux/spawni.c (maybe_script_execute):
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86/bits/procfs.h (ELF_NGREG): Likewise.
+ * sysdeps/unix/sysv/linux/x86/bits/sigcontext.h
+ (FP_XSTATE_MAGIC2_SIZE): Likewise.
+ * sysdeps/x86/fpu/sfp-machine.h (TI_BITS): Likewise.
+ * time/test_time.c (main): Likewise.
+
2019-02-27 Adhemerval Zanella <adhemerval.zanella@linaro.org>
* wcsmbs/wcsnlen.c (__wcsnlen): Rewrite using wmemchr.
diff --git a/benchtests/bench-strcpy.c b/benchtests/bench-strcpy.c
index 92cad4cc65..9fe999e5f4 100644
--- a/benchtests/bench-strcpy.c
+++ b/benchtests/bench-strcpy.c
@@ -102,11 +102,11 @@ do_test (size_t align1, size_t align2, size_t len, int max_char)
but in wchar_ts, in bytes it will equal to align * (sizeof (wchar_t))
len for wcschr here isn't in bytes but it's number of wchar_t symbols. */
align1 &= 7;
- if ((align1 + len) * sizeof(CHAR) >= page_size)
+ if ((align1 + len) * sizeof (CHAR) >= page_size)
return;
align2 &= 7;
- if ((align2 + len) * sizeof(CHAR) >= page_size)
+ if ((align2 + len) * sizeof (CHAR) >= page_size)
return;
s1 = (CHAR *) (buf1) + align1;
@@ -116,7 +116,8 @@ do_test (size_t align1, size_t align2, size_t len, int max_char)
s1[i] = 32 + 23 * i % (max_char - 32);
s1[len] = 0;
- printf ("Length %4zd, alignments in bytes %2zd/%2zd:", len, align1 * sizeof(CHAR), align2 * sizeof(CHAR));
+ printf ("Length %4zd, alignments in bytes %2zd/%2zd:", len,
+ align1 * sizeof (CHAR), align2 * sizeof (CHAR));
FOR_EACH_IMPL (impl, 0)
do_one_test (impl, s2, s1, len);
diff --git a/benchtests/bench-string.h b/benchtests/bench-string.h
index e1014ead77..9d3332a624 100644
--- a/benchtests/bench-string.h
+++ b/benchtests/bench-string.h
@@ -156,7 +156,7 @@ cmdline_process_function (int c)
case OPT_RANDOM:
{
int fdr = open ("/dev/urandom", O_RDONLY);
- if (fdr < 0 || read (fdr, &seed, sizeof(seed)) != sizeof (seed))
+ if (fdr < 0 || read (fdr, &seed, sizeof (seed)) != sizeof (seed))
seed = time (NULL);
if (fdr >= 0)
close (fdr);
diff --git a/benchtests/bench-strlen.c b/benchtests/bench-strlen.c
index f86095a5d3..f6a8bf5dff 100644
--- a/benchtests/bench-strlen.c
+++ b/benchtests/bench-strlen.c
@@ -75,7 +75,7 @@ do_test (json_ctx_t *json_ctx, size_t align, size_t len)
size_t i;
align &= 63;
- if (align + sizeof(CHAR) * len >= page_size)
+ if (align + sizeof (CHAR) * len >= page_size)
return;
json_element_object_begin (json_ctx);
@@ -127,16 +127,16 @@ test_main (void)
for (i = 1; i < 8; ++i)
{
- do_test (&json_ctx, sizeof(CHAR) * i, i);
+ do_test (&json_ctx, sizeof (CHAR) * i, i);
do_test (&json_ctx, 0, i);
}
for (i = 2; i <= 12; ++i)
{
do_test (&json_ctx, 0, 1 << i);
- do_test (&json_ctx, sizeof(CHAR) * 7, 1 << i);
- do_test (&json_ctx, sizeof(CHAR) * i, 1 << i);
- do_test (&json_ctx, sizeof(CHAR) * i, (size_t)((1 << i) / 1.5));
+ do_test (&json_ctx, sizeof (CHAR) * 7, 1 << i);
+ do_test (&json_ctx, sizeof (CHAR) * i, 1 << i);
+ do_test (&json_ctx, sizeof (CHAR) * i, (size_t)((1 << i) / 1.5));
}
json_array_end (&json_ctx);
diff --git a/catgets/gencat.c b/catgets/gencat.c
index 51fd2a724e..f0d47ae057 100644
--- a/catgets/gencat.c
+++ b/catgets/gencat.c
@@ -1270,7 +1270,7 @@ read_old (struct catalog *catalog, const char *file_name)
Insert it at the right position. */
struct message_list *newp;
- newp = (struct message_list *) xmalloc (sizeof(*newp));
+ newp = (struct message_list *) xmalloc (sizeof (*newp));
newp->number = old_cat_obj.name_ptr[cnt * 3 + 1];
newp->message =
&old_cat_obj.strings[old_cat_obj.name_ptr[cnt * 3 + 2]];
diff --git a/elf/cache.c b/elf/cache.c
index a64d67ecbe..d0d5858448 100644
--- a/elf/cache.c
+++ b/elf/cache.c
@@ -712,8 +712,8 @@ load_aux_cache (const char *aux_cache_name)
if (aux_cache == MAP_FAILED
|| aux_cache_size < sizeof (struct aux_cache_file)
|| memcmp (aux_cache->magic, AUX_CACHEMAGIC, sizeof AUX_CACHEMAGIC - 1)
- || aux_cache_size != (sizeof(struct aux_cache_file)
- + aux_cache->nlibs * sizeof(struct aux_cache_file_entry)
+ || aux_cache_size != (sizeof (struct aux_cache_file)
+ + aux_cache->nlibs * sizeof (struct aux_cache_file_entry)
+ aux_cache->len_strings))
{
close (fd);
diff --git a/iconvdata/bug-iconv8.c b/iconvdata/bug-iconv8.c
index b91dc1d1f2..e32d891b5c 100644
--- a/iconvdata/bug-iconv8.c
+++ b/iconvdata/bug-iconv8.c
@@ -16,9 +16,9 @@ do_test (void)
size_t ret;
inbuf = in;
- inbytesleft = sizeof(in) - 1;
+ inbytesleft = sizeof (in) - 1;
outbuf = out;
- outbytesleft = sizeof(out);
+ outbytesleft = sizeof (out);
cd = iconv_open("utf-8", "cp932");
ret = iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
diff --git a/math/test-tgmath-ret.c b/math/test-tgmath-ret.c
index 676edf7b70..7c4cabbb80 100644
--- a/math/test-tgmath-ret.c
+++ b/math/test-tgmath-ret.c
@@ -84,7 +84,7 @@ do_test (void)
check_return_fromfpx ();
check_return_ufromfpx ();
- printf ("%Zd\n", sizeof(carg (lx)));
+ printf ("%Zd\n", sizeof (carg (lx)));
return errors != 0;
}
diff --git a/nis/nis_call.c b/nis/nis_call.c
index c1cfd8dcec..a48ecc39a8 100644
--- a/nis/nis_call.c
+++ b/nis/nis_call.c
@@ -503,7 +503,7 @@ rec_dirsearch (const_nis_name name, directory_obj *dir, nis_error *status)
return dir;
}
nis_free_directory (dir);
- obj = calloc (1, sizeof(directory_obj));
+ obj = calloc (1, sizeof (directory_obj));
if (obj == NULL)
{
__free_fdresult (fd_res);
diff --git a/nis/nis_findserv.c b/nis/nis_findserv.c
index 5a76a130dd..d0ce3e8693 100644
--- a/nis/nis_findserv.c
+++ b/nis/nis_findserv.c
@@ -127,7 +127,7 @@ __nis_findfastest_with_timeout (dir_binding *bind,
}
memcpy ((char *) &pings[pings_count].sin, (char *) &sin,
sizeof (sin));
- memcpy ((char *)&saved_sin, (char *)&sin, sizeof(sin));
+ memcpy ((char *)&saved_sin, (char *)&sin, sizeof (sin));
pings[pings_count].xid = xid_seed + pings_count;
pings[pings_count].server_nr = i;
pings[pings_count].server_ep = j;
diff --git a/nptl/tst-audit-threads.c b/nptl/tst-audit-threads.c
index ad10fbf652..5846248771 100644
--- a/nptl/tst-audit-threads.c
+++ b/nptl/tst-audit-threads.c
@@ -77,7 +77,7 @@ do_test (void)
/* Used to synchronize all the threads after calling each retNumN. */
xpthread_barrier_init (&barrier, NULL, num_threads);
- threads = (pthread_t *) xcalloc (num_threads, sizeof(pthread_t));
+ threads = (pthread_t *) xcalloc (num_threads, sizeof (pthread_t));
for (i = 0; i < num_threads; i++)
threads[i] = xpthread_create(NULL, thread_main, NULL);
diff --git a/nptl/tst-cancel4-common.h b/nptl/tst-cancel4-common.h
index 6799aa486b..18702fbf51 100644
--- a/nptl/tst-cancel4-common.h
+++ b/nptl/tst-cancel4-common.h
@@ -68,10 +68,10 @@ static void
set_socket_buffer (int s)
{
int val = 1;
- socklen_t len = sizeof(val);
+ socklen_t len = sizeof (val);
TEST_VERIFY_EXIT (setsockopt (s, SOL_SOCKET, SO_SNDBUF, &val,
- sizeof(val)) == 0);
+ sizeof (val)) == 0);
TEST_VERIFY_EXIT (getsockopt (s, SOL_SOCKET, SO_SNDBUF, &val, &len) == 0);
TEST_VERIFY_EXIT (val < WRITE_BUFFER_SIZE);
}
diff --git a/nss/nss_test1.c b/nss/nss_test