mirror of
https://github.com/Perl/perl5.git
synced 2026-01-26 08:38:23 +00:00
sv.h: Make SvIsUV() return 1 (rather than 0x80000000) for true condition
This would make it easier to receive the result with `bool` type. Note that (implicit) casting to C99 `_Bool` automatically converts any nonzero scalar values to 1, so that this change is technically not necessary in C99 which perl now requires to compile. But I think it will keep the code less surprising.
This commit is contained in:
parent
5cc1154cbc
commit
a61bf5550e
2
sv.h
2
sv.h
@ -1045,7 +1045,7 @@ Set the size of the string buffer for the SV. See C<L</SvLEN>>.
|
||||
#define BOOL_INTERNALS_sv_isbool_false(sv) (SvIsCOW_static(sv) && \
|
||||
(SvPVX_const(sv) == PL_No))
|
||||
|
||||
#define SvIsUV(sv) (SvFLAGS(sv) & SVf_IVisUV)
|
||||
#define SvIsUV(sv) ((SvFLAGS(sv) & SVf_IVisUV) != 0)
|
||||
#define SvIsUV_on(sv) (SvFLAGS(sv) |= SVf_IVisUV)
|
||||
#define SvIsUV_off(sv) (SvFLAGS(sv) &= ~SVf_IVisUV)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user