From 95e4a93b1bb98eb94b4ca00fb73a0162bd5c8c0e Mon Sep 17 00:00:00 2001 From: Kahrl Date: Tue, 10 Sep 2013 15:49:43 +0200 Subject: [PATCH] Add license headers and remove useless includes --- src/database-dummy.cpp | 34 ++++++++++++++++++++++------------ src/database-dummy.h | 28 +++++++++++++++++++++++----- src/database-leveldb.cpp | 36 +++++++++++++++++++++++------------- src/database-leveldb.h | 33 +++++++++++++++++++++++++-------- src/database-sqlite3.cpp | 35 +++++++++++++++++++++++------------ src/database-sqlite3.h | 28 ++++++++++++++++++++++------ src/database.cpp | 34 ++++++++++++++++++---------------- src/database.h | 30 +++++++++++++++++++++--------- src/map.h | 2 +- 9 files changed, 178 insertions(+), 82 deletions(-) diff --git a/src/database-dummy.cpp b/src/database-dummy.cpp index 9ca0e732..acc19ca0 100644 --- a/src/database-dummy.cpp +++ b/src/database-dummy.cpp @@ -1,26 +1,36 @@ +/* +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + /* Dummy "database" class */ +#include "database-dummy.h" + #include "map.h" #include "mapsector.h" #include "mapblock.h" +#include "serialization.h" #include "main.h" -#include "filesys.h" -#include "voxel.h" -#include "porting.h" -#include "mapgen.h" -#include "nodemetadata.h" #include "settings.h" #include "log.h" -#include "profiler.h" -#include "nodedef.h" -#include "gamedef.h" -#include "util/directiontables.h" -#include "rollback_interface.h" - -#include "database-dummy.h" Database_Dummy::Database_Dummy(ServerMap *map) { diff --git a/src/database-dummy.h b/src/database-dummy.h index 5a692137..1474a4a9 100644 --- a/src/database-dummy.h +++ b/src/database-dummy.h @@ -1,12 +1,30 @@ +/* +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + #ifndef DATABASE_DUMMY_HEADER #define DATABASE_DUMMY_HEADER -#include "map.h" -#include "mapsector.h" -#include "mapblock.h" -#include "main.h" -#include "filesys.h" #include "database.h" +#include +#include + +class ServerMap; class Database_Dummy : public Database { diff --git a/src/database-leveldb.cpp b/src/database-leveldb.cpp index cb0101a8..8f8d1829 100644 --- a/src/database-leveldb.cpp +++ b/src/database-leveldb.cpp @@ -1,3 +1,22 @@ +/* +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + #include "config.h" #if USE_LEVELDB @@ -6,25 +25,16 @@ LevelDB databases */ +#include "database-leveldb.h" +#include "leveldb/db.h" + #include "map.h" #include "mapsector.h" #include "mapblock.h" +#include "serialization.h" #include "main.h" -#include "filesys.h" -#include "voxel.h" -#include "porting.h" -#include "mapgen.h" -#include "nodemetadata.h" #include "settings.h" #include "log.h" -#include "profiler.h" -#include "nodedef.h" -#include "gamedef.h" -#include "util/directiontables.h" -#include "rollback_interface.h" - -#include "database-leveldb.h" -#include "leveldb/db.h" Database_LevelDB::Database_LevelDB(ServerMap *map, std::string savedir) { diff --git a/src/database-leveldb.h b/src/database-leveldb.h index 94299211..5408f4ce 100644 --- a/src/database-leveldb.h +++ b/src/database-leveldb.h @@ -1,17 +1,34 @@ -#include "config.h" +/* +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ -#if USE_LEVELDB #ifndef DATABASE_LEVELDB_HEADER #define DATABASE_LEVELDB_HEADER -#include "map.h" -#include "mapsector.h" -#include "mapblock.h" -#include "main.h" -#include "filesys.h" -#include "database.h" +#include "config.h" + +#if USE_LEVELDB +#include "database.h" #include "leveldb/db.h" +#include + +class ServerMap; class Database_LevelDB : public Database { diff --git a/src/database-sqlite3.cpp b/src/database-sqlite3.cpp index 1ae4d7a4..17484d48 100644 --- a/src/database-sqlite3.cpp +++ b/src/database-sqlite3.cpp @@ -1,3 +1,22 @@ +/* +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + /* SQLite format specification: - Initially only replaces sectors/ and sectors2/ @@ -15,24 +34,16 @@ BLOB data */ + +#include "database-sqlite3.h" + #include "map.h" #include "mapsector.h" #include "mapblock.h" +#include "serialization.h" #include "main.h" -#include "filesys.h" -#include "voxel.h" -#include "porting.h" -#include "mapgen.h" -#include "nodemetadata.h" #include "settings.h" #include "log.h" -#include "profiler.h" -#include "nodedef.h" -#include "gamedef.h" -#include "util/directiontables.h" -#include "rollback_interface.h" - -#include "database-sqlite3.h" Database_SQLite3::Database_SQLite3(ServerMap *map, std::string savedir) { diff --git a/src/database-sqlite3.h b/src/database-sqlite3.h index 80ba028a..f426f461 100644 --- a/src/database-sqlite3.h +++ b/src/database-sqlite3.h @@ -1,18 +1,34 @@ +/* +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + #ifndef DATABASE_SQLITE3_HEADER #define DATABASE_SQLITE3_HEADER -#include "config.h" -#include "map.h" -#include "mapsector.h" -#include "mapblock.h" -#include "main.h" -#include "filesys.h" #include "database.h" +#include extern "C" { #include "sqlite3.h" } +class ServerMap; + class Database_SQLite3 : public Database { public: diff --git a/src/database.cpp b/src/database.cpp index 771d9b96..b793cd2f 100644 --- a/src/database.cpp +++ b/src/database.cpp @@ -1,22 +1,24 @@ -#include "map.h" -#include "mapsector.h" -#include "mapblock.h" -#include "main.h" -#include "filesys.h" -#include "voxel.h" -#include "porting.h" -#include "mapgen.h" -#include "nodemetadata.h" -#include "settings.h" -#include "log.h" -#include "profiler.h" -#include "nodedef.h" -#include "gamedef.h" -#include "util/directiontables.h" -#include "rollback_interface.h" +/* +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include "database.h" +#include "irrlichttypes.h" static s32 unsignedToSigned(s32 i, s32 max_positive) { diff --git a/src/database.h b/src/database.h index 337f2745..79cabe6a 100644 --- a/src/database.h +++ b/src/database.h @@ -1,17 +1,29 @@ +/* +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + #ifndef DATABASE_HEADER #define DATABASE_HEADER -#include "config.h" -#include "map.h" -#include "mapsector.h" -#include "mapblock.h" -#include "main.h" -#include "filesys.h" -#include "serialization.h" #include +#include "irr_v3d.h" -class Database; -class ServerMap; +class MapBlock; class Database { diff --git a/src/map.h b/src/map.h index 15725f00..34456d68 100644 --- a/src/map.h +++ b/src/map.h @@ -33,8 +33,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "modifiedstate.h" #include "util/container.h" #include "nodetimer.h" -#include "database.h" +class Database; class ClientMap; class MapSector; class ServerMapSector; -- 2.30.2