diff options
| author | Alexander Pickering <alex@cogarr.net> | 2018-06-30 16:15:05 -0600 |
|---|---|---|
| committer | Alexander Pickering <alex@cogarr.net> | 2018-06-30 16:15:05 -0600 |
| commit | ed58795eaf03bdee0b1fae8d05ce5b86d17549f7 (patch) | |
| tree | 065092f3e95bf74fdba541f6c5f7504757487d3d /src/shared | |
| parent | 45e61c74802af739736d33c82f27596b45987eee (diff) | |
| download | brokengine-ed58795eaf03bdee0b1fae8d05ce5b86d17549f7.tar.gz brokengine-ed58795eaf03bdee0b1fae8d05ce5b86d17549f7.tar.bz2 brokengine-ed58795eaf03bdee0b1fae8d05ce5b86d17549f7.zip | |
Warning-less build
All compile warning for -Wall have been fixed
Diffstat (limited to 'src/shared')
| -rw-r--r-- | src/shared/lua_api/common.cpp | 11 | ||||
| -rw-r--r-- | src/shared/lua_api/common.hpp | 1 | ||||
| -rw-r--r-- | src/shared/lua_api/load_net.cpp | 6 |
3 files changed, 15 insertions, 3 deletions
diff --git a/src/shared/lua_api/common.cpp b/src/shared/lua_api/common.cpp index 68bf203..b190bdb 100644 --- a/src/shared/lua_api/common.cpp +++ b/src/shared/lua_api/common.cpp @@ -190,6 +190,17 @@ int poprecti(lua_State* L, long *sx, long *sy, long *ex, long *ey){ return 0; } +int pushrecti(lua_State* L, long sx, long sy, long ex, long ey){ + lua_newtable(L);//{} + lua_pushnumber(L,1);//{},1,{sx,sy} + pushvector2i(L,sx,sy);//{},1,{sx,sy} + lua_settable(L,-3);//{{sx,sy}} + lua_pushnumber(L,2);//{{sx,sy}},2 + pushvector2i(L,ex,ey);//{{sx,sy}},2,{ex,ey} + lua_settable(L,-3);//{{sx,sy},{ex,ey}} + return 1; +} + int popvector2i(lua_State* L, long* a, long* b){ lua_pushinteger(L,1); lua_gettable(L,-2); diff --git a/src/shared/lua_api/common.hpp b/src/shared/lua_api/common.hpp index 6086065..66da29a 100644 --- a/src/shared/lua_api/common.hpp +++ b/src/shared/lua_api/common.hpp @@ -18,3 +18,4 @@ int popvector3d(lua_State*,double*,double*,double*); int popvector2i(lua_State*,long*,long*); int poprecti(lua_State* L,long*,long*,long*,long*); +int pushrecti(lua_State* L,long,long,long,long); diff --git a/src/shared/lua_api/load_net.cpp b/src/shared/lua_api/load_net.cpp index 740d997..6fe8525 100644 --- a/src/shared/lua_api/load_net.cpp +++ b/src/shared/lua_api/load_net.cpp @@ -166,7 +166,7 @@ int send(lua_State* L){ //socket:receive(s_name,function(stream)) int netreceive(lua_State* L){ const char* name = lua_tostring(L,-2); - int slen = strlen(name); + //int slen = strlen(name); std::string s = std::string(name); int func = luaL_ref(L,LUA_REGISTRYINDEX); lua_pushstring(L,"fd"); @@ -178,8 +178,8 @@ int netreceive(lua_State* L){ } int socketFactory(lua_State*L){ - int domain = luaL_optint(L,-1,0); - int type = luaL_optint(L,-2,0); + //int domain = luaL_optint(L,-1,0); + //int type = luaL_optint(L,-2,0); int c = nn_socket(AF_SP,NN_PAIR); if(c < 0){ |
