Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid use of "register" as optimization hint.
  • Loading branch information
Joseph Myers committed Jun 7, 2013
1 parent 8e254d8 commit 2e09a79
Show file tree
Hide file tree
Showing 79 changed files with 430 additions and 278 deletions.
145 changes: 145 additions & 0 deletions ChangeLog
@@ -1,3 +1,148 @@
2013-06-07 Joseph Myers <joseph@codesourcery.com>

* bits/byteswap.h [__GNUC__ && !__GNUC_PREREQ (4, 3)]
(__bswap_32): Do not use "register".
* crypt/crypt.c (_ufc_doit_r): Likewise.
* debug/stpcpy_chk.c (__stpcpy_chk): Likewise.
* debug/wcscat_chk.c (__wcscat_chk): Likewise.
* gmon/gmon.c (__monstartup): Likewise.
* gmon/mcount.c (_MCOUNT_DECL(frompc, selfpc)): Likewise.
* hurd/hurdmalloc.c (more_memory): Likewise.
(malloc): Likewise.
(free): Likewise.
(realloc): Likewise.
(malloc_fork_prepare): Likewise.
(malloc_fork_parent): Likewise.
(malloc_fork_child): Likewise.
* include/rpc/auth_des.h (xdr_authdes_verf): Likewise.
(_svcauth_des): Likewise.
* inet/inet_lnaof.c (inet_lnaof): Likewise.
* inet/inet_net.c (inet_network): Likewise.
* inet/inet_netof.c (inet_netof): Likewise.
* inet/rcmd.c (__validuser2_sa): Likewise.
* io/fts.c (fts_open): Likewise.
(fts_load): Likewise.
(fts_close): Likewise.
(fts_read): Likewise.
(fts_children): Likewise.
(fts_build): Likewise.
(fts_stat): Likewise.
(fts_sort): Likewise.
(fts_alloc): Likewise.
(fts_lfree): Likewise.
* libio/fileops.c (_IO_new_file_xsputn): Likewise.
(_IO_file_xsgetn): Likewise.
(_IO_file_xsgetn_mmap): Likewise.
* libio/iofopncook.c (_IO_cookie_read): Likewise.
(_IO_cookie_write): Likewise.
* libio/oldfileops.c (_IO_old_file_xsputn): Likewise.
* libio/wfileops.c (_IO_wfile_xsputn): Likewise.
* mach/msgserver.c (__mach_msg_server_timeout): Likewise.
* malloc/obstack.c (_obstack_begin): Likewise.
(_obstack_begin_1): Likewise.
(_obstack_newchunk): Likewise.
(_obstack_allocated_p): Likewise.
(obstack_free): Likewise.
(_obstack_memory_used): Likewise.
* misc/getttyent.c (getttynam): Likewise.
(getttyent): Likewise.
(skip): Likewise.
(value): Likewise.
* misc/getusershell.c (initshells): Likewise.
* misc/syslog.c (__vsyslog_chk): Likewise.
* misc/ttyslot.c (ttyslot): Likewise.
* nis/nis_hash.c (__nis_hash): Likewise.
* posix/fnmatch_loop.c (FCT): Likewise.
* posix/getconf.c (print_all): Likewise.
(main): Likewise.
* posix/getopt.c (exchange): Likewise.
* posix/glob.c (globfree): Likewise.
(prefix_array): Likewise.
(__glob_pattern_type): Likewise.
* resolv/arpa/nameser.h (NS_GET16): Likewise.
(NS_GET32): Likewise.
(NS_PUT16): Likewise.
(NS_PUT32): Likewise.
* resolv/gethnamaddr.c (getanswer): Likewise.
(gethostbyname2): Likewise.
(gethostbyaddr): Likewise.
(_gethtent): Likewise.
(_gethtbyname2): Likewise.
(_gethtbyaddr): Likewise.
* resolv/ns_print.c (dst_s_get_int16): Likewise.
* resolv/nss_dns/dns-host.c (getanswer_r): Likewise.
* resolv/res_init.c (__res_vinit): Likewise.
(net_mask): Likewise.
* resolv/res_mkquery.c (outchar): Likewise.
(PRINT): Likewise.
* stdio-common/printf_fp.c (outchar): Likewise.
(PRINT): Likewise.
* stdio-common/printf_fphex.c (outchar): Likewise.
(PRINT): Likewise.
* stdio-common/printf_size.c (outchar): Likewise.
(PRINT): Likewise.
* stdio-common/test_rdwr.c (main): Likewise.
* stdio-common/tfformat.c (matches): Likewise.
* stdio-common/vfprintf.c (outchar): Likewise.
(printf_unknown): Likewise.
(buffered_vfprintf): Likewise.
* stdio-common/vfscanf.c (_IO_vfscanf_internal): Likewise.
* stdio-common/xbug.c (AppendToBuffer): Likewise.
(ReadFile): Likewise.
* stdlib/qsort.c (SWAP): Likewise.
(_quicksort): Likewise.
* stdlib/setenv.c (__add_to_environ): Likewise.
* stdlib/strtod_l.c (____STRTOF_INTERNAL): Likewise.
* stdlib/strtol_l.c (__strtol_l): Likewise.
* stdlib/tst-strtod.c (main): Likewise.
* stdlib/tst-strtol.c (main): Likewise.
* stdlib/tst-strtoll.c (main): Likewise.
* string/bits/string2.h (__strcmp_cc): Likewise.
(__strcmp_cg): Likewise.
(__strcspn_c1): Likewise.
(__strcspn_c2): Likewise.
(__strcspn_c3): Likewise.
(__strspn_c1): Likewise.
(__strspn_c2): Likewise.
(__strspn_c3): Likewise.
(__strsep_1c): Likewise.
(__strsep_2c): Likewise.
(__strsep_3c): Likewise.
* string/memccpy.c (__memccpy): Likewise.
* string/stpcpy.c (__stpcpy): Likewise.
* string/strcmp.c (strcmp): Likewise.
* string/strrchr.c (strrchr): Likewise.
* sysdeps/generic/sigset-cvt-mask.h (sigset_get_old_mask):
Likewise.
* sysdeps/mach/hurd/getcwd.c
(_hurd_canonicalize_directory_name_internal): Likewise.
* sysdeps/mach/i386/sysdep.h (SNARF_ARGS): Likewise.
* sysdeps/powerpc/powerpc32/power6/wcschr.c (wcschr): Likewise.
* sysdeps/powerpc/powerpc32/power6/wcsrchr.c (wcsrchr): Likewise.
* sysdeps/x86/bits/byteswap-16.h [__GNUC__] (__bswap_16):
Likewise, in both definitions.
* sysdeps/x86/bits/byteswap.h (__bswap_32): Likewise, in multiple
definitions.
[__GNUC_PREREQ (2, 0) && !__GNUC_PREREQ (4, 3) && __WORDSIZE ==
64] (__bswap_64): Likewise.
* time/test_time.c (main): Likewise.
* time/tzfile.c (__tzfile_read): Likewise.
(__tzfile_compute): Likewise.
* time/tzset.c (__tzset_parse_tz): Likewise.
(tzset_internal): Likewise.
(compute_change): Likewise.
* wcsmbs/wcscat.c (__wcscat): Likewise.
* wcsmbs/wcschr.c (wcschr): Likewise.
* wcsmbs/wcschrnul.c (__wcschrnul): Likewise.
* wcsmbs/wcscspn.c (wcscspn): Likewise.
* wcsmbs/wcspbrk.c (wcspbrk): Likewise.
* wcsmbs/wcsrchr.c (wcsrchr): Likewise.
* wcsmbs/wcsspn.c (wcsspn): Likewise.
* wcsmbs/wcsstr.c (wcsstr): Likewise.
* wcsmbs/wmemchr.c (wmemchr): Likewise.
* wcsmbs/wmemcmp.c (WMEMCMP): Likewise.
* wcsmbs/wmemset.c (wmemset): Likewise.

