diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-12-02 11:33:09 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-12-02 11:33:09 -0300 |
commit | 82fae58e25b7e2be6390238ce60d5678b24dce44 (patch) | |
tree | 30477985a439aeff299b772e6c2c9c890f2dca20 | |
parent | 9a77f57edc5cc24c2ab71d416b7481a5679e3869 (diff) | |
download | lua-82fae58e25b7e2be6390238ce60d5678b24dce44.tar.gz lua-82fae58e25b7e2be6390238ce60d5678b24dce44.tar.bz2 lua-82fae58e25b7e2be6390238ce60d5678b24dce44.zip |
Details
Parentheses and comments.
-rw-r--r-- | lmathlib.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -267,7 +267,7 @@ static int math_type (lua_State *L) { | |||
267 | 267 | ||
268 | /* try to find an integer type with at least 64 bits */ | 268 | /* try to find an integer type with at least 64 bits */ |
269 | 269 | ||
270 | #if (ULONG_MAX >> 31 >> 31) >= 3 | 270 | #if ((ULONG_MAX >> 31) >> 31) >= 3 |
271 | 271 | ||
272 | /* 'long' has at least 64 bits */ | 272 | /* 'long' has at least 64 bits */ |
273 | #define Rand64 unsigned long | 273 | #define Rand64 unsigned long |
@@ -277,9 +277,9 @@ static int math_type (lua_State *L) { | |||
277 | /* there is a 'long long' type (which must have at least 64 bits) */ | 277 | /* there is a 'long long' type (which must have at least 64 bits) */ |
278 | #define Rand64 unsigned long long | 278 | #define Rand64 unsigned long long |
279 | 279 | ||
280 | #elif (LUA_MAXUNSIGNED >> 31 >> 31) >= 3 | 280 | #elif ((LUA_MAXUNSIGNED >> 31) >> 31) >= 3 |
281 | 281 | ||
282 | /* 'lua_Integer' has at least 64 bits */ | 282 | /* 'lua_Unsigned' has at least 64 bits */ |
283 | #define Rand64 lua_Unsigned | 283 | #define Rand64 lua_Unsigned |
284 | 284 | ||
285 | #endif | 285 | #endif |
@@ -500,12 +500,12 @@ static lua_Number I2d (Rand64 x) { | |||
500 | 500 | ||
501 | /* convert a 'Rand64' to a 'lua_Unsigned' */ | 501 | /* convert a 'Rand64' to a 'lua_Unsigned' */ |
502 | static lua_Unsigned I2UInt (Rand64 x) { | 502 | static lua_Unsigned I2UInt (Rand64 x) { |
503 | return ((lua_Unsigned)trim32(x.h) << 31 << 1) | (lua_Unsigned)trim32(x.l); | 503 | return (((lua_Unsigned)trim32(x.h) << 31) << 1) | (lua_Unsigned)trim32(x.l); |
504 | } | 504 | } |
505 | 505 | ||
506 | /* convert a 'lua_Unsigned' to a 'Rand64' */ | 506 | /* convert a 'lua_Unsigned' to a 'Rand64' */ |
507 | static Rand64 Int2I (lua_Unsigned n) { | 507 | static Rand64 Int2I (lua_Unsigned n) { |
508 | return packI((lu_int32)(n >> 31 >> 1), (lu_int32)n); | 508 | return packI((lu_int32)((n >> 31) >> 1), (lu_int32)n); |
509 | } | 509 | } |
510 | 510 | ||
511 | #endif /* } */ | 511 | #endif /* } */ |