aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-02-05 12:37:25 +1000
committerDavid Walter Seikel2012-02-05 12:37:25 +1000
commitf7e197ee7d3a1c0dd88515acefa3f334ce7a4d24 (patch)
tree04fbb042ab95ffd526bba03632145a8fa20ef313 /LuaSL
parentCommentry clean ups. (diff)
downloadSledjHamr-f7e197ee7d3a1c0dd88515acefa3f334ce7a4d24.zip
SledjHamr-f7e197ee7d3a1c0dd88515acefa3f334ce7a4d24.tar.gz
SledjHamr-f7e197ee7d3a1c0dd88515acefa3f334ce7a4d24.tar.bz2
SledjHamr-f7e197ee7d3a1c0dd88515acefa3f334ce7a4d24.tar.xz
Right shifts are arithmetic shifts.
Diffstat (limited to 'LuaSL')
-rw-r--r--LuaSL/src/LuaSL_compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c
index c2c0638..9009264 100644
--- a/LuaSL/src/LuaSL_compile.c
+++ b/LuaSL/src/LuaSL_compile.c
@@ -1219,7 +1219,7 @@ Any binary operation involving a float and an integer implicitly casts the integ
1219 1219
1220A boolean operation deals with TRUE (1) and FALSE (0). Any non zero value is a TRUE (generally sigh). 1220A boolean operation deals with TRUE (1) and FALSE (0). Any non zero value is a TRUE (generally sigh).
1221On the other hand, in Lua, only false and nil are false, everything else is true. 0 is true. sigh 1221On the other hand, in Lua, only false and nil are false, everything else is true. 0 is true. sigh
1222Bitwise operations only apply to integers. The shifts are arithmatic, not logical. Right shifted bits are dropped, left shifts the sign bit. 1222Bitwise operations only apply to integers. Right shifts are arithmetic, not logical.
1223 1223
1224integer = integer0 % integer1; // Apparently only applies to integers, but works fine on floats in OS. 1224integer = integer0 % integer1; // Apparently only applies to integers, but works fine on floats in OS.
1225string = string0 + string1; // Concatenation. 1225string = string0 + string1; // Concatenation.
@@ -1764,7 +1764,7 @@ static void outputBitOp(FILE *file, outputMode mode, LSL_Leaf *leaf)
1764 case LSL_BIT_XOR : fprintf(file, " _bit.xor("); break; 1764 case LSL_BIT_XOR : fprintf(file, " _bit.xor("); break;
1765 case LSL_BIT_NOT : fprintf(file, " _bit.bnot("); break; 1765 case LSL_BIT_NOT : fprintf(file, " _bit.bnot("); break;
1766 case LSL_LEFT_SHIFT : fprintf(file, " _bit.lshift("); break; 1766 case LSL_LEFT_SHIFT : fprintf(file, " _bit.lshift("); break;
1767 case LSL_RIGHT_SHIFT : fprintf(file, " _bit.rshift("); break; 1767 case LSL_RIGHT_SHIFT : fprintf(file, " _bit.arshift("); break;
1768 default : break; 1768 default : break;
1769 } 1769 }
1770 outputLeaf(file, mode, leaf->left); 1770 outputLeaf(file, mode, leaf->left);