Add more spaces before '('.

This patch fixes more places where a space should have been present
before '(' in accordance with the GNU Coding Standards (as with the
previous patch, mainly for calls to sizeof).

Tested with build-many-glibcs.py.

	* sysdeps/powerpc/powerpc32/dl-machine.c
	(__elf_machine_fixup_plt): Use space before '('.
	(__process_machine_rela): Likewise.
	* sysdeps/powerpc/powerpc32/register-dump.h (register_dump):
	Likewise.
	* sysdeps/powerpc/powerpc64/le/fpu/sfp-machine.h (TI_BITS):
	Likewise.
	* sysdeps/powerpc/powerpc64/register-dump.h (register_dump):
	Likewise.
	* sysdeps/powerpc/test-arith.c (union_t): Likewise.
	(pattern): Likewise.
	(delta): Likewise.
	(check_result): Likewise.
	(check_excepts): Likewise.
	(check_op): Likewise.
	(fail_xr): Likewise.
	* sysdeps/unix/alpha/sysdep.h (syscall_promote): Likewise.
	* sysdeps/unix/sysv/linux/alpha/a.out.h (AOUTHSZ): Likewise.
	(SCNHSZ): Likewise.
	* sysdeps/unix/sysv/linux/hppa/makecontext.c (FRAME_SIZE_BYTES):
	Likewise.
	(ARGS): Likewise.
	(__makecontext): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h (ucontext_t):
	Likewise.
This commit is contained in:
Joseph Myers 2019-02-28 15:02:09 +00:00
parent cc3e573ce3
commit 462e83a4a0
10 changed files with 63 additions and 35 deletions

View File

