diff options
| -rw-r--r-- | lbitlib.c | 26 |
1 files changed, 13 insertions, 13 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lbitlib.c,v 1.10 2010/10/28 15:17:29 roberto Exp roberto $ | 2 | ** $Id: lbitlib.c,v 1.11 2010/11/08 16:31:22 roberto Exp roberto $ |
| 3 | ** Standard library for bitwise operations | 3 | ** Standard library for bitwise operations |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -130,27 +130,27 @@ static int b_rot (lua_State *L, int i) { | |||
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | 132 | ||
| 133 | static int b_rol (lua_State *L) { | 133 | static int b_lrot (lua_State *L) { |
| 134 | return b_rot(L, luaL_checkint(L, 2)); | 134 | return b_rot(L, luaL_checkint(L, 2)); |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | 137 | ||
| 138 | static int b_ror (lua_State *L) { | 138 | static int b_rrot (lua_State *L) { |
| 139 | return b_rot(L, -luaL_checkint(L, 2)); | 139 | return b_rot(L, -luaL_checkint(L, 2)); |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | 142 | ||
| 143 | static const luaL_Reg bitlib[] = { | 143 | static const luaL_Reg bitlib[] = { |
| 144 | {"AND", b_and}, | 144 | {"arshift", b_arshift}, |
| 145 | {"TEST", b_test}, | 145 | {"band", b_and}, |
| 146 | {"OR", b_or}, | 146 | {"bnot", b_not}, |
| 147 | {"XOR", b_xor}, | 147 | {"bor", b_or}, |
| 148 | {"NOT", b_not}, | 148 | {"bxor", b_xor}, |
| 149 | {"SHL", b_lshift}, | 149 | {"lrotate", b_lrot}, |
| 150 | {"SAR", b_arshift}, | 150 | {"lshift", b_lshift}, |
| 151 | {"SHR", b_rshift}, | 151 | {"rrotate", b_rrot}, |
| 152 | {"ROL", b_rol}, | 152 | {"rshift", b_rshift}, |
| 153 | {"ROR", b_ror}, | 153 | {"test", b_test}, |
| 154 | {NULL, NULL} | 154 | {NULL, NULL} |
| 155 | }; | 155 | }; |
| 156 | 156 | ||
