summaryrefslogtreecommitdiff
path: root/pad.h
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 /pad.h
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 'pad.h')
-rw-r--r--pad.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/pad.h b/pad.h
index 07c4d86863..ab7ad5706f 100644
--- a/pad.h
+++ b/pad.h
@@ -315,7 +315,7 @@ Restore the old pad saved into the local variable C<opad> by C<PAD_SAVE_LOCAL()>
#define PadnameSV(pn) \
newSVpvn_flags(PadnamePV(pn), PadnameLEN(pn), SVs_TEMP|SVf_UTF8)
#define PadnameFLAGS(pn) (pn)->xpadn_flags
-#define PadnameIsOUR(pn) (!!(pn)->xpadn_ourstash)
+#define PadnameIsOUR(pn) cBOOL((pn)->xpadn_ourstash)
#define PadnameOURSTASH(pn) (pn)->xpadn_ourstash
#define PadnameTYPE(pn) (pn)->xpadn_type_u.xpadn_typestash
#define PadnamePROTOCV(pn) (pn)->xpadn_type_u.xpadn_protocv
@@ -338,8 +338,8 @@ Restore the old pad saved into the local variable C<opad> by C<PAD_SAVE_LOCAL()>
/* backward compatibility */
#define SvPAD_STATE PadnameIsSTATE
-#define SvPAD_TYPED(pn) (!!PadnameTYPE(pn))
-#define SvPAD_OUR(pn) (!!PadnameOURSTASH(pn))
+#define SvPAD_TYPED(pn) cBOOL(PadnameTYPE(pn))
+#define SvPAD_OUR(pn) cBOOL(PadnameOURSTASH(pn))
#define SvPAD_STATE_on PadnameIsSTATE_on
#define SvPAD_TYPED_on(pn) (PadnameFLAGS(pn) |= PADNAMEt_TYPED)
#define SvPAD_OUR_on(pn) (PadnameFLAGS(pn) |= PADNAMEt_OUR)