aboutsummaryrefslogtreecommitdiff
path: root/src/database-sqlite3.h
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-06-16 11:25:52 +0200
committerGitHub <noreply@github.com>2017-06-16 11:25:52 +0200
commit76be103a91d6987527af19e87d93007be8ba8a67 (patch)
treec83c21e7c0adc37251f77788023eb3c242a751ca /src/database-sqlite3.h
parent49d6e5f4ab79078d1608c22a9cce286b3cf86eb9 (diff)
downloadminetest-76be103a91d6987527af19e87d93007be8ba8a67.tar.gz
minetest-76be103a91d6987527af19e87d93007be8ba8a67.tar.bz2
minetest-76be103a91d6987527af19e87d93007be8ba8a67.zip
C++11 patchset 9: move hardcoded init parameters to class definitions (part 1) (#5984)
* C++11 patchset 9: move hardcoded init parameters to class definitions C++11 introduced the possibility to define the default values directly in class definitions, do it on current code Also remove some unused attributes * CollisionInfo::bouncy * collisionMoveResult::collides_xy * collisionMoveResult::standing_on_unloaded * Clouds::speed * More constructor cleanups + some variables removal * remove only write guiFormSpecMenu::m_old_tooltip * move header included inside defintions in genericobject.h * remove some unused since years exception classes * remove unused & empty debug_stacks_init * remove unused & empty content_nodemeta_serialize_legacy * remove forgotten useless bool (bouncy) in collision.cpp code
Diffstat (limited to 'src/database-sqlite3.h')
-rw-r--r--src/database-sqlite3.h48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/database-sqlite3.h b/src/database-sqlite3.h
index 3244facc9..ec7a34ad7 100644
--- a/src/database-sqlite3.h
+++ b/src/database-sqlite3.h
@@ -113,18 +113,18 @@ protected:
virtual void createDatabase() = 0;
virtual void initStatements() = 0;
- sqlite3 *m_database;
+ sqlite3 *m_database = nullptr;
private:
// Open the database
void openDatabase();
- bool m_initialized;
+ bool m_initialized = false;
- std::string m_savedir;
- std::string m_dbname;
+ std::string m_savedir = "";
+ std::string m_dbname = "";
- sqlite3_stmt *m_stmt_begin;
- sqlite3_stmt *m_stmt_end;
+ sqlite3_stmt *m_stmt_begin = nullptr;
+ sqlite3_stmt *m_stmt_end = nullptr;
s64 m_busy_handler_data[2];
@@ -152,10 +152,10 @@ private:
void bindPos(sqlite3_stmt *stmt, const v3s16 &pos, int index = 1);
// Map
- sqlite3_stmt *m_stmt_read;
- sqlite3_stmt *m_stmt_write;
- sqlite3_stmt *m_stmt_list;
- sqlite3_stmt *m_stmt_delete;
+ sqlite3_stmt *m_stmt_read = nullptr;
+ sqlite3_stmt *m_stmt_write = nullptr;
+ sqlite3_stmt *m_stmt_list = nullptr;
+ sqlite3_stmt *m_stmt_delete = nullptr;
};
class PlayerDatabaseSQLite3 : private Database_SQLite3, public PlayerDatabase
@@ -177,20 +177,20 @@ private:
bool playerDataExists(const std::string &name);
// Players
- sqlite3_stmt *m_stmt_player_load;
- sqlite3_stmt *m_stmt_player_add;
- sqlite3_stmt *m_stmt_player_update;
- sqlite3_stmt *m_stmt_player_remove;
- sqlite3_stmt *m_stmt_player_list;
- sqlite3_stmt *m_stmt_player_load_inventory;
- sqlite3_stmt *m_stmt_player_load_inventory_items;
- sqlite3_stmt *m_stmt_player_add_inventory;
- sqlite3_stmt *m_stmt_player_add_inventory_items;
- sqlite3_stmt *m_stmt_player_remove_inventory;
- sqlite3_stmt *m_stmt_player_remove_inventory_items;
- sqlite3_stmt *m_stmt_player_metadata_load;
- sqlite3_stmt *m_stmt_player_metadata_remove;
- sqlite3_stmt *m_stmt_player_metadata_add;
+ sqlite3_stmt *m_stmt_player_load = nullptr;
+ sqlite3_stmt *m_stmt_player_add = nullptr;
+ sqlite3_stmt *m_stmt_player_update = nullptr;
+ sqlite3_stmt *m_stmt_player_remove = nullptr;
+ sqlite3_stmt *m_stmt_player_list = nullptr;
+ sqlite3_stmt *m_stmt_player_load_inventory = nullptr;
+ sqlite3_stmt *m_stmt_player_load_inventory_items = nullptr;
+ sqlite3_stmt *m_stmt_player_add_inventory = nullptr;
+ sqlite3_stmt *m_stmt_player_add_inventory_items = nullptr;
+ sqlite3_stmt *m_stmt_player_remove_inventory = nullptr;
+ sqlite3_stmt *m_stmt_player_remove_inventory_items = nullptr;
+ sqlite3_stmt *m_stmt_player_metadata_load = nullptr;
+ sqlite3_stmt *m_stmt_player_metadata_remove = nullptr;
+ sqlite3_stmt *m_stmt_player_metadata_add = nullptr;
};
#endif