summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-06-07 05:39:12 -0600
committerKarl Williamson <khw@cpan.org>2022-06-14 07:38:34 -0600
commit82943faa9f6f51aebb7960cc8eee73dd44c024e4 (patch)
treeb9e3841945cfbac528df7dfbbe9561d83a17102b /gv.c
parenta5d3a568eb8dce244c5f4f5f1e061ba5a36edbb8 (diff)
downloadperl-82943faa9f6f51aebb7960cc8eee73dd44c024e4.tar.gz
Convert '!!' to cBOOL()
I believe the '!!' is somewhat obscure; I for one didn't know about it for years of programming C, and it was buggy in one compiler, which is why cBOOL was created, I believe. And it is graphically dense, and generally harder to read than the cBOOL() construct. This commit dates from before we moved to C99 where we can simply cast to (bool), and cBOOL() has been rewritten to do that. But the vast majority of code uses cBOOL(), and this commit brings the remainder of the core .[ch] files into uniformity.
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gv.c b/gv.c
index 683818a9f5..713b51a453 100644
--- a/gv.c
+++ b/gv.c
@@ -310,7 +310,7 @@ Perl_cvgv_from_hek(pTHX_ CV *cv)
if (!isGV(gv))
gv_init_pvn(gv, CvSTASH(cv), HEK_KEY(CvNAME_HEK(cv)),
HEK_LEN(CvNAME_HEK(cv)),
- SVf_UTF8 * !!HEK_UTF8(CvNAME_HEK(cv)));
+ SVf_UTF8 * cBOOL(HEK_UTF8(CvNAME_HEK(cv))));
if (!CvNAMED(cv)) { /* gv_init took care of it */
assert (SvANY(cv)->xcv_gv_u.xcv_gv == gv);
return gv;
@@ -4148,7 +4148,7 @@ Perl_gv_try_downgrade(pTHX_ GV *gv)
(gvp = hv_fetchhek(stash, namehek, 0)) &&
*gvp == (SV*)gv) {
SV *value = SvREFCNT_inc(CvXSUBANY(cv).any_ptr);
- const bool imported = !!GvIMPORTED_CV(gv);
+ const bool imported = cBOOL(GvIMPORTED_CV(gv));
SvREFCNT(gv) = 0;
sv_clear((SV*)gv);
SvREFCNT(gv) = 1;