From 3e6f39ae931637ca1bbcb0cd1c7af43f552d39df Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Mon, 14 Jul 2014 08:13:24 +0000 Subject: [PATCH] Remove some 'register' in variable declaration. Save a few cycles by calling 'apr_isalnum' instead of 'apr_isalpha' and 'apr_isdigit'. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1610353 13f79535-47bb-0310-9956-ffa450edef68 --- server/util.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/util.c b/server/util.c index af356b248c..42b0d2dad7 100644 --- a/server/util.c +++ b/server/util.c @@ -253,7 +253,7 @@ AP_DECLARE(int) ap_os_is_path_absolute(apr_pool_t *p, const char *dir) AP_DECLARE(int) ap_is_matchexp(const char *str) { - register int x; + int x; for (x = 0; str[x]; x++) if ((str[x] == '*') || (str[x] == '?')) @@ -529,7 +529,7 @@ AP_DECLARE(void) ap_getparents(char *name) while (name[l] != '\0') { if (name[l] == '.' && name[l + 1] == '.' && IS_SLASH(name[l + 2]) && (l == 0 || IS_SLASH(name[l - 1]))) { - register int m = l + 3, n; + int m = l + 3, n; l = l - 2; if (l >= 0) { @@ -655,7 +655,7 @@ AP_DECLARE(char *) ap_make_dirstr_parent(apr_pool_t *p, const char *s) AP_DECLARE(int) ap_count_dirs(const char *path) { - register int x, n; + int x, n; for (x = 0, n = 0; path[x]; x++) if (path[x] == '/') @@ -1586,7 +1586,7 @@ AP_DECLARE(char *) ap_escape_shell_cmd(apr_pool_t *p, const char *str) static char x2c(const char *what) { - register char digit; + char digit; #if !APR_CHARSET_EBCDIC digit = ((what[0] >= 'A') ? ((what[0] & 0xdf) - 'A') + 10 @@ -1618,7 +1618,7 @@ static char x2c(const char *what) static int unescape_url(char *url, const char *forbid, const char *reserved) { - register int badesc, badpath; + int badesc, badpath; char *x, *y; badesc = 0; @@ -2115,11 +2115,11 @@ AP_DECLARE(char *) ap_make_full_path(apr_pool_t *a, const char *src1, */ AP_DECLARE(int) ap_is_url(const char *u) { - register int x; + int x; for (x = 0; u[x] != ':'; x++) { if ((!u[x]) || - ((!apr_isalpha(u[x])) && (!apr_isdigit(u[x])) && + ((!apr_isalnum(u[x])) && (u[x] != '+') && (u[x] != '-') && (u[x] != '.'))) { return 0; } -- 2.40.0