From 5a14b61c0da5491e493a008aac7670d28ac67fed Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Fri, 3 Dec 2021 12:34:00 +0100 Subject: [PATCH] [register] Drop register Compilers are smart and don't need such hints. --- src/document/html/parser/parse.c | 6 +++--- src/document/html/parser/parse.h | 2 +- src/main/event.c | 2 +- src/util/base64.c | 8 ++++---- src/util/conv.h | 6 +++--- src/util/math.h | 12 ++++++------ src/util/md5.c | 4 ++-- src/util/memory.h | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/document/html/parser/parse.c b/src/document/html/parser/parse.c index 5147dd3b7..b7e8ba732 100644 --- a/src/document/html/parser/parse.c +++ b/src/document/html/parser/parse.c @@ -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; diff --git a/src/document/html/parser/parse.h b/src/document/html/parser/parse.h index d55b93d74..423afc1b0 100644 --- a/src/document/html/parser/parse.h +++ b/src/document/html/parser/parse.h @@ -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) diff --git a/src/main/event.c b/src/main/event.c index 5847923ea..dc65029f5 100644 --- a/src/main/event.c +++ b/src/main/event.c @@ -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); } diff --git a/src/util/base64.c b/src/util/base64.c index a5ecfbf36..09f252424 100644 --- a/src/util/base64.c +++ b/src/util/base64.c @@ -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]; diff --git a/src/util/conv.h b/src/util/conv.h index 4207c0528..a953df741 100644 --- a/src/util/conv.h +++ b/src/util/conv.h @@ -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; diff --git a/src/util/math.h b/src/util/math.h index 00c4f4781..4918b384c 100644 --- a/src/util/math.h +++ b/src/util/math.h @@ -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; diff --git a/src/util/md5.c b/src/util/md5.c index 8ab3b5e06..1fae0dfc5 100644 --- a/src/util/md5.c +++ b/src/util/md5.c @@ -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]; diff --git a/src/util/memory.h b/src/util/memory.h index 54f6e76c5..efbb4cb29 100644 --- a/src/util/memory.h +++ b/src/util/memory.h @@ -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. */