Skip to content

Commit 90c1777

Browse files
authored
Merge pull request #77 from uudiin/master
remove two functions conflict with lua5.1 and luajit
2 parents 98ec221 + 2285aaa commit 90c1777

File tree

4 files changed

+1
-32
lines changed

4 files changed

+1
-32
lines changed

src/l52util.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,6 @@ void lua_rawsetp (lua_State *L, int index, const void *p){
5858
lua_rawset(L, index);
5959
}
6060

61-
int luaL_getmetafield (lua_State *L, int obj, const char *event) {
62-
if (!lua_getmetatable(L, obj)) /* no metatable? */
63-
return 0;
64-
lua_pushstring(L, event);
65-
lua_rawget(L, -2);
66-
if (lua_isnil(L, -1)) {
67-
lua_pop(L, 2); /* remove metatable and metafield */
68-
return 0;
69-
}
70-
else {
71-
lua_remove(L, -2); /* remove only metatable */
72-
return 1;
73-
}
74-
}
75-
76-
int luaL_callmeta (lua_State *L, int obj, const char *event) {
77-
obj = lua_absindex(L, obj);
78-
if (!luaL_getmetafield(L, obj, event)) /* no metafield? */
79-
return 0;
80-
lua_pushvalue(L, obj);
81-
lua_call(L, 1, 1);
82-
return 1;
83-
}
84-
8561
#endif
8662

8763
int lutil_newmetatablep (lua_State *L, const void *p) {

src/l52util.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void luaL_register (lua_State *L, const char *libname, const luaL_Reg *l);
5858

5959
#else /* Lua 5.1 */
6060

61-
/* functions form lua 5.2 */
61+
/* functions from lua 5.2 */
6262

6363
# define lua_absindex(L, i) (((i)>0)?(i):((i)<=LUA_REGISTRYINDEX?(i):(lua_gettop(L)+(i)+1)))
6464
# define lua_rawlen lua_objlen
@@ -67,9 +67,6 @@ void lua_rawgetp (lua_State *L, int index, const void *p);
6767
void lua_rawsetp (lua_State *L, int index, const void *p);
6868
void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup);
6969

70-
int luaL_getmetafield (lua_State *L, int obj, const char *event);
71-
int luaL_callmeta (lua_State *L, int obj, const char *event);
72-
7370
#endif
7471

7572
int lutil_newmetatablep (lua_State *L, const void *p);

src/lceasy.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,6 @@ static int lcurl_easy_pause(lua_State *L){
10291029
}
10301030

10311031
static int lcurl_easy_setdata(lua_State *L){
1032-
lcurl_easy_t *p = lcurl_geteasy(L);
10331032
lua_settop(L, 2);
10341033
lua_pushvalue(L, 1);
10351034
lua_insert(L, 2);
@@ -1038,7 +1037,6 @@ static int lcurl_easy_setdata(lua_State *L){
10381037
}
10391038

10401039
static int lcurl_easy_getdata(lua_State *L){
1041-
lcurl_easy_t *p = lcurl_geteasy(L);
10421040
lua_settop(L, 1);
10431041
lua_rawget(L, LCURL_USERVALUES);
10441042
return 1;

src/lcmulti.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,6 @@ static int lcurl_multi_setopt(lua_State *L){
462462
}
463463

464464
static int lcurl_multi_setdata(lua_State *L){
465-
lcurl_multi_t *p = lcurl_getmulti(L);
466465
lua_settop(L, 2);
467466
lua_pushvalue(L, 1);
468467
lua_insert(L, 2);
@@ -471,7 +470,6 @@ static int lcurl_multi_setdata(lua_State *L){
471470
}
472471

473472
static int lcurl_multi_getdata(lua_State *L){
474-
lcurl_multi_t *p = lcurl_getmulti(L);
475473
lua_settop(L, 1);
476474
lua_rawget(L, LCURL_USERVALUES);
477475
return 1;

0 commit comments

Comments
 (0)