소스 검색

conversion from pointer to void to pointer to function seems more
"correct" if done through an integral type (because conversions
between pointers and numbers are allowed, only "implementation
defined").

Roberto Ierusalimschy 15 년 전
부모
커밋
d320c908d0
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      loadlib.c

+ 2 - 2
loadlib.c

@@ -1,5 +1,5 @@
 /*
-** $Id: loadlib.c,v 1.75 2010/01/11 17:06:31 roberto Exp roberto $
+** $Id: loadlib.c,v 1.76 2010/01/11 17:11:24 roberto Exp roberto $
 ** Dynamic library loader for Lua
 ** See Copyright Notice in lua.h
 **
@@ -113,7 +113,7 @@ static void *ll_load (lua_State *L, const char *path, int seeglb) {
 
 
 static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) {
-  lua_CFunction f = (lua_CFunction)dlsym(lib, sym);
+  lua_CFunction f = (lua_CFunction)(unsigned long)dlsym(lib, sym);
   if (f == NULL) lua_pushstring(L, dlerror());
   return f;
 }