Convert spaces to tabs (#13506)

* Convert spaces to tabs

* Desour reviews 1-3 fix

* Desour fixes

* Undo alignment changes
This commit is contained in:
Thresher 2023-05-26 09:13:57 -04:00 committed by GitHub
parent f4cb16cc2d
commit 00c647e4cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 118 additions and 118 deletions

View File

@ -87,10 +87,10 @@ class UpscaleStep : public RenderStep
{ {
public: public:
virtual void setRenderSource(RenderSource *source) override { m_source = source; } virtual void setRenderSource(RenderSource *source) override { m_source = source; }
virtual void setRenderTarget(RenderTarget *target) override { m_target = target; } virtual void setRenderTarget(RenderTarget *target) override { m_target = target; }
virtual void reset(PipelineContext &context) override {}; virtual void reset(PipelineContext &context) override {};
virtual void run(PipelineContext &context) override; virtual void run(PipelineContext &context) override;
private: private:
RenderSource *m_source; RenderSource *m_source;
RenderTarget *m_target; RenderTarget *m_target;

View File

@ -23,8 +23,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "database-postgresql.h" #include "database-postgresql.h"
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>
#include <winsock2.h> #include <winsock2.h>
#else #else
#include <netinet/in.h> #include <netinet/in.h>
#endif #endif

View File

@ -127,7 +127,7 @@ bool PathStartsWith(const std::string &path, const std::string &prefix);
// removed: If non-NULL, receives the removed component(s). // removed: If non-NULL, receives the removed component(s).
// count: Number of components to remove // count: Number of components to remove
std::string RemoveLastPathComponent(const std::string &path, 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 // Remove "." and ".." path components and for every ".." removed, remove
// the last normal path component before it. Unlike AbsolutePath, // the last normal path component before it. Unlike AbsolutePath,

View File

@ -36,7 +36,7 @@ struct InventoryLocation
CURRENT_PLAYER, CURRENT_PLAYER,
PLAYER, PLAYER,
NODEMETA, NODEMETA,
DETACHED, DETACHED,
} type; } type;
std::string name; // PLAYER, DETACHED std::string name; // PLAYER, DETACHED
@ -115,9 +115,9 @@ public:
// Get an inventory (server and client) // Get an inventory (server and client)
virtual Inventory* getInventory(const InventoryLocation &loc){return NULL;} 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) {} 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){} virtual void inventoryAction(InventoryAction *a){}
}; };

View File

@ -20,10 +20,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "lighting.h" #include "lighting.h"
AutoExposure::AutoExposure() AutoExposure::AutoExposure()
: luminance_min(-3.f), : luminance_min(-3.f),
luminance_max(-3.f), luminance_max(-3.f),
exposure_correction(0.0f), exposure_correction(0.0f),
speed_dark_bright(1000.f), speed_dark_bright(1000.f),
speed_bright_dark(1000.f), speed_bright_dark(1000.f),
center_weight_power(1.f) center_weight_power(1.f)
{} {}

View File

@ -30,27 +30,27 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/ */
struct AutoExposure struct AutoExposure
{ {
/// @brief Minimum boundary for computed luminance /// @brief Minimum boundary for computed luminance
float luminance_min; float luminance_min;
/// @brief Maximum boundary for computed luminance /// @brief Maximum boundary for computed luminance
float luminance_max; float luminance_max;
/// @brief Luminance bias. Higher values make the scene darker, can be negative. /// @brief Luminance bias. Higher values make the scene darker, can be negative.
float exposure_correction; float exposure_correction;
/// @brief Speed of transition from dark to bright scenes /// @brief Speed of transition from dark to bright scenes
float speed_dark_bright; float speed_dark_bright;
/// @brief Speed of transition from bright to dark scenes /// @brief Speed of transition from bright to dark scenes
float speed_bright_dark; float speed_bright_dark;
/// @brief Power value for center-weighted metering. Value of 1.0 measures entire screen uniformly /// @brief Power value for center-weighted metering. Value of 1.0 measures entire screen uniformly
float center_weight_power; float center_weight_power;
AutoExposure(); AutoExposure();
}; };
/** Describes ambient light settings for a player /** Describes ambient light settings for a player
*/ */
struct Lighting struct Lighting
{ {
AutoExposure exposure; AutoExposure exposure;
float shadow_intensity {0.0f}; float shadow_intensity {0.0f};
float saturation {1.0f}; float saturation {1.0f};
}; };

