C++11 patchset 2: remove util/cpp11.h and util/cpp11_container.h (#5821)
authorLoïc Blot <nerzhul@users.noreply.github.com>
Sun, 4 Jun 2017 19:00:04 +0000 (21:00 +0200)
committerGitHub <noreply@github.com>
Sun, 4 Jun 2017 19:00:04 +0000 (21:00 +0200)
59 files changed:
src/client.cpp
src/client.h
src/client/tile.cpp
src/clientenvironment.cpp
src/clientenvironment.h
src/clientiface.cpp
src/clientiface.h
src/clientmedia.cpp
src/clientmedia.h
src/clientobject.cpp
src/clientobject.h
src/content_cao.cpp
src/content_cao.h
src/content_mapblock.cpp
src/content_sao.cpp
src/content_sao.h
src/emerge.cpp
src/emerge.h
src/face_position_cache.cpp
src/face_position_cache.h
src/guiFormSpecMenu.cpp
src/guiFormSpecMenu.h
src/itemgroup.h
src/map.h
src/mapblock_mesh.h
src/mapsector.cpp
src/mapsector.h
src/mg_decoration.cpp
src/mg_decoration.h
src/mg_ore.cpp
src/mg_ore.h
src/mg_schematic.cpp
src/mods.cpp
src/mods.h
src/nameidmapping.cpp
src/nameidmapping.h
src/network/clientpackethandler.cpp
src/network/serverpackethandler.cpp
src/nodedef.cpp
src/nodemetadata.h
src/reflowscan.cpp
src/script/common/c_content.cpp
src/script/common/c_converter.h
src/script/lua_api/l_mapgen.cpp
src/script/lua_api/l_object.cpp
src/script/lua_api/l_util.cpp
src/server.cpp
src/server.h
src/serverenvironment.cpp
src/serverenvironment.h
src/serverobject.h
src/settings.h
src/sound_openal.cpp
src/tool.cpp
src/tool.h
src/util/cpp11.h [deleted file]
src/util/cpp11_container.h [deleted file]
src/util/string.h
src/voxelalgorithms.h

index a5228132d629c5eae1927fc5f01cda0e36c0e66b..56e35ac1fbc4fa8f953fe2dc4581e92d20246081 100644 (file)
@@ -242,7 +242,7 @@ Client::~Client()
        delete m_inventory_from_server;
 
        // Delete detached inventories
-       for (UNORDERED_MAP<std::string, Inventory*>::iterator
+       for (std::unordered_map<std::string, Inventory*>::iterator
                        i = m_detached_inventories.begin();
                        i != m_detached_inventories.end(); ++i) {
                delete i->second;
@@ -571,7 +571,7 @@ void Client::step(float dtime)
                Update positions of sounds attached to objects
        */
        {
-               for(UNORDERED_MAP<int, u16>::iterator i = m_sounds_to_objects.begin();
+               for(std::unordered_map<int, u16>::iterator i = m_sounds_to_objects.begin();
                                i != m_sounds_to_objects.end(); ++i) {
                        int client_id = i->first;
                        u16 object_id = i->second;
@@ -591,7 +591,7 @@ void Client::step(float dtime)
                m_removed_sounds_check_timer = 0;
                // Find removed sounds and clear references to them
                std::vector<s32> removed_server_ids;
-               for(UNORDERED_MAP<s32, int>::iterator i = m_sounds_server_to_client.begin();
+               for (std::unordered_map<s32, int>::iterator i = m_sounds_server_to_client.begin();
                                i != m_sounds_server_to_client.end();) {
                        s32 server_id = i->first;
                        int client_id = i->second;
@@ -614,7 +614,7 @@ void Client::step(float dtime)
        if (m_mod_storage_save_timer <= 0.0f) {
                verbosestream << "Saving registered mod storages." << std::endl;
                m_mod_storage_save_timer = g_settings->getFloat("server_map_save_interval");
-               for (UNORDERED_MAP<std::string, ModMetadata *>::const_iterator
+               for (std::unordered_map<std::string, ModMetadata *>::const_iterator
                                it = m_mod_storages.begin(); it != m_mod_storages.end(); ++it) {
                        if (it->second->isModified()) {
                                it->second->save(getModStoragePath());
@@ -1959,7 +1959,8 @@ bool Client::registerModStorage(ModMetadata *storage)
 
 void Client::unregisterModStorage(const std::string &name)
 {
-       UNORDERED_MAP<std::string, ModMetadata *>::const_iterator it = m_mod_storages.find(name);
+       std::unordered_map<std::string, ModMetadata *>::const_iterator it =
+               m_mod_storages.find(name);
        if (it != m_mod_storages.end()) {
                // Save unconditionaly on unregistration
                it->second->save(getModStoragePath());
index b4145c76ff207127c08084f2dfcdb9f29e72e053..fc24160874d0a6914719aac0ccb62949f5d5f334 100644 (file)
@@ -28,6 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <map>
 #include <set>
 #include <vector>
+#include <unordered_set>
 #include "clientobject.h"
 #include "gamedef.h"
 #include "inventorymanager.h"
@@ -656,18 +657,18 @@ private:
        // Sounds
        float m_removed_sounds_check_timer;
        // Mapping from server sound ids to our sound ids
-       UNORDERED_MAP<s32, int> m_sounds_server_to_client;
+       std::unordered_map<s32, int> m_sounds_server_to_client;
        // And the other way!
-       UNORDERED_MAP<int, s32> m_sounds_client_to_server;
+       std::unordered_map<int, s32> m_sounds_client_to_server;
        // And relations to objects
-       UNORDERED_MAP<int, u16> m_sounds_to_objects;
+       std::unordered_map<int, u16> m_sounds_to_objects;
 
        // Privileges
-       UNORDERED_SET<std::string> m_privileges;
+       std::unordered_set<std::string> m_privileges;
 
        // Detached inventories
        // key = name
-       UNORDERED_MAP<std::string, Inventory*> m_detached_inventories;
+       std::unordered_map<std::string, Inventory*> m_detached_inventories;
 
        // Storage for mesh data for creating multiple instances of the same mesh
        StringMap m_mesh_data;
@@ -682,7 +683,7 @@ private:
 
        ClientScripting *m_script;
        bool m_modding_enabled;
-       UNORDERED_MAP<std::string, ModMetadata *> m_mod_storages;
+       std::unordered_map<std::string, ModMetadata *> m_mod_storages;
        float m_mod_storage_save_timer;
        GameUIFlags *m_game_ui_flags;
 
index 99495132b53acfd0ad8c017a06d74cb872639223..0918836e5de573142b1b7f738d5c5b2a69fcc9ea 100644 (file)
@@ -427,7 +427,7 @@ private:
        std::vector<video::ITexture*> m_texture_trash;
 
        // Maps image file names to loaded palettes.
-       UNORDERED_MAP<std::string, Palette> m_palettes;
+       std::unordered_map<std::string, Palette> m_palettes;
 
        // Cached settings needed for making textures from meshes
        bool m_setting_trilinear_filter;
@@ -700,7 +700,7 @@ Palette* TextureSource::getPalette(const std::string &name)
        if (name == "")
                return NULL;
 
-       UNORDERED_MAP<std::string, Palette>::iterator it = m_palettes.find(name);
+       std::unordered_map<std::string, Palette>::iterator it = m_palettes.find(name);
        if (it == m_palettes.end()) {
                // Create palette
                video::IImage *img = generateImage(name);
index cc7cb54ddcca2802bba65cdc7fa778c4a20b4537..d6af06ddebff0c63bcb51aaadc73bc1ff5f322b6 100644 (file)
@@ -55,8 +55,8 @@ ClientEnvironment::ClientEnvironment(ClientMap *map, scene::ISceneManager *smgr,
 ClientEnvironment::~ClientEnvironment()
 {
        // delete active objects
-       for (UNORDERED_MAP<u16, ClientActiveObject*>::iterator i = m_active_objects.begin();
-               i != m_active_objects.end(); ++i) {
+       for (ClientActiveObjectMap::iterator i = m_active_objects.begin();
+                       i != m_active_objects.end(); ++i) {
                delete i->second;
        }
 
@@ -346,8 +346,8 @@ void ClientEnvironment::step(float dtime)
 
        g_profiler->avg("CEnv: num of objects", m_active_objects.size());
        bool update_lighting = m_active_object_light_update_interval.step(dtime, 0.21);
-       for (UNORDERED_MAP<u16, ClientActiveObject*>::iterator i = m_active_objects.begin();
-               i != m_active_objects.end(); ++i) {
+       for (ClientActiveObjectMap::iterator i = m_active_objects.begin();
+                       i != m_active_objects.end(); ++i) {
                ClientActiveObject* obj = i->second;
                // Step object
                obj->step(dtime, this);
@@ -406,14 +406,14 @@ GenericCAO* ClientEnvironment::getGenericCAO(u16 id)
 
 ClientActiveObject* ClientEnvironment::getActiveObject(u16 id)
 {
-       UNORDERED_MAP<u16, ClientActiveObject*>::iterator n = m_active_objects.find(id);
+       ClientActiveObjectMap::iterator n = m_active_objects.find(id);
        if (n == m_active_objects.end())
                return NULL;
        return n->second;
 }
 
 bool isFreeClientActiveObjectId(const u16 id,
-       UNORDERED_MAP<u16, ClientActiveObject*> &objects)
+       ClientActiveObjectMap &objects)
 {
        if(id == 0)
                return false;
@@ -421,7 +421,7 @@ bool isFreeClientActiveObjectId(const u16 id,
        return objects.find(id) == objects.end();
 }
 
-u16 getFreeClientActiveObjectId(UNORDERED_MAP<u16, ClientActiveObject*> &objects)
+u16 getFreeClientActiveObjectId(ClientActiveObjectMap &objects)
 {
        //try to reuse id's as late as possible
        static u16 last_used_id = 0;
@@ -583,8 +583,8 @@ void ClientEnvironment::updateLocalPlayerBreath(u16 breath)
 void ClientEnvironment::getActiveObjects(v3f origin, f32 max_d,
        std::vector<DistanceSortedActiveObject> &dest)
 {
-       for (UNORDERED_MAP<u16, ClientActiveObject*>::iterator i = m_active_objects.begin();
-               i != m_active_objects.end(); ++i) {
+       for (ClientActiveObjectMap::iterator i = m_active_objects.begin();
+                       i != m_active_objects.end(); ++i) {
                ClientActiveObject* obj = i->second;
 
                f32 d = (obj->getPosition() - origin).getLength();
index 79b4797ad07e9bc9483a4425aaf1d83b3a9ec084..2906553f0427632e53fec234a34046ebf92cc318 100644 (file)
@@ -64,6 +64,7 @@ struct ClientEnvEvent
        };
 };
 
+typedef std::unordered_map<u16, ClientActiveObject*> ClientActiveObjectMap;
 class ClientEnvironment : public Environment
 {
 public:
@@ -181,7 +182,7 @@ private:
        Client *m_client;
        ClientScripting *m_script;
        IrrlichtDevice *m_irr;
-       UNORDERED_MAP<u16, ClientActiveObject*> m_active_objects;
+       ClientActiveObjectMap m_active_objects;
        std::vector<ClientSimpleObject*> m_simple_objects;
        std::queue<ClientEnvEvent> m_client_event_queue;
        IntervalLimiter m_active_object_light_update_interval;
index 68bd4afe7986b07ab4bcb455684044064b626420..b79d36ea2f1922e4e3a3e2ec3ee7ff3cac65101e 100644 (file)
@@ -611,7 +611,7 @@ ClientInterface::~ClientInterface()
        {
                MutexAutoLock clientslock(m_clients_mutex);
 
-               for (UNORDERED_MAP<u16, RemoteClient*>::iterator i = m_clients.begin();
+               for (RemoteClientMap::iterator i = m_clients.begin();
                        i != m_clients.end(); ++i) {
                        // Delete client
                        delete i->second;
@@ -624,7 +624,7 @@ std::vector<u16> ClientInterface::getClientIDs(ClientState min_state)
        std::vector<u16> reply;
        MutexAutoLock clientslock(m_clients_mutex);
 
-       for(UNORDERED_MAP<u16, RemoteClient*>::iterator i = m_clients.begin();
+       for (RemoteClientMap::iterator i = m_clients.begin();
                i != m_clients.end(); ++i) {
                if (i->second->getState() >= min_state)
                        reply.push_back(i->second->peer_id);
@@ -682,7 +682,7 @@ void ClientInterface::send(u16 peer_id, u8 channelnum,
 void ClientInterface::sendToAll(NetworkPacket *pkt)
 {
        MutexAutoLock clientslock(m_clients_mutex);
-       for (UNORDERED_MAP<u16, RemoteClient*>::iterator i = m_clients.begin();
+       for (RemoteClientMap::iterator i = m_clients.begin();
                        i != m_clients.end(); ++i) {
                RemoteClient *client = i->second;
 
@@ -697,7 +697,7 @@ void ClientInterface::sendToAll(NetworkPacket *pkt)
 RemoteClient* ClientInterface::getClientNoEx(u16 peer_id, ClientState state_min)
 {
        MutexAutoLock clientslock(m_clients_mutex);
-       UNORDERED_MAP<u16, RemoteClient*>::iterator n = m_clients.find(peer_id);
+       RemoteClientMap::const_iterator n = m_clients.find(peer_id);
        // The client may not exist; clients are immediately removed if their
        // access is denied, and this event occurs later then.
        if (n == m_clients.end())
@@ -711,7 +711,7 @@ RemoteClient* ClientInterface::getClientNoEx(u16 peer_id, ClientState state_min)
 
 RemoteClient* ClientInterface::lockedGetClientNoEx(u16 peer_id, ClientState state_min)
 {
-       UNORDERED_MAP<u16, RemoteClient*>::iterator n = m_clients.find(peer_id);
+       RemoteClientMap::const_iterator n = m_clients.find(peer_id);
        // The client may not exist; clients are immediately removed if their
        // access is denied, and this event occurs later then.
        if (n == m_clients.end())
@@ -726,7 +726,7 @@ RemoteClient* ClientInterface::lockedGetClientNoEx(u16 peer_id, ClientState stat
 ClientState ClientInterface::getClientState(u16 peer_id)
 {
        MutexAutoLock clientslock(m_clients_mutex);
-       UNORDERED_MAP<u16, RemoteClient*>::iterator n = m_clients.find(peer_id);
+       RemoteClientMap::const_iterator n = m_clients.find(peer_id);
        // The client may not exist; clients are immediately removed if their
        // access is denied, and this event occurs later then.
        if (n == m_clients.end())
@@ -738,7 +738,7 @@ ClientState ClientInterface::getClientState(u16 peer_id)
 void ClientInterface::setPlayerName(u16 peer_id,std::string name)
 {
        MutexAutoLock clientslock(m_clients_mutex);
-       UNORDERED_MAP<u16, RemoteClient*>::iterator n = m_clients.find(peer_id);
+       RemoteClientMap::iterator n = m_clients.find(peer_id);
        // The client may not exist; clients are immediately removed if their
        // access is denied, and this event occurs later then.
        if (n != m_clients.end())
@@ -750,7 +750,7 @@ void ClientInterface::DeleteClient(u16 peer_id)
        MutexAutoLock conlock(m_clients_mutex);
 
        // Error check
-       UNORDERED_MAP<u16, RemoteClient*>::iterator n = m_clients.find(peer_id);
+       RemoteClientMap::iterator n = m_clients.find(peer_id);
        // The client may not exist; clients are immediately removed if their
        // access is denied, and this event occurs later then.
        if (n == m_clients.end())
@@ -762,10 +762,8 @@ void ClientInterface::DeleteClient(u16 peer_id)
        //TODO this should be done by client destructor!!!
        RemoteClient *client = n->second;
        // Handle objects
-       for(std::set<u16>::iterator
-                       i = client->m_known_objects.begin();
-                       i != client->m_known_objects.end(); ++i)
-       {
+       for (std::set<u16>::iterator i = client->m_known_objects.begin();
+                       i != client->m_known_objects.end(); ++i) {
                // Get object
                u16 id = *i;
                ServerActiveObject* obj = m_env->getActiveObject(id);
@@ -784,7 +782,7 @@ void ClientInterface::CreateClient(u16 peer_id)
        MutexAutoLock conlock(m_clients_mutex);
 
        // Error check
-       UNORDERED_MAP<u16, RemoteClient*>::iterator n = m_clients.find(peer_id);
+       RemoteClientMap::iterator n = m_clients.find(peer_id);
        // The client shouldn't already exist
        if (n != m_clients.end()) return;
 
@@ -800,7 +798,7 @@ void ClientInterface::event(u16 peer_id, ClientStateEvent event)
                MutexAutoLock clientlock(m_clients_mutex);
 
                // Error check
-               UNORDERED_MAP<u16, RemoteClient*>::iterator n = m_clients.find(peer_id);
+               RemoteClientMap::iterator n = m_clients.find(peer_id);
 
                // No client to deliver event
                if (n == m_clients.end())
@@ -821,7 +819,7 @@ u16 ClientInterface::getProtocolVersion(u16 peer_id)
        MutexAutoLock conlock(m_clients_mutex);
 
        // Error check
-       UNORDERED_MAP<u16, RemoteClient*>::iterator n = m_clients.find(peer_id);
+       RemoteClientMap::iterator n = m_clients.find(peer_id);
 
        // No client to get version
        if (n == m_clients.end())
@@ -835,7 +833,7 @@ void ClientInterface::setClientVersion(u16 peer_id, u8 major, u8 minor, u8 patch
        MutexAutoLock conlock(m_clients_mutex);
 
        // Error check
-       UNORDERED_MAP<u16, RemoteClient*>::iterator n = m_clients.find(peer_id);
+       RemoteClientMap::iterator n = m_clients.find(peer_id);
 
        // No client to set versions
        if (n == m_clients.end())
index d2299c8796910d3c020ae34d6d388c8e40aa7797..107ed3bf30ba18a632b51633bcb4f8b65ac29d49 100644 (file)
@@ -25,7 +25,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "serialization.h"             // for SER_FMT_VER_INVALID
 #include "threading/mutex.h"
 #include "network/networkpacket.h"
-#include "util/cpp11_container.h"
 #include "porting.h"
 
 #include <list>
@@ -435,6 +434,8 @@ private:
        const u64 m_connection_time;
 };
 
+typedef std::unordered_map<u16, RemoteClient*> RemoteClientMap;
+
 class ClientInterface {
 public:
 
@@ -499,7 +500,7 @@ protected:
        void lock() { m_clients_mutex.lock(); }
        void unlock() { m_clients_mutex.unlock(); }
 
-       UNORDERED_MAP<u16, RemoteClient*>& getClientList() { return m_clients; }
+       RemoteClientMap& getClientList() { return m_clients; }
 
 private:
        /* update internal player list */
@@ -509,7 +510,7 @@ private:
        con::Connection* m_con;
        Mutex m_clients_mutex;
        // Connected clients (behind the con mutex)
-       UNORDERED_MAP<u16, RemoteClient*> m_clients;
+       RemoteClientMap m_clients;
        std::vector<std::string> m_clients_names; //for announcing masterserver
 
        // Environment
index 9c1e430dfb31f02f460ffd8c75be87f059939a9b..2877d8a2e7432026bd00661d23110f945ed05862 100644 (file)
@@ -348,7 +348,7 @@ void ClientMediaDownloader::remoteMediaReceived(
 
        std::string name;
        {
-               UNORDERED_MAP<unsigned long, std::string>::iterator it =
+               std::unordered_map<unsigned long, std::string>::iterator it =
                        m_remote_file_transfers.find(fetch_result.request_id);
                assert(it != m_remote_file_transfers.end());
                name = it->second;
index 3c96dfe8a61314f04bc714070c6782d5eb81932b..4c0c3c8887999fd31e49d40b9f94fe6376017d1c 100644 (file)
@@ -26,7 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <map>
 #include <set>
 #include <vector>
-#include "util/cpp11_container.h"
+#include <unordered_map>
 
 class Client;
 struct HTTPFetchResult;
@@ -138,7 +138,7 @@ private:
        s32 m_httpfetch_active;
        s32 m_httpfetch_active_limit;
        s32 m_outstanding_hash_sets;
-       UNORDERED_MAP<unsigned long, std::string> m_remote_file_transfers;
+       std::unordered_map<unsigned long, std::string> m_remote_file_transfers;
 
        // All files up to this name have either been received from a
        // remote server or failed on all remote servers, so those files
index 89a0474a40b1781dfd199e5f8efff8f7fbf1f2a7..329f10469b1a8a69b5880b01e6b5a04c84a37a14 100644 (file)
@@ -42,8 +42,8 @@ ClientActiveObject* ClientActiveObject::create(ActiveObjectType type,
                Client *client, ClientEnvironment *env)
 {
        // Find factory function
-       UNORDERED_MAP<u16, Factory>::iterator n = m_types.find(type);
-       if(n == m_types.end()) {
+       std::unordered_map<u16, Factory>::iterator n = m_types.find(type);
+       if (n == m_types.end()) {
                // If factory is not found, just return.
                warningstream << "ClientActiveObject: No factory for type="
                                << (int)type << std::endl;
@@ -57,7 +57,7 @@ ClientActiveObject* ClientActiveObject::create(ActiveObjectType type,
 
 void ClientActiveObject::registerType(u16 type, Factory f)
 {
-       UNORDERED_MAP<u16, Factory>::iterator n = m_types.find(type);
+       std::unordered_map<u16, Factory>::iterator n = m_types.find(type);
        if(n != m_types.end())
                return;
        m_types[type] = f;
index aa0ec9c560c7d7b9237f6004fac2851cf45a7115..a3eb3e2422529cd9cbdb736193993061797a82d2 100644 (file)
@@ -23,7 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "irrlichttypes_extrabloated.h"
 #include "activeobject.h"
 #include <map>
-#include "util/cpp11_container.h"
+#include <unordered_map>
 
 class ClientEnvironment;
 class ITextureSource;
@@ -89,7 +89,7 @@ protected:
        ClientEnvironment *m_env;
 private:
        // Used for creating objects based on type
-       static UNORDERED_MAP<u16, Factory> m_types;
+       static std::unordered_map<u16, Factory> m_types;
 };
 
 struct DistanceSortedActiveObject
index d15c53e7a36185ed60f53dc00b3c11dbe5a316e9..c904082d6e9eb433c9e1c669af65666feacb9934 100644 (file)
@@ -49,7 +49,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 class Settings;
 struct ToolCapabilities;
 
-UNORDERED_MAP<u16, ClientActiveObject::Factory> ClientActiveObject::m_types;
+std::unordered_map<u16, ClientActiveObject::Factory> ClientActiveObject::m_types;
 
 SmoothTranslator::SmoothTranslator():
        vect_old(0,0,0),
@@ -565,7 +565,7 @@ GenericCAO::GenericCAO(Client *client, ClientEnvironment *env):
                m_animation_speed(15),
                m_animation_blend(0),
                m_animation_loop(true),
-               m_bone_position(UNORDERED_MAP<std::string, core::vector2d<v3f> >()),
+               m_bone_position(),
                m_attachment_bone(""),
                m_attachment_position(v3f(0,0,0)),
                m_attachment_rotation(v3f(0,0,0)),
@@ -1493,7 +1493,7 @@ void GenericCAO::updateBonePosition()
                return;
 
        m_animated_meshnode->setJointMode(irr::scene::EJUOR_CONTROL); // To write positions to the mesh on render
-       for(UNORDERED_MAP<std::string, core::vector2d<v3f> >::const_iterator
+       for(std::unordered_map<std::string, core::vector2d<v3f>>::const_iterator
                        ii = m_bone_position.begin(); ii != m_bone_position.end(); ++ii) {
                std::string bone_name = (*ii).first;
                v3f bone_pos = (*ii).second.X;
index 412cdff12eaeb1b1827ee4ae51f92a33f4c4ed4f..e5b23aa35d16174ad37fba76a164cebb2d15664b 100644 (file)
@@ -91,7 +91,8 @@ private:
        int m_animation_speed;
        int m_animation_blend;
        bool m_animation_loop;
-       UNORDERED_MAP<std::string, core::vector2d<v3f> > m_bone_position; // stores position and rotation for each bone name
+       // stores position and rotation for each bone name
+       std::unordered_map<std::string, core::vector2d<v3f>> m_bone_position;
        std::string m_attachment_bone;
        v3f m_attachment_position;
        v3f m_attachment_rotation;
index e6dd8e83e7dddbfc1cc4954c7cad009a2d43ca8e..326433141a7c58184ad536684f50beb1638799c8 100644 (file)
@@ -29,7 +29,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "client.h"
 #include "log.h"
 #include "noise.h"
-#include "util/cpp11.h"
 
 // Distance of light extrapolation (for oversized nodes)
 // After this distance, it gives up and considers light level constant
@@ -43,7 +42,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 // Corresponding offsets are listed in g_27dirs
 #define FRAMED_NEIGHBOR_COUNT 18
 
-static constexpr v3s16 light_dirs[8] = {
+static const v3s16 light_dirs[8] = {
        v3s16(-1, -1, -1),
        v3s16(-1, -1,  1),
        v3s16(-1,  1, -1),
index be1c52fe6931e7c2aae4bb9fef88d9f1665d35f5..90d830ce3edb65ec37dbe5cb91e67f9ee6d78f6c 100644 (file)
@@ -213,7 +213,7 @@ void UnitSAO::removeAttachmentChild(int child_id)
        m_attachment_child_ids.erase(child_id);
 }
 
-const UNORDERED_SET<int> &UnitSAO::getAttachmentChildIds()
+const std::unordered_set<int> &UnitSAO::getAttachmentChildIds()
 {
        return m_attachment_child_ids;
 }
@@ -263,7 +263,7 @@ LuaEntitySAO::~LuaEntitySAO()
                m_env->getScriptIface()->luaentity_Remove(m_id);
        }
 
-       for (UNORDERED_SET<u32>::iterator it = m_attached_particle_spawners.begin();
+       for (std::unordered_set<u32>::iterator it = m_attached_particle_spawners.begin();
                it != m_attached_particle_spawners.end(); ++it) {
                m_env->deleteParticleSpawner(*it, false);
        }
@@ -461,7 +461,7 @@ void LuaEntitySAO::step(float dtime, bool send_recommended)
 
        if(m_bone_position_sent == false){
                m_bone_position_sent = true;
-               for (UNORDERED_MAP<std::string, core::vector2d<v3f> >::const_iterator
+               for (std::unordered_map<std::string, core::vector2d<v3f>>::const_iterator
                                ii = m_bone_position.begin(); ii != m_bone_position.end(); ++ii){
                        std::string str = gob_cmd_update_bone_position((*ii).first,
                                        (*ii).second.X, (*ii).second.Y);
@@ -498,7 +498,7 @@ std::string LuaEntitySAO::getClientInitializationData(u16 protocol_version)
        msg_os << serializeLongString(gob_cmd_update_armor_groups(m_armor_groups)); // 2
        msg_os << serializeLongString(gob_cmd_update_animation(
                m_animation_range, m_animation_speed, m_animation_blend, m_animation_loop)); // 3
-       for (UNORDERED_MAP<std::string, core::vector2d<v3f> >::const_iterator
+       for (std::unordered_map<std::string, core::vector2d<v3f>>::const_iterator
                        ii = m_bone_position.begin(); ii != m_bone_position.end(); ++ii) {
                msg_os << serializeLongString(gob_cmd_update_bone_position((*ii).first,
                                (*ii).second.X, (*ii).second.Y)); // m_bone_position.size
@@ -506,7 +506,7 @@ std::string LuaEntitySAO::getClientInitializationData(u16 protocol_version)
        msg_os << serializeLongString(gob_cmd_update_attachment(m_attachment_parent_id,
                m_attachment_bone, m_attachment_position, m_attachment_rotation)); // 4
        int message_count = 4 + m_bone_position.size();
-       for (UNORDERED_SET<int>::const_iterator ii = m_attachment_child_ids.begin();
+       for (std::unordered_set<int>::const_iterator ii = m_attachment_child_ids.begin();
                        (ii != m_attachment_child_ids.end()); ++ii) {
                if (ServerActiveObject *obj = m_env->getActiveObject(*ii)) {
                        message_count++;
@@ -868,7 +868,7 @@ void PlayerSAO::removingFromEnvironment()
        ServerActiveObject::removingFromEnvironment();
        if (m_player->getPlayerSAO() == this) {
                unlinkPlayerSessionAndSave();
-               for (UNORDERED_SET<u32>::iterator it = m_attached_particle_spawners.begin();
+               for (std::unordered_set<u32>::iterator it = m_attached_particle_spawners.begin();
                        it != m_attached_particle_spawners.end(); ++it) {
                        m_env->deleteParticleSpawner(*it, false);
                }
@@ -893,7 +893,7 @@ std::string PlayerSAO::getClientInitializationData(u16 protocol_version)
        msg_os << serializeLongString(gob_cmd_update_armor_groups(m_armor_groups)); // 2
        msg_os << serializeLongString(gob_cmd_update_animation(
                m_animation_range, m_animation_speed, m_animation_blend, m_animation_loop)); // 3
-       for (UNORDERED_MAP<std::string, core::vector2d<v3f> >::const_iterator
+       for (std::unordered_map<std::string, core::vector2d<v3f>>::const_iterator
                        ii = m_bone_position.begin(); ii != m_bone_position.end(); ++ii) {
                msg_os << serializeLongString(gob_cmd_update_bone_position((*ii).first,
                        (*ii).second.X, (*ii).second.Y)); // m_bone_position.size
@@ -906,7 +906,7 @@ std::string PlayerSAO::getClientInitializationData(u16 protocol_version)
        // (GENERIC_CMD_UPDATE_NAMETAG_ATTRIBUTES) : Deprecated, for backwards compatibility only.
        msg_os << serializeLongString(gob_cmd_update_nametag_attributes(m_prop.nametag_color)); // 6
        int message_count = 6 + m_bone_position.size();
-       for (UNORDERED_SET<int>::const_iterator ii = m_attachment_child_ids.begin();
+       for (std::unordered_set<int>::const_iterator ii = m_attachment_child_ids.begin();
                        ii != m_attachment_child_ids.end(); ++ii) {
                if (ServerActiveObject *obj = m_env->getActiveObject(*ii)) {
                        message_count++;
@@ -1083,7 +1083,7 @@ void PlayerSAO::step(float dtime, bool send_recommended)
 
        if (!m_bone_position_sent) {
                m_bone_position_sent = true;
-               for (UNORDERED_MAP<std::string, core::vector2d<v3f> >::const_iterator
+               for (std::unordered_map<std::string, core::vector2d<v3f>>::const_iterator
                                ii = m_bone_position.begin(); ii != m_bone_position.end(); ++ii) {
                        std::string str = gob_cmd_update_bone_position((*ii).first,
                                        (*ii).second.X, (*ii).second.Y);
index 0dad548057c284b097a4be4eb849e21e8445ffbe..bb1a61a1937cd1d7605fff7685d8f9d4d3606aa6 100644 (file)
@@ -52,7 +52,7 @@ public:
        void getAttachment(int *parent_id, std::string *bone, v3f *position, v3f *rotation);
        void addAttachmentChild(int child_id);
        void removeAttachmentChild(int child_id);
-       const UNORDERED_SET<int> &getAttachmentChildIds();
+       const std::unordered_set<int> &getAttachmentChildIds();
        ObjectProperties* accessObjectProperties();
        void notifyObjectPropertiesModified();
 protected:
@@ -72,11 +72,11 @@ protected:
        bool m_animation_sent;
 
        // Stores position and rotation for each bone name
-       UNORDERED_MAP<std::string, core::vector2d<v3f> > m_bone_position;
+       std::unordered_map<std::string, core::vector2d<v3f>> m_bone_position;
        bool m_bone_position_sent;
 
        int m_attachment_parent_id;
-       UNORDERED_SET<int> m_attachment_child_ids;
+       std::unordered_set<int> m_attachment_child_ids;
        std::string m_attachment_bone;
        v3f m_attachment_position;
        v3f m_attachment_rotation;
@@ -188,7 +188,7 @@ public:
        }
 };
 
-typedef UNORDERED_MAP<std::string, std::string> PlayerAttributes;
+typedef std::unordered_map<std::string, std::string> PlayerAttributes;
 class RemotePlayer;
 
 class PlayerSAO : public UnitSAO
index d24971e44a099490dfaeca4938d7c618e0c3343d..053f4dd454d3d9b16a4dbce80981cf3a14e480f4 100644 (file)
@@ -375,7 +375,7 @@ bool EmergeManager::pushBlockEmergeData(
 bool EmergeManager::popBlockEmergeData(v3s16 pos, BlockEmergeData *bedata)
 {
        std::map<v3s16, BlockEmergeData>::iterator it;
-       UNORDERED_MAP<u16, u16>::iterator it2;
+       std::unordered_map<u16, u16>::iterator it2;
 
        it = m_blocks_enqueued.find(pos);
        if (it == m_blocks_enqueued.end())
index 76653e6cdf84d5da2e2db71a5b6c6bf8d1943b95..55be370d21dd542b47ea4c6cf5e6fa1c66932ff5 100644 (file)
@@ -157,7 +157,7 @@ private:
 
        Mutex m_queue_mutex;
        std::map<v3s16, BlockEmergeData> m_blocks_enqueued;
-       UNORDERED_MAP<u16, u16> m_peer_queue_count;
+       std::unordered_map<u16, u16> m_peer_queue_count;
 
        u16 m_qlimit_total;
        u16 m_qlimit_diskonly;
index f57e75da9ac390add186549ba915a7d18814b1ba..d2883a1b33d001f9a91299283625e18fba3fada0 100644 (file)
@@ -21,14 +21,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "threading/mutex_auto_lock.h"
 
 
-UNORDERED_MAP<u16, std::vector<v3s16> > FacePositionCache::cache;
+std::unordered_map<u16, std::vector<v3s16>> FacePositionCache::cache;
 Mutex FacePositionCache::cache_mutex;
 
 // Calculate the borders of a "d-radius" cube
 const std::vector<v3s16> &FacePositionCache::getFacePositions(u16 d)
 {
        MutexAutoLock lock(cache_mutex);
-       UNORDERED_MAP<u16, std::vector<v3s16> >::iterator it = cache.find(d);
+       std::unordered_map<u16, std::vector<v3s16>>::const_iterator it = cache.find(d);
        if (it != cache.end())
                return it->second;
 
index c1d2841c44e485a8d1cd5e6371032f9865826ebd..5ea0d938b2e1c778cc0cc312942e830d825f83d5 100644 (file)
@@ -22,10 +22,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include "irr_v3d.h"
 #include "threading/mutex.h"
-#include "util/cpp11_container.h"
 
 #include <map>
 #include <vector>
+#include <unordered_map>
 
 /*
  * This class permits caching getFacePosition call results.
@@ -37,7 +37,7 @@ public:
 
 private:
        static const std::vector<v3s16> &generateFacePosition(u16 d);
-       static UNORDERED_MAP<u16, std::vector<v3s16> > cache;
+       static std::unordered_map<u16, std::vector<v3s16>> cache;
        static Mutex cache_mutex;
 };
 
index 19fd9f1f0e59abc526f0416aa73ae153778d7fb0..888536128a8edfb25a80a2c8af610c0566e098a1 100644 (file)
@@ -3807,7 +3807,7 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
                                        if (s.ftype == f_Unknown &&
                                                        s.fid == event.GUIEvent.Caller->getID()) {
                                                current_field_enter_pending = s.fname;
-                                               UNORDERED_MAP<std::string, bool>::const_iterator it =
+                                               std::unordered_map<std::string, bool>::const_iterator it =
                                                        field_close_on_enter.find(s.fname);
                                                if (it != field_close_on_enter.end())
                                                        close_on_enter = (*it).second;
index 9eaf60ac6353794563390a08408e46527367054c..bf0b4f356b81907d24b41b65b43d221f151e4ced 100644 (file)
@@ -397,7 +397,7 @@ protected:
        std::vector<ImageDrawSpec> m_images;
        std::vector<ImageDrawSpec> m_itemimages;
        std::vector<BoxDrawSpec> m_boxes;
-       UNORDERED_MAP<std::string, bool> field_close_on_enter;
+       std::unordered_map<std::string, bool> field_close_on_enter;
        std::vector<FieldSpec> m_fields;
        std::vector<StaticTextSpec> m_static_texts;
        std::vector<std::pair<FieldSpec,GUITable*> > m_tables;
@@ -460,7 +460,7 @@ private:
                GUITable::TableOptions table_options;
                GUITable::TableColumns table_columns;
                // used to restore table selection/scroll/treeview state
-               UNORDERED_MAP<std::string, GUITable::DynamicData> table_dyndata;
+               std::unordered_map<std::string, GUITable::DynamicData> table_dyndata;
        } parserData;
 
        typedef struct {
index 2206857fd48b652c466246418b820ec0f59bce28..e9d050cd11000eb67e56623a2903c29d6feb89b8 100644 (file)
@@ -21,9 +21,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define ITEMGROUP_HEADER
 
 #include <string>
-#include "util/cpp11_container.h"
+#include <unordered_map>
 
-typedef UNORDERED_MAP<std::string, int> ItemGroupList;
+typedef std::unordered_map<std::string, int> ItemGroupList;
 
 static inline int itemgroup_get(const ItemGroupList &groups, const std::string &name)
 {
index 4b6e08f9600c45e9f4a86c5f0be1db2c9ac0d6ba..0be0e96a37c63ba7e18f958e49962a8a5f3c778d 100644 (file)
--- a/src/map.h
+++ b/src/map.h
@@ -32,7 +32,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "voxel.h"
 #include "modifiedstate.h"
 #include "util/container.h"
-#include "util/cpp11_container.h"
 #include "nodetimer.h"
 #include "map_settings_manager.h"
 
index 93d932a7ba5dd7d6d8dd2ce9bd54eade47b1294d..f56111620df7cca875b0901ad92295d61caf562f 100644 (file)
@@ -23,7 +23,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "irrlichttypes_extrabloated.h"
 #include "client/tile.h"
 #include "voxel.h"
-#include "util/cpp11_container.h"
 #include <map>
 
 class Client;
index 410689f5efe6c626c2e6ae67bee8daf5191923b9..ad7cb7b700bffce8738b894a2d1332d51b19371a 100644 (file)
@@ -42,7 +42,7 @@ void MapSector::deleteBlocks()
        m_block_cache = NULL;
 
        // Delete all
-       for (UNORDERED_MAP<s16, MapBlock*>::iterator i = m_blocks.begin();
+       for (std::unordered_map<s16, MapBlock*>::iterator i = m_blocks.begin();
                        i != m_blocks.end(); ++i) {
                delete i->second;
        }
@@ -60,7 +60,7 @@ MapBlock * MapSector::getBlockBuffered(s16 y)
        }
 
        // If block doesn't exist, return NULL
-       UNORDERED_MAP<s16, MapBlock*>::iterator n = m_blocks.find(y);
+       std::unordered_map<s16, MapBlock*>::const_iterator n = m_blocks.find(y);
        block = (n != m_blocks.end() ? n->second : NULL);
 
        // Cache the last result
@@ -127,7 +127,7 @@ void MapSector::deleteBlock(MapBlock *block)
 
 void MapSector::getBlocks(MapBlockVect &dest)
 {
-       for (UNORDERED_MAP<s16, MapBlock*>::iterator bi = m_blocks.begin();
+       for (std::unordered_map<s16, MapBlock*>::iterator bi = m_blocks.begin();
                bi != m_blocks.end(); ++bi) {
                dest.push_back(bi->second);
        }
index c3bff3575932432ff693e5fe16c50913a88984aa..ddafbc77dfb015f6ced2879f9b76398bf2d5484c 100644 (file)
@@ -71,7 +71,7 @@ public:
 protected:
 
        // The pile of MapBlocks
-       UNORDERED_MAP<s16, MapBlock*> m_blocks;
+       std::unordered_map<s16, MapBlock*> m_blocks;
 
        Map *m_parent;
        // Position on parent (in MapBlock widths)
index b0566e83072aeefe6737935e74a60acfa7b2f9d7..1a469cd9ca24fa026dd289ac5fc630878d7a2c7f 100644 (file)
@@ -208,14 +208,11 @@ size_t Decoration::placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax)
 #endif
                        }
 
-                       if (mg->biomemap) {
-                               UNORDERED_SET<u8>::iterator iter;
-
-                               if (!biomes.empty()) {
-                                       iter = biomes.find(mg->biomemap[mapindex]);
-                                       if (iter == biomes.end())
-                                               continue;
-                               }
+                       if (mg->biomemap && !biomes.empty()) {
+                               std::unordered_set<u8>::const_iterator iter =
+                                       biomes.find(mg->biomemap[mapindex]);
+                               if (iter == biomes.end())
+                                       continue;
                        }
 
                        v3s16 pos(x, y, z);
index 950800ec8e458474bf02f685107ab77e6ad57fdc..6a48796d808854e93abc33920cc2b36219205b01 100644 (file)
@@ -21,7 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #ifndef MG_DECORATION_HEADER
 #define MG_DECORATION_HEADER
 
-#include "util/cpp11_container.h"
+#include <unordered_set>
 #include "objdef.h"
 #include "noise.h"
 #include "nodedef.h"
@@ -87,9 +87,7 @@ public:
        std::vector<content_t> c_spawnby;
        s16 nspawnby;
 
-       UNORDERED_SET<u8> biomes;
-       //std::list<CutoffData> cutoffs;
-       //Mutex cutoff_mutex;
+       std::unordered_set<u8> biomes;
 };
 
 class DecoSimple : public Decoration {
index 89319238e34c754395bc8248d0b22232c2616b55..6275de313490a774ae5fa01bb49cc01d1efd2a31 100644 (file)
@@ -150,7 +150,7 @@ void OreScatter::generate(MMVManip *vm, int mapseed, u32 blockseed,
 
                if (biomemap && !biomes.empty()) {
                        u32 index = sizex * (z0 - nmin.Z) + (x0 - nmin.X);
-                       UNORDERED_SET<u8>::iterator it = biomes.find(biomemap[index]);
+                       std::unordered_set<u8>::const_iterator it = biomes.find(biomemap[index]);
                        if (it == biomes.end())
                                continue;
                }
@@ -204,7 +204,7 @@ void OreSheet::generate(MMVManip *vm, int mapseed, u32 blockseed,
                        continue;
 
                if (biomemap && !biomes.empty()) {
-                       UNORDERED_SET<u8>::iterator it = biomes.find(biomemap[index]);
+                       std::unordered_set<u8>::const_iterator it = biomes.find(biomemap[index]);
                        if (it == biomes.end())
                                continue;
                }
@@ -272,7 +272,7 @@ void OrePuff::generate(MMVManip *vm, int mapseed, u32 blockseed,
                        continue;
 
                if (biomemap && !biomes.empty()) {
-                       UNORDERED_SET<u8>::iterator it = biomes.find(biomemap[index]);
+                       std::unordered_set<u8>::const_iterator it = biomes.find(biomemap[index]);
                        if (it == biomes.end())
                                continue;
                }
@@ -340,7 +340,7 @@ void OreBlob::generate(MMVManip *vm, int mapseed, u32 blockseed,
 
                if (biomemap && !biomes.empty()) {
                        u32 bmapidx = sizex * (z0 - nmin.Z) + (x0 - nmin.X);
-                       UNORDERED_SET<u8>::iterator it = biomes.find(biomemap[bmapidx]);
+                       std::unordered_set<u8>::const_iterator it = biomes.find(biomemap[bmapidx]);
                        if (it == biomes.end())
                                continue;
                }
@@ -424,7 +424,7 @@ void OreVein::generate(MMVManip *vm, int mapseed, u32 blockseed,
 
                if (biomemap && !biomes.empty()) {
                        u32 bmapidx = sizex * (z - nmin.Z) + (x - nmin.X);
-                       UNORDERED_SET<u8>::iterator it = biomes.find(biomemap[bmapidx]);
+                       std::unordered_set<u8>::const_iterator it = biomes.find(biomemap[bmapidx]);
                        if (it == biomes.end())
                                continue;
                }
index 0503a6ca07165cc416cc31a55b382d313f241bb5..77025e1bb9f8e403611ffe93ac1b22d128bd1366 100644 (file)
@@ -21,7 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #ifndef MG_ORE_HEADER
 #define MG_ORE_HEADER
 
-#include "util/cpp11_container.h"
+#include <unordered_set>
 #include "objdef.h"
 #include "noise.h"
 #include "nodedef.h"
@@ -66,7 +66,7 @@ public:
        float nthresh;      // threshold for noise at which an ore is placed
        NoiseParams np;     // noise for distribution of clusters (NULL for uniform scattering)
        Noise *noise;
-       UNORDERED_SET<u8> biomes;
+       std::unordered_set<u8> biomes;
 
        Ore();
        virtual ~Ore();
index 67931497f34a7e565c3aa5540e89cf037f184c62..3cea3c321e66d26e08ee4f261922f14ebda6335c 100644 (file)
@@ -561,14 +561,14 @@ void Schematic::applyProbabilities(v3s16 p0,
 void generate_nodelist_and_update_ids(MapNode *nodes, size_t nodecount,
        std::vector<std::string> *usednodes, INodeDefManager *ndef)
 {
-       UNORDERED_MAP<content_t, content_t> nodeidmap;
+       std::unordered_map<content_t, content_t> nodeidmap;
        content_t numids = 0;
 
        for (size_t i = 0; i != nodecount; i++) {
                content_t id;
                content_t c = nodes[i].getContent();
 
-               UNORDERED_MAP<content_t, content_t>::const_iterator it = nodeidmap.find(c);
+               std::unordered_map<content_t, content_t>::const_iterator it = nodeidmap.find(c);
                if (it == nodeidmap.end()) {
                        id = numids;
                        numids++;
index 0e583b2db59ca71b2e3837bec627af933da8d092..5a71ca2d461742584eb80b679d38cc702c3fd67e 100644 (file)
@@ -144,7 +144,8 @@ void ModConfiguration::printUnsatisfiedModsError() const
                it != m_unsatisfied_mods.end(); ++it) {
                ModSpec mod = *it;
                errorstream << "mod \"" << mod.name << "\" has unsatisfied dependencies: ";
-               for (UNORDERED_SET<std::string>::iterator dep_it = mod.unsatisfied_depends.begin();
+               for (std::unordered_set<std::string>::iterator dep_it =
+                       mod.unsatisfied_depends.begin();
                        dep_it != mod.unsatisfied_depends.end(); ++dep_it)
                        errorstream << " \"" << *dep_it << "\"";
                errorstream << std::endl;
@@ -268,8 +269,8 @@ void ModConfiguration::checkConflictsAndDeps()
        // report on name conflicts
        if (!m_name_conflicts.empty()) {
                std::string s = "Unresolved name conflicts for mods ";
-               for (UNORDERED_SET<std::string>::const_iterator it = m_name_conflicts.begin();
-                       it != m_name_conflicts.end(); ++it) {
+               for (std::unordered_set<std::string>::const_iterator it =
+                       m_name_conflicts.begin(); it != m_name_conflicts.end(); ++it) {
                        if (it != m_name_conflicts.begin()) s += ", ";
                        s += std::string("\"") + (*it) + "\"";
                }
@@ -299,7 +300,7 @@ void ModConfiguration::resolveDependencies()
                ModSpec mod = *it;
                mod.unsatisfied_depends = mod.depends;
                // check which optional dependencies actually exist
-               for (UNORDERED_SET<std::string>::iterator it_optdep = mod.optdepends.begin();
+               for (std::unordered_set<std::string>::iterator it_optdep = mod.optdepends.begin();
                                it_optdep != mod.optdepends.end(); ++it_optdep) {
                        std::string optdep = *it_optdep;
                        if (modnames.count(optdep) != 0)
index 7455a51eaf3e433e127507fb24362049433eae78..792280b8b4faed58b2facd3a0057c0f1c787a0d4 100644 (file)
@@ -27,7 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <string>
 #include <map>
 #include <json/json.h>
-#include "util/cpp11_container.h"
+#include <unordered_set>
 #include "config.h"
 #include "metadata.h"
 
@@ -38,9 +38,9 @@ struct ModSpec
        std::string name;
        std::string path;
        //if normal mod:
-       UNORDERED_SET<std::string> depends;
-       UNORDERED_SET<std::string> optdepends;
-       UNORDERED_SET<std::string> unsatisfied_depends;
+       std::unordered_set<std::string> depends;
+       std::unordered_set<std::string> optdepends;
+       std::unordered_set<std::string> unsatisfied_depends;
 
        bool part_of_modpack;
        bool is_modpack;
@@ -125,7 +125,7 @@ private:
        // 1. game mod in modpack; 2. game mod;
        // 3. world mod in modpack; 4. world mod;
        // 5. addon mod in modpack; 6. addon mod.
-       UNORDERED_SET<std::string> m_name_conflicts;
+       std::unordered_set<std::string> m_name_conflicts;
 
        // Deleted default constructor
        ModConfiguration() {}
index d031f080848e42a4367dacca47ead4c59d8d73d8..78e4a0a56e2df4d1c212304a45d59bb3680b479d 100644 (file)
@@ -25,7 +25,7 @@ void NameIdMapping::serialize(std::ostream &os) const
 {
        writeU8(os, 0); // version
        writeU16(os, m_id_to_name.size());
-       for (UNORDERED_MAP<u16, std::string>::const_iterator i = m_id_to_name.begin();
+       for (IdToNameMap::const_iterator i = m_id_to_name.begin();
                        i != m_id_to_name.end(); ++i) {
                writeU16(os, i->first);
                os << serializeString(i->second);
index be353327db8533e1e3f7a0118a3857a28bad3b94..3898430619606d2c43edc7fb560afc377f2fafe2 100644 (file)
@@ -23,8 +23,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <string>
 #include <iostream>
 #include <set>
+#include <unordered_map>
 #include "irrlichttypes_bloated.h"
-#include "util/cpp11_container.h"
+
+typedef std::unordered_map<u16, std::string> IdToNameMap;
+typedef std::unordered_map<std::string, u16> NameToIdMap;
 
 class NameIdMapping
 {
@@ -43,6 +46,7 @@ public:
                m_id_to_name[id] = name;
                m_name_to_id[name] = id;
        }
+
        void removeId(u16 id)
        {
                std::string name;
@@ -63,7 +67,7 @@ public:
        }
        bool getName(u16 id, std::string &result) const
        {
-               UNORDERED_MAP<u16, std::string>::const_iterator i;
+               IdToNameMap::const_iterator i;
                i = m_id_to_name.find(id);
                if (i == m_id_to_name.end())
                        return false;
@@ -72,7 +76,7 @@ public:
        }
        bool getId(const std::string &name, u16 &result) const
        {
-               UNORDERED_MAP<std::string, u16>::const_iterator i;
+               NameToIdMap::const_iterator i;
                i = m_name_to_id.find(name);
                if (i == m_name_to_id.end())
                        return false;
@@ -82,8 +86,8 @@ public:
        u16 size() const { return m_id_to_name.size(); }
 
 private:
-       UNORDERED_MAP<u16, std::string> m_id_to_name;
-       UNORDERED_MAP<std::string, u16> m_name_to_id;
+       IdToNameMap m_id_to_name;
+       NameToIdMap m_name_to_id;
 };
 
 #endif
index 59669fe6d0b933c2eabe8d333a117bca7c8cf2da..d002ae10d8a50ee4d204dea2444ed7b2d741c5d1 100644 (file)
@@ -818,7 +818,7 @@ void Client::handleCommand_StopSound(NetworkPacket* pkt)
 
        *pkt >> server_id;
 
-       UNORDERED_MAP<s32, int>::iterator i = m_sounds_server_to_client.find(server_id);
+       std::unordered_map<s32, int>::iterator i = m_sounds_server_to_client.find(server_id);
        if (i != m_sounds_server_to_client.end()) {
                int client_id = i->second;
                m_sound->stopSound(client_id);
@@ -833,7 +833,7 @@ void Client::handleCommand_FadeSound(NetworkPacket *pkt)
 
        *pkt >> sound_id >> step >> gain;
 
-       UNORDERED_MAP<s32, int>::iterator i =
+       std::unordered_map<s32, int>::const_iterator i =
                        m_sounds_server_to_client.find(sound_id);
 
        if (i != m_sounds_server_to_client.end())
index 5b026bbdb03dffb3d27fcdaf60866efe8b07fe94..098c6e11ec78f18dd0176c2384548a53b4eaec24 100644 (file)
@@ -1695,7 +1695,8 @@ void Server::handleCommand_RemovedSounds(NetworkPacket* pkt)
 
                *pkt >> id;
 
-               UNORDERED_MAP<s32, ServerPlayingSound>::iterator i = m_playing_sounds.find(id);
+               std::unordered_map<s32, ServerPlayingSound>::iterator i =
+                       m_playing_sounds.find(id);
                if (i == m_playing_sounds.end())
                        continue;
 
index 98b34ea9e54be797bce308271d7b44de71776bcb..6b2718636cde7d143c9a56ad9f12946b9347c8bc 100644 (file)
@@ -912,12 +912,12 @@ private:
        // item aliases too. Updated by updateAliases()
        // Note: Not serialized.
 
-       UNORDERED_MAP<std::string, content_t> m_name_id_mapping_with_aliases;
+       std::unordered_map<std::string, content_t> m_name_id_mapping_with_aliases;
 
        // A mapping from groups to a list of content_ts (and their levels)
        // that belong to it.  Necessary for a direct lookup in getIds().
        // Note: Not serialized.
-       UNORDERED_MAP<std::string, GroupItems> m_group_to_items;
+       std::unordered_map<std::string, GroupItems> m_group_to_items;
 
        // Next possibly free id
        content_t m_next_id;
@@ -1050,7 +1050,7 @@ inline const ContentFeatures& CNodeDefManager::get(const MapNode &n) const
 
 bool CNodeDefManager::getId(const std::string &name, content_t &result) const
 {
-       UNORDERED_MAP<std::string, content_t>::const_iterator
+       std::unordered_map<std::string, content_t>::const_iterator
                i = m_name_id_mapping_with_aliases.find(name);
        if(i == m_name_id_mapping_with_aliases.end())
                return false;
@@ -1080,7 +1080,7 @@ bool CNodeDefManager::getIds(const std::string &name,
        }
        std::string group = name.substr(6);
 
-       UNORDERED_MAP<std::string, GroupItems>::const_iterator
+       std::unordered_map<std::string, GroupItems>::const_iterator
                i = m_group_to_items.find(group);
        if (i == m_group_to_items.end())
                return true;
@@ -1282,7 +1282,7 @@ content_t CNodeDefManager::set(const std::string &name, const ContentFeatures &d
                i != def.groups.end(); ++i) {
                std::string group_name = i->first;
 
-               UNORDERED_MAP<std::string, GroupItems>::iterator
+               std::unordered_map<std::string, GroupItems>::iterator
                        j = m_group_to_items.find(group_name);
                if (j == m_group_to_items.end()) {
                        m_group_to_items[group_name].push_back(
@@ -1318,7 +1318,7 @@ void CNodeDefManager::removeNode(const std::string &name)
        }
 
        // Erase node content from all groups it belongs to
-       for (UNORDERED_MAP<std::string, GroupItems>::iterator iter_groups =
+       for (std::unordered_map<std::string, GroupItems>::iterator iter_groups =
                        m_group_to_items.begin(); iter_groups != m_group_to_items.end();) {
                GroupItems &items = iter_groups->second;
                for (GroupItems::iterator iter_groupitems = items.begin();
index 0d72485bcc8a0cca0399e987287596215440b29f..4b4cb17c7084214d00df9199b65124c318fbf230 100644 (file)
@@ -20,8 +20,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #ifndef NODEMETADATA_HEADER
 #define NODEMETADATA_HEADER
 
+#include <unordered_set>
 #include "metadata.h"
-#include "util/cpp11_container.h"
 
 /*
        NodeMetadata stores arbitary amounts of data for special blocks.
@@ -63,7 +63,7 @@ private:
        int countNonPrivate() const;
 
        Inventory *m_inventory;
-       UNORDERED_SET<std::string> m_privatevars;
+       std::unordered_set<std::string> m_privatevars;
 };
 
 
index eec37102220bb2a5da280361379dcc6b39bc8cd8..439b752653ceca10936b1e613a2d4f7212722007 100644 (file)
@@ -22,7 +22,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "mapblock.h"
 #include "nodedef.h"
 #include "util/timetaker.h"
-#include "util/cpp11.h"
 
 
 ReflowScan::ReflowScan(Map *map, INodeDefManager *ndef) :
index c0e29abf0ae3b08a9a9411a70c4fb20a4ffd9188..9be9d77178a2ce924b4021c393b3a7f4423ba401 100644 (file)
@@ -132,7 +132,7 @@ void push_item_definition(lua_State *L, const ItemDefinition &i)
 void push_item_definition_full(lua_State *L, const ItemDefinition &i)
 {
        std::string type(es_ItemType[(int)i.type].str);
-       
+
        lua_newtable(L);
        lua_pushstring(L, i.name.c_str());
        lua_setfield(L, -2, "name");
@@ -721,9 +721,9 @@ void push_content_features(lua_State *L, const ContentFeatures &c)
        std::string paramtype2(ScriptApiNode::es_ContentParamType2[(int)c.param_type_2].str);
        std::string drawtype(ScriptApiNode::es_DrawType[(int)c.drawtype].str);
        std::string liquid_type(ScriptApiNode::es_LiquidType[(int)c.liquid_type].str);
-       
+
        /* Missing "tiles" because I don't see a usecase (at least not yet). */
-       
+
        lua_newtable(L);
        lua_pushboolean(L, c.has_on_construct);
        lua_setfield(L, -2, "has_on_construct");
@@ -756,10 +756,10 @@ void push_content_features(lua_State *L, const ContentFeatures &c)
        if (!c.palette_name.empty()) {
                push_ARGB8(L, c.color);
                lua_setfield(L, -2, "color");
-               
+
                lua_pushstring(L, c.palette_name.c_str());
                lua_setfield(L, -2, "palette_name");
-               
+
                push_palette(L, c.palette);
                lua_setfield(L, -2, "palette");
        }
@@ -767,7 +767,7 @@ void push_content_features(lua_State *L, const ContentFeatures &c)
        lua_setfield(L, -2, "waving");
        lua_pushnumber(L, c.connect_sides);
        lua_setfield(L, -2, "connect_sides");
-       
+
        lua_newtable(L);
        u16 i = 1;
        for (std::vector<std::string>::const_iterator it = c.connects_to.begin();
@@ -776,7 +776,7 @@ void push_content_features(lua_State *L, const ContentFeatures &c)
                lua_rawseti(L, -2, i);
        }
        lua_setfield(L, -2, "connects_to");
-       
+
        push_ARGB8(L, c.post_effect_color);
        lua_setfield(L, -2, "post_effect_color");
        lua_pushnumber(L, c.leveled);
@@ -1171,7 +1171,7 @@ void push_tool_capabilities(lua_State *L,
                        const ToolGroupCap &groupcap = i->second;
                        // Create subtable "times"
                        lua_newtable(L);
-                       for (UNORDERED_MAP<int, float>::const_iterator
+                       for (std::unordered_map<int, float>::const_iterator
                                        i = groupcap.times.begin(); i != groupcap.times.end(); ++i) {
                                lua_pushinteger(L, i->first);
                                lua_pushnumber(L, i->second);
index b0f61a8cad554e166be934ce0faa58d4d960d067..f7d9294d6441ce723d65a5a78acb9f80061ab095 100644 (file)
@@ -28,7 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define C_CONVERTER_H_
 
 #include <vector>
-#include "util/cpp11_container.h"
+#include <unordered_map>
 
 #include "irrlichttypes_bloated.h"
 #include "common/c_types.h"
@@ -60,7 +60,7 @@ bool               getintfield(lua_State *L, int table,
 bool               getintfield(lua_State *L, int table,
                              const char *fieldname, u32 &result);
 void               read_groups(lua_State *L, int index,
-                             UNORDERED_MAP<std::string, int> &result);
+                             std::unordered_map<std::string, int> &result);
 bool               getboolfield(lua_State *L, int table,
                              const char *fieldname, bool &result);
 bool               getfloatfield(lua_State *L, int table,
index 32eb7af8480ec3cf7a6c4bbbd4a80d38ebd6377c..454e8f7194130d2d33a6ebe7f16fe5b1406ab797 100644 (file)
@@ -100,7 +100,7 @@ Biome *get_or_load_biome(lua_State *L, int index,
        BiomeManager *biomemgr);
 Biome *read_biome_def(lua_State *L, int index, INodeDefManager *ndef);
 size_t get_biome_list(lua_State *L, int index,
-       BiomeManager *biomemgr, UNORDERED_SET<u8> *biome_id_list);
+       BiomeManager *biomemgr, std::unordered_set<u8> *biome_id_list);
 
 Schematic *get_or_load_schematic(lua_State *L, int index,
        SchematicManager *schemmgr, StringMap *replace_names);
@@ -244,7 +244,7 @@ bool read_schematic_def(lua_State *L, int index,
        schem->schemdata = new MapNode[numnodes];
 
        size_t names_base = names->size();
-       UNORDERED_MAP<std::string, content_t> name_id_map;
+       std::unordered_map<std::string, content_t> name_id_map;
 
        u32 i = 0;
        for (lua_pushnil(L); lua_next(L, -2); i++, lua_pop(L, 1)) {
@@ -266,7 +266,7 @@ bool read_schematic_def(lua_State *L, int index,
                u8 param2 = getintfield_default(L, -1, "param2", 0);
 
                //// Find or add new nodename-to-ID mapping
-               UNORDERED_MAP<std::string, content_t>::iterator it = name_id_map.find(name);
+               std::unordered_map<std::string, content_t>::iterator it = name_id_map.find(name);
                content_t name_index;
                if (it != name_id_map.end()) {
                        name_index = it->second;
@@ -409,7 +409,7 @@ Biome *read_biome_def(lua_State *L, int index, INodeDefManager *ndef)
 
 
 size_t get_biome_list(lua_State *L, int index,
-       BiomeManager *biomemgr, UNORDERED_SET<u8> *biome_id_list)
+       BiomeManager *biomemgr, std::unordered_set<u8> *biome_id_list)
 {
        if (index < 0)
                index = lua_gettop(L) + 1 + index;
index aaab0d98eca1bc11bfd8ee5f9b2def0805051eaf..d37c525dd0663b68915983a1c85b086066da9827 100644 (file)
@@ -137,8 +137,8 @@ int ObjectRef::l_remove(lua_State *L)
        if (co->getType() == ACTIVEOBJECT_TYPE_PLAYER)
                return 0;
 
-       const UNORDERED_SET<int> &child_ids = co->getAttachmentChildIds();
-       UNORDERED_SET<int>::const_iterator it;
+       const std::unordered_set<int> &child_ids = co->getAttachmentChildIds();
+       std::unordered_set<int>::const_iterator it;
        for (it = child_ids.begin(); it != child_ids.end(); ++it) {
                // Child can be NULL if it was deleted earlier
                if (ServerActiveObject *child = env->getActiveObject(*it))
index c4a988e0758fc3c07cc438c13683d208d0a5e2a7..3cf19f02400d66bf84f579898507e1e4f12640ce 100644 (file)
@@ -174,7 +174,7 @@ int ModApiUtil::l_get_dig_params(lua_State *L)
 int ModApiUtil::l_get_hit_params(lua_State *L)
 {
        NO_MAP_LOCK_REQUIRED;
-       UNORDERED_MAP<std::string, int> groups;
+       std::unordered_map<std::string, int> groups;
        read_groups(L, 1, groups);
        ToolCapabilities tp = read_tool_capabilities(L, 2);
        if(lua_isnoneornil(L, 3))
index 1e8e6a5d2a78ec3c828e8579cc990830ff6a8cda..b2fdecfa94d509d41e4f07cc558cf7e3e97b3c99 100644 (file)
@@ -634,7 +634,7 @@ void Server::AsyncRunStep(bool initial_step)
                MutexAutoLock envlock(m_env_mutex);
 
                m_clients.lock();
-               UNORDERED_MAP<u16, RemoteClient*> clients = m_clients.getClientList();
+               RemoteClientMap clients = m_clients.getClientList();
                ScopeProfiler sp(g_profiler, "Server: checking added and deleted objs");
 
                // Radius inside which objects are active
@@ -650,7 +650,7 @@ void Server::AsyncRunStep(bool initial_step)
                if (player_radius == 0 && is_transfer_limited)
                        player_radius = radius;
 
-               for (UNORDERED_MAP<u16, RemoteClient*>::iterator i = clients.begin();
+               for (RemoteClientMap::iterator i = clients.begin();
                        i != clients.end(); ++i) {
                        RemoteClient *client = i->second;
 
@@ -761,7 +761,7 @@ void Server::AsyncRunStep(bool initial_step)
                if (m_mod_storage_save_timer <= 0.0f) {
                        infostream << "Saving registered mod storages." << std::endl;
                        m_mod_storage_save_timer = g_settings->getFloat("server_map_save_interval");
-                       for (UNORDERED_MAP<std::string, ModMetadata *>::const_iterator
+                       for (std::unordered_map<std::string, ModMetadata *>::const_iterator
                                it = m_mod_storages.begin(); it != m_mod_storages.end(); ++it) {
                                if (it->second->isModified()) {
                                        it->second->save(getModStoragePath());
@@ -779,7 +779,7 @@ void Server::AsyncRunStep(bool initial_step)
 
                // Key = object id
                // Value = data sent by object
-               UNORDERED_MAP<u16, std::vector<ActiveObjectMessage>* > buffered_messages;
+               std::unordered_map<u16, std::vector<ActiveObjectMessage>*> buffered_messages;
 
                // Get active object messages from environment
                for(;;) {
@@ -788,7 +788,7 @@ void Server::AsyncRunStep(bool initial_step)
                                break;
 
                        std::vector<ActiveObjectMessage>* message_list = NULL;
-                       UNORDERED_MAP<u16, std::vector<ActiveObjectMessage>* >::iterator n;
+                       std::unordered_map<u16, std::vector<ActiveObjectMessage>* >::iterator n;
                        n = buffered_messages.find(aom.id);
                        if (n == buffered_messages.end()) {
                                message_list = new std::vector<ActiveObjectMessage>;
@@ -801,15 +801,15 @@ void Server::AsyncRunStep(bool initial_step)
                }
 
                m_clients.lock();
-               UNORDERED_MAP<u16, RemoteClient*> clients = m_clients.getClientList();
+               RemoteClientMap clients = m_clients.getClientList();
                // Route data to every client
-               for (UNORDERED_MAP<u16, RemoteClient*>::iterator i = clients.begin();
-                       i != clients.end(); ++i) {
+               for (std::unordered_map<u16, RemoteClient*>::iterator i = clients.begin();
+                               i != clients.end(); ++i) {
                        RemoteClient *client = i->second;
                        std::string reliable_data;
                        std::string unreliable_data;
                        // Go through all objects in message buffer
-                       for (UNORDERED_MAP<u16, std::vector<ActiveObjectMessage>* >::iterator
+                       for (std::unordered_map<u16, std::vector<ActiveObjectMessage>* >::iterator
                                        j = buffered_messages.begin();
                                        j != buffered_messages.end(); ++j) {
                                // If object is not known by client, skip it
@@ -853,7 +853,7 @@ void Server::AsyncRunStep(bool initial_step)
                m_clients.unlock();
 
                // Clear buffered_messages
-               for (UNORDERED_MAP<u16, std::vector<ActiveObjectMessage>* >::iterator
+               for (std::unordered_map<u16, std::vector<ActiveObjectMessage>* >::iterator
                                i = buffered_messages.begin();
                                i != buffered_messages.end(); ++i) {
                        delete i->second;
@@ -2112,7 +2112,8 @@ s32 Server::playSound(const SimpleSoundSpec &spec,
 void Server::stopSound(s32 handle)
 {
        // Get sound reference
-       UNORDERED_MAP<s32, ServerPlayingSound>::iterator i = m_playing_sounds.find(handle);
+       std::unordered_map<s32, ServerPlayingSound>::iterator i =
+               m_playing_sounds.find(handle);
        if (i == m_playing_sounds.end())
                return;
        ServerPlayingSound &psound = i->second;
@@ -2120,10 +2121,10 @@ void Server::stopSound(s32 handle)
        NetworkPacket pkt(TOCLIENT_STOP_SOUND, 4);
        pkt << handle;
 
-       for (UNORDERED_SET<u16>::iterator i = psound.clients.begin();
-                       i != psound.clients.end(); ++i) {
+       for (std::unordered_set<u16>::const_iterator si = psound.clients.begin();
+                       si != psound.clients.end(); ++si) {
                // Send as reliable
-               m_clients.send(*i, 0, &pkt, true);
+               m_clients.send(*si, 0, &pkt, true);
        }
        // Remove sound reference
        m_playing_sounds.erase(i);
@@ -2132,8 +2133,8 @@ void Server::stopSound(s32 handle)
 void Server::fadeSound(s32 handle, float step, float gain)
 {
        // Get sound reference
-       UNORDERED_MAP<s32, ServerPlayingSound>::iterator i =
-                       m_playing_sounds.find(handle);
+       std::unordered_map<s32, ServerPlayingSound>::iterator i =
+               m_playing_sounds.find(handle);
        if (i == m_playing_sounds.end())
                return;
 
@@ -2151,7 +2152,7 @@ void Server::fadeSound(s32 handle, float step, float gain)
        NetworkPacket compat_pkt(TOCLIENT_STOP_SOUND, 4);
        compat_pkt << handle;
 
-       for (UNORDERED_SET<u16>::iterator it = psound.clients.begin();
+       for (std::unordered_set<u16>::iterator it = psound.clients.begin();
                        it != psound.clients.end();) {
                if (m_clients.getProtocolVersion(*it) >= 32) {
                        // Send as reliable
@@ -2460,7 +2461,7 @@ void Server::sendMediaAnnouncement(u16 peer_id)
        NetworkPacket pkt(TOCLIENT_ANNOUNCE_MEDIA, 0, peer_id);
        pkt << (u16) m_media.size();
 
-       for (UNORDERED_MAP<std::string, MediaInfo>::iterator i = m_media.begin();
+       for (std::unordered_map<std::string, MediaInfo>::iterator i = m_media.begin();
                        i != m_media.end(); ++i) {
                pkt << i->first << i->second.sha1_digest;
        }
@@ -2769,7 +2770,7 @@ void Server::DeleteClient(u16 peer_id, ClientDeletionReason reason)
                /*
                        Clear references to playing sounds
                */
-               for (UNORDERED_MAP<s32, ServerPlayingSound>::iterator
+               for (std::unordered_map<s32, ServerPlayingSound>::iterator
                                 i = m_playing_sounds.begin(); i != m_playing_sounds.end();) {
                        ServerPlayingSound &psound = i->second;
                        psound.clients.erase(peer_id);
@@ -3560,7 +3561,7 @@ void Server::requestShutdown(const std::string &msg, bool reconnect, float delay
        if (delay == 0.0f) {
        // No delay, shutdown immediately
                m_shutdown_requested = true;
-               // only print to the infostream, a chat message saying 
+               // only print to the infostream, a chat message saying
                // "Server Shutting Down" is sent when the server destructs.
                infostream << "*** Immediate Server shutdown requested." << std::endl;
        } else if (delay < 0.0f && m_shutdown_timer > 0.0f) {
@@ -3645,7 +3646,7 @@ bool Server::registerModStorage(ModMetadata *storage)
 
 void Server::unregisterModStorage(const std::string &name)
 {
-       UNORDERED_MAP<std::string, ModMetadata *>::const_iterator it = m_mod_storages.find(name);
+       std::unordered_map<std::string, ModMetadata *>::const_iterator it = m_mod_storages.find(name);
        if (it != m_mod_storages.end()) {
                // Save unconditionaly on unregistration
                it->second->save(getModStoragePath());
index 2e735e77c62abeded92d77f5f6f30a4fe3618a0c..935be5f957104531c02f9cb1e3c822ee34397e18 100644 (file)
@@ -135,7 +135,7 @@ struct ServerPlayingSound
 {
        ServerSoundParams params;
        SimpleSoundSpec spec;
-       UNORDERED_SET<u16> clients; // peer ids
+       std::unordered_set<u16> clients; // peer ids
 };
 
 class Server : public con::PeerHandler, public MapEventReceiver,
@@ -653,12 +653,12 @@ private:
        u16 m_ignore_map_edit_events_peer_id;
 
        // media files known to server
-       UNORDERED_MAP<std::string, MediaInfo> m_media;
+       std::unordered_map<std::string, MediaInfo> m_media;
 
        /*
                Sounds
        */
-       UNORDERED_MAP<s32, ServerPlayingSound> m_playing_sounds;
+       std::unordered_map<s32, ServerPlayingSound> m_playing_sounds;
        s32 m_next_sound_id;
 
        /*
@@ -669,7 +669,7 @@ private:
        // value = "" (visible to all players) or player name
        std::map<std::string, std::string> m_detached_inventories_player;
 
-       UNORDERED_MAP<std::string, ModMetadata *> m_mod_storages;
+       std::unordered_map<std::string, ModMetadata *> m_mod_storages;
        float m_mod_storage_save_timer;
 
        DISABLE_CLASS_COPY(Server);
index cbdc747d1f9e8cd375a59bbcf79d425a65c7dcea..f013a3cc7b58b6e048fa515926dae9630271bb1a 100644 (file)
@@ -999,9 +999,10 @@ bool ServerEnvironment::swapNode(v3s16 p, const MapNode &n)
        return true;
 }
 
-void ServerEnvironment::getObjectsInsideRadius(std::vector<u16> &objects, v3f pos, float radius)
+void ServerEnvironment::getObjectsInsideRadius(std::vector<u16> &objects, v3f pos,
+       float radius)
 {
-       for (ActiveObjectMap::iterator i = m_active_objects.begin();
+       for (ServerActiveObjectMap::iterator i = m_active_objects.begin();
                i != m_active_objects.end(); ++i) {
                ServerActiveObject* obj = i->second;
                u16 id = i->first;
@@ -1017,7 +1018,7 @@ void ServerEnvironment::clearObjects(ClearObjectsMode mode)
        infostream << "ServerEnvironment::clearObjects(): "
                << "Removing all active objects" << std::endl;
        std::vector<u16> objects_to_remove;
-       for (ActiveObjectMap::iterator i = m_active_objects.begin();
+       for (ServerActiveObjectMap::iterator i = m_active_objects.begin();
                i != m_active_objects.end(); ++i) {
                ServerActiveObject* obj = i->second;
                if (obj->getType() == ACTIVEOBJECT_TYPE_PLAYER)
@@ -1395,7 +1396,7 @@ void ServerEnvironment::step(float dtime)
                        send_recommended = true;
                }
 
-               for(ActiveObjectMap::iterator i = m_active_objects.begin();
+               for (ServerActiveObjectMap::iterator i = m_active_objects.begin();
                        i != m_active_objects.end(); ++i) {
                        ServerActiveObject* obj = i->second;
                        // Don't step if is to be removed or stored statically
@@ -1429,7 +1430,7 @@ void ServerEnvironment::step(float dtime)
                Manage particle spawner expiration
        */
        if (m_particle_management_interval.step(dtime, 1.0)) {
-               for (UNORDERED_MAP<u32, float>::iterator i = m_particle_spawners.begin();
+               for (std::unordered_map<u32, float>::iterator i = m_particle_spawners.begin();
                        i != m_particle_spawners.end(); ) {
                        //non expiring spawners
                        if (i->second == PARTICLE_SPAWNER_NO_EXPIRY) {
@@ -1454,7 +1455,7 @@ u32 ServerEnvironment::addParticleSpawner(float exptime)
        u32 id = 0;
        for (;;) { // look for unused particlespawner id
                id++;
-               UNORDERED_MAP<u32, float>::iterator f = m_particle_spawners.find(id);
+               std::unordered_map<u32, float>::iterator f = m_particle_spawners.find(id);
                if (f == m_particle_spawners.end()) {
                        m_particle_spawners[id] = time;
                        break;
@@ -1476,7 +1477,7 @@ u32 ServerEnvironment::addParticleSpawner(float exptime, u16 attached_id)
 void ServerEnvironment::deleteParticleSpawner(u32 id, bool remove_from_object)
 {
        m_particle_spawners.erase(id);
-       UNORDERED_MAP<u32, u16>::iterator it = m_particle_spawner_attachments.find(id);
+       std::unordered_map<u32, u16>::iterator it = m_particle_spawner_attachments.find(id);
        if (it != m_particle_spawner_attachments.end()) {
                u16 obj_id = (*it).second;
                ServerActiveObject *sao = getActiveObject(obj_id);
@@ -1489,11 +1490,11 @@ void ServerEnvironment::deleteParticleSpawner(u32 id, bool remove_from_object)
 
 ServerActiveObject* ServerEnvironment::getActiveObject(u16 id)
 {
-       ActiveObjectMap::iterator n = m_active_objects.find(id);
+       ServerActiveObjectMap::const_iterator n = m_active_objects.find(id);
        return (n != m_active_objects.end() ? n->second : NULL);
 }
 
-bool isFreeServerActiveObjectId(u16 id, ActiveObjectMap &objects)
+bool isFreeServerActiveObjectId(u16 id, ServerActiveObjectMap &objects)
 {
        if (id == 0)
                return false;
@@ -1501,7 +1502,7 @@ bool isFreeServerActiveObjectId(u16 id, ActiveObjectMap &objects)
        return objects.find(id) == objects.end();
 }
 
-u16 getFreeServerActiveObjectId(ActiveObjectMap &objects)
+u16 getFreeServerActiveObjectId(ServerActiveObjectMap &objects)
 {
        //try to reuse id's as late as possible
        static u16 last_used_id = 0;
@@ -1546,7 +1547,7 @@ void ServerEnvironment::getAddedActiveObjects(PlayerSAO *playersao, s16 radius,
                - discard objects that are found in current_objects.
                - add remaining objects to added_objects
        */
-       for (ActiveObjectMap::iterator i = m_active_objects.begin();
+       for (ServerActiveObjectMap::iterator i = m_active_objects.begin();
                i != m_active_objects.end(); ++i) {
                u16 id = i->first;
 
@@ -1642,7 +1643,7 @@ void ServerEnvironment::setStaticForActiveObjectsInBlock(
                so_it = block->m_static_objects.m_active.begin();
                so_it != block->m_static_objects.m_active.end(); ++so_it) {
                // Get the ServerActiveObject counterpart to this StaticObject
-               ActiveObjectMap::iterator ao_it = m_active_objects.find(so_it->first);
+               ServerActiveObjectMap::const_iterator ao_it = m_active_objects.find(so_it->first);
                if (ao_it == m_active_objects.end()) {
                        // If this ever happens, there must be some kind of nasty bug.
                        errorstream << "ServerEnvironment::setStaticForObjectsInBlock(): "
@@ -1761,7 +1762,7 @@ u16 ServerEnvironment::addActiveObjectRaw(ServerActiveObject *object,
 void ServerEnvironment::removeRemovedObjects()
 {
        std::vector<u16> objects_to_remove;
-       for(ActiveObjectMap::iterator i = m_active_objects.begin();
+       for(ServerActiveObjectMap::iterator i = m_active_objects.begin();
                i != m_active_objects.end(); ++i) {
                u16 id = i->first;
                ServerActiveObject* obj = i->second;
@@ -1979,7 +1980,7 @@ void ServerEnvironment::activateObjects(MapBlock *block, u32 dtime_s)
 void ServerEnvironment::deactivateFarObjects(bool _force_delete)
 {
        std::vector<u16> objects_to_remove;
-       for(ActiveObjectMap::iterator i = m_active_objects.begin();
+       for (ServerActiveObjectMap::iterator i = m_active_objects.begin();
                i != m_active_objects.end(); ++i) {
                // force_delete might be overriden per object
                bool force_delete = _force_delete;
index 7c370fd5495cedc725e6433d45b3a3ba7998a669..3b7bf8fb06e51bf87ba3cc1da109444632db36b7 100644 (file)
@@ -190,7 +190,7 @@ enum ClearObjectsMode {
        This is not thread-safe. Server uses an environment mutex.
 */
 
-typedef UNORDERED_MAP<u16, ServerActiveObject *> ActiveObjectMap;
+typedef std::unordered_map<u16, ServerActiveObject *> ServerActiveObjectMap;
 
 class ServerEnvironment : public Environment
 {
@@ -395,7 +395,7 @@ private:
        // World path
        const std::string m_path_world;
        // Active object list
-       ActiveObjectMap m_active_objects;
+       ServerActiveObjectMap m_active_objects;
        // Outgoing network message buffer for active objects
        std::queue<ActiveObjectMessage> m_active_object_messages;
        // Some timers
@@ -431,8 +431,8 @@ private:
 
        // Particles
        IntervalLimiter m_particle_management_interval;
-       UNORDERED_MAP<u32, float> m_particle_spawners;
-       UNORDERED_MAP<u32, u16> m_particle_spawner_attachments;
+       std::unordered_map<u32, float> m_particle_spawners;
+       std::unordered_map<u32, u16> m_particle_spawner_attachments;
 };
 
 #endif
index 38204980e439b57beda6722863a6d16d73166c97..3041910d1598b48d822604249c7314a57b519781 100644 (file)
@@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #ifndef SERVEROBJECT_HEADER
 #define SERVEROBJECT_HEADER
 
+#include <unordered_set>
 #include "irrlichttypes_bloated.h"
 #include "activeobject.h"
 #include "inventorymanager.h"
@@ -166,8 +167,8 @@ public:
        {}
        virtual void removeAttachmentChild(int child_id)
        {}
-       virtual const UNORDERED_SET<int> &getAttachmentChildIds()
-       { static const UNORDERED_SET<int> rv; return rv; }
+       virtual const std::unordered_set<int> &getAttachmentChildIds()
+       { static const std::unordered_set<int> rv; return rv; }
        virtual ObjectProperties* accessObjectProperties()
        { return NULL; }
        virtual void notifyObjectPropertiesModified()
@@ -251,7 +252,7 @@ protected:
 
        ServerEnvironment *m_env;
        v3f m_base_position;
-       UNORDERED_SET<u32> m_attached_particle_spawners;
+       std::unordered_set<u32> m_attached_particle_spawners;
 
 private:
        // Used for creating objects based on type
index 8c4f6e559e05cfedc9f0c21953d947a6b9f80c69..e570c1a84930d8256924cbc1d482048393587623 100644 (file)
@@ -24,7 +24,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "util/string.h"
 #include "threading/mutex.h"
 #include <string>
-#include "util/cpp11_container.h"
 #include <list>
 #include <set>
 
@@ -45,7 +44,7 @@ typedef std::vector<
        >
 > SettingsCallbackList;
 
-typedef UNORDERED_MAP<std::string, SettingsCallbackList> SettingsCallbackMap;
+typedef std::unordered_map<std::string, SettingsCallbackList> SettingsCallbackMap;
 
 enum ValueType {
        VALUETYPE_STRING,
@@ -95,7 +94,7 @@ struct SettingsEntry {
        bool is_group;
 };
 
-typedef UNORDERED_MAP<std::string, SettingsEntry> SettingEntries;
+typedef std::unordered_map<std::string, SettingsEntry> SettingEntries;
 
 class Settings {
 public:
index a425af8274374f34be56380171b5bab5c93ca7fd..d1a5279b309af0d30b2cef936ad1d791a83d1490 100644 (file)
@@ -43,7 +43,7 @@ with this program; ifnot, write to the Free Software Foundation, Inc.,
 #include "porting.h"
 #include <vector>
 #include <fstream>
-#include "util/cpp11_container.h"
+#include <unordered_map>
 
 #define BUFFER_SIZE 30000
 
@@ -271,8 +271,8 @@ private:
        ALCdevice *m_device;
        ALCcontext *m_context;
        int m_next_id;
-       UNORDERED_MAP<std::string, std::vector<SoundBuffer*> > m_buffers;
-       UNORDERED_MAP<int, PlayingSound*> m_sounds_playing;
+       std::unordered_map<std::string, std::vector<SoundBuffer*>> m_buffers;
+       std::unordered_map<int, PlayingSound*> m_sounds_playing;
        v3f m_listener_pos;
        struct FadeState {
                FadeState() {}
@@ -285,7 +285,7 @@ private:
                float target_gain;
        };
 
-       UNORDERED_MAP<int, FadeState> m_sounds_fading;
+       std::unordered_map<int, FadeState> m_sounds_fading;
        float m_fade_delay;
 public:
        bool m_is_initialized;
@@ -351,8 +351,8 @@ public:
                alcCloseDevice(m_device);
                m_device = NULL;
 
-               for (UNORDERED_MAP<std::string, std::vector<SoundBuffer*> >::iterator i = m_buffers.begin();
-                               i != m_buffers.end(); ++i) {
+               for (std::unordered_map<std::string, std::vector<SoundBuffer*>>::iterator i =
+                               m_buffers.begin(); i != m_buffers.end(); ++i) {
                        for (std::vector<SoundBuffer*>::iterator iter = (*i).second.begin();
                                        iter != (*i).second.end(); ++iter) {
                                delete *iter;
@@ -370,7 +370,7 @@ public:
 
        void addBuffer(const std::string &name, SoundBuffer *buf)
        {
-               UNORDERED_MAP<std::string, std::vector<SoundBuffer*> >::iterator i =
+               std::unordered_map<std::string, std::vector<SoundBuffer*>>::iterator i =
                                m_buffers.find(name);
                if(i != m_buffers.end()){
                        i->second.push_back(buf);
@@ -384,7 +384,7 @@ public:
 
        SoundBuffer* getBuffer(const std::string &name)
        {
-               UNORDERED_MAP<std::string, std::vector<SoundBuffer*> >::iterator i =
+               std::unordered_map<std::string, std::vector<SoundBuffer*>>::iterator i =
                                m_buffers.find(name);
                if(i == m_buffers.end())
                        return NULL;
@@ -461,7 +461,7 @@ public:
 
        void deleteSound(int id)
        {
-               UNORDERED_MAP<int, PlayingSound*>::iterator i = m_sounds_playing.find(id);
+               std::unordered_map<int, PlayingSound*>::iterator i = m_sounds_playing.find(id);
                if(i == m_sounds_playing.end())
                        return;
                PlayingSound *sound = i->second;
@@ -501,7 +501,7 @@ public:
                                <<m_sounds_playing.size()<<" playing sounds, "
                                <<m_buffers.size()<<" sound names loaded"<<std::endl;
                std::set<int> del_list;
-               for(UNORDERED_MAP<int, PlayingSound*>::iterator i = m_sounds_playing.begin();
+               for(std::unordered_map<int, PlayingSound*>::iterator i = m_sounds_playing.begin();
                                i != m_sounds_playing.end(); ++i) {
                        int id = i->first;
                        PlayingSound *sound = i->second;
@@ -615,7 +615,7 @@ public:
                        return;
 
                float chkGain = 0;
-               for (UNORDERED_MAP<int, FadeState>::iterator i = m_sounds_fading.begin();
+               for (std::unordered_map<int, FadeState>::iterator i = m_sounds_fading.begin();
                                i != m_sounds_fading.end();) {
                        if (i->second.step < 0.f)
                                chkGain = -(i->second.current_gain);
@@ -646,7 +646,7 @@ public:
 
        void updateSoundPosition(int id, v3f pos)
        {
-               UNORDERED_MAP<int, PlayingSound*>::iterator i = m_sounds_playing.find(id);
+               std::unordered_map<int, PlayingSound*>::iterator i = m_sounds_playing.find(id);
                if (i == m_sounds_playing.end())
                        return;
                PlayingSound *sound = i->second;
@@ -659,7 +659,7 @@ public:
 
        bool updateSoundGain(int id, float gain)
        {
-               UNORDERED_MAP<int, PlayingSound*>::iterator i = m_sounds_playing.find(id);
+               std::unordered_map<int, PlayingSound*>::iterator i = m_sounds_playing.find(id);
                if (i == m_sounds_playing.end())
                        return false;
 
@@ -670,7 +670,7 @@ public:
 
        float getSoundGain(int id)
        {
-               UNORDERED_MAP<int, PlayingSound*>::iterator i = m_sounds_playing.find(id);
+               std::unordered_map<int, PlayingSound*>::iterator i = m_sounds_playing.find(id);
                if (i == m_sounds_playing.end())
                        return 0;
 
index bb884938c8eb6a66642f0b0e6c7a6c129f18b09c..1afd716309dc1f30d6f44e1c2bceeb0bfe32accd 100644 (file)
@@ -38,7 +38,7 @@ void ToolCapabilities::serialize(std::ostream &os, u16 protocol_version) const
                writeS16(os, cap->uses);
                writeS16(os, cap->maxlevel);
                writeU32(os, cap->times.size());
-               for (UNORDERED_MAP<int, float>::const_iterator
+               for (std::unordered_map<int, float>::const_iterator
                                j = cap->times.begin(); j != cap->times.end(); ++j) {
                        writeS16(os, j->first);
                        writeF1000(os, j->second);
index f33152355c21e3cf5f9f3dc3bfa14c99195a1493..083328d0604f3c0f7e597df18335cb42dfebab5a 100644 (file)
@@ -23,12 +23,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "irrlichttypes.h"
 #include <string>
 #include <iostream>
-#include "util/cpp11_container.h"
 #include "itemgroup.h"
 
 struct ToolGroupCap
 {
-       UNORDERED_MAP<int, float> times;
+       std::unordered_map<int, float> times;
        int maxlevel;
        int uses;
 
@@ -39,7 +38,7 @@ struct ToolGroupCap
 
        bool getTime(int rating, float *time) const
        {
-               UNORDERED_MAP<int, float>::const_iterator i = times.find(rating);
+               std::unordered_map<int, float>::const_iterator i = times.find(rating);
                if (i == times.end()) {
                        *time = 0;
                        return false;
@@ -50,8 +49,8 @@ struct ToolGroupCap
 };
 
 
-typedef UNORDERED_MAP<std::string, struct ToolGroupCap> ToolGCMap;
-typedef UNORDERED_MAP<std::string, s16> DamageGroup;
+typedef std::unordered_map<std::string, struct ToolGroupCap> ToolGCMap;
+typedef std::unordered_map<std::string, s16> DamageGroup;
 
 struct ToolCapabilities
 {
diff --git a/src/util/cpp11.h b/src/util/cpp11.h
deleted file mode 100644 (file)
index 14913cb..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-Minetest
-Copyright (C) 2016 nerzhul, Loic Blot <loic.blot@unix-experience.fr>
-
-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 MT_CPP11_HEADER
-#define MT_CPP11_HEADER
-
-#if __cplusplus < 201103L || _MSC_VER < 1600
-#define USE_CPP11_FAKE_KEYWORD
-#endif
-
-#ifdef USE_CPP11_FAKE_KEYWORD
-#define constexpr const
-#define nullptr NULL
-#endif
-
-#endif
diff --git a/src/util/cpp11_container.h b/src/util/cpp11_container.h
deleted file mode 100644 (file)
index 0194385..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-Minetest
-Copyright (C) 2016 nerzhul, Loic Blot <loic.blot@unix-experience.fr>
-
-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 MT_CPP11CONTAINER_HEADER
-#define MT_CPP11CONTAINER_HEADER
-
-#if __cplusplus >= 201103L
-#define USE_UNORDERED_CONTAINERS
-#endif
-
-#if _MSC_VER >= 1600
-#define USE_UNORDERED_CONTAINERS
-#endif
-
-#ifdef USE_UNORDERED_CONTAINERS
-#include <unordered_map>
-#include <unordered_set>
-#define UNORDERED_MAP std::unordered_map
-#define UNORDERED_SET std::unordered_set
-#else
-#include <map>
-#include <set>
-#define UNORDERED_MAP std::map
-#define UNORDERED_SET std::set
-#endif
-
-#endif
index cc278da1323d06185499788268e034499217e2f3..c0f4beefbdd70149ec68b469d12613447335df30 100644 (file)
@@ -21,7 +21,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define UTIL_STRING_HEADER
 
 #include "irrlichttypes_bloated.h"
-#include "cpp11_container.h"
 #include <stdlib.h>
 #include <string>
 #include <cstring>
@@ -30,6 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <sstream>
 #include <iomanip>
 #include <cctype>
+#include <unordered_map>
 
 #define STRINGIFY(x) #x
 #define TOSTRING(x) STRINGIFY(x)
@@ -55,7 +55,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
        (((unsigned char)(x) < 0xe0) ? 2 :     \
        (((unsigned char)(x) < 0xf0) ? 3 : 4))
 
-typedef UNORDERED_MAP<std::string, std::string> StringMap;
+typedef std::unordered_map<std::string, std::string> StringMap;
 
 struct FlagDesc {
        const char *name;
index b518979d7f095a4a7c92009c4886c901250833dc..6996246127c5b9352ffa3ecd409a0e0cb75cb2d0 100644 (file)
@@ -23,7 +23,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "voxel.h"
 #include "mapnode.h"
 #include "util/container.h"
-#include "util/cpp11_container.h"
 
 class Map;
 class ServerMap;