if (SvUTF8(sv1)) {
char *pv = (char*)bytes_from_utf8((U8*)pv1, &cur1, &is_utf8);
- if (is_utf8)
- return 0;
- pv1tmp = (pv != pv1);
- pv1 = pv;
+
+ if ((pv1tmp = (pv != pv1)))
+ pv1 = pv;
}
else {
char *pv = (char *)bytes_from_utf8((U8*)pv2, &cur2, &is_utf8);
- if (is_utf8)
- return 0;
- pv2tmp = (pv != pv2);
- pv2 = pv;
+
+ if ((pv2tmp = (pv != pv2)))
+ pv2 = pv;
}
}
len = -len;
is_utf8 = TRUE;
}
- if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT))
- src = (char*)bytes_from_utf8((U8*)src, (STRLEN*)&len, &is_utf8);
+ if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT)) {
+ STRLEN tmplen = len;
+ /* See the note in hv.c:hv_fetch() --jhi */
+ src = (char*)bytes_from_utf8((U8*)src, &tmplen, &is_utf8);
+ len = tmplen;
+ }
if (!hash)
PERL_HASH(hash, src, len);
new_SV(sv);
}
/*
+=for apidoc sv_setref_uv
+
+Copies an unsigned integer into a new SV, optionally blessing the SV. The C<rv>
+argument will be upgraded to an RV. That RV will be modified to point to
+the new SV. The C<classname> argument indicates the package for the
+blessing. Set C<classname> to C<Nullch> to avoid the blessing. The new SV
+will be returned and will have a reference count of 1.
+
+=cut
+*/
+
+SV*
+Perl_sv_setref_uv(pTHX_ SV *rv, const char *classname, UV uv)
+{
+ sv_setuv(newSVrv(rv,classname), uv);
+ return rv;
+}
+
+/*
=for apidoc sv_setref_nv
Copies a double into a new SV, optionally blessing the SV. The C<rv>