Browse Source

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
Bart van Strien 8 years ago
parent
commit
9f6aa716fa
54 changed files with 60 additions and 59 deletions
  1. 5 5
      src/common/runtime.cpp
  2. 3 2
      src/common/runtime.h
  3. 1 1
      src/common/wrap_Data.cpp
  4. 1 1
      src/modules/audio/wrap_Source.cpp
  5. 1 1
      src/modules/filesystem/wrap_DroppedFile.cpp
  6. 1 1
      src/modules/filesystem/wrap_File.cpp
  7. 1 1
      src/modules/filesystem/wrap_FileData.cpp
  8. 1 1
      src/modules/font/wrap_GlyphData.cpp
  9. 1 1
      src/modules/font/wrap_Rasterizer.cpp
  10. 1 1
      src/modules/graphics/opengl/wrap_Canvas.cpp
  11. 1 1
      src/modules/graphics/opengl/wrap_Font.cpp
  12. 1 1
      src/modules/graphics/opengl/wrap_Graphics.cpp
  13. 1 1
      src/modules/graphics/opengl/wrap_Image.cpp
  14. 1 1
      src/modules/graphics/opengl/wrap_Mesh.cpp
  15. 1 1
      src/modules/graphics/opengl/wrap_ParticleSystem.cpp
  16. 1 1
      src/modules/graphics/opengl/wrap_Shader.cpp
  17. 1 1
      src/modules/graphics/opengl/wrap_SpriteBatch.cpp
  18. 1 1
      src/modules/graphics/opengl/wrap_Text.cpp
  19. 1 1
      src/modules/graphics/opengl/wrap_Video.cpp
  20. 1 1
      src/modules/graphics/wrap_Quad.cpp
  21. 1 1
      src/modules/graphics/wrap_Texture.cpp
  22. 1 1
      src/modules/image/wrap_CompressedImageData.cpp
  23. 1 1
      src/modules/image/wrap_ImageData.cpp
  24. 1 1
      src/modules/joystick/wrap_Joystick.cpp
  25. 1 1
      src/modules/math/wrap_BezierCurve.cpp
  26. 1 1
      src/modules/math/wrap_CompressedData.cpp
  27. 1 1
      src/modules/math/wrap_RandomGenerator.cpp
  28. 1 1
      src/modules/mouse/wrap_Cursor.cpp
  29. 1 1
      src/modules/physics/box2d/wrap_Body.cpp
  30. 1 1
      src/modules/physics/box2d/wrap_ChainShape.cpp
  31. 1 1
      src/modules/physics/box2d/wrap_CircleShape.cpp
  32. 1 1
      src/modules/physics/box2d/wrap_Contact.cpp
  33. 1 1
      src/modules/physics/box2d/wrap_DistanceJoint.cpp
  34. 1 1
      src/modules/physics/box2d/wrap_EdgeShape.cpp
  35. 1 1
      src/modules/physics/box2d/wrap_Fixture.cpp
  36. 1 1
      src/modules/physics/box2d/wrap_FrictionJoint.cpp
  37. 1 1
      src/modules/physics/box2d/wrap_GearJoint.cpp
  38. 1 1
      src/modules/physics/box2d/wrap_Joint.cpp
  39. 1 1
      src/modules/physics/box2d/wrap_MotorJoint.cpp
  40. 1 1
      src/modules/physics/box2d/wrap_MouseJoint.cpp
  41. 1 1
      src/modules/physics/box2d/wrap_PolygonShape.cpp
  42. 1 1
      src/modules/physics/box2d/wrap_PrismaticJoint.cpp
  43. 1 1
      src/modules/physics/box2d/wrap_PulleyJoint.cpp
  44. 1 1
      src/modules/physics/box2d/wrap_RevoluteJoint.cpp
  45. 1 1
      src/modules/physics/box2d/wrap_RopeJoint.cpp
  46. 1 1
      src/modules/physics/box2d/wrap_Shape.cpp
  47. 1 1
      src/modules/physics/box2d/wrap_WeldJoint.cpp
  48. 1 1
      src/modules/physics/box2d/wrap_WheelJoint.cpp
  49. 1 1
      src/modules/physics/box2d/wrap_World.cpp
  50. 1 1
      src/modules/sound/wrap_Decoder.cpp
  51. 1 1
      src/modules/sound/wrap_SoundData.cpp
  52. 1 1
      src/modules/thread/wrap_Channel.cpp
  53. 1 1
      src/modules/thread/wrap_LuaThread.cpp
  54. 1 1
      src/modules/video/wrap_VideoStream.cpp

