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:
@@ -650,7 +650,7 @@ static const luaL_Reg w_Body_functions[] =
|
||||
|
||||
extern "C" int luaopen_body(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, Body::type, w_Body_functions, nullptr);
|
||||
return luax_register_type(L, &Body::type, w_Body_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -149,7 +149,7 @@ static const luaL_Reg w_ChainShape_functions[] =
|
||||
|
||||
extern "C" int luaopen_chainshape(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, ChainShape::type, w_Shape_functions, w_ChainShape_functions, nullptr);
|
||||
return luax_register_type(L, &ChainShape::type, w_Shape_functions, w_ChainShape_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -75,7 +75,7 @@ static const luaL_Reg w_CircleShape_functions[] =
|
||||
|
||||
extern "C" int luaopen_circleshape(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, CircleShape::type, w_Shape_functions, w_CircleShape_functions, nullptr);
|
||||
return luax_register_type(L, &CircleShape::type, w_Shape_functions, w_CircleShape_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -181,7 +181,7 @@ static const luaL_Reg w_Contact_functions[] =
|
||||
|
||||
extern "C" int luaopen_contact(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, Contact::type, w_Contact_functions, nullptr);
|
||||
return luax_register_type(L, &Contact::type, w_Contact_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -93,7 +93,7 @@ static const luaL_Reg w_DistanceJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_distancejoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, DistanceJoint::type, w_Joint_functions, w_DistanceJoint_functions, nullptr);
|
||||
return luax_register_type(L, &DistanceJoint::type, w_Joint_functions, w_DistanceJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -105,7 +105,7 @@ static const luaL_Reg w_EdgeShape_functions[] =
|
||||
|
||||
extern "C" int luaopen_edgeshape(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, EdgeShape::type, w_Shape_functions, w_EdgeShape_functions, nullptr);
|
||||
return luax_register_type(L, &EdgeShape::type, w_Shape_functions, w_EdgeShape_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -302,7 +302,7 @@ static const luaL_Reg w_Fixture_functions[] =
|
||||
|
||||
extern "C" int luaopen_fixture(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, Fixture::type, w_Fixture_functions, nullptr);
|
||||
return luax_register_type(L, &Fixture::type, w_Fixture_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -77,7 +77,7 @@ static const luaL_Reg w_FrictionJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_frictionjoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, FrictionJoint::type, w_Joint_functions, w_FrictionJoint_functions, nullptr);
|
||||
return luax_register_type(L, &FrictionJoint::type, w_Joint_functions, w_FrictionJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -77,7 +77,7 @@ static const luaL_Reg w_GearJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_gearjoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, GearJoint::type, w_Joint_functions, w_GearJoint_functions, nullptr);
|
||||
return luax_register_type(L, &GearJoint::type, w_Joint_functions, w_GearJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -182,7 +182,7 @@ const luaL_Reg w_Joint_functions[] =
|
||||
|
||||
extern "C" int luaopen_joint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, Joint::type, w_Joint_functions, nullptr);
|
||||
return luax_register_type(L, &Joint::type, w_Joint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -127,7 +127,7 @@ static const luaL_Reg w_MotorJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_motorjoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, MotorJoint::type, w_Joint_functions, w_MotorJoint_functions, nullptr);
|
||||
return luax_register_type(L, &MotorJoint::type, w_Joint_functions, w_MotorJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ static const luaL_Reg w_MouseJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_mousejoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, MouseJoint::type, w_Joint_functions, w_MouseJoint_functions, nullptr);
|
||||
return luax_register_type(L, &MouseJoint::type, w_Joint_functions, w_MouseJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -55,7 +55,7 @@ static const luaL_Reg w_PolygonShape_functions[] =
|
||||
|
||||
extern "C" int luaopen_polygonshape(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, PolygonShape::type, w_Shape_functions, w_PolygonShape_functions, nullptr);
|
||||
return luax_register_type(L, &PolygonShape::type, w_Shape_functions, w_PolygonShape_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -204,7 +204,7 @@ static const luaL_Reg w_PrismaticJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_prismaticjoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, PrismaticJoint::type, w_Joint_functions, w_PrismaticJoint_functions, nullptr);
|
||||
return luax_register_type(L, &PrismaticJoint::type, w_Joint_functions, w_PrismaticJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -74,7 +74,7 @@ static const luaL_Reg w_PulleyJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_pulleyjoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, PulleyJoint::type, w_Joint_functions, w_PulleyJoint_functions, nullptr);
|
||||
return luax_register_type(L, &PulleyJoint::type, w_Joint_functions, w_PulleyJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -196,7 +196,7 @@ static const luaL_Reg w_RevoluteJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_revolutejoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, RevoluteJoint::type, w_Joint_functions, w_RevoluteJoint_functions, nullptr);
|
||||
return luax_register_type(L, &RevoluteJoint::type, w_Joint_functions, w_RevoluteJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -50,7 +50,7 @@ static const luaL_Reg w_RopeJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_ropejoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, RopeJoint::type, w_Joint_functions, w_RopeJoint_functions, nullptr);
|
||||
return luax_register_type(L, &RopeJoint::type, w_Joint_functions, w_RopeJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -108,7 +108,7 @@ const luaL_Reg w_Shape_functions[] =
|
||||
|
||||
extern "C" int luaopen_shape(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, Shape::type, w_Shape_functions, nullptr);
|
||||
return luax_register_type(L, &Shape::type, w_Shape_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -84,7 +84,7 @@ static const luaL_Reg w_WeldJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_weldjoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, WeldJoint::type, w_Joint_functions, w_WeldJoint_functions, nullptr);
|
||||
return luax_register_type(L, &WeldJoint::type, w_Joint_functions, w_WeldJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -160,7 +160,7 @@ static const luaL_Reg w_WheelJoint_functions[] =
|
||||
|
||||
extern "C" int luaopen_wheeljoint(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, WheelJoint::type, w_Joint_functions, w_WheelJoint_functions, nullptr);
|
||||
return luax_register_type(L, &WheelJoint::type, w_Joint_functions, w_WheelJoint_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
@@ -237,7 +237,7 @@ static const luaL_Reg w_World_functions[] =
|
||||
|
||||
extern "C" int luaopen_world(lua_State *L)
|
||||
{
|
||||
return luax_register_type(L, World::type, w_World_functions, nullptr);
|
||||
return luax_register_type(L, &World::type, w_World_functions, nullptr);
|
||||
}
|
||||
|
||||
} // box2d
|
||||
|
||||
Reference in New Issue
Block a user