c = UTF8SKIP(x);
if (IS_UTF8_CHAR_FAST(c)) {
if (!IS_UTF8_CHAR(x, c))
- goto out;
- } else if (!is_utf8_char_slow(x, c))
- goto out;
+ c = 0;
+ }
+ else
+ c = is_utf8_char_slow(x, c);
#else
c = is_utf8_char(x);
#endif /* #ifdef IS_UTF8_CHAR */
const U8* x = s;
const U8* send;
STRLEN c;
+ STRLEN outlen = 0;
PERL_UNUSED_CONTEXT;
if (!len)
len = strlen((const char *)s);
send = s + len;
- if (el)
- *el = 0;
while (x < send) {
/* Inline the easy bits of is_utf8_char() here for speed... */
goto out;
}
x += c;
- if (el)
- (*el)++;
+ outlen++;
}
out:
+ if (el)
+ *el = outlen;
+
if (ep)
*ep = x;
- if (x != send)
- return FALSE;
-
- return TRUE;
+ return (x == send);
}
/*
updates len to contain the new length.
Returns zero on failure, setting C<len> to -1.
+If you need a copy of the string, see C<bytes_from_utf8>.
+
=cut
*/
const char* const pv = SvPV_const(tokenbufsv, len);
Copy(pv, PL_tokenbuf, len+1, char);
- PL_curcop->op_private = (U8)(PL_hints & HINT_PRIVATE_MASK);
+ CopHINTS_set(PL_curcop, PL_hints);
}
if (!SvROK(retval) || SvTYPE(SvRV(retval)) != SVt_PVHV) {
if (SvPOK(retval))
Perl_croak(aTHX_ "Can't find Unicode property definition \"%"SVf"\"",
- retval);
+ (void*)retval);
Perl_croak(aTHX_ "SWASHNEW didn't return an HV ref");
}
return retval;
needents);
if (IN_PERL_COMPILETIME)
- PL_curcop->op_private = (U8)(PL_hints & HINT_PRIVATE_MASK);
+ CopHINTS_set(PL_curcop, PL_hints);
svp = hv_store(hv, (const char *)ptr, klen, swatch, 0);
}
if (opc == '+' && otherval)
- /*EMPTY*/; /* replace with otherval */
+ NOOP; /* replace with otherval */
else if (opc == '!' && !otherval)
otherval = 1;
else if (opc == '-' && otherval)