Pass Type to luax_register_type by pointer instead of reference

Since the type is passed to va_start, and apparently that's undefined behaviour if it's a reference.

<Textmode> the best kind of behavior

--HG--
branch : dynamiccore2
This commit is contained in:
Bart van Strien
2016-11-14 21:51:47 +01:00
parent d967a755e5
commit 9f6aa716fa
54 changed files with 60 additions and 59 deletions
+1 -1
View File
@@ -112,7 +112,7 @@ static const luaL_Reg w_Canvas_functions[] =
extern "C" int luaopen_canvas(lua_State *L)
{
return luax_register_type(L, Canvas::type, w_Texture_functions, w_Canvas_functions, nullptr);
return luax_register_type(L, &Canvas::type, w_Texture_functions, w_Canvas_functions, nullptr);
}
} // opengl
+1 -1
View File
@@ -207,7 +207,7 @@ static const luaL_Reg w_Font_functions[] =
extern "C" int luaopen_font(lua_State *L)
{
return luax_register_type(L, Font::type, w_Font_functions, nullptr);
return luax_register_type(L, &Font::type, w_Font_functions, nullptr);
}
} // opengl
@@ -2090,7 +2090,7 @@ static const luaL_Reg functions[] =
static int luaopen_drawable(lua_State *L)
{
return luax_register_type(L, Drawable::type, nullptr);
return luax_register_type(L, &Drawable::type, nullptr);
}
// Types for this module.
+1 -1
View File
@@ -150,7 +150,7 @@ static const luaL_Reg w_Image_functions[] =
extern "C" int luaopen_image(lua_State *L)
{
return luax_register_type(L, Image::type, w_Texture_functions, w_Image_functions, nullptr);
return luax_register_type(L, &Image::type, w_Texture_functions, w_Image_functions, nullptr);
}
} // opengl
+1 -1
View File
@@ -528,7 +528,7 @@ static const luaL_Reg w_Mesh_functions[] =
extern "C" int luaopen_mesh(lua_State *L)
{
return luax_register_type(L, Mesh::type, w_Mesh_functions, nullptr);
return luax_register_type(L, &Mesh::type, w_Mesh_functions, nullptr);
}
} // opengl
@@ -772,7 +772,7 @@ static const luaL_Reg w_ParticleSystem_functions[] =
extern "C" int luaopen_particlesystem(lua_State *L)
{
return luax_register_type(L, ParticleSystem::type, w_ParticleSystem_functions, nullptr);
return luax_register_type(L, &ParticleSystem::type, w_ParticleSystem_functions, nullptr);
}
} // opengl
+1 -1
View File
@@ -317,7 +317,7 @@ static const luaL_Reg w_Shader_functions[] =
extern "C" int luaopen_shader(lua_State *L)
{
return luax_register_type(L, Shader::type, w_Shader_functions, nullptr);
return luax_register_type(L, &Shader::type, w_Shader_functions, nullptr);
}
} // opengl
@@ -257,7 +257,7 @@ static const luaL_Reg w_SpriteBatch_functions[] =
extern "C" int luaopen_spritebatch(lua_State *L)
{
return luax_register_type(L, SpriteBatch::type, w_SpriteBatch_functions, nullptr);
return luax_register_type(L, &SpriteBatch::type, w_SpriteBatch_functions, nullptr);
}
} // opengl
+1 -1
View File
@@ -245,7 +245,7 @@ static const luaL_Reg w_Text_functions[] =
extern "C" int luaopen_text(lua_State *L)
{
return luax_register_type(L, Text::type, w_Text_functions, nullptr);
return luax_register_type(L, &Text::type, w_Text_functions, nullptr);
}
} // opengl
+1 -1
View File
@@ -143,7 +143,7 @@ static const luaL_Reg functions[] =
int luaopen_video(lua_State *L)
{
int ret = luax_register_type(L, Video::type, functions, nullptr);
int ret = luax_register_type(L, &Video::type, functions, nullptr);
luaL_loadbuffer(L, video_lua, sizeof(video_lua), "Video.lua");
luax_gettypemetatable(L, Video::type);
+1 -1
View File
@@ -84,7 +84,7 @@ static const luaL_Reg w_Quad_functions[] =
extern "C" int luaopen_quad(lua_State *L)
{
return luax_register_type(L, Quad::type, w_Quad_functions, nullptr);
return luax_register_type(L, &Quad::type, w_Quad_functions, nullptr);
}
} // graphics
+1 -1
View File
@@ -139,7 +139,7 @@ const luaL_Reg w_Texture_functions[] =
extern "C" int luaopen_texture(lua_State *L)
{
return luax_register_type(L, Texture::type, w_Texture_functions, nullptr);
return luax_register_type(L, &Texture::type, w_Texture_functions, nullptr);
}
} // graphics