This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fde84d2
)
SvTRUE(): add code comment
author
David Mitchell
<davem@iabyn.com>
Fri, 4 Aug 2017 08:48:06 +0000
(09:48 +0100)
committer
David Mitchell
<davem@iabyn.com>
Fri, 4 Aug 2017 08:48:06 +0000
(09:48 +0100)
explain that the '!= 0' is acting as a bool cast (since SvTRUE() is
supposed to return a bool value rather than an int value).
sv.h
patch
|
blob
|
blame
|
history
diff --git
a/sv.h
b/sv.h
index
198d1d1
..
a31bd73
100644
(file)
--- a/
sv.h
+++ b/
sv.h
@@
-1775,7
+1775,7
@@
Like C<sv_utf8_upgrade>, but doesn't do magic on C<sv>.
: SvPOK(sv) \
? SvPVXtrue(sv) \
: SvIOK(sv) \
- ? (SvIVX(sv) != 0
)
\
+ ? (SvIVX(sv) != 0
/* cast to bool */)
\
: (SvROK(sv) && !( SvOBJECT(SvRV(sv)) \
&& HvAMAGIC(SvSTASH(SvRV(sv))))) \
? TRUE \