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:
TAKAI Kousuke 2025-05-07 23:34:13 +09:00 committed by Karl Williamson
parent 5cc1154cbc
commit a61bf5550e

2
sv.h
View File

@ -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)