summaryrefslogtreecommitdiff
path: root/op.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 /op.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 'op.c')
-rw-r--r--op.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/op.c b/op.c
index 365c4a5484..497ceb0240 100644
--- a/op.c
+++ b/op.c
@@ -512,7 +512,7 @@ Perl_Slab_Free(pTHX_ void *op)
void
Perl_opslab_free_nopad(pTHX_ OPSLAB *slab)
{
- const bool havepad = !!PL_comppad;
+ const bool havepad = cBOOL(PL_comppad);
PERL_ARGS_ASSERT_OPSLAB_FREE_NOPAD;
if (havepad) {
ENTER;
@@ -18874,7 +18874,7 @@ Perl_report_redefined_cv(pTHX_ const SV *name, const CV *old_cv,
SV * const *new_const_svp)
{
const char *hvname;
- bool is_const = !!CvCONST(old_cv);
+ bool is_const = cBOOL(CvCONST(old_cv));
SV *old_const_sv = is_const ? cv_const_sv(old_cv) : NULL;
PERL_ARGS_ASSERT_REPORT_REDEFINED_CV;