summaryrefslogtreecommitdiff
path: root/src/cat
diff options
context:
space:
mode:
authorSimon 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)
commitbb8a3f76e3b558a63eab38ab15ebb71f9b5ac762 (patch)
treeff63bd38df84018dc9843e5a5d26f5795b657735 /src/cat
parent9e4cd165eb66b27a42f8eb3aad1993be5178d825 (diff)
downloadpowder-bb8a3f76e3b558a63eab38ab15ebb71f9b5ac762.zip
powder-bb8a3f76e3b558a63eab38ab15ebb71f9b5ac762.tar.gz
OS X compiling working, Make it a bit more friendly with stricter compilers
Diffstat (limited to 'src/cat')
-rw-r--r--src/cat/LuaScriptInterface.cpp40
-rw-r--r--src/cat/LuaScriptInterface.h6
-rw-r--r--src/cat/TPTScriptInterface.cpp12
3 files changed, 29 insertions, 29 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;
diff --git a/src/cat/LuaScriptInterface.h b/src/cat/LuaScriptInterface.h
index a346b1a..50ec52e 100644
--- a/src/cat/LuaScriptInterface.h
+++ b/src/cat/LuaScriptInterface.h
@@ -10,9 +10,9 @@
extern "C"
{
-#include <lua5.1/lua.h>
-#include <lua5.1/lauxlib.h>
-#include <lua5.1/lualib.h>
+#include <lua.h>
+#include <lauxlib.h>
+#include <lualib.h>
}
#include "CommandInterface.h"
diff --git a/src/cat/TPTScriptInterface.cpp b/src/cat/TPTScriptInterface.cpp
index a3f468c..137ad58 100644
--- a/src/cat/TPTScriptInterface.cpp
+++ b/src/cat/TPTScriptInterface.cpp
@@ -198,10 +198,10 @@ AnyType TPTScriptInterface::tptS_set(std::deque<std::string> * words)
switch(propertyFormat)
{
case FormatInt:
- *((int*)(((void*)&sim->parts[partIndex])+propertyOffset)) = ((NumberType)value).Value();
+ *((int*)(((unsigned char*)&sim->parts[partIndex])+propertyOffset)) = ((NumberType)value).Value();
break;
case FormatFloat:
- *((float*)(((void*)&sim->parts[partIndex])+propertyOffset)) = ((NumberType)value).Value();
+ *((float*)(((unsigned char*)&sim->parts[partIndex])+propertyOffset)) = ((NumberType)value).Value();
break;
}
returnValue = 1;
@@ -217,7 +217,7 @@ AnyType TPTScriptInterface::tptS_set(std::deque<std::string> * words)
if(sim->parts[j].type)
{
returnValue++;
- *((int*)(((void*)&sim->parts[j])+propertyOffset)) = tempNumber;
+ *((int*)(((unsigned char*)&sim->parts[j])+propertyOffset)) = tempNumber;
}
}
break;
@@ -228,7 +228,7 @@ AnyType TPTScriptInterface::tptS_set(std::deque<std::string> * words)
if(sim->parts[j].type)
{
returnValue++;
- *((float*)(((void*)&sim->parts[j])+propertyOffset)) = tempNumber;
+ *((float*)(((unsigned char*)&sim->parts[j])+propertyOffset)) = tempNumber;
}
}
break;
@@ -253,7 +253,7 @@ AnyType TPTScriptInterface::tptS_set(std::deque<std::string> * words)
if(sim->parts[j].type == type)
{
returnValue++;
- *((int*)(((void*)&sim->parts[j])+propertyOffset)) = tempNumber;
+ *((int*)(((unsigned char*)&sim->parts[j])+propertyOffset)) = tempNumber;
}
}
break;
@@ -264,7 +264,7 @@ AnyType TPTScriptInterface::tptS_set(std::deque<std::string> * words)
if(sim->parts[j].type == type)
{
returnValue++;
- *((float*)(((void*)&sim->parts[j])+propertyOffset)) = tempNumber;
+ *((float*)(((unsigned char*)&sim->parts[j])+propertyOffset)) = tempNumber;
}
}
break;