2013-06-06 Joseph Myers <joseph@codesourcery.com>

* scripts/config.guess: Update to version 2013-05-16.
Expand Down
2 changes: 1 addition & 1 deletion bits/byteswap.h
Expand Up @@ -48,7 +48,7 @@ __bswap_32 (unsigned int __bsx)
# else
# define __bswap_32(x) \
(__extension__ \
({ register unsigned int __bsx = (x); __bswap_constant_32 (__bsx); }))
({ unsigned int __bsx = (x); __bswap_constant_32 (__bsx); }))
# endif
#else
static __inline unsigned int
Expand Down
4 changes: 2 additions & 2 deletions crypt/crypt.c
Expand Up @@ -88,8 +88,8 @@ _ufc_doit_r(itr, __data, res)
{
int i;
long64 l, r, s, *k;
register long64 *sb01 = (long64*)__data->sb0;
register long64 *sb23 = (long64*)__data->sb2;
long64 *sb01 = (long64*)__data->sb0;
long64 *sb23 = (long64*)__data->sb2;

l = (((long64)res[0]) << 32) | ((long64)res[1]);
r = (((long64)res[2]) << 32) | ((long64)res[3]);
Expand Down
4 changes: 2 additions & 2 deletions debug/stpcpy_chk.c
Expand Up @@ -29,8 +29,8 @@ __stpcpy_chk (dest, src, destlen)
const char *src;
size_t destlen;
{
register char *d = dest;
register const char *s = src;
char *d = dest;
const char *s = src;

do
{
Expand Down
4 changes: 2 additions & 2 deletions debug/wcscat_chk.c
Expand Up @@ -23,8 +23,8 @@
wchar_t *
__wcscat_chk (wchar_t *dest, const wchar_t *src, size_t destlen)
{
register wchar_t *s1 = dest;
register const wchar_t *s2 = src;
wchar_t *s1 = dest;
const wchar_t *s2 = src;
wchar_t c;

/* Find the end of the string. */
Expand Down
2 changes: 1 addition & 1 deletion gmon/gmon.c
Expand Up @@ -102,7 +102,7 @@ __monstartup (lowpc, highpc)
u_long lowpc;
u_long highpc;
{
register int o;
int o;
char *cp;
struct gmonparam *p = &_gmonparam;

Expand Down
8 changes: 4 additions & 4 deletions gmon/mcount.c
Expand Up @@ -58,10 +58,10 @@ static char sccsid[] = "@(#)mcount.c 8.1 (Berkeley) 6/4/93";
*/
_MCOUNT_DECL(frompc, selfpc) /* _mcount; may be static, inline, etc */
{
register ARCINDEX *frompcindex;
register struct tostruct *top, *prevtop;
register struct gmonparam *p;
register ARCINDEX toindex;
ARCINDEX *frompcindex;
struct tostruct *top, *prevtop;
struct gmonparam *p;
ARCINDEX toindex;
int i;

p = &_gmonparam;
Expand Down
40 changes: 20 additions & 20 deletions hurd/hurdmalloc.c
Expand Up @@ -171,10 +171,10 @@ malloc_init (void)
static void
more_memory(int size, free_list_t fl)
{
register int amount;
register int n;
int amount;
int n;
vm_address_t where;
register header_t h;
header_t h;
kern_return_t r;

if (size <= vm_page_size) {
Expand Down Expand Up @@ -203,11 +203,11 @@ more_memory(int size, free_list_t fl)
/* Declaration changed to standard one for GNU. */
void *
malloc(size)
register size_t size;
size_t size;
{
register int i, n;
register free_list_t fl;
register header_t h;
int i, n;
free_list_t fl;
header_t h;

if ((int) size < 0) /* sanity check */
return 0;
Expand Down Expand Up @@ -272,9 +272,9 @@ void
free(base)
void *base;
{
register header_t h;
register free_list_t fl;
register int i;
header_t h;
free_list_t fl;
int i;

if (base == 0)
return;
Expand Down Expand Up @@ -322,9 +322,9 @@ realloc(old_base, new_size)
void *old_base;
size_t new_size;
{
register header_t h;
register free_list_t fl;
register int i;
header_t h;
free_list_t fl;
int i;
unsigned int old_size;
char *new_base;

Expand Down Expand Up @@ -382,10 +382,10 @@ realloc(old_base, new_size)
void
print_malloc_free_list()
{
register int i, size;
register free_list_t fl;
register int n;
register header_t h;
int i, size;
free_list_t fl;
int n;
header_t h;
int total_used = 0;
int total_free = 0;

Expand Down Expand Up @@ -416,7 +416,7 @@ malloc_fork_prepare(void)
* malloc critical section.
*/
{
register int i;
int i;

for (i = 0; i < NBUCKETS; i++) {
spin_lock(&malloc_free_list[i].lock);
Expand All @@ -429,7 +429,7 @@ malloc_fork_parent(void)
* Called in the parent process after a fork() to resume normal operation.
*/
{
register int i;
int i;

for (i = NBUCKETS-1; i >= 0; i--) {
spin_unlock(&malloc_free_list[i].lock);
Expand All @@ -442,7 +442,7 @@ malloc_fork_child(void)
* Called in the child process after a fork() to resume normal operation.
*/
{
register int i;
int i;

for (i = NBUCKETS-1; i >= 0; i--) {
spin_unlock(&malloc_free_list[i].lock);
Expand Down
8 changes: 4 additions & 4 deletions include/rpc/auth_des.h
Expand Up @@ -7,12 +7,12 @@ libc_hidden_proto (getsecretkey)
libc_hidden_proto (rtime)

extern bool_t xdr_authdes_cred (XDR *xdrs, struct authdes_cred *cred);
extern bool_t xdr_authdes_verf (register XDR *xdrs,
register struct authdes_verf *verf);
extern bool_t xdr_authdes_verf (XDR *xdrs,
struct authdes_verf *verf);
struct svc_req;
struct rpc_msg;
extern enum auth_stat _svcauth_des (register struct svc_req *rqst,
register struct rpc_msg *msg);
extern enum auth_stat _svcauth_des (struct svc_req *rqst,
struct rpc_msg *msg);


#define DECLARE_NSS_PROTOTYPES(service) \
Expand Down
2 changes: 1 addition & 1 deletion inet/inet_lnaof.c
Expand Up @@ -44,7 +44,7 @@ in_addr_t
inet_lnaof(in)
struct in_addr in;
{
register u_int32_t i = ntohl(in.s_addr);
u_int32_t i = ntohl(in.s_addr);

if (IN_CLASSA(i))
return ((i)&IN_CLASSA_HOST);
Expand Down
6 changes: 3 additions & 3 deletions inet/inet_net.c
Expand Up @@ -43,10 +43,10 @@ static char sccsid[] = "@(#)inet_network.c 8.1 (Berkeley) 6/4/93";
*/
u_int32_t
inet_network(cp)
register const char *cp;
const char *cp;
{
register u_int32_t val, base, n, i;
register char c;
u_int32_t val, base, n, i;
char c;
u_int32_t parts[4], *pp = parts;
int digit;

Expand Down
2 changes: 1 addition & 1 deletion inet/inet_netof.c
Expand Up @@ -43,7 +43,7 @@ in_addr_t
inet_netof(in)
struct in_addr in;
{
register u_int32_t i = ntohl(in.s_addr);
u_int32_t i = ntohl(in.s_addr);

if (IN_CLASSA(i))
return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT);
Expand Down
4 changes: 2 additions & 2 deletions inet/rcmd.c
Expand Up @@ -769,8 +769,8 @@ __validuser2_sa(hostf, ra, ralen, luser, ruser, rhost)
size_t ralen;
const char *luser, *ruser, *rhost;
{
register const char *user;
register char *p;
const char *user;
char *p;
int hcheck, ucheck;
char *buf = NULL;
size_t bufsize = 0;
Expand Down

0 comments on commit 2e09a79

Please sign in to comment.