p4raw-id: //depot/perl@29493
void
Perl_sv_setuv_mg(pTHX_ register SV *sv, UV u)
{
- sv_setiv(sv, 0);
- SvIsUV_on(sv);
sv_setuv(sv,u);
SvSETMAGIC(sv);
}
if (SvIOK(sv) || ((SvIOKp(sv) && !SvNOKp(sv)))) {
/* I'm assuming that if both IV and NV are equally valid then
converting the IV is going to be more efficient */
- const U32 isIOK = SvIOK(sv);
const U32 isUIOK = SvIsUV(sv);
char buf[TYPE_CHARS(UV)];
char *ebuf, *ptr;
SvCUR_set(sv, ebuf - ptr);
s = SvEND(sv);
*s = '\0';
- if (isIOK)
- SvIOK_on(sv);
- else
- SvIOKp_on(sv);
- if (isUIOK)
- SvIsUV_on(sv);
}
else if (SvNOKp(sv)) {
const int olderrno = errno;