summaryrefslogtreecommitdiffstats
path: root/Modules/_sre.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-11-22 02:31:20 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-11-22 02:31:20 (GMT)
commit63ab875cfefc0f1f4e123f4d9c885b3079446f35 (patch)
tree486029b035cc7f541bf9553cc388e6007726d4b7 /Modules/_sre.c
parent0d3721d986e1cbb601e73cbb4d25552924d8ebf8 (diff)
downloadcpython-63ab875cfefc0f1f4e123f4d9c885b3079446f35.zip
cpython-63ab875cfefc0f1f4e123f4d9c885b3079446f35.tar.gz
cpython-63ab875cfefc0f1f4e123f4d9c885b3079446f35.tar.bz2
Remove "#ifdef Py_UNICODE_WIDE": Python is now always wide
Diffstat (limited to 'Modules/_sre.c')
-rw-r--r--Modules/_sre.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/Modules/_sre.c b/Modules/_sre.c
index 56f35c3..0069d82 100644
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -500,7 +500,7 @@ SRE_COUNT(SRE_STATE* state, SRE_CODE* pattern, Py_ssize_t maxcount)
case SRE_OP_IN:
/* repeated set */
TRACE(("|%p|%p|COUNT IN\n", pattern, ptr));
- while (ptr < end &&
+ while (ptr < end &&
SRE_CHARSET(pattern + 2, SRE_CHARGET(state, ptr, 0)))
ptr += state->charsize;
break;
@@ -1030,7 +1030,7 @@ entrance:
ctx->u.chr = ctx->pattern[ctx->pattern[0]+1];
for (;;) {
while (ctx->count >= (Py_ssize_t) ctx->pattern[1] &&
- (ctx->ptr >= end ||
+ (ctx->ptr >= end ||
SRE_CHARGET(state, ctx->ptr, 0) != ctx->u.chr)) {
ctx->ptr -= state->charsize;
ctx->count--;
@@ -1302,7 +1302,7 @@ entrance:
if (!p || !e || e < p)
RETURN_FAILURE;
while (p < e) {
- if (ctx->ptr >= end ||
+ if (ctx->ptr >= end ||
SRE_CHARGET(state, ctx->ptr, 0) != SRE_CHARGET(state, p, 0))
RETURN_FAILURE;
p += state->charsize;
@@ -2664,7 +2664,7 @@ _compile(PyObject* self_, PyObject* args)
if (pattern == Py_None) {
self->logical_charsize = -1;
self->charsize = -1;
- }
+ }
else {
Py_ssize_t p_length;
if (!getstring(pattern, &p_length, &self->logical_charsize,
@@ -3021,10 +3021,8 @@ _validate_inner(SRE_CODE *code, SRE_CODE *end, Py_ssize_t groups)
GET_ARG; max = arg;
if (min > max)
FAIL;
-#ifdef Py_UNICODE_WIDE
if (max > 65535)
FAIL;
-#endif
if (!_validate_inner(code, code+skip-4, groups))
FAIL;
code += skip-4;
@@ -3042,10 +3040,8 @@ _validate_inner(SRE_CODE *code, SRE_CODE *end, Py_ssize_t groups)
GET_ARG; max = arg;
if (min > max)
FAIL;
-#ifdef Py_UNICODE_WIDE
if (max > 65535)
FAIL;
-#endif
if (!_validate_inner(code, code+skip-3, groups))
FAIL;
code += skip-3;