From: Jarkko Hietaniemi Date: Tue, 29 Feb 2000 18:15:09 +0000 (+0000) Subject: Some compilers have problems with quad switch() controls. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=470c347452fb266b7c1193e6adcb1f6faf973d67;p=p5sagit%2Fp5-mst-13.2.git Some compilers have problems with quad switch() controls. p4raw-id: //depot/cfgperl@5366 --- diff --git a/regcomp.c b/regcomp.c index 8046c76..271c20c 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;