This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Proper use of enums
[perl5.git] / sv.h
diff --git a/sv.h b/sv.h
index 554fe69..ab09bba 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -158,11 +158,11 @@ Same as SvREFCNT_inc, but can only be used if you know I<sv>
 is not NULL.  Since we don't have to check the NULLness, it's faster
 and smaller.
 
-=for apidoc Am|SV*|SvREFCNT_inc_void|SV* sv
+=for apidoc Am|void|SvREFCNT_inc_void|SV* sv
 Same as SvREFCNT_inc, but can only be used if you don't need the
 return value.  The macro doesn't need to return a meaningful value.
 
-=for apidoc Am|SV*|SvREFCNT_inc_void_NN|SV* sv
+=for apidoc Am|void|SvREFCNT_inc_void_NN|SV* sv
 Same as SvREFCNT_inc, but can only be used if you don't need the return
 value, and you know that I<sv> is not NULL.  The macro doesn't need
 to return a meaningful value, or check for NULLness, so it's smaller
@@ -178,12 +178,15 @@ Same as SvREFCNT_inc_simple, but can only be used if you know I<sv>
 is not NULL.  Since we don't have to check the NULLness, it's faster
 and smaller.
 
-=for apidoc Am|SV*|SvREFCNT_inc_simple_void|SV* sv
+=for apidoc Am|void|SvREFCNT_inc_simple_void|SV* sv
 Same as SvREFCNT_inc_simple, but can only be used if you don't need the
 return value.  The macro doesn't need to return a meaningful value.
 
-=for apidoc Am|SV*|SvREFCNT_inc|SV* sv
-Increments the reference count of the given SV.
+=for apidoc Am|void|SvREFCNT_inc_simple_void_NN|SV* sv
+Same as SvREFCNT_inc, but can only be used if you don't need the return
+value, and you know that I<sv> is not NULL.  The macro doesn't need
+to return a meaningful value, or check for NULLness, so it's smaller
+and faster.
 
 =for apidoc Am|void|SvREFCNT_dec|SV* sv
 Decrements the reference count of the given SV.
@@ -240,7 +243,7 @@ perform the upgrade if necessary.  See C<svtype>.
 #endif
 
 /* These guys don't need the curly blocks */
-#define SvREFCNT_inc_simple_void(sv)   if (sv) (SvREFCNT(sv)++);
+#define SvREFCNT_inc_simple_void(sv)   STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END
 #define SvREFCNT_inc_simple_NN(sv)     (++(SvREFCNT(sv)),(SV*)(sv))
 #define SvREFCNT_inc_void_NN(sv)       (void)(++SvREFCNT((SV*)(sv)))
 #define SvREFCNT_inc_simple_void_NN(sv)        (void)(++SvREFCNT((SV*)(sv)))
@@ -263,7 +266,7 @@ perform the upgrade if necessary.  See C<svtype>.
 #endif
 
 #define SVTYPEMASK     0xff
-#define SvTYPE(sv)     ((sv)->sv_flags & SVTYPEMASK)
+#define SvTYPE(sv)     (svtype)((sv)->sv_flags & SVTYPEMASK)
 
 /* Sadly there are some parts of the core that have pointers to already-freed
    SV heads, and rely on being able to tell that they are now free. So mark
@@ -839,7 +842,7 @@ Set the value of the RV pointer in sv to val.  See C<SvIV_set>.
 =for apidoc Am|void|SvMAGIC_set|SV* sv|MAGIC* val
 Set the value of the MAGIC pointer in sv to val.  See C<SvIV_set>.
 
-=for apidoc Am|void|SvSTASH_set|SV* sv|STASH* val
+=for apidoc Am|void|SvSTASH_set|SV* sv|HV* val
 Set the value of the STASH pointer in sv to val.  See C<SvIV_set>.
 
 =for apidoc Am|void|SvCUR_set|SV* sv|STRLEN len