diff options
| author | Simon Robertshaw <simon@Simons-Mac-Pro.local> | 2012-04-26 12:10:47 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@Simons-Mac-Pro.local> | 2012-04-26 12:10:47 (GMT) |
| commit | bb8a3f76e3b558a63eab38ab15ebb71f9b5ac762 (patch) | |
| tree | ff63bd38df84018dc9843e5a5d26f5795b657735 /src/cat/LuaScriptInterface.cpp | |
| parent | 9e4cd165eb66b27a42f8eb3aad1993be5178d825 (diff) | |
| download | powder-bb8a3f76e3b558a63eab38ab15ebb71f9b5ac762.zip powder-bb8a3f76e3b558a63eab38ab15ebb71f9b5ac762.tar.gz | |
OS X compiling working, Make it a bit more friendly with stricter compilers
Diffstat (limited to 'src/cat/LuaScriptInterface.cpp')
| -rw-r--r-- | src/cat/LuaScriptInterface.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/cat/LuaScriptInterface.cpp b/src/cat/LuaScriptInterface.cpp index a918ff1..6ee9132 100644 --- a/src/cat/LuaScriptInterface.cpp +++ b/src/cat/LuaScriptInterface.cpp @@ -326,11 +326,11 @@ int luacon_partread(lua_State* l){ switch(format) { case 0: - tempinteger = *((int*)(((void*)&luacon_sim->parts[i])+offset)); + tempinteger = *((int*)(((unsigned char*)&luacon_sim->parts[i])+offset)); lua_pushnumber(l, tempinteger); break; case 1: - tempfloat = *((float*)(((void*)&luacon_sim->parts[i])+offset)); + tempfloat = *((float*)(((unsigned char*)&luacon_sim->parts[i])+offset)); lua_pushnumber(l, tempfloat); break; } @@ -358,10 +358,10 @@ int luacon_partwrite(lua_State* l){ switch(format) { case 0: - *((int*)(((void*)&luacon_sim->parts[i])+offset)) = luaL_optinteger(l, 3, 0); + *((int*)(((unsigned char*)&luacon_sim->parts[i])+offset)) = luaL_optinteger(l, 3, 0); break; case 1: - *((float*)(((void*)&luacon_sim->parts[i])+offset)) = luaL_optnumber(l, 3, 0); + *((float*)(((unsigned char*)&luacon_sim->parts[i])+offset)) = luaL_optnumber(l, 3, 0); break; } return 1; @@ -488,11 +488,11 @@ int luacon_transitionread(lua_State* l){ switch(format) { case 0: - tempinteger = *((int*)(((void*)&luacon_sim->ptransitions[i])+offset)); + tempinteger = *((int*)(((unsigned char*)&luacon_sim->ptransitions[i])+offset)); lua_pushnumber(l, tempinteger); break; case 1: - tempfloat = *((float*)(((void*)&luacon_sim->ptransitions[i])+offset)); + tempfloat = *((float*)(((unsigned char*)&luacon_sim->ptransitions[i])+offset)); lua_pushnumber(l, tempfloat); break; } @@ -522,10 +522,10 @@ int luacon_transitionwrite(lua_State* l){ switch(format) { case 0: - *((int*)(((void*)&luacon_sim->ptransitions[i])+offset)) = luaL_optinteger(l, 3, 0); + *((int*)(((unsigned char*)&luacon_sim->ptransitions[i])+offset)) = luaL_optinteger(l, 3, 0); break; case 1: - *((float*)(((void*)&luacon_sim->ptransitions[i])+offset)) = luaL_optnumber(l, 3, 0); + *((float*)(((unsigned char*)&luacon_sim->ptransitions[i])+offset)) = luaL_optnumber(l, 3, 0); break; } return 0; @@ -675,19 +675,19 @@ int luacon_elementread(lua_State* l){ switch(format) { case 0: - tempinteger = *((int*)(((void*)&luacon_sim->ptypes[i])+offset)); + tempinteger = *((int*)(((unsigned char*)&luacon_sim->ptypes[i])+offset)); lua_pushnumber(l, tempinteger); break; case 1: - tempfloat = *((float*)(((void*)&luacon_sim->ptypes[i])+offset)); + tempfloat = *((float*)(((unsigned char*)&luacon_sim->ptypes[i])+offset)); lua_pushnumber(l, tempfloat); break; case 2: - tempstring = *((char**)(((void*)&luacon_sim->ptypes[i])+offset)); + tempstring = *((char**)(((unsigned char*)&luacon_sim->ptypes[i])+offset)); lua_pushstring(l, tempstring); break; case 3: - tempinteger = *((unsigned char*)(((void*)&luacon_sim->ptypes[i])+offset)); + tempinteger = *((unsigned char*)(((unsigned char*)&luacon_sim->ptypes[i])+offset)); lua_pushnumber(l, tempinteger); break; } @@ -719,10 +719,10 @@ int luacon_elementwrite(lua_State* l){ switch(format) { case 0: - *((int*)(((void*)&luacon_sim->ptypes[i])+offset)) = luaL_optinteger(l, 3, 0); + *((int*)(((unsigned char*)&luacon_sim->ptypes[i])+offset)) = luaL_optinteger(l, 3, 0); break; case 1: - *((float*)(((void*)&luacon_sim->ptypes[i])+offset)) = luaL_optnumber(l, 3, 0); + *((float*)(((unsigned char*)&luacon_sim->ptypes[i])+offset)) = luaL_optnumber(l, 3, 0); break; case 2: tempstring = mystrdup((char*)luaL_optstring(l, 3, "")); @@ -745,11 +745,11 @@ int luacon_elementwrite(lua_State* l){ return luaL_error(l, "Name in use"); } } - *((char**)(((void*)&luacon_sim->ptypes[i])+offset)) = tempstring; + *((char**)(((unsigned char*)&luacon_sim->ptypes[i])+offset)) = tempstring; //Need some way of cleaning up previous values break; case 3: - *((unsigned char*)(((void*)&luacon_sim->ptypes[i])+offset)) = luaL_optinteger(l, 3, 0); + *((unsigned char*)(((unsigned char*)&luacon_sim->ptypes[i])+offset)) = luaL_optinteger(l, 3, 0); break; } if (modified_stuff) @@ -1212,9 +1212,9 @@ int luatpt_set_property(lua_State* l) } i = r>>8; if(format == CommandInterface::FormatFloat){ - *((float*)(((void*)&luacon_sim->parts[i])+offset)) = f; + *((float*)(((unsigned char*)&luacon_sim->parts[i])+offset)) = f; } else { - *((int*)(((void*)&luacon_sim->parts[i])+offset)) = t; + *((int*)(((unsigned char*)&luacon_sim->parts[i])+offset)) = t; } } } else { @@ -1236,9 +1236,9 @@ int luatpt_set_property(lua_State* l) if (partsel && partsel != luacon_sim->parts[i].type) return 0; if(format == CommandInterface::FormatFloat){ - *((float*)(((void*)&luacon_sim->parts[i])+offset)) = f; + *((float*)(((unsigned char*)&luacon_sim->parts[i])+offset)) = f; } else { - *((int*)(((void*)&luacon_sim->parts[i])+offset)) = t; + *((int*)(((unsigned char*)&luacon_sim->parts[i])+offset)) = t; } } return 0; |
