Make SvUPGRADE always have the value '1'
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 13 Jun 2005 09:00:00 +0000 (09:00 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 13 Jun 2005 09:00:00 +0000 (09:00 +0000)
Make sv_upgrade a void function

p4raw-id: //depot/perl@24817

embed.fnc
pod/perlapi.pod
proto.h
sv.c
sv.h

index b40a204..7262eeb 100644 (file)
--- 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 \
index 80990d1..6ffe590 100644 (file)
@@ -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<SvUPGRADE> macro wrapper. See also C<svtype>.
 
-       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 (file)
--- 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 (file)
--- a/sv.c
+++ b/sv.c
@@ -1757,7 +1757,7 @@ You generally want to use the C<SvUPGRADE> macro wrapper. See also C<svtype>.
 =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 (file)
--- a/sv.h
+++ b/sv.h
@@ -208,7 +208,7 @@ perform the upgrade if necessary.  See C<svtype>.
 #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 */