From: Amos Jeffries Date: Fri, 16 Apr 2010 06:55:31 +0000 (-0600) Subject: Cleanup: remove Cisms from GNURegex alternative X-Git-Tag: SQUID_3_2_0_1~294 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3de79283a04fbe7cd6c28e877104afb7515633ba;p=thirdparty%2Fsquid.git Cleanup: remove Cisms from GNURegex alternative --- diff --git a/compat/GnuRegex.c b/compat/GnuRegex.c index 6606549028..35924851d1 100644 --- a/compat/GnuRegex.c +++ b/compat/GnuRegex.c @@ -104,7 +104,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 @@ -112,25 +112,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, +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)); + 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, +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)); + 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 6bcb99ea16..d57a0c9c49 100644 --- a/compat/GnuRegex.h +++ b/compat/GnuRegex.h @@ -398,21 +398,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 }