Skip to content

Commit ac5e48f

Browse files
committed
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.
1 parent 778ca25 commit ac5e48f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ Set the size of the string buffer for the SV. See C<L</SvLEN>>.
10451045
#define BOOL_INTERNALS_sv_isbool_false(sv) (SvIsCOW_static(sv) && \
10461046
(SvPVX_const(sv) == PL_No))
10471047

1048-
#define SvIsUV(sv) (SvFLAGS(sv) & SVf_IVisUV)
1048+
#define SvIsUV(sv) ((SvFLAGS(sv) & SVf_IVisUV) != 0)
10491049
#define SvIsUV_on(sv) (SvFLAGS(sv) |= SVf_IVisUV)
10501050
#define SvIsUV_off(sv) (SvFLAGS(sv) &= ~SVf_IVisUV)
10511051

0 commit comments

Comments
 (0)