mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[register] Drop register
Compilers are smart and don't need such hints.
This commit is contained in:
parent
ecc380f091
commit
5a14b61c0d
@ -39,7 +39,7 @@
|
|||||||
#define end_of_tag(c) ((c) == '>' || (c) == '<')
|
#define end_of_tag(c) ((c) == '>' || (c) == '<')
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
atchr(register unsigned char c)
|
atchr(unsigned char c)
|
||||||
{
|
{
|
||||||
return (c < 127 && (c > '>' || (c > ' ' && c != '=' && !end_of_tag(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
|
/* It returns -1 when it failed (returned values in pointers are invalid) and
|
||||||
* 0 for success. */
|
* 0 for success. */
|
||||||
int
|
int
|
||||||
parse_element(register char *e, char *eof,
|
parse_element(char *e, char *eof,
|
||||||
char **name, int *namelen,
|
char **name, int *namelen,
|
||||||
char **attr, char **end)
|
char **attr, char **end)
|
||||||
{
|
{
|
||||||
@ -138,7 +138,7 @@ end:
|
|||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
char *
|
char *
|
||||||
get_attr_value(register char *e, char *name,
|
get_attr_value(char *e, char *name,
|
||||||
int cp, enum html_attr_flags flags)
|
int cp, enum html_attr_flags flags)
|
||||||
{
|
{
|
||||||
char *n;
|
char *n;
|
||||||
|
@ -41,7 +41,7 @@ enum html_attr_flags {
|
|||||||
* - name is searched attribute
|
* - name is searched attribute
|
||||||
*
|
*
|
||||||
* Returns allocated string containing the attribute, or NULL on unsuccess. */
|
* 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(). */
|
/* Wrappers for get_attr_value(). */
|
||||||
#define get_attr_val(e, name, cp) get_attr_value(e, name, cp, HTML_ATTR_NONE)
|
#define get_attr_val(e, name, cp) get_attr_value(e, name, cp, HTML_ATTR_NONE)
|
||||||
|
@ -68,7 +68,7 @@ static struct hash *event_hash = NULL;
|
|||||||
mem_align_alloc(ptr, (size), (size) + 1, EVENT_GRANULARITY)
|
mem_align_alloc(ptr, (size), (size) + 1, EVENT_GRANULARITY)
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
invalid_event_id(register int id)
|
invalid_event_id(int id)
|
||||||
{
|
{
|
||||||
return (id < 0 || id >= eventssize || id == EVENT_NONE);
|
return (id < 0 || id >= eventssize || id == EVENT_NONE);
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
static unsigned char base64_chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
static unsigned char base64_chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||||
|
|
||||||
char *
|
char *
|
||||||
base64_encode(register char *in)
|
base64_encode(char *in)
|
||||||
{
|
{
|
||||||
assert(in && *in);
|
assert(in && *in);
|
||||||
if_assert_failed return NULL;
|
if_assert_failed return NULL;
|
||||||
@ -25,7 +25,7 @@ base64_encode(register char *in)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
base64_encode_bin(register char *in, int inlen, int *outlen)
|
base64_encode_bin(char *in, int inlen, int *outlen)
|
||||||
{
|
{
|
||||||
char *out;
|
char *out;
|
||||||
char *outstr;
|
char *outstr;
|
||||||
@ -64,7 +64,7 @@ base64_encode_bin(register char *in, int inlen, int *outlen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
base64_decode(register char *in)
|
base64_decode(char *in)
|
||||||
{
|
{
|
||||||
assert(in && *in);
|
assert(in && *in);
|
||||||
if_assert_failed return NULL;
|
if_assert_failed return NULL;
|
||||||
@ -80,7 +80,7 @@ base64_decode(register char *in)
|
|||||||
* @returns the string decoded (must be freed by the caller)
|
* @returns the string decoded (must be freed by the caller)
|
||||||
* or NULL if an error occurred (syntax error or out of memory) */
|
* or NULL if an error occurred (syntax error or out of memory) */
|
||||||
char *
|
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 is_base64_char[256]; /* static to force initialization at zero */
|
||||||
static unsigned char decode[256];
|
static unsigned char decode[256];
|
||||||
|
@ -23,14 +23,14 @@ long strtolx(char *, char **);
|
|||||||
|
|
||||||
/** Convert a decimal number to hexadecimal (lowercase) (0 <= @a a <= 15). */
|
/** Convert a decimal number to hexadecimal (lowercase) (0 <= @a a <= 15). */
|
||||||
static inline unsigned char
|
static inline unsigned char
|
||||||
hx(register int a)
|
hx(int a)
|
||||||
{
|
{
|
||||||
return a >= 10 ? a + 'a' - 10 : a + '0';
|
return a >= 10 ? a + 'a' - 10 : a + '0';
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Convert a decimal number to hexadecimal (uppercase) (0 <= @a a <= 15). */
|
/** Convert a decimal number to hexadecimal (uppercase) (0 <= @a a <= 15). */
|
||||||
static inline unsigned char
|
static inline unsigned char
|
||||||
Hx(register int a)
|
Hx(int a)
|
||||||
{
|
{
|
||||||
return a >= 10 ? a + 'A' - 10 : a + '0';
|
return a >= 10 ? a + 'A' - 10 : a + '0';
|
||||||
}
|
}
|
||||||
@ -39,7 +39,7 @@ Hx(register int a)
|
|||||||
* its decimal value (0 <= result <= 15).
|
* its decimal value (0 <= result <= 15).
|
||||||
* Returns -1 if parameter is not an hexadecimal char. */
|
* Returns -1 if parameter is not an hexadecimal char. */
|
||||||
static inline int
|
static inline int
|
||||||
unhx(register unsigned char a)
|
unhx(unsigned char a)
|
||||||
{
|
{
|
||||||
if (isdigit(a)) return a - '0';
|
if (isdigit(a)) return a - '0';
|
||||||
if (a >= 'a' && a <= 'f') return a - 'a' + 10;
|
if (a >= 'a' && a <= 'f') return a - 'a' + 10;
|
||||||
|
@ -27,14 +27,14 @@ extern "C" {
|
|||||||
|
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
int_min(register int x, register int y)
|
int_min(int x, int y)
|
||||||
{
|
{
|
||||||
if (x < y) return x;
|
if (x < y) return x;
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
int_max(register int x, register int y)
|
int_max(int x, int y)
|
||||||
{
|
{
|
||||||
if (x > y) return x;
|
if (x > y) return x;
|
||||||
return y;
|
return y;
|
||||||
@ -43,14 +43,14 @@ int_max(register int x, register int y)
|
|||||||
|
|
||||||
/** Limit @a what pointed value to upper bound @a limit. */
|
/** Limit @a what pointed value to upper bound @a limit. */
|
||||||
static inline void
|
static inline void
|
||||||
int_upper_bound(register int *what, register int limit)
|
int_upper_bound(int *what, int limit)
|
||||||
{
|
{
|
||||||
if (*what > limit) *what = limit;
|
if (*what > limit) *what = limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Limit @a what pointed value to lower bound @a limit. */
|
/** Limit @a what pointed value to lower bound @a limit. */
|
||||||
static inline void
|
static inline void
|
||||||
int_lower_bound(register int *what, register int limit)
|
int_lower_bound(int *what, int limit)
|
||||||
{
|
{
|
||||||
if (*what < limit) *what = 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
|
/** Limit @a what pointed value to lower bound @a lower_limit and to
|
||||||
* upper bound @a upper_limit. */
|
* upper bound @a upper_limit. */
|
||||||
static inline void
|
static inline void
|
||||||
int_bounds(register int *what, register int lower_limit,
|
int_bounds(int *what, int lower_limit,
|
||||||
register int upper_limit)
|
int upper_limit)
|
||||||
{
|
{
|
||||||
if (*what < lower_limit)
|
if (*what < lower_limit)
|
||||||
*what = lower_limit;
|
*what = lower_limit;
|
||||||
|
@ -64,7 +64,7 @@ init_md5(struct md5_context *ctx)
|
|||||||
void
|
void
|
||||||
update_md5(struct md5_context *ctx, const char *buf, unsigned long len)
|
update_md5(struct md5_context *ctx, const char *buf, unsigned long len)
|
||||||
{
|
{
|
||||||
register uint32_t t;
|
uint32_t t;
|
||||||
|
|
||||||
/* Update bitcount */
|
/* Update bitcount */
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ digest_md5(const char *data, unsigned long length,
|
|||||||
static void
|
static void
|
||||||
transform_md5(uint32_t buf[4], uint32_t const in[16])
|
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];
|
a = buf[0];
|
||||||
b = buf[1];
|
b = buf[1];
|
||||||
|
@ -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_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
|
#if 0
|
||||||
/* This may help to find bugs. */
|
/* This may help to find bugs. */
|
||||||
|
Loading…
Reference in New Issue
Block a user