+ 5 - 5
src/common/runtime.cpp

@@ -307,9 +307,9 @@ int luax_preload(lua_State *L, lua_CFunction f, const char *name)
 	return 0;
 	return 0;
 }
 }
 
 
-int luax_register_type(lua_State *L, love::Type &type, ...)
+int luax_register_type(lua_State *L, love::Type *type, ...)
 {
 {
-	type.init();
+	type->init();
 
 
 	// Get the place for storing and re-using instantiated love types.
 	// Get the place for storing and re-using instantiated love types.
 	luax_getregistry(L, REGISTRY_OBJECTS);
 	luax_getregistry(L, REGISTRY_OBJECTS);
@@ -336,7 +336,7 @@ int luax_register_type(lua_State *L, love::Type &type, ...)
 	else
 	else
 		lua_pop(L, 1);
 		lua_pop(L, 1);
 
 
-	luaL_newmetatable(L, type.getName());
+	luaL_newmetatable(L, type->getName());
 
 
 	// m.__index = m
 	// m.__index = m
 	lua_pushvalue(L, -1);
 	lua_pushvalue(L, -1);
@@ -351,12 +351,12 @@ int luax_register_type(lua_State *L, love::Type &type, ...)
 	lua_setfield(L, -2, "__eq");
 	lua_setfield(L, -2, "__eq");
 
 
 	// Add tostring function.
 	// Add tostring function.
-	lua_pushstring(L, type.getName());
+	lua_pushstring(L, type->getName());
 	lua_pushcclosure(L, w__tostring, 1);
 	lua_pushcclosure(L, w__tostring, 1);
 	lua_setfield(L, -2, "__tostring");
 	lua_setfield(L, -2, "__tostring");
 
 
 	// Add type
 	// Add type
-	lua_pushstring(L, type.getName());
+	lua_pushstring(L, type->getName());
 	lua_pushcclosure(L, w__type, 1);
 	lua_pushcclosure(L, w__type, 1);
 	lua_setfield(L, -2, "type");
 	lua_setfield(L, -2, "type");
 
 

+ 3 - 2
src/common/runtime.h

@@ -249,11 +249,12 @@ int luax_preload(lua_State *L, lua_CFunction f, const char *name);
 
 
 /**
 /**
  * Register a new type.
  * Register a new type.
+ * NOTE: The type is passed by pointer instead of reference because calling va_start
+ * on a reference is undefined behaviour.
  * @param type The type.
  * @param type The type.
- * @param name The type's human-readable name
  * @param ... The list of lists of member functions for the type. (of type luaL_Reg*)
  * @param ... The list of lists of member functions for the type. (of type luaL_Reg*)
  **/
  **/
-int luax_register_type(lua_State *L, love::Type &type, ...);
+int luax_register_type(lua_State *L, love::Type *type, ...);
 
 
 /**
 /**
  * Pushes the metatable of the specified type onto the stack.
  * Pushes the metatable of the specified type onto the stack.

+ 1 - 1
src/common/wrap_Data.cpp

@@ -59,7 +59,7 @@ const luaL_Reg w_Data_functions[] =
 
 
 int w_Data_open(lua_State *L)
 int w_Data_open(lua_State *L)
 {
 {
-	luax_register_type(L, Data::type, w_Data_functions, nullptr);
+	luax_register_type(L, &Data::type, w_Data_functions, nullptr);
 	return 0;
 	return 0;
 }
 }
 
 

+ 1 - 1
src/modules/audio/wrap_Source.cpp

@@ -450,7 +450,7 @@ static const luaL_Reg w_Source_functions[] =
 
 
 extern "C" int luaopen_source(lua_State *L)
 extern "C" int luaopen_source(lua_State *L)
 {
 {
-	return luax_register_type(L, love::audio::Source::type, w_Source_functions, nullptr);
+	return luax_register_type(L, &love::audio::Source::type, w_Source_functions, nullptr);
 }
 }
 
 
 } // audio
 } // audio

+ 1 - 1
src/modules/filesystem/wrap_DroppedFile.cpp

@@ -33,7 +33,7 @@ DroppedFile *luax_checkdroppedfile(lua_State *L, int idx)
 
 
 extern "C" int luaopen_droppedfile(lua_State *L)
 extern "C" int luaopen_droppedfile(lua_State *L)
 {
 {
-	return luax_register_type(L, DroppedFile::type, w_File_functions, nullptr);
+	return luax_register_type(L, &DroppedFile::type, w_File_functions, nullptr);
 }
 }
 
 
 } // filesystem
 } // filesystem

+ 1 - 1
src/modules/filesystem/wrap_File.cpp

@@ -435,7 +435,7 @@ const luaL_Reg w_File_functions[] =
 
 
 extern "C" int luaopen_file(lua_State *L)
 extern "C" int luaopen_file(lua_State *L)
 {
 {
-	return luax_register_type(L, File::type, w_File_functions, nullptr);
+	return luax_register_type(L, &File::type, w_File_functions, nullptr);
 }
 }
 
 
 } // filesystem
 } // filesystem

+ 1 - 1
src/modules/filesystem/wrap_FileData.cpp

@@ -56,7 +56,7 @@ static const luaL_Reg w_FileData_functions[] =
 
 
 extern "C" int luaopen_filedata(lua_State *L)
 extern "C" int luaopen_filedata(lua_State *L)
 {
 {
-	return luax_register_type(L, FileData::type, w_Data_functions, w_FileData_functions, nullptr);
+	return luax_register_type(L, &FileData::type, w_Data_functions, w_FileData_functions, nullptr);
 }
 }
 
 
 } // filesystem
 } // filesystem

+ 1 - 1
src/modules/font/wrap_GlyphData.cpp

@@ -131,7 +131,7 @@ const luaL_Reg w_GlyphData_functions[] =
 
 
 extern "C" int luaopen_glyphdata(lua_State *L)
 extern "C" int luaopen_glyphdata(lua_State *L)
 {
 {
-	return luax_register_type(L, GlyphData::type, w_Data_functions, w_GlyphData_functions, nullptr);
+	return luax_register_type(L, &GlyphData::type, w_Data_functions, w_GlyphData_functions, nullptr);
 }
 }
 
 
 } // font
 } // font

+ 1 - 1
src/modules/font/wrap_Rasterizer.cpp

@@ -139,7 +139,7 @@ const luaL_Reg w_Rasterizer_functions[] =
 
 
 extern "C" int luaopen_rasterizer(lua_State *L)
 extern "C" int luaopen_rasterizer(lua_State *L)
 {
 {
-	return luax_register_type(L, Rasterizer::type, w_Rasterizer_functions, nullptr);
+	return luax_register_type(L, &Rasterizer::type, w_Rasterizer_functions, nullptr);
 }
 }
 
 
 } // font
 } // font

+ 1 - 1
src/modules/graphics/opengl/wrap_Canvas.cpp

@@ -112,7 +112,7 @@ static const luaL_Reg w_Canvas_functions[] =
 
 
 extern "C" int luaopen_canvas(lua_State *L)
 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
 } // opengl

+ 1 - 1
src/modules/graphics/opengl/wrap_Font.cpp

@@ -207,7 +207,7 @@ static const luaL_Reg w_Font_functions[] =
 
 
 extern "C" int luaopen_font(lua_State *L)
 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
 } // opengl

+ 1 - 1
src/modules/graphics/opengl/wrap_Graphics.cpp

@@ -2090,7 +2090,7 @@ static const luaL_Reg functions[] =
 
 
 static int luaopen_drawable(lua_State *L)
 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.
 // Types for this module.

+ 1 - 1
src/modules/graphics/opengl/wrap_Image.cpp

@@ -150,7 +150,7 @@ static const luaL_Reg w_Image_functions[] =
 
 
 extern "C" int luaopen_image(lua_State *L)
 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
 } // opengl

+ 1 - 1
src/modules/graphics/opengl/wrap_Mesh.cpp

@@ -528,7 +528,7 @@ static const luaL_Reg w_Mesh_functions[] =
 
 
 extern "C" int luaopen_mesh(lua_State *L)
 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
 } // opengl

+ 1 - 1
src/modules/graphics/opengl/wrap_ParticleSystem.cpp

@@ -772,7 +772,7 @@ static const luaL_Reg w_ParticleSystem_functions[] =
 
 
 extern "C" int luaopen_particlesystem(lua_State *L)
 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
 } // opengl

+ 1 - 1
src/modules/graphics/opengl/wrap_Shader.cpp

@@ -317,7 +317,7 @@ static const luaL_Reg w_Shader_functions[] =
 
 
 extern "C" int luaopen_shader(lua_State *L)
 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
 } // opengl

+ 1 - 1
src/modules/graphics/opengl/wrap_SpriteBatch.cpp

@@ -257,7 +257,7 @@ static const luaL_Reg w_SpriteBatch_functions[] =
 
 
 extern "C" int luaopen_spritebatch(lua_State *L)
 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
 } // opengl

+ 1 - 1
src/modules/graphics/opengl/wrap_Text.cpp

@@ -245,7 +245,7 @@ static const luaL_Reg w_Text_functions[] =
 
 
 extern "C" int luaopen_text(lua_State *L)
 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
 } // opengl

+ 1 - 1
src/modules/graphics/opengl/wrap_Video.cpp

@@ -143,7 +143,7 @@ static const luaL_Reg functions[] =
 
 
 int luaopen_video(lua_State *L)
 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");
 	luaL_loadbuffer(L, video_lua, sizeof(video_lua), "Video.lua");
 	luax_gettypemetatable(L, Video::type);
 	luax_gettypemetatable(L, Video::type);

+ 1 - 1
src/modules/graphics/wrap_Quad.cpp

@@ -84,7 +84,7 @@ static const luaL_Reg w_Quad_functions[] =
 
 
 extern "C" int luaopen_quad(lua_State *L)
 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
 } // graphics

+ 1 - 1
src/modules/graphics/wrap_Texture.cpp

@@ -139,7 +139,7 @@ const luaL_Reg w_Texture_functions[] =
 
 
 extern "C" int luaopen_texture(lua_State *L)
 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
 } // graphics

+ 1 - 1
src/modules/image/wrap_CompressedImageData.cpp

@@ -106,7 +106,7 @@ static const luaL_Reg w_CompressedImageData_functions[] =
 
 
 extern "C" int luaopen_compressedimagedata(lua_State *L)
 extern "C" int luaopen_compressedimagedata(lua_State *L)
 {
 {
-	return luax_register_type(L, CompressedImageData::type, w_Data_functions, w_CompressedImageData_functions, nullptr);
+	return luax_register_type(L, &CompressedImageData::type, w_Data_functions, w_CompressedImageData_functions, nullptr);
 }
 }
 
 
 } // image
 } // image

+ 1 - 1
src/modules/image/wrap_ImageData.cpp

@@ -366,7 +366,7 @@ static const luaL_Reg w_ImageData_functions[] =
 
 
 extern "C" int luaopen_imagedata(lua_State *L)
 extern "C" int luaopen_imagedata(lua_State *L)
 {
 {
-	int ret = luax_register_type(L, ImageData::type, w_Data_functions, w_ImageData_functions, nullptr);
+	int ret = luax_register_type(L, &ImageData::type, w_Data_functions, w_ImageData_functions, nullptr);
 
 
 	luax_gettypemetatable(L, ImageData::type);
 	luax_gettypemetatable(L, ImageData::type);
 
 

+ 1 - 1
src/modules/joystick/wrap_Joystick.cpp

@@ -296,7 +296,7 @@ static const luaL_Reg w_Joystick_functions[] =
 
 
 extern "C" int luaopen_joystick(lua_State *L)
 extern "C" int luaopen_joystick(lua_State *L)
 {
 {
-	return luax_register_type(L, Joystick::type, w_Joystick_functions, nullptr);
+	return luax_register_type(L, &Joystick::type, w_Joystick_functions, nullptr);
 }
 }
 
 
 } // joystick
 } // joystick

+ 1 - 1
src/modules/math/wrap_BezierCurve.cpp

@@ -234,7 +234,7 @@ static const luaL_Reg w_BezierCurve_functions[] =
 
 
 extern "C" int luaopen_beziercurve(lua_State *L)
 extern "C" int luaopen_beziercurve(lua_State *L)
 {
 {
-	return luax_register_type(L, BezierCurve::type, w_BezierCurve_functions, nullptr);
+	return luax_register_type(L, &BezierCurve::type, w_BezierCurve_functions, nullptr);
 }
 }
 
 
 } // math
 } // math

+ 1 - 1
src/modules/math/wrap_CompressedData.cpp

@@ -53,7 +53,7 @@ static const luaL_Reg w_CompressedData_functions[] =
 
 
 extern "C" int luaopen_compresseddata(lua_State *L)
 extern "C" int luaopen_compresseddata(lua_State *L)
 {
 {
-	return luax_register_type(L, CompressedData::type, w_Data_functions, w_CompressedData_functions, nullptr);
+	return luax_register_type(L, &CompressedData::type, w_Data_functions, w_CompressedData_functions, nullptr);
 }
 }
 
 
 } // math
 } // math

+ 1 - 1
src/modules/math/wrap_RandomGenerator.cpp

@@ -147,7 +147,7 @@ static const luaL_Reg w_RandomGenerator_functions[] =
 
 
 extern "C" int luaopen_randomgenerator(lua_State *L)
 extern "C" int luaopen_randomgenerator(lua_State *L)
 {
 {
-	int n = luax_register_type(L, RandomGenerator::type, w_RandomGenerator_functions, nullptr);
+	int n = luax_register_type(L, &RandomGenerator::type, w_RandomGenerator_functions, nullptr);
 
 
 	luax_gettypemetatable(L, RandomGenerator::type);
 	luax_gettypemetatable(L, RandomGenerator::type);
 
 

+ 1 - 1
src/modules/mouse/wrap_Cursor.cpp

@@ -61,7 +61,7 @@ static const luaL_Reg w_Cursor_functions[] =
 
 
 extern "C" int luaopen_cursor(lua_State *L)
 extern "C" int luaopen_cursor(lua_State *L)
 {
 {
-	return luax_register_type(L, Cursor::type, w_Cursor_functions, nullptr);
+	return luax_register_type(L, &Cursor::type, w_Cursor_functions, nullptr);
 }
 }
 
 
 } // mouse
 } // mouse

+ 1 - 1
src/modules/physics/box2d/wrap_Body.cpp

@@ -650,7 +650,7 @@ static const luaL_Reg w_Body_functions[] =
 
 
 extern "C" int luaopen_body(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/physics/box2d/wrap_ChainShape.cpp

@@ -149,7 +149,7 @@ static const luaL_Reg w_ChainShape_functions[] =
 
 
 extern "C" int luaopen_chainshape(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/physics/box2d/wrap_CircleShape.cpp

@@ -75,7 +75,7 @@ static const luaL_Reg w_CircleShape_functions[] =
 
 
 extern "C" int luaopen_circleshape(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/physics/box2d/wrap_Contact.cpp

@@ -181,7 +181,7 @@ static const luaL_Reg w_Contact_functions[] =
 
 
 extern "C" int luaopen_contact(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/physics/box2d/wrap_DistanceJoint.cpp

@@ -93,7 +93,7 @@ static const luaL_Reg w_DistanceJoint_functions[] =
 
 
 extern "C" int luaopen_distancejoint(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/physics/box2d/wrap_EdgeShape.cpp

@@ -105,7 +105,7 @@ static const luaL_Reg w_EdgeShape_functions[] =
 
 
 extern "C" int luaopen_edgeshape(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/physics/box2d/wrap_Fixture.cpp

@@ -302,7 +302,7 @@ static const luaL_Reg w_Fixture_functions[] =
 
 
 extern "C" int luaopen_fixture(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/physics/box2d/wrap_FrictionJoint.cpp

@@ -77,7 +77,7 @@ static const luaL_Reg w_FrictionJoint_functions[] =
 
 
 extern "C" int luaopen_frictionjoint(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/physics/box2d/wrap_GearJoint.cpp

@@ -77,7 +77,7 @@ static const luaL_Reg w_GearJoint_functions[] =
 
 
 extern "C" int luaopen_gearjoint(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/physics/box2d/wrap_Joint.cpp

@@ -182,7 +182,7 @@ const luaL_Reg w_Joint_functions[] =
 
 
 extern "C" int luaopen_joint(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/physics/box2d/wrap_MotorJoint.cpp

@@ -127,7 +127,7 @@ static const luaL_Reg w_MotorJoint_functions[] =
 
 
 extern "C" int luaopen_motorjoint(lua_State *L)
 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);
 }
 }
 
 
 
 

+ 1 - 1
src/modules/physics/box2d/wrap_MouseJoint.cpp

@@ -111,7 +111,7 @@ static const luaL_Reg w_MouseJoint_functions[] =
 
 
 extern "C" int luaopen_mousejoint(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/physics/box2d/wrap_PolygonShape.cpp

@@ -55,7 +55,7 @@ static const luaL_Reg w_PolygonShape_functions[] =
 
 
 extern "C" int luaopen_polygonshape(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/physics/box2d/wrap_PrismaticJoint.cpp

@@ -204,7 +204,7 @@ static const luaL_Reg w_PrismaticJoint_functions[] =
 
 
 extern "C" int luaopen_prismaticjoint(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/physics/box2d/wrap_PulleyJoint.cpp

@@ -74,7 +74,7 @@ static const luaL_Reg w_PulleyJoint_functions[] =
 
 
 extern "C" int luaopen_pulleyjoint(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/physics/box2d/wrap_RevoluteJoint.cpp

@@ -196,7 +196,7 @@ static const luaL_Reg w_RevoluteJoint_functions[] =
 
 
 extern "C" int luaopen_revolutejoint(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/physics/box2d/wrap_RopeJoint.cpp

@@ -50,7 +50,7 @@ static const luaL_Reg w_RopeJoint_functions[] =
 
 
 extern "C" int luaopen_ropejoint(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/physics/box2d/wrap_Shape.cpp

@@ -108,7 +108,7 @@ const luaL_Reg w_Shape_functions[] =
 
 
 extern "C" int luaopen_shape(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/physics/box2d/wrap_WeldJoint.cpp

@@ -84,7 +84,7 @@ static const luaL_Reg w_WeldJoint_functions[] =
 
 
 extern "C" int luaopen_weldjoint(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/physics/box2d/wrap_WheelJoint.cpp

@@ -160,7 +160,7 @@ static const luaL_Reg w_WheelJoint_functions[] =
 
 
 extern "C" int luaopen_wheeljoint(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/physics/box2d/wrap_World.cpp

@@ -237,7 +237,7 @@ static const luaL_Reg w_World_functions[] =
 
 
 extern "C" int luaopen_world(lua_State *L)
 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
 } // box2d

+ 1 - 1
src/modules/sound/wrap_Decoder.cpp

@@ -109,7 +109,7 @@ static const luaL_Reg w_Decoder_functions[] =
 
 
 extern "C" int luaopen_decoder(lua_State *L)
 extern "C" int luaopen_decoder(lua_State *L)
 {
 {
-	return luax_register_type(L, Decoder::type, w_Decoder_functions, nullptr);
+	return luax_register_type(L, &Decoder::type, w_Decoder_functions, nullptr);
 }
 }
 
 
 } // sound
 } // sound

+ 1 - 1
src/modules/sound/wrap_SoundData.cpp

@@ -110,7 +110,7 @@ static const luaL_Reg w_SoundData_functions[] =
 
 
 extern "C" int luaopen_sounddata(lua_State *L)
 extern "C" int luaopen_sounddata(lua_State *L)
 {
 {
-	int ret = luax_register_type(L, SoundData::type, w_Data_functions, w_SoundData_functions, nullptr);
+	int ret = luax_register_type(L, &SoundData::type, w_Data_functions, w_SoundData_functions, nullptr);
 
 
 	luax_gettypemetatable(L, SoundData::type);
 	luax_gettypemetatable(L, SoundData::type);
 
 

+ 1 - 1
src/modules/thread/wrap_Channel.cpp

@@ -147,7 +147,7 @@ static const luaL_Reg w_Channel_functions[] =
 
 
 extern "C" int luaopen_channel(lua_State *L)
 extern "C" int luaopen_channel(lua_State *L)
 {
 {
-	return luax_register_type(L, Channel::type, w_Channel_functions, nullptr);
+	return luax_register_type(L, &Channel::type, w_Channel_functions, nullptr);
 }
 }
 
 
 } // thread
 } // thread

+ 1 - 1
src/modules/thread/wrap_LuaThread.cpp

@@ -87,7 +87,7 @@ static const luaL_Reg w_Thread_functions[] =
 
 
 extern "C" int luaopen_thread(lua_State *L)
 extern "C" int luaopen_thread(lua_State *L)
 {
 {
-	return luax_register_type(L, LuaThread::type, w_Thread_functions, nullptr);
+	return luax_register_type(L, &LuaThread::type, w_Thread_functions, nullptr);
 }
 }
 
 
 } // thread
 } // thread

+ 1 - 1
src/modules/video/wrap_VideoStream.cpp

@@ -124,7 +124,7 @@ static const luaL_Reg videostream_functions[] =
 
 
 int luaopen_videostream(lua_State *L)
 int luaopen_videostream(lua_State *L)
 {
 {
-	return luax_register_type(L, VideoStream::type, videostream_functions, nullptr);
+	return luax_register_type(L, &VideoStream::type, videostream_functions, nullptr);
 }
 }
 
 
 } // video
 } // video