diff options
author | Lukas Mai <l.mai@web.de> | 2014-11-29 12:17:05 +0100 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-11-29 06:11:08 -0800 |
commit | 6d59e610a3f269be73ffea56a90d1cd7dc8bf2fd (patch) | |
tree | 3323ee9f84c4e0909c8066796c8ea4bfa4e36bbd /sv.c | |
parent | e59642234eb8b658c16fed728636bfbbc49c4514 (diff) | |
download | perl-6d59e610a3f269be73ffea56a90d1cd7dc8bf2fd.tar.gz |
define and use STATIC_ASSERT_STMT for compile-time invariants
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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; |