summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2006-06-11 17:44:34 -0500
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-06-12 10:07:18 +0000
commit42d0e0b77a1ef47b81ab3e346a1a4dc0af5b9bec (patch)
tree7011adacbdf7230ca54109588b961d605d72fae6 /sv.c
parentbe8e71aa96b3d344129617fadcaca7d958882caa (diff)
downloadperl-42d0e0b77a1ef47b81ab3e346a1a4dc0af5b9bec.tar.gz
Proper use of enums
Message-ID: <20060612034434.GA21588@petdance.com> p4raw-id: //depot/perl@28381
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sv.c b/sv.c
index 029d0faf9e..6fbcd003e5 100644
--- a/sv.c
+++ b/sv.c
@@ -1120,12 +1120,12 @@ You generally want to use the C<SvUPGRADE> macro wrapper. See also C<svtype>.
*/
void
-Perl_sv_upgrade(pTHX_ register SV *sv, U32 new_type)
+Perl_sv_upgrade(pTHX_ register SV *sv, svtype new_type)
{
dVAR;
void* old_body;
void* new_body;
- const U32 old_type = SvTYPE(sv);
+ const svtype old_type = SvTYPE(sv);
const struct body_details *new_type_details;
const struct body_details *const old_type_details
= bodies_by_type + old_type;
@@ -1496,6 +1496,7 @@ Perl_sv_setiv(pTHX_ register SV *sv, IV i)
case SVt_PVIO:
Perl_croak(aTHX_ "Can't coerce %s to integer in %s", sv_reftype(sv,0),
OP_DESC(PL_op));
+ default: NOOP;
}
(void)SvIOK_only(sv); /* validate number */
SvIV_set(sv, i);
@@ -1596,6 +1597,7 @@ Perl_sv_setnv(pTHX_ register SV *sv, NV num)
case SVt_PVIO:
Perl_croak(aTHX_ "Can't coerce %s to number in %s", sv_reftype(sv,0),
OP_NAME(PL_op));
+ default: NOOP;
}
SvNV_set(sv, num);
(void)SvNOK_only(sv); /* validate number */
@@ -3348,7 +3350,7 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
dVAR;
register U32 sflags;
register int dtype;
- register int stype;
+ register svtype stype;
if (sstr == dstr)
return;
@@ -3483,7 +3485,7 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
if (stype == SVt_PVLV)
SvUPGRADE(dstr, SVt_PVNV);
else
- SvUPGRADE(dstr, (U32)stype);
+ SvUPGRADE(dstr, (svtype)stype);
}
/* dstr may have been upgraded. */