diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index ad5ca6c26a..cc67fd6fce 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -1333,7 +1333,7 @@ static NV_PAYLOAD_TYPE S_getpayload(NV nv) #ifdef NV_PAYLOAD_DEBUG Perl_warn(aTHX_ "a[%d] = %" UVxf "\n", i, a[i]); #endif - payload *= UV_MAX; + payload *= (NV) UV_MAX; payload += a[i]; } #ifdef NV_PAYLOAD_DEBUG diff --git a/ext/POSIX/lib/POSIX.pm b/ext/POSIX/lib/POSIX.pm index 51a51a213e..c374af6aa0 100644 --- a/ext/POSIX/lib/POSIX.pm +++ b/ext/POSIX/lib/POSIX.pm @@ -4,7 +4,7 @@ use warnings; our ($AUTOLOAD, %SIGRT); -our $VERSION = '1.95'; +our $VERSION = '1.96'; require XSLoader; diff --git a/inline.h b/inline.h index 5ada1555d1..3b34ad4667 100644 --- a/inline.h +++ b/inline.h @@ -1980,7 +1980,7 @@ S_lossless_NV_to_IV(const NV nv, IV *ivp) /* Written this way so that with an always-false NaN comparison we * return false */ - if (!(LIKELY(nv >= IV_MIN) && LIKELY(nv <= IV_MAX))) { + if (!(LIKELY(nv >= (NV) IV_MIN) && LIKELY(nv < IV_MAX_P1))) { return FALSE; } diff --git a/pp_ctl.c b/pp_ctl.c index 5cb5a10b20..ed451c02e8 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -1228,7 +1228,7 @@ PP(pp_flop) if ((SvOK(left) && !SvIOK(left) && SvNV_nomg(left) < IV_MIN) || (SvOK(right) && (SvIOK(right) ? SvIsUV(right) && SvUV(right) > IV_MAX - : SvNV_nomg(right) > IV_MAX))) + : SvNV_nomg(right) > (NV) IV_MAX))) DIE(aTHX_ "Range iterator outside integer range"); i = SvIV_nomg(left); j = SvIV_nomg(right); diff --git a/sv.c b/sv.c index f062cc2ad2..5c4c355555 100644 --- a/sv.c +++ b/sv.c @@ -2055,7 +2055,7 @@ S_sv_2iuv_non_preserve(pTHX_ SV *const sv (void)SvNOK_on(sv); /* Can't use strtol etc to convert this string. (See truth table in sv_2iv */ - if (SvNVX(sv) <= (UV)IV_MAX) { + if (SvNVX(sv) < IV_MAX_P1) { SvIV_set(sv, I_V(SvNVX(sv))); if ((NV)(SvIVX(sv)) == SvNVX(sv)) { SvIOK_on(sv); /* Integer is precise. NOK, IOK */ @@ -11118,7 +11118,7 @@ S_F0convert(NV nv, char *const endbuf, STRLEN *const len) assert(!Perl_isinfnan(nv)); if (neg) nv = -nv; - if (nv != 0.0 && nv < UV_MAX) { + if (nv != 0.0 && nv < (NV) UV_MAX) { char *p = endbuf; uv = (UV)nv; if (uv != nv) {