summaryrefslogtreecommitdiffstats
path: root/src/Bindings/BindingsProcessor.lua
diff options
context:
space:
mode:
authortycho <work.tycho@gmail.com>2015-05-19 16:25:18 +0200
committertycho <work.tycho@gmail.com>2015-05-19 18:09:05 +0200
commit480052c058f3a8ebc70f024933ba5deb6baf0b08 (patch)
tree139f97344eb2f10201021b0cb3f582a7a024d9ec /src/Bindings/BindingsProcessor.lua
parentFixed some more warnings (diff)
downloadcuberite-480052c058f3a8ebc70f024933ba5deb6baf0b08.tar
cuberite-480052c058f3a8ebc70f024933ba5deb6baf0b08.tar.gz
cuberite-480052c058f3a8ebc70f024933ba5deb6baf0b08.tar.bz2
cuberite-480052c058f3a8ebc70f024933ba5deb6baf0b08.tar.lz
cuberite-480052c058f3a8ebc70f024933ba5deb6baf0b08.tar.xz
cuberite-480052c058f3a8ebc70f024933ba5deb6baf0b08.tar.zst
cuberite-480052c058f3a8ebc70f024933ba5deb6baf0b08.zip
Diffstat (limited to '')
-rw-r--r--src/Bindings/BindingsProcessor.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Bindings/BindingsProcessor.lua b/src/Bindings/BindingsProcessor.lua
index f86be6c6d..fba992082 100644
--- a/src/Bindings/BindingsProcessor.lua
+++ b/src/Bindings/BindingsProcessor.lua
@@ -101,7 +101,7 @@ local function OutputLuaStateHelpers(a_Package)
f:write("void Push(" .. item.name .. " * a_Value);\n")
end
for _, item in ipairs(types) do
- f:write("void GetStackValue(int a_StackPos, Ptr" .. item.lname .. " & a_ReturnedVal);\n")
+ f:write("bool GetStackValue(int a_StackPos, Ptr" .. item.lname .. " & a_ReturnedVal);\n")
end
f:write("\n\n\n\n\n")
f:close()
@@ -125,15 +125,17 @@ local function OutputLuaStateHelpers(a_Package)
end
end
for _, item in ipairs(types) do
- f:write("void cLuaState::GetStackValue(int a_StackPos, Ptr" .. item.lname .. " & a_ReturnedVal)\n{\n\tASSERT(IsValid());\n")
+ f:write("bool cLuaState::GetStackValue(int a_StackPos, Ptr" .. item.lname .. " & a_ReturnedVal)\n{\n\tASSERT(IsValid());\n")
f:write("\tif (lua_isnil(m_LuaState, a_StackPos))\n\t{\n")
- f:write("\t a_ReturnedVal = nullptr;\n")
- f:write("\t return;\n\t}\n")
+ f:write("\t\ta_ReturnedVal = nullptr;\n")
+ f:write("\t\treturn false;\n\t}\n")
f:write("\ttolua_Error err;\n")
f:write("\tif (tolua_isusertype(m_LuaState, a_StackPos, \"" .. item.name .. "\", false, &err))\n")
f:write("\t{\n")
- f:write("\t a_ReturnedVal = *(reinterpret_cast<" .. item.name .. " **>(lua_touserdata(m_LuaState, a_StackPos)));\n")
+ f:write("\t\ta_ReturnedVal = *(reinterpret_cast<" .. item.name .. " **>(lua_touserdata(m_LuaState, a_StackPos)));\n")
+ f:write("\t\treturn true;\n");
f:write("\t}\n")
+ f:write("\treturn false;\n")
f:write("}\n\n\n\n\n\n")
end
f:close()