From: Amos Jeffries Date: Thu, 22 Apr 2010 13:10:25 +0000 (+1200) Subject: Cleanup: remove Cisms from GNURegex alternative X-Git-Tag: SQUID_3_1_2~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c0b1b2c3788476cbe475be67695380a8c43fc0ea;p=thirdparty%2Fsquid.git Cleanup: remove Cisms from GNURegex alternative --- diff --git a/compat/GnuRegex.c b/compat/GnuRegex.c index 222429cd5a..bdb302c0a2 100644 --- a/compat/GnuRegex.c +++ b/compat/GnuRegex.c @@ -103,7 +103,7 @@ init_syntax_once(void) /* Compile a fastmap for the compiled pattern in BUFFER; used to * accelerate searches. Return 0 if successful and -2 if was an * internal error. */ -static int re_compile_fastmap _RE_ARGS((struct re_pattern_buffer * buffer)); +static int re_compile_fastmap(struct re_pattern_buffer * buffer); /* Search in the string STRING (with length LENGTH) for the pattern @@ -111,25 +111,22 @@ static int re_compile_fastmap _RE_ARGS((struct re_pattern_buffer * buffer)); * characters. Return the starting position of the match, -1 for no * match, or -2 for an internal error. Also return register * information in REGS (if REGS and BUFFER->no_sub are nonzero). */ -static int re_search -_RE_ARGS((struct re_pattern_buffer * buffer, const char *string, - int length, int start, int range, struct re_registers * regs)); +static int re_search(struct re_pattern_buffer * buffer, const char *string, + int length, int start, int range, struct re_registers * regs); /* Like `re_search', but search in the concatenation of STRING1 and * STRING2. Also, stop searching at index START + STOP. */ -static int re_search_2 -_RE_ARGS((struct re_pattern_buffer * buffer, const char *string1, - int length1, const char *string2, int length2, - int start, int range, struct re_registers * regs, int stop)); +static int re_search_2(struct re_pattern_buffer * buffer, const char *string1, + int length1, const char *string2, int length2, + int start, int range, struct re_registers * regs, int stop); /* Like `re_search_2', but return how many characters in STRING the regexp * in BUFFER matched, starting at position START. */ -static int re_match_2 -_RE_ARGS((struct re_pattern_buffer * buffer, const char *string1, - int length1, const char *string2, int length2, - int start, struct re_registers * regs, int stop)); +static int re_match_2(struct re_pattern_buffer * buffer, const char *string1, + int length1, const char *string2, int length2, + int start, struct re_registers * regs, int stop); /* isalpha etc. are used for the character classes. */ diff --git a/compat/GnuRegex.h b/compat/GnuRegex.h index 32dac86a16..6309c36484 100644 --- a/compat/GnuRegex.h +++ b/compat/GnuRegex.h @@ -405,25 +405,11 @@ extern "C" { * unfortunately clutters up the declarations a bit, but I think it's * worth it. */ -#if STDC_HEADERS - -#define _RE_ARGS(args) args - -#else /* not __STDC__ */ - -#define _RE_ARGS(args) () - -#endif /* not __STDC__ */ - /* POSIX compatibility. */ - extern int regcomp _RE_ARGS((regex_t * preg, const char *pattern, int cflags)); - extern int regexec - _RE_ARGS((const regex_t * preg, const char *string, size_t nmatch, - regmatch_t pmatch[], int eflags)); - extern size_t regerror - _RE_ARGS((int errcode, const regex_t * preg, char *errbuf, - size_t errbuf_size)); - extern void regfree _RE_ARGS((regex_t * preg)); + extern int regcomp(regex_t * preg, const char *pattern, int cflags); + extern int regexec(const regex_t * preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags); + extern size_t regerror(int errcode, const regex_t * preg, char *errbuf, size_t errbuf_size); + extern void regfree(regex_t * preg); #ifdef __cplusplus }