Skip to content
Permalink
Browse files

Rename macros with two leading underscores

These names are reserved for the compiler/library implementations.
  • Loading branch information
ShadowNinja authored and kwolekr committed Oct 14, 2015
1 parent 6f4d6cb commit 6f2d785d0ff761961912d7e79a7d16c4adf86861
@@ -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;
@@ -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,15 +1231,15 @@ void Client::sendBreath(u16 breath)

void Client::sendRespawn()
{
DSTACK(__FUNCTION_NAME);
DSTACK(FUNCTION_NAME);

NetworkPacket pkt(TOSERVER_RESPAWN, 0);
Send(&pkt);
}

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));
@@ -67,7 +67,7 @@ void RemoteClient::GetNextBlocks (
float dtime,
std::vector<PrioritySortedBlockTransfer> &dest)
{
DSTACK(__FUNCTION_NAME);
DSTACK(FUNCTION_NAME);


// Increment timers
@@ -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;

@@ -465,7 +465,7 @@ void ItemCAO::updateTexture()
}
catch(SerializationError &e)
{
warningstream<<__FUNCTION_NAME
warningstream<<FUNCTION_NAME
<<": error deSerializing itemstring \""
<<m_itemstring<<std::endl;
}
@@ -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;
@@ -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);
@@ -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)

@@ -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;
@@ -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);
@@ -616,7 +616,7 @@ class CurlFetchThread : public Thread

void *run()
{
DSTACK(__FUNCTION_NAME);
DSTACK(FUNCTION_NAME);

CurlHandlePool pool;

@@ -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();

@@ -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();

0 comments on commit 6f2d785

Please sign in to comment.