From 00c647e4cc26d098e021981ba44018e14c6106aa Mon Sep 17 00:00:00 2001 From: Thresher <90872694+Bituvo@users.noreply.github.com> Date: Fri, 26 May 2023 09:13:57 -0400 Subject: [PATCH] Convert spaces to tabs (#13506) * Convert spaces to tabs * Desour reviews 1-3 fix * Desour fixes * Undo alignment changes --- src/client/render/plain.h | 8 +- src/database/database-postgresql.cpp | 4 +- src/filesys.h | 2 +- src/inventorymanager.h | 6 +- src/lighting.cpp | 12 +-- src/lighting.h | 32 ++++---- src/main.cpp | 6 +- src/map.cpp | 2 +- src/network/clientopcodes.h | 6 +- src/network/networkprotocol.h | 4 +- src/network/serveropcodes.h | 6 +- src/pathfinder.cpp | 2 +- src/porting.cpp | 2 +- src/script/cpp_api/s_player.cpp | 2 +- src/serialization.cpp | 40 +++++----- src/server/player_sao.cpp | 6 +- src/server/player_sao.h | 2 +- src/unittest/test_map_settings_manager.cpp | 2 +- src/unittest/test_utilities.cpp | 92 +++++++++++----------- 19 files changed, 118 insertions(+), 118 deletions(-) diff --git a/src/client/render/plain.h b/src/client/render/plain.h index 7062cd0e6..4fd3de97a 100644 --- a/src/client/render/plain.h +++ b/src/client/render/plain.h @@ -87,10 +87,10 @@ class UpscaleStep : public RenderStep { public: - virtual void setRenderSource(RenderSource *source) override { m_source = source; } - virtual void setRenderTarget(RenderTarget *target) override { m_target = target; } - virtual void reset(PipelineContext &context) override {}; - virtual void run(PipelineContext &context) override; + virtual void setRenderSource(RenderSource *source) override { m_source = source; } + virtual void setRenderTarget(RenderTarget *target) override { m_target = target; } + virtual void reset(PipelineContext &context) override {}; + virtual void run(PipelineContext &context) override; private: RenderSource *m_source; RenderTarget *m_target; diff --git a/src/database/database-postgresql.cpp b/src/database/database-postgresql.cpp index 54bcf7032..7b6ecc934 100644 --- a/src/database/database-postgresql.cpp +++ b/src/database/database-postgresql.cpp @@ -23,8 +23,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "database-postgresql.h" #ifdef _WIN32 - #include - #include + #include + #include #else #include #endif diff --git a/src/filesys.h b/src/filesys.h index fa9ddcaa8..63641488e 100644 --- a/src/filesys.h +++ b/src/filesys.h @@ -127,7 +127,7 @@ bool PathStartsWith(const std::string &path, const std::string &prefix); // removed: If non-NULL, receives the removed component(s). // count: Number of components to remove std::string RemoveLastPathComponent(const std::string &path, - std::string *removed = NULL, int count = 1); + std::string *removed = NULL, int count = 1); // Remove "." and ".." path components and for every ".." removed, remove // the last normal path component before it. Unlike AbsolutePath, diff --git a/src/inventorymanager.h b/src/inventorymanager.h index 246ad2947..704a493fd 100644 --- a/src/inventorymanager.h +++ b/src/inventorymanager.h @@ -36,7 +36,7 @@ struct InventoryLocation CURRENT_PLAYER, PLAYER, NODEMETA, - DETACHED, + DETACHED, } type; std::string name; // PLAYER, DETACHED @@ -115,9 +115,9 @@ public: // Get an inventory (server and client) virtual Inventory* getInventory(const InventoryLocation &loc){return NULL;} - // Set modified (will be saved and sent over network; only on server) + // Set modified (will be saved and sent over network; only on server) virtual void setInventoryModified(const InventoryLocation &loc) {} - // Send inventory action to server (only on client) + // Send inventory action to server (only on client) virtual void inventoryAction(InventoryAction *a){} }; diff --git a/src/lighting.cpp b/src/lighting.cpp index b19d47772..0af1eb86e 100644 --- a/src/lighting.cpp +++ b/src/lighting.cpp @@ -20,10 +20,10 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "lighting.h" AutoExposure::AutoExposure() - : luminance_min(-3.f), - luminance_max(-3.f), - exposure_correction(0.0f), - speed_dark_bright(1000.f), - speed_bright_dark(1000.f), - center_weight_power(1.f) + : luminance_min(-3.f), + luminance_max(-3.f), + exposure_correction(0.0f), + speed_dark_bright(1000.f), + speed_bright_dark(1000.f), + center_weight_power(1.f) {} diff --git a/src/lighting.h b/src/lighting.h index 9c4211605..0535383a6 100644 --- a/src/lighting.h +++ b/src/lighting.h @@ -30,27 +30,27 @@ with this program; if not, write to the Free Software Foundation, Inc., */ struct AutoExposure { - /// @brief Minimum boundary for computed luminance - float luminance_min; - /// @brief Maximum boundary for computed luminance - float luminance_max; - /// @brief Luminance bias. Higher values make the scene darker, can be negative. - float exposure_correction; - /// @brief Speed of transition from dark to bright scenes - float speed_dark_bright; - /// @brief Speed of transition from bright to dark scenes - float speed_bright_dark; - /// @brief Power value for center-weighted metering. Value of 1.0 measures entire screen uniformly - float center_weight_power; + /// @brief Minimum boundary for computed luminance + float luminance_min; + /// @brief Maximum boundary for computed luminance + float luminance_max; + /// @brief Luminance bias. Higher values make the scene darker, can be negative. + float exposure_correction; + /// @brief Speed of transition from dark to bright scenes + float speed_dark_bright; + /// @brief Speed of transition from bright to dark scenes + float speed_bright_dark; + /// @brief Power value for center-weighted metering. Value of 1.0 measures entire screen uniformly + float center_weight_power; - AutoExposure(); + AutoExposure(); }; /** Describes ambient light settings for a player */ struct Lighting { - AutoExposure exposure; - float shadow_intensity {0.0f}; - float saturation {1.0f}; + AutoExposure exposure; + float shadow_intensity {0.0f}; + float saturation {1.0f}; }; diff --git a/src/main.cpp b/src/main.cpp index ec805f5d3..61a1ed8e4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -708,9 +708,9 @@ static void uninit_common() static void startup_message() { infostream << PROJECT_NAME << " " << _("with") - << " SER_FMT_VER_HIGHEST_READ=" - << (int)SER_FMT_VER_HIGHEST_READ << ", " - << g_build_info << std::endl; + << " SER_FMT_VER_HIGHEST_READ=" + << (int)SER_FMT_VER_HIGHEST_READ << ", " + << g_build_info << std::endl; } static bool read_config_file(const Settings &cmd_args) diff --git a/src/map.cpp b/src/map.cpp index 239d5fb02..1ecd2c126 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -513,7 +513,7 @@ struct NodeNeighbor { }; void ServerMap::transforming_liquid_add(v3s16 p) { - m_transforming_liquid.push_back(p); + m_transforming_liquid.push_back(p); } void ServerMap::transformLiquids(std::map &modified_blocks, diff --git a/src/network/clientopcodes.h b/src/network/clientopcodes.h index d03dc457d..5c5a31315 100644 --- a/src/network/clientopcodes.h +++ b/src/network/clientopcodes.h @@ -33,9 +33,9 @@ enum ToClientConnectionState { struct ToClientCommandHandler { - const char* name; - ToClientConnectionState state; - void (Client::*handler)(NetworkPacket* pkt); + const char* name; + ToClientConnectionState state; + void (Client::*handler)(NetworkPacket* pkt); }; struct ServerCommandFactory diff --git a/src/network/networkprotocol.h b/src/network/networkprotocol.h index ba526b98d..fd09bcaa1 100644 --- a/src/network/networkprotocol.h +++ b/src/network/networkprotocol.h @@ -233,8 +233,8 @@ with this program; if not, write to the Free Software Foundation, Inc., // Constant that differentiates the protocol from random data and other protocols #define PROTOCOL_ID 0x4f457403 -#define PASSWORD_SIZE 28 // Maximum password length. Allows for - // base64-encoded SHA-1 (27+\0). +#define PASSWORD_SIZE 28 // Maximum password length. Allows for + // base64-encoded SHA-1 (27+\0). // See also formspec [Version History] in doc/lua_api.md #define FORMSPEC_API_VERSION 6 diff --git a/src/network/serveropcodes.h b/src/network/serveropcodes.h index 6df09d5ef..dfaa52a0f 100644 --- a/src/network/serveropcodes.h +++ b/src/network/serveropcodes.h @@ -33,9 +33,9 @@ enum ToServerConnectionState { }; struct ToServerCommandHandler { - const std::string name; - ToServerConnectionState state; - void (Server::*handler)(NetworkPacket* pkt); + const std::string name; + ToServerConnectionState state; + void (Server::*handler)(NetworkPacket* pkt); }; struct ClientCommandFactory diff --git a/src/pathfinder.cpp b/src/pathfinder.cpp index 4f1392772..5060aa1db 100644 --- a/src/pathfinder.cpp +++ b/src/pathfinder.cpp @@ -133,7 +133,7 @@ public: * s = surface (walkable node) * - = non-walkable node (e.g. air) above surface * g = other non-walkable node - */ + */ }; class Pathfinder; diff --git a/src/porting.cpp b/src/porting.cpp index 629f00c37..16e14631d 100644 --- a/src/porting.cpp +++ b/src/porting.cpp @@ -58,7 +58,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #endif #if defined(__HAIKU__) - #include + #include #endif #include "config.h" diff --git a/src/script/cpp_api/s_player.cpp b/src/script/cpp_api/s_player.cpp index 22b24f363..b5c662dae 100644 --- a/src/script/cpp_api/s_player.cpp +++ b/src/script/cpp_api/s_player.cpp @@ -78,7 +78,7 @@ bool ScriptApiPlayer::on_punchplayer(ServerActiveObject *player, } void ScriptApiPlayer::on_rightclickplayer(ServerActiveObject *player, - ServerActiveObject *clicker) + ServerActiveObject *clicker) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_rightclickplayers diff --git a/src/serialization.cpp b/src/serialization.cpp index dc34dd7b9..c0a104224 100644 --- a/src/serialization.cpp +++ b/src/serialization.cpp @@ -27,29 +27,29 @@ with this program; if not, write to the Free Software Foundation, Inc., /* report a zlib or i/o error */ static void zerr(int ret) { - dstream<<"zerr: "; - switch (ret) { - case Z_ERRNO: - if (ferror(stdin)) - dstream<<"error reading stdin"<= 0.0f && r.X < 360.0f) - UASSERT(r.Y == 0.0f) - UASSERT(r.Z == 0.0f) - } - - // only y test with little step - for (float y = -720.f; y <= 720; y += 0.05) { - v3f r = wrapDegrees_0_360_v3f(v3f(0, y, 0)); - UASSERT(r.X == 0.0f) - UASSERT(r.Y >= 0.0f && r.Y < 360.0f) - UASSERT(r.Z == 0.0f) - } - - // only z test with little step - for (float z = -720.f; z <= 720; z += 0.05) { - v3f r = wrapDegrees_0_360_v3f(v3f(0, 0, z)); - UASSERT(r.X == 0.0f) - UASSERT(r.Y == 0.0f) - UASSERT(r.Z >= 0.0f && r.Z < 360.0f) + v3f r = wrapDegrees_0_360_v3f(v3f(x, 0, 0)); + UASSERT(r.X >= 0.0f && r.X < 360.0f) + UASSERT(r.Y == 0.0f) + UASSERT(r.Z == 0.0f) } - // test the whole coordinate translation - for (float x = -720.f; x <= 720; x += 2.5) { - for (float y = -720.f; y <= 720; y += 2.5) { - for (float z = -720.f; z <= 720; z += 2.5) { - v3f r = wrapDegrees_0_360_v3f(v3f(x, y, z)); - UASSERT(r.X >= 0.0f && r.X < 360.0f) - UASSERT(r.Y >= 0.0f && r.Y < 360.0f) - UASSERT(r.Z >= 0.0f && r.Z < 360.0f) - } - } - } + // only y test with little step + for (float y = -720.f; y <= 720; y += 0.05) { + v3f r = wrapDegrees_0_360_v3f(v3f(0, y, 0)); + UASSERT(r.X == 0.0f) + UASSERT(r.Y >= 0.0f && r.Y < 360.0f) + UASSERT(r.Z == 0.0f) + } + + // only z test with little step + for (float z = -720.f; z <= 720; z += 0.05) { + v3f r = wrapDegrees_0_360_v3f(v3f(0, 0, z)); + UASSERT(r.X == 0.0f) + UASSERT(r.Y == 0.0f) + UASSERT(r.Z >= 0.0f && r.Z < 360.0f) + } + + // test the whole coordinate translation + for (float x = -720.f; x <= 720; x += 2.5) { + for (float y = -720.f; y <= 720; y += 2.5) { + for (float z = -720.f; z <= 720; z += 2.5) { + v3f r = wrapDegrees_0_360_v3f(v3f(x, y, z)); + UASSERT(r.X >= 0.0f && r.X < 360.0f) + UASSERT(r.Y >= 0.0f && r.Y < 360.0f) + UASSERT(r.Z >= 0.0f && r.Z < 360.0f) + } + } + } }