mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
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:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user