lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 092fa71dddb6615e7627602f3675c70fd0e9e06f
parent a2eaad5d815ba584ce2756ab9c8b8b4d71984c91
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Mon, 22 Nov 2010 14:38:56 -0200

conventional names for bitwise operators

Diffstat:
Mlbitlib.c | 26+++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/lbitlib.c b/lbitlib.c @@ -1,5 +1,5 @@ /* -** $Id: lbitlib.c,v 1.10 2010/10/28 15:17:29 roberto Exp roberto $ +** $Id: lbitlib.c,v 1.11 2010/11/08 16:31:22 roberto Exp roberto $ ** Standard library for bitwise operations ** See Copyright Notice in lua.h */ @@ -130,27 +130,27 @@ static int b_rot (lua_State *L, int i) { } -static int b_rol (lua_State *L) { +static int b_lrot (lua_State *L) { return b_rot(L, luaL_checkint(L, 2)); } -static int b_ror (lua_State *L) { +static int b_rrot (lua_State *L) { return b_rot(L, -luaL_checkint(L, 2)); } static const luaL_Reg bitlib[] = { - {"AND", b_and}, - {"TEST", b_test}, - {"OR", b_or}, - {"XOR", b_xor}, - {"NOT", b_not}, - {"SHL", b_lshift}, - {"SAR", b_arshift}, - {"SHR", b_rshift}, - {"ROL", b_rol}, - {"ROR", b_ror}, + {"arshift", b_arshift}, + {"band", b_and}, + {"bnot", b_not}, + {"bor", b_or}, + {"bxor", b_xor}, + {"lrotate", b_lrot}, + {"lshift", b_lshift}, + {"rrotate", b_rrot}, + {"rshift", b_rshift}, + {"test", b_test}, {NULL, NULL} };