From: Rafael Garcia-Suarez Date: Mon, 13 Jun 2005 09:00:00 +0000 (+0000) Subject: Make SvUPGRADE always have the value '1' X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=63f971906e4e2f134a559c695d28f479cac191db;p=p5sagit%2Fp5-mst-13.2.git Make SvUPGRADE always have the value '1' Make sv_upgrade a void function p4raw-id: //depot/perl@24817 --- diff --git a/embed.fnc b/embed.fnc index b40a204..7262eeb 100644 --- a/embed.fnc +++ b/embed.fnc @@ -802,7 +802,7 @@ Apd |int |sv_unmagic |NN SV* sv|int type Apd |void |sv_unref |NN SV* sv Apd |void |sv_unref_flags |NN SV* sv|U32 flags Apd |void |sv_untaint |NN SV* sv -Apd |bool |sv_upgrade |NN SV* sv|U32 mt +Apd |void |sv_upgrade |NN SV* sv|U32 mt Apd |void |sv_usepvn |NN SV* sv|char* ptr|STRLEN len Apd |void |sv_vcatpvfn |NN SV* sv|NN const char* pat|STRLEN patlen \ |va_list* args|SV** svargs|I32 svmax \ diff --git a/pod/perlapi.pod b/pod/perlapi.pod index 80990d1..6ffe590 100644 --- a/pod/perlapi.pod +++ b/pod/perlapi.pod @@ -5046,7 +5046,7 @@ Upgrade an SV to a more complex form. Generally adds a new body type to the SV, then copies across as much information as possible from the old body. You generally want to use the C macro wrapper. See also C. - bool sv_upgrade(SV* sv, U32 mt) + void sv_upgrade(SV* sv, U32 mt) =for hackers Found in file sv.c diff --git a/proto.h b/proto.h index 779457d..499f106 100644 --- a/proto.h +++ b/proto.h @@ -1572,7 +1572,7 @@ PERL_CALLCONV void Perl_sv_unref_flags(pTHX_ SV* sv, U32 flags) PERL_CALLCONV void Perl_sv_untaint(pTHX_ SV* sv) __attribute__nonnull__(pTHX_1); -PERL_CALLCONV bool Perl_sv_upgrade(pTHX_ SV* sv, U32 mt) +PERL_CALLCONV void Perl_sv_upgrade(pTHX_ SV* sv, U32 mt) __attribute__nonnull__(pTHX_1); PERL_CALLCONV void Perl_sv_usepvn(pTHX_ SV* sv, char* ptr, STRLEN len) diff --git a/sv.c b/sv.c index d101c1d..d161b11 100644 --- a/sv.c +++ b/sv.c @@ -1757,7 +1757,7 @@ You generally want to use the C macro wrapper. See also C. =cut */ -bool +void Perl_sv_upgrade(pTHX_ register SV *sv, U32 mt) { @@ -1774,7 +1774,7 @@ Perl_sv_upgrade(pTHX_ register SV *sv, U32 mt) } if (SvTYPE(sv) == mt) - return TRUE; + return; pv = NULL; cur = 0; @@ -1969,7 +1969,6 @@ Perl_sv_upgrade(pTHX_ register SV *sv, U32 mt) SvLEN_set(sv, len); break; } - return TRUE; } /* diff --git a/sv.h b/sv.h index 719dfe2..e6aea8d 100644 --- a/sv.h +++ b/sv.h @@ -208,7 +208,7 @@ perform the upgrade if necessary. See C. #define SVTYPEMASK 0xff #define SvTYPE(sv) ((sv)->sv_flags & SVTYPEMASK) -#define SvUPGRADE(sv, mt) (void)(SvTYPE(sv) >= mt || sv_upgrade(sv, mt)) +#define SvUPGRADE(sv, mt) (SvTYPE(sv) >= (mt) || (sv_upgrade(sv, mt), 1)) #define SVs_PADSTALE 0x00000100 /* lexical has gone out of scope */ #define SVs_PADTMP 0x00000200 /* in use as tmp */