aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-11-22 14:39:20 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-11-22 14:39:20 -0200
commit092fa71dddb6615e7627602f3675c70fd0e9e06f (patch)
treee60266553316b81cb81116b72d0afc7098e3bfe9
parenta2eaad5d815ba584ce2756ab9c8b8b4d71984c91 (diff)
downloadlua-092fa71dddb6615e7627602f3675c70fd0e9e06f.tar.gz
lua-092fa71dddb6615e7627602f3675c70fd0e9e06f.tar.bz2
lua-092fa71dddb6615e7627602f3675c70fd0e9e06f.zip
conventional names for bitwise operators
-rw-r--r--lbitlib.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/lbitlib.c b/lbitlib.c
index b6b2442c..f0dce9a6 100644
--- a/lbitlib.c
+++ b/lbitlib.c
@@ -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
133static int b_rol (lua_State *L) { 133static 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
138static int b_ror (lua_State *L) { 138static 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
143static const luaL_Reg bitlib[] = { 143static 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