View File

@ -708,9 +708,9 @@ static void uninit_common()
static void startup_message() static void startup_message()
{ {
infostream << PROJECT_NAME << " " << _("with") infostream << PROJECT_NAME << " " << _("with")
<< " SER_FMT_VER_HIGHEST_READ=" << " SER_FMT_VER_HIGHEST_READ="
<< (int)SER_FMT_VER_HIGHEST_READ << ", " << (int)SER_FMT_VER_HIGHEST_READ << ", "
<< g_build_info << std::endl; << g_build_info << std::endl;
} }
static bool read_config_file(const Settings &cmd_args) static bool read_config_file(const Settings &cmd_args)

View File

@ -513,7 +513,7 @@ struct NodeNeighbor {
}; };
void ServerMap::transforming_liquid_add(v3s16 p) { void ServerMap::transforming_liquid_add(v3s16 p) {
m_transforming_liquid.push_back(p); m_transforming_liquid.push_back(p);
} }
void ServerMap::transformLiquids(std::map<v3s16, MapBlock*> &modified_blocks, void ServerMap::transformLiquids(std::map<v3s16, MapBlock*> &modified_blocks,

View File

@ -33,9 +33,9 @@ enum ToClientConnectionState {
struct ToClientCommandHandler struct ToClientCommandHandler
{ {
const char* name; const char* name;
ToClientConnectionState state; ToClientConnectionState state;
void (Client::*handler)(NetworkPacket* pkt); void (Client::*handler)(NetworkPacket* pkt);
}; };
struct ServerCommandFactory struct ServerCommandFactory

View File

@ -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 // Constant that differentiates the protocol from random data and other protocols
#define PROTOCOL_ID 0x4f457403 #define PROTOCOL_ID 0x4f457403
#define PASSWORD_SIZE 28 // Maximum password length. Allows for #define PASSWORD_SIZE 28 // Maximum password length. Allows for
// base64-encoded SHA-1 (27+\0). // base64-encoded SHA-1 (27+\0).
// See also formspec [Version History] in doc/lua_api.md // See also formspec [Version History] in doc/lua_api.md
#define FORMSPEC_API_VERSION 6 #define FORMSPEC_API_VERSION 6

View File

@ -33,9 +33,9 @@ enum ToServerConnectionState {
}; };
struct ToServerCommandHandler struct ToServerCommandHandler
{ {
const std::string name; const std::string name;
ToServerConnectionState state; ToServerConnectionState state;
void (Server::*handler)(NetworkPacket* pkt); void (Server::*handler)(NetworkPacket* pkt);
}; };
struct ClientCommandFactory struct ClientCommandFactory

View File

@ -133,7 +133,7 @@ public:
* s = surface (walkable node) * s = surface (walkable node)
* - = non-walkable node (e.g. air) above surface * - = non-walkable node (e.g. air) above surface
* g = other non-walkable node * g = other non-walkable node
*/ */
}; };
class Pathfinder; class Pathfinder;

View File

@ -58,7 +58,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#endif #endif
#if defined(__HAIKU__) #if defined(__HAIKU__)
#include <FindDirectory.h> #include <FindDirectory.h>
#endif #endif
#include "config.h" #include "config.h"

View File

