summaryrefslogtreecommitdiffstats
path: root/Modules/regexpr.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-09-03 00:47:36 (GMT)
committerGuido van Rossum <guido@python.org>1997-09-03 00:47:36 (GMT)
commitd19c04a88e8c4720818e3a01671547ffdde01c98 (patch)
treef156ea25970151cae26ea4c4f8dce54fc781c87f /Modules/regexpr.c
parent5ade0849020cc241fd6a9af47b7c84746440c1ed (diff)
downloadcpython-d19c04a88e8c4720818e3a01671547ffdde01c98.zip
cpython-d19c04a88e8c4720818e3a01671547ffdde01c98.tar.gz
cpython-d19c04a88e8c4720818e3a01671547ffdde01c98.tar.bz2
Change [_Py_]re_compile_pattern() to return a char*.
Since it only returns an error message (or NULL) there's no reason for it to be unsigned char *, and various compilers like this better.
Diffstat (limited to 'Modules/regexpr.c')
-rw-r--r--Modules/regexpr.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/Modules/regexpr.c b/Modules/regexpr.c
index a90363a..4279d61 100644
--- a/Modules/regexpr.c
+++ b/Modules/regexpr.c
@@ -1157,7 +1157,7 @@ else \
} \
}
-unsigned char *re_compile_pattern(unsigned char *regex, int size, regexp_t bufp)
+char *re_compile_pattern(unsigned char *regex, int size, regexp_t bufp)
{
int a;
int pos;
@@ -1535,36 +1535,36 @@ unsigned char *re_compile_pattern(unsigned char *regex, int size, regexp_t bufp)
STORE(Cend);
SET_FIELDS;
if(!re_optimize(bufp))
- return (unsigned char *)"Optimization error";
+ return "Optimization error";
return NULL;
op_error:
SET_FIELDS;
- return (unsigned char *)"Badly placed special character";
+ return "Badly placed special character";
bad_match_register:
SET_FIELDS;
- return (unsigned char *)"Bad match register number";
+ return "Bad match register number";
hex_error:
SET_FIELDS;
- return (unsigned char *)"Bad hexadecimal number";
+ return "Bad hexadecimal number";
parenthesis_error:
SET_FIELDS;
- return (unsigned char *)"Badly placed parenthesis";
+ return "Badly placed parenthesis";
out_of_memory:
SET_FIELDS;
- return (unsigned char *)"Out of memory";
+ return "Out of memory";
ends_prematurely:
SET_FIELDS;
- return (unsigned char *)"Regular expression ends prematurely";
+ return "Regular expression ends prematurely";
too_complex:
SET_FIELDS;
- return (unsigned char *)"Regular expression too complex";
+ return "Regular expression too complex";
}
#undef CHARAT