summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorLukas Mai <l.mai@web.de>2014-11-29 12:17:05 +0100
committerFather Chrysostomos <sprout@cpan.org>2014-11-29 06:11:08 -0800
commit6d59e610a3f269be73ffea56a90d1cd7dc8bf2fd (patch)
tree3323ee9f84c4e0909c8066796c8ea4bfa4e36bbd /sv.c
parente59642234eb8b658c16fed728636bfbbc49c4514 (diff)
downloadperl-6d59e610a3f269be73ffea56a90d1cd7dc8bf2fd.tar.gz
define and use STATIC_ASSERT_STMT for compile-time invariants
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sv.c b/sv.c
index 40b614e81e..3cbcbf8664 100644
--- a/sv.c
+++ b/sv.c
@@ -1320,8 +1320,8 @@ Perl_sv_upgrade(pTHX_ SV *const sv, svtype new_type)
break;
case SVt_PV:
assert(new_type > SVt_PV);
- assert(SVt_IV < SVt_PV);
- assert(SVt_NV < SVt_PV);
+ STATIC_ASSERT_STMT(SVt_IV < SVt_PV);
+ STATIC_ASSERT_STMT(SVt_NV < SVt_PV);
break;
case SVt_PVIV:
break;
@@ -4311,7 +4311,7 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, SV* sstr, const I32 flags)
/* We're starting from SVt_NULL, so provided that's
* actual 0, we don't have to unset any SV type flags
* to promote to SVt_IV. */
- assert(SVt_NULL == 0);
+ STATIC_ASSERT_STMT(SVt_NULL == 0);
SET_SVANY_FOR_BODYLESS_IV(dstr);
SvFLAGS(dstr) |= SVt_IV;
break;
@@ -9366,7 +9366,7 @@ Perl_newSViv(pTHX_ const IV i)
/* We're starting from SVt_FIRST, so provided that's
* actual 0, we don't have to unset any SV type flags
* to promote to SVt_IV. */
- assert(SVt_FIRST == 0);
+ STATIC_ASSERT_STMT(SVt_FIRST == 0);
SET_SVANY_FOR_BODYLESS_IV(sv);
SvFLAGS(sv) |= SVt_IV;