summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-02-29 18:15:09 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-02-29 18:15:09 +0000
commit470c347452fb266b7c1193e6adcb1f6faf973d67 (patch)
treefa6a858133f2679d92fd5618bcd8bdc50bb13e5b /regcomp.c
parent49acb6c86ad2e0478eebe0cafad30e7a4989e180 (diff)
downloadperl-470c347452fb266b7c1193e6adcb1f6faf973d67.tar.gz
Some compilers have problems with quad switch() controls.
p4raw-id: //depot/cfgperl@5366
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/regcomp.c b/regcomp.c
index 8046c76056..271c20c8f6 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -2867,7 +2867,7 @@ STATIC regnode *
S_regclass(pTHX)
{
dTHR;
- register UV value;
+ register U32 value;
register I32 lastvalue = OOB_CHAR8;
register I32 range = 0;
register regnode *ret;
@@ -2911,6 +2911,8 @@ S_regclass(pTHX)
namedclass = regpposixcc(value);
else if (value == '\\') {
value = UCHARAT(PL_regcomp_parse++);
+ /* Some compilers cannot handle switching on 64-bit integer
+ * values, therefore value cannot be an UV. --jhi */
switch (value) {
case 'w': namedclass = ANYOF_ALNUM; break;
case 'W': namedclass = ANYOF_NALNUM; break;
@@ -3312,7 +3314,7 @@ S_regclassutf8(pTHX)
{
dTHR;
register char *e;
- register UV value;
+ register U32 value;
register U32 lastvalue = OOB_UTF8;
register I32 range = 0;
register regnode *ret;
@@ -3353,8 +3355,11 @@ S_regclassutf8(pTHX)
if (value == '[')
namedclass = regpposixcc(value);
else if (value == '\\') {
- value = utf8_to_uv((U8*)PL_regcomp_parse, &numlen);
+ value = (U32)utf8_to_uv((U8*)PL_regcomp_parse, &numlen);
PL_regcomp_parse += numlen;
+ /* Some compilers cannot handle switching on 64-bit integer
+ * values, therefore value cannot be an UV. Yes, this will
+ * be a problem later if we want switch on Unicode. --jhi */
switch (value) {
case 'w': namedclass = ANYOF_ALNUM; break;
case 'W': namedclass = ANYOF_NALNUM; break;