From: Jarkko Hietaniemi Date: Wed, 25 Oct 2000 13:53:05 +0000 (+0000) Subject: Rename UTF8LEN() to be UNISKIP(), too confusing to have X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5bbb0b5ac8fdf0a5cc17b4f7b9199f9e3d7db4b6;p=p5sagit%2Fp5-mst-13.2.git Rename UTF8LEN() to be UNISKIP(), too confusing to have UTF8LEN() and UTF8SKIP(). p4raw-id: //depot/perl@7437 --- diff --git a/pp.c b/pp.c index 03f35eb..73b6a12 100644 --- a/pp.c +++ b/pp.c @@ -1486,7 +1486,7 @@ PP(pp_complement) while (tmps < send) { UV c = utf8_to_uv(tmps, &l); tmps += UTF8SKIP(tmps); - targlen += UTF8LEN(~c); + targlen += UNISKIP(~c); } /* Now rewind strings and write them. */ diff --git a/utf8.c b/utf8.c index 2e48339..7415821 100644 --- a/utf8.c +++ b/utf8.c @@ -136,7 +136,7 @@ Perl_is_utf8_char(pTHX_ U8 *s) s++; } - if (UTF8LEN(uv) < len) + if (UNISKIP(uv) < len) return 0; return len; @@ -290,11 +290,11 @@ Perl_utf8_to_uv_chk(pTHX_ U8* s, STRLEN curlen, STRLEN* retlen, bool checking) "Malformed UTF-8 character (impossible character 0x%04"UVxf")", uv); goto malformed; - } else if (expectlen > UTF8LEN(uv)) { + } else if (expectlen > UNISKIP(uv)) { if (dowarn) Perl_warner(aTHX_ WARN_UTF8, "Malformed UTF-8 character (%d byte%s, need %d)", - expectlen, expectlen > 1 ? "s": "", UTF8LEN(uv)); + expectlen, expectlen > 1 ? "s": "", UNISKIP(uv)); goto malformed; } diff --git a/utf8.h b/utf8.h index bb494ab..548d821 100644 --- a/utf8.h +++ b/utf8.h @@ -36,7 +36,7 @@ END_EXTERN_C #define UTF8SKIP(s) PL_utf8skip[*(U8*)s] #ifdef HAS_QUAD -#define UTF8LEN(uv) ( (uv) < 0x80 ? 1 : \ +#define UNISKIP(uv) ( (uv) < 0x80 ? 1 : \ (uv) < 0x800 ? 2 : \ (uv) < 0x10000 ? 3 : \ (uv) < 0x200000 ? 4 : \ @@ -45,7 +45,7 @@ END_EXTERN_C (uv) < 0x1000000000LL ? 7 : 13 ) #else /* No, I'm not even going to *TRY* putting #ifdef inside a #define */ -#define UTF8LEN(uv) ( (uv) < 0x80 ? 1 : \ +#define UNISKIP(uv) ( (uv) < 0x80 ? 1 : \ (uv) < 0x800 ? 2 : \ (uv) < 0x10000 ? 3 : \ (uv) < 0x200000 ? 4 : \