]> git.lizzy.rs Git - minetest.git/blobdiff - src/script/lua_api/l_storage.h
C++11 cleanup on constructors (#6000)
[minetest.git] / src / script / lua_api / l_storage.h
index fde2828ad075a3077793b8b0bfccf243e8803506..eaf7ec9f6cb2bffbb489eb2a9ff5406042b53aed 100644 (file)
@@ -21,33 +21,34 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #ifndef __L_STORAGE_H__
 #define __L_STORAGE_H__
 
-#include "lua_api/l_base.h"
 #include "l_metadata.h"
+#include "lua_api/l_base.h"
 
 class ModMetadata;
 
-class ModApiStorage: public ModApiBase
+class ModApiStorage : public ModApiBase
 {
 protected:
        static int l_get_mod_storage(lua_State *L);
+
 public:
        static void Initialize(lua_State *L, int top);
-
 };
 
-class StorageRef: public MetaDataRef
+class StorageRef : public MetaDataRef
 {
 private:
-       ModMetadata *m_object;
+       ModMetadata *m_object = nullptr;
 
        static const char className[];
-       static const luaL_reg methods[];
+       static const luaL_Reg methods[];
 
-       virtual Metadatagetmeta(bool auto_create);
+       virtual Metadata *getmeta(bool auto_create);
        virtual void clearMeta();
 
        // garbage collector
        static int gc_object(lua_State *L);
+
 public:
        StorageRef(ModMetadata *object);
        ~StorageRef() {}
@@ -56,7 +57,7 @@ class StorageRef: public MetaDataRef
        static void create(lua_State *L, ModMetadata *object);
 
        static StorageRef *checkobject(lua_State *L, int narg);
-       static ModMetadatagetobject(StorageRef *ref);
+       static ModMetadata *getobject(StorageRef *ref);
 };
 
 #endif /* __L_STORAGE_H__ */