@ -78,7 +78,7 @@ bool ScriptApiPlayer::on_punchplayer(ServerActiveObject *player,
} }
void ScriptApiPlayer::on_rightclickplayer(ServerActiveObject *player, void ScriptApiPlayer::on_rightclickplayer(ServerActiveObject *player,
ServerActiveObject *clicker) ServerActiveObject *clicker)
{ {
SCRIPTAPI_PRECHECKHEADER SCRIPTAPI_PRECHECKHEADER
// Get core.registered_on_rightclickplayers // Get core.registered_on_rightclickplayers

View File

@ -27,29 +27,29 @@ with this program; if not, write to the Free Software Foundation, Inc.,
/* report a zlib or i/o error */ /* report a zlib or i/o error */
static void zerr(int ret) static void zerr(int ret)
{ {
dstream<<"zerr: "; dstream<<"zerr: ";
switch (ret) { switch (ret) {
case Z_ERRNO: case Z_ERRNO:
if (ferror(stdin)) if (ferror(stdin))
dstream<<"error reading stdin"<<std::endl; dstream<<"error reading stdin"<<std::endl;
if (ferror(stdout)) if (ferror(stdout))
dstream<<"error writing stdout"<<std::endl; dstream<<"error writing stdout"<<std::endl;
break; break;
case Z_STREAM_ERROR: case Z_STREAM_ERROR:
dstream<<"invalid compression level"<<std::endl; dstream<<"invalid compression level"<<std::endl;
break; break;
case Z_DATA_ERROR: case Z_DATA_ERROR:
dstream<<"invalid or incomplete deflate data"<<std::endl; dstream<<"invalid or incomplete deflate data"<<std::endl;
break; break;
case Z_MEM_ERROR: case Z_MEM_ERROR:
dstream<<"out of memory"<<std::endl; dstream<<"out of memory"<<std::endl;
break; break;
case Z_VERSION_ERROR: case Z_VERSION_ERROR:
dstream<<"zlib version mismatch!"<<std::endl; dstream<<"zlib version mismatch!"<<std::endl;
break; break;
default: default:
dstream<<"return value = "<<ret<<std::endl; dstream<<"return value = "<<ret<<std::endl;
} }
} }
// Make sure that z is deleted in case of exception // Make sure that z is deleted in case of exception

View File

@ -185,7 +185,7 @@ void PlayerSAO::step(float dtime, bool send_recommended)
if (!isImmortal() && m_node_hurt_interval.step(dtime, 1.0f)) { if (!isImmortal() && m_node_hurt_interval.step(dtime, 1.0f)) {
u32 damage_per_second = 0; u32 damage_per_second = 0;
std::string nodename; std::string nodename;
v3s16 node_pos; v3s16 node_pos;
// Lowest and highest damage points are 0.1 within collisionbox // Lowest and highest damage points are 0.1 within collisionbox
float dam_top = m_prop.collisionbox.MaxEdge.Y - 0.1f; float dam_top = m_prop.collisionbox.MaxEdge.Y - 0.1f;
@ -199,7 +199,7 @@ void PlayerSAO::step(float dtime, bool send_recommended)
if (c.damage_per_second > damage_per_second) { if (c.damage_per_second > damage_per_second) {
damage_per_second = c.damage_per_second; damage_per_second = c.damage_per_second;
nodename = c.name; nodename = c.name;
node_pos = p; node_pos = p;
} }
} }
@ -211,7 +211,7 @@ void PlayerSAO::step(float dtime, bool send_recommended)
if (c.damage_per_second > damage_per_second) { if (c.damage_per_second > damage_per_second) {
damage_per_second = c.damage_per_second; damage_per_second = c.damage_per_second;
nodename = c.name; nodename = c.name;
node_pos = ptop; node_pos = ptop;
} }
if (damage_per_second != 0 && m_hp > 0) { if (damage_per_second != 0 && m_hp > 0) {

View File

@ -246,7 +246,7 @@ struct PlayerHPChangeReason
ServerActiveObject *object = nullptr; ServerActiveObject *object = nullptr;
// For NODE_DAMAGE // For NODE_DAMAGE
std::string node; std::string node;
v3s16 node_pos; v3s16 node_pos;
inline bool hasLuaReference() const { return lua_reference >= 0; } inline bool hasLuaReference() const { return lua_reference >= 0; }

View File

@ -127,7 +127,7 @@ void TestMapSettingsManager::testMapSettingsManager()
UASSERT(mgr.getMapSetting("water_level", &value)); UASSERT(mgr.getMapSetting("water_level", &value));
UASSERT(value == "20"); UASSERT(value == "20");
// Pretend we have some mapgen settings configured from the scripting // Pretend we have some mapgen settings configured from the scripting
UASSERT(mgr.setMapSetting("water_level", "15")); UASSERT(mgr.setMapSetting("water_level", "15"));
UASSERT(mgr.setMapSetting("seed", "02468")); UASSERT(mgr.setMapSetting("seed", "02468"));
UASSERT(mgr.setMapSetting("mg_flags", "nolight", true)); UASSERT(mgr.setMapSetting("mg_flags", "nolight", true));

View File

@ -117,62 +117,62 @@ inline float ref_WrapDegrees_0_360(float f)
void TestUtilities::testAngleWrapAround() { void TestUtilities::testAngleWrapAround() {
UASSERT(fabs(modulo360f(100.0) - 100.0) < 0.001); UASSERT(fabs(modulo360f(100.0) - 100.0) < 0.001);
UASSERT(fabs(modulo360f(720.5) - 0.5) < 0.001); UASSERT(fabs(modulo360f(720.5) - 0.5) < 0.001);
UASSERT(fabs(modulo360f(-0.5) - (-0.5)) < 0.001); UASSERT(fabs(modulo360f(-0.5) - (-0.5)) < 0.001);
UASSERT(fabs(modulo360f(-365.5) - (-5.5)) < 0.001); UASSERT(fabs(modulo360f(-365.5) - (-5.5)) < 0.001);
for (float f = -720; f <= -360; f += 0.25) { for (float f = -720; f <= -360; f += 0.25) {
UASSERT(std::fabs(modulo360f(f) - modulo360f(f + 360)) < 0.001); UASSERT(std::fabs(modulo360f(f) - modulo360f(f + 360)) < 0.001);
} }
for (float f = -1440; f <= 1440; f += 0.25) { for (float f = -1440; f <= 1440; f += 0.25) {
UASSERT(std::fabs(modulo360f(f) - fmodf(f, 360)) < 0.001); UASSERT(std::fabs(modulo360f(f) - fmodf(f, 360)) < 0.001);
UASSERT(std::fabs(wrapDegrees_180(f) - ref_WrapDegrees180(f)) < 0.001); UASSERT(std::fabs(wrapDegrees_180(f) - ref_WrapDegrees180(f)) < 0.001);
UASSERT(std::fabs(wrapDegrees_0_360(f) - ref_WrapDegrees_0_360(f)) < 0.001); UASSERT(std::fabs(wrapDegrees_0_360(f) - ref_WrapDegrees_0_360(f)) < 0.001);
UASSERT(wrapDegrees_0_360( UASSERT(wrapDegrees_0_360(
std::fabs(wrapDegrees_180(f) - wrapDegrees_0_360(f))) < 0.001); std::fabs(wrapDegrees_180(f) - wrapDegrees_0_360(f))) < 0.001);
} }
} }
void TestUtilities::testWrapDegrees_0_360_v3f() void TestUtilities::testWrapDegrees_0_360_v3f()
{ {
// only x test with little step // only x test with little step
for (float x = -720.f; x <= 720; x += 0.05) { for (float x = -720.f; x <= 720; x += 0.05) {
v3f r = wrapDegrees_0_360_v3f(v3f(x, 0, 0)); v3f r = wrapDegrees_0_360_v3f(v3f(x, 0, 0));
UASSERT(r.X >= 0.0f && r.X < 360.0f) UASSERT(r.X >= 0.0f && r.X < 360.0f)
UASSERT(r.Y == 0.0f) UASSERT(r.Y == 0.0f)
UASSERT(r.Z == 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)
} }
// test the whole coordinate translation // only y test with little step
for (float x = -720.f; x <= 720; x += 2.5) { for (float y = -720.f; y <= 720; y += 0.05) {
for (float y = -720.f; y <= 720; y += 2.5) { v3f r = wrapDegrees_0_360_v3f(v3f(0, y, 0));
for (float z = -720.f; z <= 720; z += 2.5) { UASSERT(r.X == 0.0f)
v3f r = wrapDegrees_0_360_v3f(v3f(x, y, z)); UASSERT(r.Y >= 0.0f && r.Y < 360.0f)
UASSERT(r.X >= 0.0f && r.X < 360.0f) UASSERT(r.Z == 0.0f)
UASSERT(r.Y >= 0.0f && r.Y < 360.0f) }
UASSERT(r.Z >= 0.0f && r.Z < 360.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)
}
}
}
} }