1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Replace PP with direct printing

This commit is contained in:
numzero 2023-06-25 21:18:12 +03:00 committed by sfan5
parent de77fe8ade
commit 3b74cc4a41
18 changed files with 110 additions and 109 deletions

View file

@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "filesys.h"
#include "exceptions.h"
#include "remoteplayer.h"
#include "irrlicht_changes/printing.h"
#include "server/player_sao.h"
#include "util/serialize.h"
#include "util/string.h"
@ -58,7 +59,7 @@ bool Database_LevelDB::saveBlock(const v3s16 &pos, const std::string &data)
i64tos(getBlockAsInteger(pos)), data);
if (!status.ok()) {
warningstream << "saveBlock: LevelDB error saving block "
<< PP(pos) << ": " << status.ToString() << std::endl;
<< pos << ": " << status.ToString() << std::endl;
return false;
}
@ -80,7 +81,7 @@ bool Database_LevelDB::deleteBlock(const v3s16 &pos)
i64tos(getBlockAsInteger(pos)));
if (!status.ok()) {
warningstream << "deleteBlock: LevelDB error deleting block "
<< PP(pos) << ": " << status.ToString() << std::endl;
<< pos << ": " << status.ToString() << std::endl;
return false;
}

View file

@ -26,6 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "settings.h"
#include "log.h"
#include "exceptions.h"
#include "irrlicht_changes/printing.h"
#include "util/string.h"
#include <hiredis.h>
@ -98,13 +99,13 @@ bool Database_Redis::saveBlock(const v3s16 &pos, const std::string &data)
hash.c_str(), tmp.c_str(), data.c_str(), data.size()));
if (!reply) {
warningstream << "saveBlock: redis command 'HSET' failed on "
"block " << PP(pos) << ": " << ctx->errstr << std::endl;
"block " << pos << ": " << ctx->errstr << std::endl;
freeReplyObject(reply);
return false;
}
if (reply->type == REDIS_REPLY_ERROR) {
warningstream << "saveBlock: saving block " << PP(pos)
warningstream << "saveBlock: saving block " << pos
<< " failed: " << std::string(reply->str, reply->len) << std::endl;
freeReplyObject(reply);
return false;
@ -134,7 +135,7 @@ void Database_Redis::loadBlock(const v3s16 &pos, std::string *block)
case REDIS_REPLY_ERROR: {
std::string errstr(reply->str, reply->len);
freeReplyObject(reply);
errorstream << "loadBlock: loading block " << PP(pos)
errorstream << "loadBlock: loading block " << pos
<< " failed: " << errstr << std::endl;
throw DatabaseException(std::string(
"Redis command 'HGET %s %s' errored: ") + errstr);
@ -146,7 +147,7 @@ void Database_Redis::loadBlock(const v3s16 &pos, std::string *block)
}
}
errorstream << "loadBlock: loading block " << PP(pos)
errorstream << "loadBlock: loading block " << pos
<< " returned invalid reply type " << reply->type
<< ": " << std::string(reply->str, reply->len) << std::endl;
freeReplyObject(reply);
@ -164,7 +165,7 @@ bool Database_Redis::deleteBlock(const v3s16 &pos)
throw DatabaseException(std::string(
"Redis command 'HDEL %s %s' failed: ") + ctx->errstr);
} else if (reply->type == REDIS_REPLY_ERROR) {
warningstream << "deleteBlock: deleting block " << PP(pos)
warningstream << "deleteBlock: deleting block " << pos
<< " failed: " << std::string(reply->str, reply->len) << std::endl;
freeReplyObject(reply);
return false;

View file

@ -34,6 +34,7 @@ SQLite format specification:
#include "porting.h"
#include "util/string.h"
#include "remoteplayer.h"
#include "irrlicht_changes/printing.h"
#include "server/player_sao.h"
#include <cassert>
@ -252,7 +253,7 @@ bool MapDatabaseSQLite3::deleteBlock(const v3s16 &pos)
if (!good) {
warningstream << "deleteBlock: Block failed to delete "
<< PP(pos) << ": " << sqlite3_errmsg(m_database) << std::endl;
<< pos << ": " << sqlite3_errmsg(m_database) << std::endl;
}
return good;
}