@ -1,3 +1,31 @@
2019-02-28 Joseph Myers <joseph@codesourcery.com>
* sysdeps/powerpc/powerpc32/dl-machine.c
(__elf_machine_fixup_plt): Use space before '('.
(__process_machine_rela): Likewise.
* sysdeps/powerpc/powerpc32/register-dump.h (register_dump):
Likewise.
* sysdeps/powerpc/powerpc64/le/fpu/sfp-machine.h (TI_BITS):
Likewise.
* sysdeps/powerpc/powerpc64/register-dump.h (register_dump):
Likewise.
* sysdeps/powerpc/test-arith.c (union_t): Likewise.
(pattern): Likewise.
(delta): Likewise.
(check_result): Likewise.
(check_excepts): Likewise.
(check_op): Likewise.
(fail_xr): Likewise.
* sysdeps/unix/alpha/sysdep.h (syscall_promote): Likewise.
* sysdeps/unix/sysv/linux/alpha/a.out.h (AOUTHSZ): Likewise.
(SCNHSZ): Likewise.
* sysdeps/unix/sysv/linux/hppa/makecontext.c (FRAME_SIZE_BYTES):
Likewise.
(ARGS): Likewise.
(__makecontext): Likewise.
* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h (ucontext_t):
Likewise.
2019-02-28 Florian Weimer <fweimer@redhat.com> 2019-02-28 Florian Weimer <fweimer@redhat.com>
[BZ #23937] [BZ #23937]

View File

@ -348,7 +348,7 @@ __elf_machine_fixup_plt (struct link_map *map,
Elf32_Word index, offset, num_plt_entries; Elf32_Word index, offset, num_plt_entries;
num_plt_entries = (map->l_info[DT_PLTRELSZ]->d_un.d_val num_plt_entries = (map->l_info[DT_PLTRELSZ]->d_un.d_val
/ sizeof(Elf32_Rela)); / sizeof (Elf32_Rela));
plt = (Elf32_Word *) D_PTR (map, l_info[DT_PLTGOT]); plt = (Elf32_Word *) D_PTR (map, l_info[DT_PLTGOT]);
offset = reloc_addr - plt; offset = reloc_addr - plt;
index = (offset - PLT_INITIAL_ENTRY_WORDS)/2; index = (offset - PLT_INITIAL_ENTRY_WORDS)/2;
@ -538,7 +538,7 @@ __process_machine_rela (struct link_map *map,
{ {
index = (offset - PLT_INITIAL_ENTRY_WORDS)/2; index = (offset - PLT_INITIAL_ENTRY_WORDS)/2;
num_plt_entries = (map->l_info[DT_PLTRELSZ]->d_un.d_val num_plt_entries = (map->l_info[DT_PLTRELSZ]->d_un.d_val
/ sizeof(Elf32_Rela)); / sizeof (Elf32_Rela));
data_words = plt + PLT_DATA_START_WORDS (num_plt_entries); data_words = plt + PLT_DATA_START_WORDS (num_plt_entries);
data_words[index] = finaladdr; data_words[index] = finaladdr;
reloc_addr[0] = OPCODE_LI (11, index * 4); reloc_addr[0] = OPCODE_LI (11, index * 4);

View File

@ -96,15 +96,15 @@ r28=000001c% r29=000001d% r30=000001e% r31=000001f% fscr=0000071% ccr=0000026%\
static void static void
register_dump (int fd, struct sigcontext *ctx) register_dump (int fd, struct sigcontext *ctx)
{ {
char buffer[sizeof(dumpform)]; char buffer[sizeof (dumpform)];
char *bufferpos; char *bufferpos;
unsigned regno; unsigned regno;
unsigned *regs = (unsigned *)(ctx->regs); unsigned *regs = (unsigned *)(ctx->regs);
memcpy(buffer, dumpform, sizeof(dumpform)); memcpy(buffer, dumpform, sizeof (dumpform));
/* Generate the output. */ /* Generate the output. */
while ((bufferpos = memchr (buffer, '%', sizeof(dumpform)))) while ((bufferpos = memchr (buffer, '%', sizeof (dumpform))))
{ {
regno = xtoi (bufferpos[-1]) | xtoi (bufferpos[-2]) << 4; regno = xtoi (bufferpos[-1]) | xtoi (bufferpos[-2]) << 4;
memset (bufferpos-2, '0', 3); memset (bufferpos-2, '0', 3);
@ -112,7 +112,7 @@ register_dump (int fd, struct sigcontext *ctx)
} }
/* Write the output. */ /* Write the output. */
write (fd, buffer, sizeof(buffer) - 1); write (fd, buffer, sizeof (buffer) - 1);
} }

View File

@ -6,7 +6,7 @@
typedef int TItype __attribute__ ((mode (TI))); typedef int TItype __attribute__ ((mode (TI)));
typedef unsigned int UTItype __attribute__ ((mode (TI))); typedef unsigned int UTItype __attribute__ ((mode (TI)));
#define TI_BITS (__CHAR_BIT__ * (int)sizeof(TItype)) #define TI_BITS (__CHAR_BIT__ * (int) sizeof (TItype))
/* The type of the result of a floating point comparison. This must /* The type of the result of a floating point comparison. This must
match `__libgcc_cmp_return__' in GCC for the target. */ match `__libgcc_cmp_return__' in GCC for the target. */

View File

@ -100,15 +100,15 @@ fp28-31: 00000000000004c% 00000000000004d% 00000000000004e% 00000000000004f%\n\
static void static void
register_dump (int fd, struct sigcontext *ctx) register_dump (int fd, struct sigcontext *ctx)
{ {
char buffer[sizeof(dumpform)]; char buffer[sizeof (dumpform)];
char *bufferpos; char *bufferpos;
unsigned regno; unsigned regno;
unsigned long *regs = (unsigned long *)(ctx->regs); unsigned long *regs = (unsigned long *)(ctx->regs);
memcpy(buffer, dumpform, sizeof(dumpform)); memcpy(buffer, dumpform, sizeof (dumpform));
/* Generate the output. */ /* Generate the output. */
while ((bufferpos = memchr (buffer, '%', sizeof(dumpform)))) while ((bufferpos = memchr (buffer, '%', sizeof (dumpform))))
{ {
regno = xtoi (bufferpos[-1]) | xtoi (bufferpos[-2]) << 4; regno = xtoi (bufferpos[-1]) | xtoi (bufferpos[-2]) << 4;
memset (bufferpos-2, '0', 3); memset (bufferpos-2, '0', 3);
@ -116,7 +116,7 @@ register_dump (int fd, struct sigcontext *ctx)
} }
/* Write the output. */ /* Write the output. */
write (fd, buffer, sizeof(buffer) - 1); write (fd, buffer, sizeof (buffer) - 1);
} }

View File

@ -43,7 +43,7 @@ static const char * const rmnames[4] =
typedef union { typedef union {
tocheck_t tc; tocheck_t tc;
unsigned char c[sizeof(tocheck_t)]; unsigned char c[sizeof (tocheck_t)];
} union_t; } union_t;
/* Don't try reading these in a font that doesn't distinguish /* Don't try reading these in a font that doesn't distinguish
@ -170,7 +170,7 @@ pattern(int negative, pattern_t exp, pattern_t mant)
pattern_fill(mant, result.c, ESIZE+1, MSIZE); pattern_fill(mant, result.c, ESIZE+1, MSIZE);
#if 0 #if 0
printf("neg=%d exp=%02x mant=%02x: ", negative, exp, mant); printf("neg=%d exp=%02x mant=%02x: ", negative, exp, mant);
for (i = 0; i < sizeof(tocheck_t); i++) for (i = 0; i < sizeof (tocheck_t); i++)
printf("%02x", result.c[i]); printf("%02x", result.c[i]);
printf("\n"); printf("\n");
#endif #endif
@ -193,10 +193,10 @@ delta(tocheck_t x, int direction)
{ {
union_t tx; union_t tx;
tx.tc = pattern(xx.c[0] >> 7, P_O, P_Z); tx.tc = pattern(xx.c[0] >> 7, P_O, P_Z);
if (memcmp(tx.c, xx.c, sizeof(tocheck_t)) == 0) if (memcmp (tx.c, xx.c, sizeof (tocheck_t)) == 0)
return x; return x;
} }
for (i = sizeof(tocheck_t)-1; i > 0; i--) for (i = sizeof (tocheck_t)-1; i > 0; i--)
{ {
xx.c[i] += direction; xx.c[i] += direction;
if (xx.c[i] != (direction > 0 ? 0 : 0xff)) if (xx.c[i] != (direction > 0 ? 0 : 0xff))
@ -222,7 +222,7 @@ static const int all_exceptions = FE_ALL_EXCEPT;
static void static void
check_result(int line, const char *rm, tocheck_t expected, tocheck_t actual) check_result(int line, const char *rm, tocheck_t expected, tocheck_t actual)
{ {
if (memcmp(&expected, &actual, sizeof(tocheck_t)) != 0) if (memcmp (&expected, &actual, sizeof (tocheck_t)) != 0)
{ {
unsigned char *ex, *ac; unsigned char *ex, *ac;
size_t i; size_t i;
@ -231,10 +231,10 @@ check_result(int line, const char *rm, tocheck_t expected, tocheck_t actual)
" expected result 0x", __FILE__, line, rm); " expected result 0x", __FILE__, line, rm);
ex = (unsigned char *)&expected; ex = (unsigned char *)&expected;
ac = (unsigned char *)&actual; ac = (unsigned char *)&actual;
for (i = 0; i < sizeof(tocheck_t); i++) for (i = 0; i < sizeof (tocheck_t); i++)
printf("%02x", ex[i]); printf("%02x", ex[i]);
printf(" got 0x"); printf(" got 0x");
for (i = 0; i < sizeof(tocheck_t); i++) for (i = 0; i < sizeof (tocheck_t); i++)
printf("%02x", ac[i]); printf("%02x", ac[i]);
printf("\n"); printf("\n");
nerrors++; nerrors++;
@ -325,13 +325,13 @@ check_excepts(int line, const char *rm, int expected, int actual)
size_t i; size_t i;
printf("%s:%d:round %s:exceptions failed\n" printf("%s:%d:round %s:exceptions failed\n"
" expected exceptions ", __FILE__, line,rm); " expected exceptions ", __FILE__, line,rm);
for (i = 0; i < sizeof(excepts)/sizeof(excepts[0]); i++) for (i = 0; i < sizeof (excepts) / sizeof (excepts[0]); i++)
if (expected & excepts[i].except) if (expected & excepts[i].except)
printf("%s ",excepts[i].name); printf("%s ",excepts[i].name);
if ((expected & all_exceptions) == 0) if ((expected & all_exceptions) == 0)
printf("- "); printf("- ");
printf("got"); printf("got");
for (i = 0; i < sizeof(excepts)/sizeof(excepts[0]); i++) for (i = 0; i < sizeof (excepts) / sizeof (excepts[0]); i++)
if (actual & excepts[i].except) if (actual & excepts[i].except)
printf(" %s",excepts[i].name); printf(" %s",excepts[i].name);
if ((actual & all_exceptions) == 0) if ((actual & all_exceptions) == 0)
@ -463,7 +463,7 @@ check_op(void)
tocheck_t r, a, b, x; tocheck_t r, a, b, x;
int raised; int raised;
for (i = 0; i < sizeof(optests)/sizeof(optests[0]); i++) for (i = 0; i < sizeof (optests) / sizeof (optests[0]); i++)
{ {
a = pattern(optests[i].a_sgn, optests[i].a_exp, a = pattern(optests[i].a_sgn, optests[i].a_exp,
optests[i].a_mant); optests[i].a_mant);
@ -504,13 +504,13 @@ fail_xr(int line, const char *rm, tocheck_t x, tocheck_t r, tocheck_t xx,
cx = (unsigned char *)&x; cx = (unsigned char *)&x;
cr = (unsigned char *)&r; cr = (unsigned char *)&r;
cxx = (unsigned char *)&xx; cxx = (unsigned char *)&xx;
for (i = 0; i < sizeof(tocheck_t); i++) for (i = 0; i < sizeof (tocheck_t); i++)
printf("%02x", cx[i]); printf("%02x", cx[i]);
printf(" r=0x"); printf(" r=0x");
for (i = 0; i < sizeof(tocheck_t); i++) for (i = 0; i < sizeof (tocheck_t); i++)
printf("%02x", cr[i]); printf("%02x", cr[i]);
printf(" xx=0x"); printf(" xx=0x");
for (i = 0; i < sizeof(tocheck_t); i++) for (i = 0; i < sizeof (tocheck_t); i++)
printf("%02x", cxx[i]); printf("%02x", cxx[i]);
printf(" inexact=%d\n", xflag != 0); printf(" inexact=%d\n", xflag != 0);
nerrors++; nerrors++;

View File

@ -200,7 +200,7 @@ __LABEL(name) \
no matter what the "real" sign of the 32-bit type. We want to no matter what the "real" sign of the 32-bit type. We want to
preserve that when filling in values for the kernel. */ preserve that when filling in values for the kernel. */
#define syscall_promote(arg) \ #define syscall_promote(arg) \
(sizeof(arg) == 4 ? (long)(int)(long)(arg) : (long)(arg)) (sizeof (arg) == 4 ? (long)(int)(long)(arg) : (long)(arg))
/* Make sure and "use" the variable that we're not returning, /* Make sure and "use" the variable that we're not returning,
in order to suppress unused variable warnings. */ in order to suppress unused variable warnings. */

View File

@ -72,8 +72,8 @@ struct exec
#define a_gpvalue ah.gpvalue #define a_gpvalue ah.gpvalue
#define AOUTHSZ sizeof(struct aouthdr) #define AOUTHSZ sizeof (struct aouthdr)
#define SCNHSZ sizeof(struct scnhdr) #define SCNHSZ sizeof (struct scnhdr)
#define SCNROUND 16 #define SCNROUND 16
enum machine_type enum machine_type

View File

@ -31,9 +31,9 @@
/* Size of frame marker in unsigned long words. */ /* Size of frame marker in unsigned long words. */
#define FRAME_SIZE_UL 8 #define FRAME_SIZE_UL 8
/* Size of frame marker in bytes. */ /* Size of frame marker in bytes. */
#define FRAME_SIZE_BYTES (8 * sizeof(unsigned long)) #define FRAME_SIZE_BYTES (8 * sizeof (unsigned long))
/* Size of X arguments in bytes. */ /* Size of X arguments in bytes. */
#define ARGS(x) (x * sizeof(unsigned long)) #define ARGS(x) (x * sizeof (unsigned long))
void void
__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...) __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
@ -61,14 +61,14 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
if (ucp->uc_link) if (ucp->uc_link)
{ {
/* Returning to the next context and next frame. */ /* Returning to the next context and next frame. */
sp[-4/sizeof(unsigned long)] = ucp->uc_link->uc_mcontext.sc_gr[30]; sp[-4 / sizeof (unsigned long)] = ucp->uc_link->uc_mcontext.sc_gr[30];
sp[-20/sizeof(unsigned long)] = ucp->uc_link->uc_mcontext.sc_gr[2]; sp[-20 / sizeof (unsigned long)] = ucp->uc_link->uc_mcontext.sc_gr[2];
} }
else else
{ {
/* This is the main context. No frame marker, and no return address. */ /* This is the main context. No frame marker, and no return address. */
sp[-4/sizeof(unsigned long)] = 0x0; sp[-4 / sizeof (unsigned long)] = 0x0;
sp[-20/sizeof(unsigned long)] = 0x0; sp[-20 / sizeof (unsigned long)] = 0x0;
} }
/* Store address to jump to. */ /* Store address to jump to. */
@ -84,7 +84,7 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
continue; continue;
} }
if ((i < 8) && (sizeof(unsigned long) == 8)) if ((i < 8) && (sizeof (unsigned long) == 8))
{ {
/* 64bit: r19-r22 are arg7-arg4. */ /* 64bit: r19-r22 are arg7-arg4. */
ucp->uc_mcontext.sc_gr[22+4-i] = va_arg (ap, int); ucp->uc_mcontext.sc_gr[22+4-i] = va_arg (ap, int);

View File

@ -188,7 +188,7 @@ typedef struct ucontext_t
} uc_mcontext; } uc_mcontext;
sigset_t uc_sigmask; sigset_t uc_sigmask;
/* last for extensibility */ /* last for extensibility */
char __ctx(uc_reg_space)[sizeof(mcontext_t) + 12]; char __ctx(uc_reg_space)[sizeof (mcontext_t) + 12];
#else /* 64-bit */ #else /* 64-bit */
sigset_t uc_sigmask; sigset_t uc_sigmask;
mcontext_t uc_mcontext; /* last for extensibility */ mcontext_t uc_mcontext; /* last for extensibility */