summaryrefslogtreecommitdiff
path: root/pp_sys.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 /pp_sys.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 'pp_sys.c')
-rw-r--r--pp_sys.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 4cbe323ec5..a3bc0794a2 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2272,7 +2272,8 @@ PP(pp_truncate)
if (PL_op->op_flags & OPf_SPECIAL
? (tmpgv = gv_fetchsv(sv, 0, SVt_PVIO), 1)
- : !!(tmpgv = MAYBE_DEREF_GV(sv)) ) {
+ : cBOOL(tmpgv = MAYBE_DEREF_GV(sv)) )
+ {
io = GvIO(tmpgv);
if (!io)
result = 0;
@@ -2827,7 +2828,8 @@ PP(pp_stat)
SV* sv;
if (PL_op->op_flags & OPf_REF ? (gv = cGVOP_gv, 1)
- : !!(sv=POPs, gv = MAYBE_DEREF_GV(sv))) {
+ : cBOOL((sv=POPs, gv = MAYBE_DEREF_GV(sv))))
+ {
if (PL_op->op_type == OP_LSTAT) {
if (gv != PL_defgv) {
do_fstat_warning_check: