summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorPip Cet <pipcet@gmail.com>2016-02-08 10:01:06 +1100
committerTony Cook <tony@develop-help.com>2016-02-08 10:01:28 +1100
commit071db91b12fc08b6b110d18071c50fbe490129ce (patch)
tree6b4df1e8fb14ec50dec44f703e42c2a2da22f525 /numeric.c
parent2e38ced43368428d48ba9336fbc27d141ae9a761 (diff)
downloadperl-071db91b12fc08b6b110d18071c50fbe490129ce.tar.gz
[perl #127474] fix operator precedence when (castflags & 2)
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/numeric.c b/numeric.c
index f1de219e98..f6455028e3 100644
--- a/numeric.c
+++ b/numeric.c
@@ -39,7 +39,7 @@ Perl_cast_ulong(NV f)
if (f < U32_MAX_P1_HALF)
return (U32) f;
f -= U32_MAX_P1_HALF;
- return ((U32) f) | (1 + U32_MAX >> 1);
+ return ((U32) f) | (1 + (U32_MAX >> 1));
#else
return (U32) f;
#endif
@@ -57,7 +57,7 @@ Perl_cast_i32(NV f)
if (f < U32_MAX_P1_HALF)
return (I32)(U32) f;
f -= U32_MAX_P1_HALF;
- return (I32)(((U32) f) | (1 + U32_MAX >> 1));
+ return (I32)(((U32) f) | (1 + (U32_MAX >> 1)));
#else
return (I32)(U32) f;
#endif
@@ -76,7 +76,7 @@ Perl_cast_iv(NV f)
if (f < UV_MAX_P1_HALF)
return (IV)(UV) f;
f -= UV_MAX_P1_HALF;
- return (IV)(((UV) f) | (1 + UV_MAX >> 1));
+ return (IV)(((UV) f) | (1 + (UV_MAX >> 1)));
#else
return (IV)(UV) f;
#endif
@@ -94,7 +94,7 @@ Perl_cast_uv(NV f)
if (f < UV_MAX_P1_HALF)
return (UV) f;
f -= UV_MAX_P1_HALF;
- return ((UV) f) | (1 + UV_MAX >> 1);
+ return ((UV) f) | (1 + (UV_MAX >> 1));
#else
return (UV) f;
#endif