1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-13 05:43:37 -04:00

[register] Drop register

Compilers are smart and don't need such hints.
This commit is contained in:
Witold Filipczyk 2021-12-03 12:34:00 +01:00
parent ecc380f091
commit 5a14b61c0d
8 changed files with 21 additions and 21 deletions

View File

@ -39,7 +39,7 @@
#define end_of_tag(c) ((c) == '>' || (c) == '<')
static inline int
atchr(register unsigned char c)
atchr(unsigned char c)
{
return (c < 127 && (c > '>' || (c > ' ' && c != '=' && !end_of_tag(c))));
}
@ -53,7 +53,7 @@ atchr(register unsigned char c)
/* It returns -1 when it failed (returned values in pointers are invalid) and
* 0 for success. */
int
parse_element(register char *e, char *eof,
parse_element(char *e, char *eof,
char **name, int *namelen,
char **attr, char **end)
{
@ -138,7 +138,7 @@ end:
} while (0)
char *
get_attr_value(register char *e, char *name,
get_attr_value(char *e, char *name,
int cp, enum html_attr_flags flags)
{
char *n;

View File

@ -41,7 +41,7 @@ enum html_attr_flags {
* - name is searched attribute
*
* Returns allocated string containing the attribute, or NULL on unsuccess. */
char *get_attr_value(register char *e, char *name, int cp, enum html_attr_flags flags);
char *get_attr_value(char *e, char *name, int cp, enum html_attr_flags flags);
/* Wrappers for get_attr_value(). */
#define get_attr_val(e, name, cp) get_attr_value(e, name, cp, HTML_ATTR_NONE)

View File

@ -68,7 +68,7 @@ static struct hash *event_hash = NULL;
mem_align_alloc(ptr, (size), (size) + 1, EVENT_GRANULARITY)
static inline int
invalid_event_id(register int id)
invalid_event_id(int id)
{
return (id < 0 || id >= eventssize || id == EVENT_NONE);
}

View File

@ -16,7 +16,7 @@
static unsigned char base64_chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
char *
base64_encode(register char *in)
base64_encode(char *in)
{
assert(in && *in);
if_assert_failed return NULL;
@ -25,7 +25,7 @@ base64_encode(register char *in)
}
char *
base64_encode_bin(register char *in, int inlen, int *outlen)
base64_encode_bin(char *in, int inlen, int *outlen)
{
char *out;
char *outstr;
@ -64,7 +64,7 @@ base64_encode_bin(register char *in, int inlen, int *outlen)
}
char *
base64_decode(register char *in)
base64_decode(char *in)
{
assert(in && *in);
if_assert_failed return NULL;
@ -80,7 +80,7 @@ base64_decode(register char *in)
* @returns the string decoded (must be freed by the caller)
* or NULL if an error occurred (syntax error or out of memory) */
char *
base64_decode_bin(register char *in, int inlen, int *outlen)
base64_decode_bin(char *in, int inlen, int *outlen)
{
static unsigned char is_base64_char[256]; /* static to force initialization at zero */
static unsigned char decode[256];

View File

@ -23,14 +23,14 @@ long strtolx(char *, char **);
/** Convert a decimal number to hexadecimal (lowercase) (0 <= @a a <= 15). */
static inline unsigned char
hx(register int a)
hx(int a)
{
return a >= 10 ? a + 'a' - 10 : a + '0';
}
/** Convert a decimal number to hexadecimal (uppercase) (0 <= @a a <= 15). */
static inline unsigned char
Hx(register int a)
Hx(int a)
{
return a >= 10 ? a + 'A' - 10 : a + '0';
}
@ -39,7 +39,7 @@ Hx(register int a)
* its decimal value (0 <= result <= 15).
* Returns -1 if parameter is not an hexadecimal char. */
static inline int
unhx(register unsigned char a)
unhx(unsigned char a)
{
if (isdigit(a)) return a - '0';
if (a >= 'a' && a <= 'f') return a - 'a' + 10;

View File

@ -27,14 +27,14 @@ extern "C" {
static inline int
int_min(register int x, register int y)
int_min(int x, int y)
{
if (x < y) return x;
return y;
}
static inline int
int_max(register int x, register int y)
int_max(int x, int y)
{
if (x > y) return x;
return y;
@ -43,14 +43,14 @@ int_max(register int x, register int y)
/** Limit @a what pointed value to upper bound @a limit. */
static inline void
int_upper_bound(register int *what, register int limit)
int_upper_bound(int *what, int limit)
{
if (*what > limit) *what = limit;
}
/** Limit @a what pointed value to lower bound @a limit. */
static inline void
int_lower_bound(register int *what, register int limit)
int_lower_bound(int *what, int limit)
{
if (*what < limit) *what = limit;
}
@ -58,8 +58,8 @@ int_lower_bound(register int *what, register int limit)
/** Limit @a what pointed value to lower bound @a lower_limit and to
* upper bound @a upper_limit. */
static inline void
int_bounds(register int *what, register int lower_limit,
register int upper_limit)
int_bounds(int *what, int lower_limit,
int upper_limit)
{
if (*what < lower_limit)
*what = lower_limit;

View File

@ -64,7 +64,7 @@ init_md5(struct md5_context *ctx)
void
update_md5(struct md5_context *ctx, const char *buf, unsigned long len)
{
register uint32_t t;
uint32_t t;
/* Update bitcount */
@ -187,7 +187,7 @@ digest_md5(const char *data, unsigned long length,
static void
transform_md5(uint32_t buf[4], uint32_t const in[16])
{
register uint32_t a, b, c, d;
uint32_t a, b, c, d;
a = buf[0];
b = buf[1];

View File

@ -159,7 +159,7 @@ mem_align_alloc__(
* @{ */
#define mem_free_set(x, v) do { if (*(x)) mem_free(*(x)); *(x) = (v); } while (0)
#define mem_free_if(x) do { register void *p = (x); if (p) mem_free(p); } while (0)
#define mem_free_if(x) do { void *p = (x); if (p) mem_free(p); } while (0)
#if 0
/* This may help to find bugs. */