Perl_fprintf_nocontext(PerlIO *stream, const char *format, ...)
{
int ret = 0;
- va_list(arglist);
+ va_list arglist;
/* Easier to special case this here than in embed.pl. (Look at what it
generates for proto.h) */
Perl_printf_nocontext(const char *format, ...)
{
dTHX;
- va_list(arglist);
+ va_list arglist;
int ret = 0;
#ifdef PERL_IMPLICIT_CONTEXT
char *
Perl_sv_collxfrm(pTHX_ SV *const sv, STRLEN *const nxp)
{
+ PERL_ARGS_ASSERT_SV_COLLXFRM;
return sv_collxfrm_flags(sv, nxp, SV_GMAGIC);
}
bool
Perl_sv_2bool(pTHX_ SV *const sv)
{
+ PERL_ARGS_ASSERT_SV_2BOOL;
return sv_2bool_flags(sv, SV_GMAGIC);
}
{
PERL_ARGS_ASSERT_IS_UTF8_CHAR;
- /* Assumes we have enough space, which is why this is deprecated */
- return isUTF8_CHAR(s, s + UTF8SKIP(s));
+ /* Assumes we have enough space, which is why this is deprecated. But the
+ * strnlen() makes it safe for the common case of NUL-terminated strings */
+ return isUTF8_CHAR(s, s + my_strnlen((char *) s, UTF8SKIP(s)));
}
/*
}
/*
-=for apidoc utf8_to_uvchr
-
-Returns the native code point of the first character in the string C<s>
-which is assumed to be in UTF-8 encoding; C<retlen> will be set to the
-length, in bytes, of that character.
-
-Some, but not all, UTF-8 malformations are detected, and in fact, some
-malformed input could cause reading beyond the end of the input buffer, which
-is why this function is deprecated. Use L</utf8_to_uvchr_buf> instead.
-
-If C<s> points to one of the detected malformations, and UTF8 warnings are
-enabled, zero is returned and C<*retlen> is set (if C<retlen> isn't
-C<NULL>) to -1. If those warnings are off, the computed value if well-defined (or
-the Unicode REPLACEMENT CHARACTER, if not) is silently returned, and C<*retlen>
-is set (if C<retlen> isn't NULL) so that (S<C<s> + C<*retlen>>) is the
-next possible position in C<s> that could begin a non-malformed character.
-See L</utf8n_to_uvchr> for details on when the REPLACEMENT CHARACTER is returned.
-
-=cut
-*/
-
-UV
-Perl_utf8_to_uvchr(pTHX_ const U8 *s, STRLEN *retlen)
-{
- PERL_ARGS_ASSERT_UTF8_TO_UVCHR;
-
- return utf8_to_uvchr_buf(s, s + UTF8_MAXBYTES, retlen);
-}
-
-/*
=for apidoc utf8_to_uvuni
Returns the Unicode code point of the first character in the string C<s>