Rename macros with two leading underscores
authorShadowNinja <shadowninja@minetest.net>
Wed, 14 Oct 2015 06:39:30 +0000 (02:39 -0400)
committerkwolekr <kwolekr@minetest.net>
Wed, 14 Oct 2015 06:39:37 +0000 (02:39 -0400)
These names are reserved for the compiler/library implementations.

20 files changed:
src/camera.cpp
src/client.cpp
src/clientiface.cpp
src/clientmap.cpp
src/content_cao.cpp
src/content_nodemeta.cpp
src/content_sao.cpp
src/debug.h
src/emerge.cpp
src/environment.cpp
src/httpfetch.cpp
src/inventory.cpp
src/inventorymanager.cpp
src/map.cpp
src/mapblock.cpp
src/nodemetadata.cpp
src/script/lua_api/l_server.cpp
src/server.cpp
src/unittest/test.cpp
src/util/thread.h

index 0c6d03e4e5034e66d9126323642a23655e27743a..5370396a9259c9254d1a20a8a9cfa18cf1ddd390 100644 (file)
@@ -79,7 +79,7 @@ Camera::Camera(scene::ISceneManager* smgr, MapDrawControl& draw_control,
 
        m_camera_mode(CAMERA_MODE_FIRST)
 {
-       //dstream<<__FUNCTION_NAME<<std::endl;
+       //dstream<<FUNCTION_NAME<<std::endl;
 
        // note: making the camera node a child of the player node
        // would lead to unexpected behaviour, so we don't do that.
@@ -494,7 +494,7 @@ void Camera::updateViewingRange(f32 frametime_in, f32 busytime_in)
                return;
        m_frametime_counter = 0.2; // Same as ClientMap::updateDrawList interval
 
-       /*dstream<<__FUNCTION_NAME
+       /*dstream<<FUNCTION_NAME
                        <<": Collected "<<m_added_frames<<" frames, total of "
                        <<m_added_busytime<<"s."<<std::endl;
 
index b2e21743c4949fde69fca67b13758f697bc5c321..5c04632d1ecbe09d8d2c35d7bc3163db63044ec2 100644 (file)
@@ -98,7 +98,7 @@ MeshUpdateQueue::~MeshUpdateQueue()
 */
 void MeshUpdateQueue::addBlock(v3s16 p, MeshMakeData *data, bool ack_block_to_server, bool urgent)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        assert(data);   // pre-condition
 
@@ -323,7 +323,7 @@ void Client::connect(Address address,
                const std::string &address_name,
                bool is_local_server)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        initLocalMapSaving(address, address_name, is_local_server);
 
@@ -333,7 +333,7 @@ void Client::connect(Address address,
 
 void Client::step(float dtime)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        // Limit a bit
        if(dtime > 2.0)
@@ -824,7 +824,7 @@ void Client::initLocalMapSaving(const Address &address,
 
 void Client::ReceiveAll()
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        u32 start_ms = porting::getTimeMs();
        for(;;)
        {
@@ -850,7 +850,7 @@ void Client::ReceiveAll()
 
 void Client::Receive()
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        NetworkPacket pkt;
        m_con.Receive(&pkt);
        ProcessData(&pkt);
@@ -867,7 +867,7 @@ inline void Client::handleCommand(NetworkPacket* pkt)
 */
 void Client::ProcessData(NetworkPacket *pkt)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        ToClientCommand command = (ToClientCommand) pkt->getCommand();
        u32 sender_peer_id = pkt->getPeerId();
@@ -1213,7 +1213,7 @@ void Client::sendChangePassword(const std::string &oldpassword,
 
 void Client::sendDamage(u8 damage)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        NetworkPacket pkt(TOSERVER_DAMAGE, sizeof(u8));
        pkt << damage;
@@ -1222,7 +1222,7 @@ void Client::sendDamage(u8 damage)
 
 void Client::sendBreath(u16 breath)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        NetworkPacket pkt(TOSERVER_BREATH, sizeof(u16));
        pkt << breath;
@@ -1231,7 +1231,7 @@ void Client::sendBreath(u16 breath)
 
 void Client::sendRespawn()
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        NetworkPacket pkt(TOSERVER_RESPAWN, 0);
        Send(&pkt);
@@ -1239,7 +1239,7 @@ void Client::sendRespawn()
 
 void Client::sendReady()
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        NetworkPacket pkt(TOSERVER_CLIENT_READY,
                        1 + 1 + 1 + 1 + 2 + sizeof(char) * strlen(g_version_hash));
index a6ab1ef41ceb4487d86277bfbbc8b6b89fb22dca..e7f127b84232c892bb1a0492a00d4be9f108778b 100644 (file)
@@ -67,7 +67,7 @@ void RemoteClient::GetNextBlocks (
                float dtime,
                std::vector<PrioritySortedBlockTransfer> &dest)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
 
        // Increment timers
index 00a5b1021297abd228fc2e019a6f62800f98ae7e..b865c2780df92b0c5b9ca2e08236db731dba1e59 100644 (file)
@@ -81,7 +81,7 @@ ClientMap::~ClientMap()
 
 MapSector * ClientMap::emergeSector(v2s16 p2d)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        // Check that it doesn't exist already
        try{
                return getSectorNoGenerate(p2d);
@@ -400,7 +400,7 @@ struct MeshBufListList
 
 void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        bool is_transparent_pass = pass == scene::ESNRP_TRANSPARENT;
 
index 27048376449331a578cfb4964fcb1907e033c391..b3f90aa9c618ffc9d6b8b59c7ec3ab17d9616c3e 100644 (file)
@@ -465,7 +465,7 @@ void ItemCAO::updateTexture()
        }
        catch(SerializationError &e)
        {
-               warningstream<<__FUNCTION_NAME
+               warningstream<<FUNCTION_NAME
                                <<": error deSerializing itemstring \""
                                <<m_itemstring<<std::endl;
        }
index 072800d6c9c0302597d8fcf1c3e38b7b9e6165ea..7f4264d8e6e284bd8d21ffc37ed2c3777c45026b 100644 (file)
@@ -154,9 +154,9 @@ void content_nodemeta_deserialize_legacy(std::istream &is,
 
        if(version > 1)
        {
-               infostream<<__FUNCTION_NAME<<": version "<<version<<" not supported"
+               infostream<<FUNCTION_NAME<<": version "<<version<<" not supported"
                                <<std::endl;
-               throw SerializationError(__FUNCTION_NAME);
+               throw SerializationError(FUNCTION_NAME);
        }
 
        u16 count = readU16(is);
@@ -174,7 +174,7 @@ void content_nodemeta_deserialize_legacy(std::istream &is,
 
                if(meta->get(p) != NULL)
                {
-                       warningstream<<__FUNCTION_NAME<<": "
+                       warningstream<<FUNCTION_NAME<<": "
                                        <<"already set data at position"
                                        <<"("<<p.X<<","<<p.Y<<","<<p.Z<<"): Ignoring."
                                        <<std::endl;
index fe46f3acb79dc2840ec4c3824cf8b0abf8f18de7..0fa806c1a11c483c155bdf5f0dc02fade756e469 100644 (file)
@@ -393,7 +393,7 @@ std::string LuaEntitySAO::getClientInitializationData(u16 protocol_version)
 
 std::string LuaEntitySAO::getStaticData()
 {
-       verbosestream<<__FUNCTION_NAME<<std::endl;
+       verbosestream<<FUNCTION_NAME<<std::endl;
        std::ostringstream os(std::ios::binary);
        // version
        writeU8(os, 1);
index e8d35ba709469ebaa53309af54c3de8ca5b4a5a3..2098942db7ec17e457fa72fb8e88d50f5e3c9d40 100644 (file)
@@ -35,13 +35,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
        #ifdef _MSC_VER
                #include <eh.h>
        #endif
-       #define __NORETURN __declspec(noreturn)
-       #define __FUNCTION_NAME __FUNCTION__
        #define NORETURN __declspec(noreturn)
        #define FUNCTION_NAME __FUNCTION__
 #else
-       #define __NORETURN __attribute__ ((__noreturn__))
-       #define __FUNCTION_NAME __PRETTY_FUNCTION__
        #define NORETURN __attribute__ ((__noreturn__))
        #define FUNCTION_NAME __PRETTY_FUNCTION__
 #endif
@@ -57,16 +53,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 /* Abort program execution immediately
  */
-__NORETURN extern void fatal_error_fn(
+NORETURN extern void fatal_error_fn(
                const char *msg, const char *file,
                unsigned int line, const char *function);
 
 #define FATAL_ERROR(msg) \
-       fatal_error_fn((msg), __FILE__, __LINE__, __FUNCTION_NAME)
+       fatal_error_fn((msg), __FILE__, __LINE__, FUNCTION_NAME)
 
 #define FATAL_ERROR_IF(expr, msg) \
        ((expr) \
-       ? fatal_error_fn((msg), __FILE__, __LINE__, __FUNCTION_NAME) \
+       ? fatal_error_fn((msg), __FILE__, __LINE__, FUNCTION_NAME) \
        : (void)(0))
 
 /*
@@ -75,14 +71,14 @@ __NORETURN extern void fatal_error_fn(
        defined)
 */
 
-__NORETURN extern void sanity_check_fn(
+NORETURN extern void sanity_check_fn(
                const char *assertion, const char *file,
                unsigned int line, const char *function);
 
 #define SANITY_CHECK(expr) \
        ((expr) \
        ? (void)(0) \
-       : sanity_check_fn(#expr, __FILE__, __LINE__, __FUNCTION_NAME))
+       : sanity_check_fn(#expr, __FILE__, __LINE__, FUNCTION_NAME))
 
 #define sanity_check(expr) SANITY_CHECK(expr)
 
index 1e40b915a18890b8cf694b0209f9693724f83e93..21f17cb0e6c4b6787eb67359cbcae18a6053586b 100644 (file)
@@ -627,7 +627,7 @@ MapBlock *EmergeThread::finishGen(v3s16 pos, BlockMakeData *bmdata,
 
 void *EmergeThread::run()
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        BEGIN_DEBUG_EXCEPTION_HANDLER
 
        v3s16 pos;
index 59159868ec1971b52d669d16cc44dbbf8482503a..88f25536ffce8e9a1df1b117b8bc04d6475aa681 100644 (file)
@@ -70,7 +70,7 @@ Environment::~Environment()
 
 void Environment::addPlayer(Player *player)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        /*
                Check that peer_ids are unique.
                Also check that names are unique.
@@ -982,7 +982,7 @@ void ServerEnvironment::clearAllObjects()
 
 void ServerEnvironment::step(float dtime)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        //TimeTaker timer("ServerEnv step");
 
@@ -2028,7 +2028,7 @@ ClientMap & ClientEnvironment::getClientMap()
 
 void ClientEnvironment::addPlayer(Player *player)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        /*
                It is a failure if player is local and there already is a local
                player
@@ -2052,7 +2052,7 @@ LocalPlayer * ClientEnvironment::getLocalPlayer()
 
 void ClientEnvironment::step(float dtime)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        /* Step time of day */
        stepTimeOfDay(dtime);
index 979f11160e893cb382630a63e650ff4596a94f7a..f10351a01a30d159ec994cb4e66412e1c0236939 100644 (file)
@@ -616,7 +616,7 @@ protected:
 
        void *run()
        {
-               DSTACK(__FUNCTION_NAME);
+               DSTACK(FUNCTION_NAME);
 
                CurlHandlePool pool;
 
index 67f979b13dd2dd15965e6ae2fcfec24c2c4ebc17..e89993e63d773f43cd610ee54cb9a1ab26be12db 100644 (file)
@@ -126,7 +126,7 @@ ItemStack::ItemStack(std::string name_, u16 count_,
 
 void ItemStack::serialize(std::ostream &os) const
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        if(empty())
                return;
@@ -151,7 +151,7 @@ void ItemStack::serialize(std::ostream &os) const
 
 void ItemStack::deSerialize(std::istream &is, IItemDefManager *itemdef)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        clear();
 
index d4e8d2f25cf43e4e3097dea225acb3eb626fabe7..5b29b6f173531ccb1d2622e780f1867c41cccbf1 100644 (file)
@@ -886,7 +886,7 @@ bool getCraftingResult(Inventory *inv, ItemStack& result,
                std::vector<ItemStack> &output_replacements,
                bool decrementInput, IGameDef *gamedef)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        result.clear();
 
index a2dbffe660445be73f551579f87d2c23e17865ca..ceebd40a35d636659d888237e928619e463c55c1 100644 (file)
@@ -1619,7 +1619,7 @@ void Map::transformLiquids(std::map<v3s16, MapBlock*> & modified_blocks)
 
        INodeDefManager *nodemgr = m_gamedef->ndef();
 
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        //TimeTaker timer("transformLiquids()");
 
        u32 loopcount = 0;
@@ -2118,7 +2118,7 @@ ServerMap::ServerMap(std::string savedir, IGameDef *gamedef, EmergeManager *emer
        m_emerge(emerge),
        m_map_metadata_changed(true)
 {
-       verbosestream<<__FUNCTION_NAME<<std::endl;
+       verbosestream<<FUNCTION_NAME<<std::endl;
 
        /*
                Try to load map; if not found, create a new one.
@@ -2205,7 +2205,7 @@ ServerMap::ServerMap(std::string savedir, IGameDef *gamedef, EmergeManager *emer
 
 ServerMap::~ServerMap()
 {
-       verbosestream<<__FUNCTION_NAME<<std::endl;
+       verbosestream<<FUNCTION_NAME<<std::endl;
 
        try
        {
@@ -2421,7 +2421,7 @@ void ServerMap::finishBlockMake(BlockMakeData *data,
 ServerMapSector *ServerMap::createSector(v2s16 p2d)
 {
        DSTACKF("%s: p2d=(%d,%d)",
-                       __FUNCTION_NAME,
+                       FUNCTION_NAME,
                        p2d.X, p2d.Y);
 
        /*
@@ -2488,7 +2488,7 @@ MapBlock * ServerMap::generateBlock(
                std::map<v3s16, MapBlock*> &modified_blocks
 )
 {
-       DSTACKF("%s: p=(%d,%d,%d)", __FUNCTION_NAME, p.X, p.Y, p.Z);
+       DSTACKF("%s: p=(%d,%d,%d)", FUNCTION_NAME, p.X, p.Y, p.Z);
 
        /*infostream<<"generateBlock(): "
                        <<"("<<p.X<<","<<p.Y<<","<<p.Z<<")"
@@ -2508,7 +2508,7 @@ MapBlock * ServerMap::generateBlock(
        */
        if(blockpos_over_limit(p))
        {
-               infostream<<__FUNCTION_NAME<<": Block position over limit"<<std::endl;
+               infostream<<FUNCTION_NAME<<": Block position over limit"<<std::endl;
                throw InvalidPositionException("generateBlock(): pos. over limit");
        }
 
@@ -2598,7 +2598,7 @@ MapBlock * ServerMap::generateBlock(
 MapBlock * ServerMap::createBlock(v3s16 p)
 {
        DSTACKF("%s: p=(%d,%d,%d)",
-                       __FUNCTION_NAME, p.X, p.Y, p.Z);
+                       FUNCTION_NAME, p.X, p.Y, p.Z);
 
        /*
                Do not create over-limit
@@ -2657,7 +2657,7 @@ MapBlock * ServerMap::createBlock(v3s16 p)
 MapBlock * ServerMap::emergeBlock(v3s16 p, bool create_blank)
 {
        DSTACKF("%s: p=(%d,%d,%d), create_blank=%d",
-                       __FUNCTION_NAME,
+                       FUNCTION_NAME,
                        p.X, p.Y, p.Z, create_blank);
 
        {
@@ -2880,7 +2880,7 @@ std::string ServerMap::getBlockFilename(v3s16 p)
 
 void ServerMap::save(ModifiedState save_level)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        if(m_map_saving_enabled == false) {
                warningstream<<"Not saving map, saving disabled."<<std::endl;
                return;
@@ -2992,7 +2992,7 @@ void ServerMap::listAllLoadedBlocks(std::vector<v3s16> &dst)
 
 void ServerMap::saveMapMeta()
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        createDirs(m_savedir);
 
@@ -3016,7 +3016,7 @@ void ServerMap::saveMapMeta()
 
 void ServerMap::loadMapMeta()
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        Settings conf;
        std::string fullpath = m_savedir + DIR_DELIM + "map_meta.txt";
@@ -3041,7 +3041,7 @@ void ServerMap::loadMapMeta()
 
 void ServerMap::saveSectorMeta(ServerMapSector *sector)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        // Format used for writing
        u8 version = SER_FMT_VER_HIGHEST_WRITE;
        // Get destination
@@ -3062,7 +3062,7 @@ void ServerMap::saveSectorMeta(ServerMapSector *sector)
 
 MapSector* ServerMap::loadSectorMeta(std::string sectordir, bool save_after_load)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        // Get destination
        v2s16 p2d = getSectorPos(sectordir);
 
@@ -3103,7 +3103,7 @@ MapSector* ServerMap::loadSectorMeta(std::string sectordir, bool save_after_load
 
 bool ServerMap::loadSectorMeta(v2s16 p2d)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        // The directory layout we're going to load from.
        //  1 - original sectors/xxxxzzzz/
@@ -3145,7 +3145,7 @@ bool ServerMap::loadSectorMeta(v2s16 p2d)
 #if 0
 bool ServerMap::loadSectorFull(v2s16 p2d)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        MapSector *sector = NULL;
 
@@ -3284,7 +3284,7 @@ bool ServerMap::saveBlock(MapBlock *block, Database *db)
 void ServerMap::loadBlock(std::string sectordir, std::string blockfile,
                MapSector *sector, bool save_after_load)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        std::string fullpath = sectordir + DIR_DELIM + blockfile;
        try {
@@ -3360,7 +3360,7 @@ void ServerMap::loadBlock(std::string sectordir, std::string blockfile,
 
 void ServerMap::loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool save_after_load)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        try {
                std::istringstream is(*blob, std::ios_base::binary);
@@ -3428,7 +3428,7 @@ void ServerMap::loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool
 
 MapBlock* ServerMap::loadBlock(v3s16 blockpos)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        v2s16 p2d(blockpos.X, blockpos.Z);
 
index be16c3bb72f748061826812cca525b1ae9db6e8f..f8747f52bafa96c8d06925a96b1b300b239f2a63 100644 (file)
@@ -796,12 +796,12 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk)
                char tmp;
                is.read(&tmp, 1);
                if (is.gcount() != 1)
-                       throw SerializationError(std::string(__FUNCTION_NAME)
+                       throw SerializationError(std::string(FUNCTION_NAME)
                                + ": not enough input data");
                is_underground = tmp;
                is.read((char *)*databuf_nodelist, nodecount * ser_length);
                if ((u32)is.gcount() != nodecount * ser_length)
-                       throw SerializationError(std::string(__FUNCTION_NAME)
+                       throw SerializationError(std::string(FUNCTION_NAME)
                                + ": not enough input data");
        } else if (version <= 10) {
                u8 t8;
@@ -814,7 +814,7 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk)
                        decompress(is, os, version);
                        std::string s = os.str();
                        if (s.size() != nodecount)
-                               throw SerializationError(std::string(__FUNCTION_NAME)
+                               throw SerializationError(std::string(FUNCTION_NAME)
                                        + ": not enough input data");
                        for (u32 i = 0; i < s.size(); i++) {
                                databuf_nodelist[i*ser_length] = s[i];
@@ -826,7 +826,7 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk)
                        decompress(is, os, version);
                        std::string s = os.str();
                        if (s.size() != nodecount)
-                               throw SerializationError(std::string(__FUNCTION_NAME)
+                               throw SerializationError(std::string(FUNCTION_NAME)
                                        + ": not enough input data");
                        for (u32 i = 0; i < s.size(); i++) {
                                databuf_nodelist[i*ser_length + 1] = s[i];
@@ -839,7 +839,7 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk)
                        decompress(is, os, version);
                        std::string s = os.str();
                        if (s.size() != nodecount)
-                               throw SerializationError(std::string(__FUNCTION_NAME)
+                               throw SerializationError(std::string(FUNCTION_NAME)
                                        + ": not enough input data");
                        for (u32 i = 0; i < s.size(); i++) {
                                databuf_nodelist[i*ser_length + 2] = s[i];
@@ -859,7 +859,7 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk)
                decompress(is, os, version);
                std::string s = os.str();
                if (s.size() != nodecount * 3)
-                       throw SerializationError(std::string(__FUNCTION_NAME)
+                       throw SerializationError(std::string(FUNCTION_NAME)
                                + ": decompress resulted in size other than nodecount*3");
 
                // deserialize nodes from buffer
index 9c74dcd28cdb4616a28c6475ccd352f124e7d7e4..126889ecf28752ec1ded7fd21a4a3bffc83d50b0 100644 (file)
@@ -120,7 +120,7 @@ void NodeMetadataList::deSerialize(std::istream &is, IItemDefManager *item_def_m
        }
 
        if (version != 1) {
-               std::string err_str = std::string(__FUNCTION_NAME)
+               std::string err_str = std::string(FUNCTION_NAME)
                        + ": version " + itos(version) + " not supported";
                infostream << err_str << std::endl;
                throw SerializationError(err_str);
index a6dac487bb02831f4589d3e686ff53b485632ba1..6a8183088adc972e384bd67dfa4d24b3aa62d79b 100644 (file)
@@ -110,7 +110,7 @@ int ModApiServer::l_get_player_ip(lua_State *L)
        }
        catch(con::PeerNotFoundException) // unlikely
        {
-               dstream << __FUNCTION_NAME << ": peer was not found" << std::endl;
+               dstream << FUNCTION_NAME << ": peer was not found" << std::endl;
                lua_pushnil(L); // error
                return 1;
        }
@@ -136,7 +136,7 @@ int ModApiServer::l_get_player_information(lua_State *L)
        }
        catch(con::PeerNotFoundException) // unlikely
        {
-               dstream << __FUNCTION_NAME << ": peer was not found" << std::endl;
+               dstream << FUNCTION_NAME << ": peer was not found" << std::endl;
                lua_pushnil(L); // error
                return 1;
        }
@@ -150,7 +150,7 @@ int ModApiServer::l_get_player_information(lua_State *L)
 
 #define ERET(code)                                                             \
        if (!(code)) {                                                             \
-               dstream << __FUNCTION_NAME << ": peer was not found" << std::endl;     \
+               dstream << FUNCTION_NAME << ": peer was not found" << std::endl;     \
                lua_pushnil(L); /* error */                                            \
                return 1;                                                              \
        }
@@ -281,7 +281,7 @@ int ModApiServer::l_ban_player(lua_State *L)
        }
        catch(con::PeerNotFoundException) // unlikely
        {
-               dstream << __FUNCTION_NAME << ": peer was not found" << std::endl;
+               dstream << FUNCTION_NAME << ": peer was not found" << std::endl;
                lua_pushboolean(L, false); // error
                return 1;
        }
index d6207538ffc1e1ffb66eae888aa285ab8a33d15d..3aff2fb977e6e601cd7ef65ae4a58c396cb3bd22 100644 (file)
@@ -88,7 +88,7 @@ private:
 
 void *ServerThread::run()
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        BEGIN_DEBUG_EXCEPTION_HANDLER
 
        m_server->AsyncRunStep(true);
@@ -433,7 +433,7 @@ Server::~Server()
 
 void Server::start(Address bind_addr)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        m_bind_addr = bind_addr;
 
@@ -466,7 +466,7 @@ void Server::start(Address bind_addr)
 
 void Server::stop()
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        infostream<<"Server: Stopping and waiting threads"<<std::endl;
 
@@ -481,7 +481,7 @@ void Server::stop()
 
 void Server::step(float dtime)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        // Limit a bit
        if(dtime > 2.0)
                dtime = 2.0;
@@ -509,7 +509,7 @@ void Server::step(float dtime)
 
 void Server::AsyncRunStep(bool initial_step)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        g_profiler->add("Server::AsyncRunStep (num)", 1);
 
@@ -693,7 +693,7 @@ void Server::AsyncRunStep(bool initial_step)
                        Player *player = m_env->getPlayer(client->peer_id);
                        if(player == NULL) {
                                // This can happen if the client timeouts somehow
-                               /*warningstream<<__FUNCTION_NAME<<": Client "
+                               /*warningstream<<FUNCTION_NAME<<": Client "
                                                <<client->peer_id
                                                <<" has no associated player"<<std::endl;*/
                                continue;
@@ -746,7 +746,7 @@ void Server::AsyncRunStep(bool initial_step)
                                // Get object type
                                u8 type = ACTIVEOBJECT_TYPE_INVALID;
                                if(obj == NULL)
-                                       warningstream<<__FUNCTION_NAME
+                                       warningstream<<FUNCTION_NAME
                                                        <<": NULL object"<<std::endl;
                                else
                                        type = obj->getSendType();
@@ -1021,7 +1021,7 @@ void Server::AsyncRunStep(bool initial_step)
 
 void Server::Receive()
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        SharedBuffer<u8> data;
        u16 peer_id;
        try {
@@ -1158,7 +1158,7 @@ inline void Server::handleCommand(NetworkPacket* pkt)
 
 void Server::ProcessData(NetworkPacket *pkt)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        // Environment is locked first.
        MutexAutoLock envlock(m_env_mutex);
 
@@ -1354,7 +1354,7 @@ void Server::SetBlocksNotSent(std::map<v3s16, MapBlock *>& block)
 
 void Server::peerAdded(con::Peer *peer)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        verbosestream<<"Server::peerAdded(): peer->id="
                        <<peer->id<<std::endl;
 
@@ -1367,7 +1367,7 @@ void Server::peerAdded(con::Peer *peer)
 
 void Server::deletingPeer(con::Peer *peer, bool timeout)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        verbosestream<<"Server::deletingPeer(): peer->id="
                        <<peer->id<<", timeout="<<timeout<<std::endl;
 
@@ -1459,7 +1459,7 @@ void Server::Send(NetworkPacket* pkt)
 
 void Server::SendMovement(u16 peer_id)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        std::ostringstream os(std::ios_base::binary);
 
        NetworkPacket pkt(TOCLIENT_MOVEMENT, 12 * sizeof(float), peer_id);
@@ -1496,7 +1496,7 @@ void Server::SendPlayerHPOrDie(PlayerSAO *playersao)
 
 void Server::SendHP(u16 peer_id, u8 hp)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        NetworkPacket pkt(TOCLIENT_HP, 1, peer_id);
        pkt << hp;
@@ -1505,7 +1505,7 @@ void Server::SendHP(u16 peer_id, u8 hp)
 
 void Server::SendBreath(u16 peer_id, u16 breath)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        NetworkPacket pkt(TOCLIENT_BREATH, 2, peer_id);
        pkt << (u16) breath;
@@ -1529,7 +1529,7 @@ void Server::SendAccessDenied(u16 peer_id, AccessDeniedCode reason,
 
 void Server::SendAccessDenied_Legacy(u16 peer_id,const std::wstring &reason)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        NetworkPacket pkt(TOCLIENT_ACCESS_DENIED_LEGACY, 0, peer_id);
        pkt << reason;
@@ -1539,7 +1539,7 @@ void Server::SendAccessDenied_Legacy(u16 peer_id,const std::wstring &reason)
 void Server::SendDeathscreen(u16 peer_id,bool set_camera_point_target,
                v3f camera_point_target)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        NetworkPacket pkt(TOCLIENT_DEATHSCREEN, 1 + sizeof(v3f), peer_id);
        pkt << set_camera_point_target << camera_point_target;
@@ -1549,7 +1549,7 @@ void Server::SendDeathscreen(u16 peer_id,bool set_camera_point_target,
 void Server::SendItemDef(u16 peer_id,
                IItemDefManager *itemdef, u16 protocol_version)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        NetworkPacket pkt(TOCLIENT_ITEMDEF, 0, peer_id);
 
@@ -1574,7 +1574,7 @@ void Server::SendItemDef(u16 peer_id,
 void Server::SendNodeDef(u16 peer_id,
                INodeDefManager *nodedef, u16 protocol_version)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        NetworkPacket pkt(TOCLIENT_NODEDEF, 0, peer_id);
 
@@ -1603,7 +1603,7 @@ void Server::SendNodeDef(u16 peer_id,
 
 void Server::SendInventory(PlayerSAO* playerSAO)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        UpdateCrafting(playerSAO->getPlayer());
 
@@ -1624,7 +1624,7 @@ void Server::SendInventory(PlayerSAO* playerSAO)
 
 void Server::SendChatMessage(u16 peer_id, const std::wstring &message)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        NetworkPacket pkt(TOCLIENT_CHAT_MESSAGE, 0, peer_id);
        pkt << message;
@@ -1640,7 +1640,7 @@ void Server::SendChatMessage(u16 peer_id, const std::wstring &message)
 void Server::SendShowFormspecMessage(u16 peer_id, const std::string &formspec,
                                      const std::string &formname)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        NetworkPacket pkt(TOCLIENT_SHOW_FORMSPEC, 0 , peer_id);
 
@@ -1655,7 +1655,7 @@ void Server::SendSpawnParticle(u16 peer_id, v3f pos, v3f velocity, v3f accelerat
                                float expirationtime, float size, bool collisiondetection,
                                bool vertical, std::string texture)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        NetworkPacket pkt(TOCLIENT_SPAWN_PARTICLE, 0, peer_id);
 
@@ -1677,7 +1677,7 @@ void Server::SendAddParticleSpawner(u16 peer_id, u16 amount, float spawntime, v3
        v3f minvel, v3f maxvel, v3f minacc, v3f maxacc, float minexptime, float maxexptime,
        float minsize, float maxsize, bool collisiondetection, bool vertical, std::string texture, u32 id)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        NetworkPacket pkt(TOCLIENT_ADD_PARTICLESPAWNER, 0, peer_id);
 
@@ -1699,7 +1699,7 @@ void Server::SendAddParticleSpawner(u16 peer_id, u16 amount, float spawntime, v3
 
 void Server::SendDeleteParticleSpawner(u16 peer_id, u32 id)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        NetworkPacket pkt(TOCLIENT_DELETE_PARTICLESPAWNER_LEGACY, 2, peer_id);
 
@@ -1809,7 +1809,7 @@ void Server::SendOverrideDayNightRatio(u16 peer_id, bool do_override,
 
 void Server::SendTimeOfDay(u16 peer_id, u16 time, f32 time_speed)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        NetworkPacket pkt(TOCLIENT_TIME_OF_DAY, 0, peer_id);
        pkt << time << time_speed;
@@ -1824,7 +1824,7 @@ void Server::SendTimeOfDay(u16 peer_id, u16 time, f32 time_speed)
 
 void Server::SendPlayerHP(u16 peer_id)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        PlayerSAO *playersao = getPlayerSAO(peer_id);
        // In some rare case, if the player is disconnected
        // while Lua call l_punch, for example, this can be NULL
@@ -1842,7 +1842,7 @@ void Server::SendPlayerHP(u16 peer_id)
 
 void Server::SendPlayerBreath(u16 peer_id)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        PlayerSAO *playersao = getPlayerSAO(peer_id);
        assert(playersao);
 
@@ -1852,7 +1852,7 @@ void Server::SendPlayerBreath(u16 peer_id)
 
 void Server::SendMovePlayer(u16 peer_id)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        Player *player = m_env->getPlayer(peer_id);
        assert(player);
 
@@ -2120,7 +2120,7 @@ void Server::setBlockNotSent(v3s16 p)
 
 void Server::SendBlockNoLock(u16 peer_id, MapBlock *block, u8 ver, u16 net_proto_version)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        v3s16 p = block->getPos();
 
@@ -2142,7 +2142,7 @@ void Server::SendBlockNoLock(u16 peer_id, MapBlock *block, u8 ver, u16 net_proto
 
 void Server::SendBlocks(float dtime)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        MutexAutoLock envlock(m_env_mutex);
        //TODO check if one big lock could be faster then multiple small ones
@@ -2212,7 +2212,7 @@ void Server::SendBlocks(float dtime)
 
 void Server::fillMediaCache()
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        infostream<<"Server: Calculating media file checksums"<<std::endl;
 
@@ -2308,7 +2308,7 @@ void Server::fillMediaCache()
 
 void Server::sendMediaAnnouncement(u16 peer_id)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        verbosestream << "Server: Announcing files to id(" << peer_id << ")"
                << std::endl;
@@ -2345,7 +2345,7 @@ struct SendableMedia
 void Server::sendRequestedMedia(u16 peer_id,
                const std::vector<std::string> &tosend)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        verbosestream<<"Server::sendRequestedMedia(): "
                        <<"Sending files to client"<<std::endl;
@@ -2452,7 +2452,7 @@ void Server::sendRequestedMedia(u16 peer_id,
 void Server::sendDetachedInventory(const std::string &name, u16 peer_id)
 {
        if(m_detached_inventories.count(name) == 0) {
-               errorstream<<__FUNCTION_NAME<<": \""<<name<<"\" not found"<<std::endl;
+               errorstream<<FUNCTION_NAME<<": \""<<name<<"\" not found"<<std::endl;
                return;
        }
        Inventory *inv = m_detached_inventories[name];
@@ -2477,7 +2477,7 @@ void Server::sendDetachedInventory(const std::string &name, u16 peer_id)
 
 void Server::sendDetachedInventories(u16 peer_id)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        for(std::map<std::string, Inventory*>::iterator
                        i = m_detached_inventories.begin();
@@ -2494,7 +2494,7 @@ void Server::sendDetachedInventories(u16 peer_id)
 
 void Server::DiePlayer(u16 peer_id)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        PlayerSAO *playersao = getPlayerSAO(peer_id);
        assert(playersao);
@@ -2514,7 +2514,7 @@ void Server::DiePlayer(u16 peer_id)
 
 void Server::RespawnPlayer(u16 peer_id)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        PlayerSAO *playersao = getPlayerSAO(peer_id);
        assert(playersao);
@@ -2540,7 +2540,7 @@ void Server::RespawnPlayer(u16 peer_id)
 
 void Server::DenySudoAccess(u16 peer_id)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        NetworkPacket pkt(TOCLIENT_DENY_SUDO_MODE, 0, peer_id);
        Send(&pkt);
@@ -2566,7 +2566,7 @@ void Server::DenyAccessVerCompliant(u16 peer_id, u16 proto_ver, AccessDeniedCode
 
 void Server::DenyAccess(u16 peer_id, AccessDeniedCode reason, const std::string &custom_reason)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        SendAccessDenied(peer_id, reason, custom_reason);
        m_clients.event(peer_id, CSE_SetDenied);
@@ -2577,7 +2577,7 @@ void Server::DenyAccess(u16 peer_id, AccessDeniedCode reason, const std::string
 // the minimum version for MT users, maybe in 1 year
 void Server::DenyAccess_Legacy(u16 peer_id, const std::wstring &reason)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        SendAccessDenied_Legacy(peer_id, reason);
        m_clients.event(peer_id, CSE_SetDenied);
@@ -2586,7 +2586,7 @@ void Server::DenyAccess_Legacy(u16 peer_id, const std::wstring &reason)
 
 void Server::acceptAuth(u16 peer_id, bool forSudoMode)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        if (!forSudoMode) {
                RemoteClient* client = getClient(peer_id, CS_Invalid);
@@ -2617,7 +2617,7 @@ void Server::acceptAuth(u16 peer_id, bool forSudoMode)
 
 void Server::DeleteClient(u16 peer_id, ClientDeletionReason reason)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
        std::wstring message;
        {
                /*
@@ -2700,7 +2700,7 @@ void Server::DeleteClient(u16 peer_id, ClientDeletionReason reason)
 
 void Server::UpdateCrafting(Player* player)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        // Get a preview for crafting
        ItemStack preview;
@@ -3388,7 +3388,7 @@ PlayerSAO* Server::emergePlayer(const char *name, u16 peer_id, u16 proto_version
 
 void dedicated_server_loop(Server &server, bool &kill)
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        verbosestream<<"dedicated_server_loop()"<<std::endl;
 
index de4711802f2fb0cadcce29a7f11fcd9568dd0140..1f3b31017b3c5068126a67451d89bc9f581ac9f4 100644 (file)
@@ -217,7 +217,7 @@ void TestGameDef::defineSomeNodes()
 
 void run_tests()
 {
-       DSTACK(__FUNCTION_NAME);
+       DSTACK(FUNCTION_NAME);
 
        u32 t1 = porting::getTime(PRECISION_MILLI);
        TestGameDef gamedef;
index 8d8b6fe7f80fbad8e93044b3a36fb5c7c39aef2d..5ed63544cede4cdd051a49c5d93cc36f82ab37f3 100644 (file)
@@ -210,7 +210,7 @@ public:
 
        void *run()
        {
-               DSTACK(__FUNCTION_NAME);
+               DSTACK(FUNCTION_NAME);
                BEGIN_DEBUG_EXCEPTION_HANDLER
 
                while (!stopRequested()) {