diff options
author | Peter Schneider-Kamp <nowonder@nowonder.de> | 2000-07-10 13:05:29 (GMT) |
---|---|---|
committer | Peter Schneider-Kamp <nowonder@nowonder.de> | 2000-07-10 13:05:29 (GMT) |
commit | 7d0c71ac8c56de9d8547a37c3e6bbce4f8e943d3 (patch) | |
tree | 61e69475c61c20b518db2656ce20eda647e77919 /Modules/regexpr.c | |
parent | 286da3b46a3647db07c422058381ac65e74e47a2 (diff) | |
download | cpython-7d0c71ac8c56de9d8547a37c3e6bbce4f8e943d3.zip cpython-7d0c71ac8c56de9d8547a37c3e6bbce4f8e943d3.tar.gz cpython-7d0c71ac8c56de9d8547a37c3e6bbce4f8e943d3.tar.bz2 |
ANSI-fication
Diffstat (limited to 'Modules/regexpr.c')
-rw-r--r-- | Modules/regexpr.c | 78 |
1 files changed, 19 insertions, 59 deletions
diff --git a/Modules/regexpr.c b/Modules/regexpr.c index cc86977..98fa04c 100644 --- a/Modules/regexpr.c +++ b/Modules/regexpr.c @@ -546,8 +546,7 @@ void re_compile_initialize() regexp_ansi_sequences = (regexp_syntax & RE_ANSI_HEX) != 0; } -int re_set_syntax(syntax) - int syntax; +int re_set_syntax(int syntax) { int ret; @@ -558,8 +557,7 @@ int re_set_syntax(syntax) return ret; } -static int hex_char_to_decimal(ch) - int ch; +static int hex_char_to_decimal(int ch) { if (ch >= '0' && ch <= '9') return ch - '0'; @@ -570,16 +568,10 @@ static int hex_char_to_decimal(ch) return 16; } -static void re_compile_fastmap_aux(code, - pos, - visited, - can_be_null, - fastmap) - unsigned char *code; - int pos; - unsigned char *visited; - unsigned char *can_be_null; - unsigned char *fastmap; +static void re_compile_fastmap_aux(unsigned char *code, int pos, + unsigned char *visited, + unsigned char *can_be_null, + unsigned char *fastmap) { int a; int b; @@ -706,16 +698,9 @@ static void re_compile_fastmap_aux(code, } } -static int re_do_compile_fastmap(buffer, - used, - pos, - can_be_null, - fastmap) - unsigned char *buffer; - int used; - int pos; - unsigned char *can_be_null; - unsigned char *fastmap; +static int re_do_compile_fastmap(unsigned char *buffer, int used, int pos, + unsigned char *can_be_null, + unsigned char *fastmap) { unsigned char small_visited[512], *visited; @@ -736,8 +721,7 @@ static int re_do_compile_fastmap(buffer, return 1; } -void re_compile_fastmap(bufp) - regexp_t bufp; +void re_compile_fastmap(regexp_t bufp) { if (!bufp->fastmap || bufp->fastmap_accurate) return; @@ -782,9 +766,7 @@ void re_compile_fastmap(bufp) * */ -static int re_optimize_star_jump(bufp, code) - regexp_t bufp; - unsigned char *code; +static int re_optimize_star_jump(regexp_t bufp, unsigned char *code) { unsigned char map[256]; unsigned char can_be_null; @@ -945,8 +927,7 @@ static int re_optimize_star_jump(bufp, code) return 1; } -static int re_optimize(bufp) - regexp_t bufp; +static int re_optimize(regexp_t bufp) { unsigned char *code; @@ -1147,10 +1128,7 @@ else \ } \ } -char *re_compile_pattern(regex, size, bufp) - unsigned char *regex; - int size; - regexp_t bufp; +char *re_compile_pattern(unsigned char *regex, int size, regexp_t bufp) { int a; int pos; @@ -1417,8 +1395,8 @@ char *re_compile_pattern(regex, size, bufp) int prev; int offset; int range; - int firstchar; - + int firstchar; + SET_LEVEL_START; ALLOC(1+256/8); STORE(Cset); @@ -1586,16 +1564,8 @@ var = (unsigned char)*text++; \ if (translate) \ var = translate[var] -int re_match(bufp, - string, - size, - pos, - old_regs) - regexp_t bufp; - unsigned char *string; - int size; - int pos; - regexp_registers_t old_regs; +int re_match(regexp_t bufp, unsigned char *string, int size, int pos, + regexp_registers_t old_regs) { unsigned char *code; unsigned char *translate; @@ -2021,18 +1991,8 @@ int re_match(bufp, #undef PREFETCH #undef NEXTCHAR -int re_search(bufp, - string, - size, - pos, - range, - regs) - regexp_t bufp; - unsigned char *string; - int size; - int pos; - int range; - regexp_registers_t regs; +int re_search(regexp_t bufp, unsigned char *string, int size, int pos, + int range, regexp_registers_t regs) { unsigned char *fastmap; unsigned char *translate; |