1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Avoid use of "register" as optimization hint.

This commit is contained in:
Joseph Myers
2013-06-07 22:24:35 +00:00
parent 8e254d8e0d
commit 2e09a79ada
79 changed files with 430 additions and 278 deletions

View File

@ -433,7 +433,7 @@ typedef enum __ns_cert_types {
* Inline versions of get/put short/long. Pointer is advanced.
*/
#define NS_GET16(s, cp) do { \
register const u_char *t_cp = (const u_char *)(cp); \
const u_char *t_cp = (const u_char *)(cp); \
(s) = ((u_int16_t)t_cp[0] << 8) \
| ((u_int16_t)t_cp[1]) \
; \
@ -441,7 +441,7 @@ typedef enum __ns_cert_types {
} while (0)
#define NS_GET32(l, cp) do { \
register const u_char *t_cp = (const u_char *)(cp); \
const u_char *t_cp = (const u_char *)(cp); \
(l) = ((u_int32_t)t_cp[0] << 24) \
| ((u_int32_t)t_cp[1] << 16) \
| ((u_int32_t)t_cp[2] << 8) \
@ -451,16 +451,16 @@ typedef enum __ns_cert_types {
} while (0)
#define NS_PUT16(s, cp) do { \
register u_int16_t t_s = (u_int16_t)(s); \
register u_char *t_cp = (u_char *)(cp); \
u_int16_t t_s = (u_int16_t)(s); \
u_char *t_cp = (u_char *)(cp); \
*t_cp++ = t_s >> 8; \
*t_cp = t_s; \
(cp) += NS_INT16SZ; \
} while (0)
#define NS_PUT32(l, cp) do { \
register u_int32_t t_l = (u_int32_t)(l); \
register u_char *t_cp = (u_char *)(cp); \
u_int32_t t_l = (u_int32_t)(l); \
u_char *t_cp = (u_char *)(cp); \
*t_cp++ = t_l >> 24; \
*t_cp++ = t_l >> 16; \
*t_cp++ = t_l >> 8; \

View File

@ -178,9 +178,9 @@ Dprintf(msg, num)
static struct hostent *
getanswer (const querybuf *answer, int anslen, const char *qname, int qtype)
{
register const HEADER *hp;
register const u_char *cp;
register int n;
const HEADER *hp;
const u_char *cp;
int n;
const u_char *eom, *erdata;
char *bp, **ap, **hap;
int type, class, buflen, ancount, qdcount;
@ -409,7 +409,7 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype)
continue;
}
if (!haveanswer) {
register int nn;
int nn;
host.h_name = bp;
nn = strlen(bp) + 1; /* for the \0 */
@ -514,7 +514,7 @@ gethostbyname2(name, af)
u_char *ptr;
} buf;
querybuf *origbuf;
register const char *cp;
const char *cp;
char *bp;
int n, size, type, len;
struct hostent *ret;
@ -653,10 +653,10 @@ gethostbyaddr(addr, len, af)
u_char *ptr;
} buf;
querybuf *orig_buf;
register struct hostent *hp;
struct hostent *hp;
char qbuf[MAXDNAME+1], *qp = NULL;
#ifdef SUNSECURITY
register struct hostent *rhp;
struct hostent *rhp;
char **haddr;
u_long old_options;
char hname2[MAXDNAME+1];
@ -807,7 +807,7 @@ struct hostent *
_gethtent()
{
char *p;
register char *cp, **q;
char *cp, **q;
int af, len;
if (!hostf && !(hostf = fopen(_PATH_HOSTS, "rce" ))) {
@ -888,8 +888,8 @@ _gethtbyname2(name, af)
const char *name;
int af;
{
register struct hostent *p;
register char **cp;
struct hostent *p;
char **cp;
_sethtent(0);
while ((p = _gethtent())) {
@ -913,7 +913,7 @@ _gethtbyaddr(addr, len, af)
size_t len;
int af;
{
register struct hostent *p;
struct hostent *p;
_sethtent(0);
while ((p = _gethtent()))

View File

@ -935,7 +935,7 @@ dst_s_id_calc(const u_char *key, const int keysize)
static u_int16_t
dst_s_get_int16(const u_char *buf)
{
register u_int16_t a = 0;
u_int16_t a = 0;
a = ((u_int16_t)(buf[0] << 8)) | ((u_int16_t)(buf[1]));
return (a);
}

View File

@ -601,7 +601,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
char *h_addr_ptrs[0];
} *host_data;
int linebuflen;
register const HEADER *hp;
const HEADER *hp;
const u_char *end_of_message, *cp;
int n, ancount, qdcount;
int haveanswer, had_error;
@ -920,7 +920,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
}
if (!haveanswer)
{
register int nn;
int nn;
/* We compose a single hostent out of the entire chain of
entries, so the TTL of the hostent is essentially the lowest

View File

@ -149,9 +149,9 @@ libc_hidden_def (__res_ninit)
/* This function has to be reachable by res_data.c but not publically. */
int
__res_vinit(res_state statp, int preinit) {
register FILE *fp;
register char *cp, **pp;
register int n;
FILE *fp;
char *cp, **pp;
int n;
char buf[BUFSIZ];
int nserv = 0; /* number of nameserver records read from file */
#ifdef _LIBC
@ -571,7 +571,7 @@ static u_int32_t
net_mask(in) /* XXX - should really use system's version of this */
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 (htonl(IN_CLASSA_NET));

View File

@ -104,9 +104,9 @@ res_nmkquery(res_state statp,
u_char *buf, /* buffer to put query */
int buflen) /* size of buffer */
{
register HEADER *hp;
register u_char *cp;
register int n;
HEADER *hp;
u_char *cp;
int n;
u_char *dnptrs[20], **dpp, **lastdnptr;
#ifdef DEBUG