From 01862b6031670e272bceb5719a3d65b071a5c6c2 Mon Sep 17 00:00:00 2001 From: Merlyn Morgan-Graham Date: Sat, 16 Mar 2024 13:06:52 +0000 Subject: [PATCH] Format source with Linux version of clang --- Source/AI/navmesh.cpp | 2 +- Source/Compat/UNIX/unix_compat.h | 2 +- Source/GUI/dimgui/dimgui.cpp | 2 +- Source/Graphics/atlasnodetree.cpp | 2 +- Source/Graphics/terrain.cpp | 2 +- Source/Graphics/textures.cpp | 4 ++-- Source/Internal/SIMD.h | 2 +- Source/Internal/buildver.cpp | 2 +- Source/Internal/collisiondetection.cpp | 2 +- Source/JSON/json-forwards.h | 6 +++--- Source/JSON/json.h | 22 +++++++++++----------- Source/JSON/jsoncpp.cpp | 4 ++-- Source/Main/engine.cpp | 6 +++--- Source/Main/scenegraph.cpp | 3 ++- Source/Physics/bulletworld.cpp | 2 +- Source/Scripting/angelscript/asmodule.cpp | 2 +- Source/Sound/sound.cpp | 2 +- 17 files changed, 34 insertions(+), 33 deletions(-) diff --git a/Source/AI/navmesh.cpp b/Source/AI/navmesh.cpp index 663bab4c6..3fe66d451 100644 --- a/Source/AI/navmesh.cpp +++ b/Source/AI/navmesh.cpp @@ -77,7 +77,7 @@ extern Config config; // So, while developing, we can assume that each new version of the game _might_ involve a code change in the navmesh, it's the conservative assumption. // static const char* NAVMESH_VERSION = "1"; -//#define NAVMESH_VERSION GetBuildVersion() +// #define NAVMESH_VERSION GetBuildVersion() #define NAVMESH_VERSION "1" NavPoint::NavPoint(const NavPoint& other) { diff --git a/Source/Compat/UNIX/unix_compat.h b/Source/Compat/UNIX/unix_compat.h index ae2e7261f..6aad76a77 100644 --- a/Source/Compat/UNIX/unix_compat.h +++ b/Source/Compat/UNIX/unix_compat.h @@ -44,7 +44,7 @@ extern "C" { void nonExistantFunctionToAlertYouToStubbedCode(void); } -//#define STUBBED(txt) nonExistantFunctionToAlertYouToStubbedCode() +// #define STUBBED(txt) nonExistantFunctionToAlertYouToStubbedCode() #define STUBBED(txt) \ { \ static bool virgin = true; \ diff --git a/Source/GUI/dimgui/dimgui.cpp b/Source/GUI/dimgui/dimgui.cpp index 58247c0e8..01a63ccf1 100644 --- a/Source/GUI/dimgui/dimgui.cpp +++ b/Source/GUI/dimgui/dimgui.cpp @@ -80,7 +80,7 @@ // disable Windows.h defining min and max as macros. Windows.h is pulled in by imgui.cpp #define NOMINMAX -//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS +// #define IMGUI_DISABLE_OBSOLETE_FUNCTIONS #include #include #include diff --git a/Source/Graphics/atlasnodetree.cpp b/Source/Graphics/atlasnodetree.cpp index 084036cab..6e82663ea 100644 --- a/Source/Graphics/atlasnodetree.cpp +++ b/Source/Graphics/atlasnodetree.cpp @@ -217,5 +217,5 @@ AtlasNodeTree::AtlasNodeTree(ivec2 dim, unsigned smallest_size) { } AtlasNodeTree::~AtlasNodeTree() { - delete[](data); + delete[] (data); } diff --git a/Source/Graphics/terrain.cpp b/Source/Graphics/terrain.cpp index 822993b5c..5bb2d7fd1 100644 --- a/Source/Graphics/terrain.cpp +++ b/Source/Graphics/terrain.cpp @@ -716,7 +716,7 @@ void Terrain::CalcDetailTextures() { // Compare each pixel to each average color // Create weight map and tint texture - //#pragma omp parallel for + // #pragma omp parallel for std::vector image_data; image_data.resize(total_bytes); texture_data.GetUncompressedData(&image_data[0]); diff --git a/Source/Graphics/textures.cpp b/Source/Graphics/textures.cpp index d155efe91..ba1c05b87 100644 --- a/Source/Graphics/textures.cpp +++ b/Source/Graphics/textures.cpp @@ -510,7 +510,7 @@ void Texture::Init() { name.clear(); } -//#pragma optimize(", off) +// #pragma optimize(", off) void Textures::DisposeTexture(int which, bool free_space) { Texture& texture = textures[which]; @@ -539,7 +539,7 @@ void Textures::DisposeTexture(int which, bool free_space) { free_spaces.push_back(which); } } -//#pragma optimize("", on) +// #pragma optimize("", on) void Textures::Dispose() { blank_texture_ref.clear(); diff --git a/Source/Internal/SIMD.h b/Source/Internal/SIMD.h index d55f5195e..b01b3ab95 100644 --- a/Source/Internal/SIMD.h +++ b/Source/Internal/SIMD.h @@ -120,7 +120,7 @@ inline vec4 vdot3( vec4 a, vec4 b ) } */ -//#include "Platform.h" +// #include "Platform.h" #if defined(CPR_OSX) && defined(__APPLE_ALTIVEC__) diff --git a/Source/Internal/buildver.cpp b/Source/Internal/buildver.cpp index 43b1d46b1..47e57c558 100644 --- a/Source/Internal/buildver.cpp +++ b/Source/Internal/buildver.cpp @@ -64,7 +64,7 @@ // macro mess so we can turn APPID and APPREV into a string literal... #define MAKEBUILDVERSTRINGLITERAL2(id, rev) \ -#id ", Revision " #rev ", Built " __DATE__ " " __TIME__ ", by " COMPILER " version " __VERSION__ + #id ", Revision " #rev ", Built " __DATE__ " " __TIME__ ", by " COMPILER " version " __VERSION__ #define MAKEBUILDVERSTRINGLITERAL(id, rev) MAKEBUILDVERSTRINGLITERAL2(id, rev) diff --git a/Source/Internal/collisiondetection.cpp b/Source/Internal/collisiondetection.cpp index 3165f94a1..5acea0a08 100644 --- a/Source/Internal/collisiondetection.cpp +++ b/Source/Internal/collisiondetection.cpp @@ -587,7 +587,7 @@ bool triBoxOverlap(const vec3 &box_min, const vec3 &box_max, const vec3 &vert1, #include -//#define FABS(x) ((float)fabs(x)) /* implement as is fastest on your machine */ +// #define FABS(x) ((float)fabs(x)) /* implement as is fastest on your machine */ /* if USE_EPSILON_TEST is true then we do a check: if |dv| EnumMemberNames; -// typedef CppTL::AnyEnumerator EnumValues; -//# endif +// # ifdef JSON_USE_CPPTL +// typedef CppTL::AnyEnumerator EnumMemberNames; +// typedef CppTL::AnyEnumerator EnumValues; +// # endif /** \brief Lightweight wrapper to tag static string. * @@ -859,10 +859,10 @@ class JSON_API Value { /// \post if type() was nullValue, it remains nullValue Members getMemberNames() const; - //# ifdef JSON_USE_CPPTL - // EnumMemberNames enumMemberNames() const; - // EnumValues enumValues() const; - //# endif + // # ifdef JSON_USE_CPPTL + // EnumMemberNames enumMemberNames() const; + // EnumValues enumValues() const; + // # endif /// \deprecated Always pass len. JSONCPP_DEPRECATED("Use setComment(std::string const&) instead.") diff --git a/Source/JSON/jsoncpp.cpp b/Source/JSON/jsoncpp.cpp index 924f40a09..5f1139b33 100644 --- a/Source/JSON/jsoncpp.cpp +++ b/Source/JSON/jsoncpp.cpp @@ -3306,7 +3306,7 @@ Value::Members Value::getMemberNames() const { return members; } // -//# ifdef JSON_USE_CPPTL +// # ifdef JSON_USE_CPPTL // EnumMemberNames // Value::enumMemberNames() const //{ @@ -3329,7 +3329,7 @@ Value::Members Value::getMemberNames() const { // return EnumValues(); //} // -//# endif +// # endif static bool IsIntegral(double d) { double integral_part; diff --git a/Source/Main/engine.cpp b/Source/Main/engine.cpp index 7ca5c74ae..92b320c79 100644 --- a/Source/Main/engine.cpp +++ b/Source/Main/engine.cpp @@ -144,12 +144,12 @@ extern char imgui_ini_path[kPathSize]; extern bool asdebugger_enabled; extern bool asprofiler_enabled; -//#define OpenVR +// #define OpenVR #ifdef OpenVR #include "openvr.h" #endif -//#define OculusVR +// #define OculusVR #ifdef OculusVR #include "OVR_CAPI_GL.h" #include "Extras/OVR_Math.h" @@ -394,7 +394,7 @@ const char* font_path = "Data/Fonts/Lato-Regular.ttf"; // Functions //----------------------------------------------------------------------------- -//#define USE_NVTX_PROFILER true +// #define USE_NVTX_PROFILER true #ifdef OpenVR vr::IVRSystem* m_pHMD; diff --git a/Source/Main/scenegraph.cpp b/Source/Main/scenegraph.cpp index b49cff1b0..68bb4573d 100644 --- a/Source/Main/scenegraph.cpp +++ b/Source/Main/scenegraph.cpp @@ -574,7 +574,8 @@ static void UpdateShaderSuffix(SceneGraph* scenegraph, Object::DrawType object_d for (int length = strlen(shader_str[0]), i = 0; i < length && shader_str[0][0] == ' '; - ++i, shader_str[0]++); + ++i, shader_str[0]++) + ; FormatString(global_shader_suffix_storage, kGlobalShaderSuffixLen, "%s", shader_str[0]); } diff --git a/Source/Physics/bulletworld.cpp b/Source/Physics/bulletworld.cpp index d82ebd94b..d251a0849 100644 --- a/Source/Physics/bulletworld.cpp +++ b/Source/Physics/bulletworld.cpp @@ -64,7 +64,7 @@ extern bool g_simple_shadows; extern bool g_level_shadows; extern Timer game_timer; -//#define ALLOW_SOFTBODY true +// #define ALLOW_SOFTBODY true inline btScalar calculateCombinedFriction(float friction0, float friction1) { btScalar friction = friction0 * friction1; diff --git a/Source/Scripting/angelscript/asmodule.cpp b/Source/Scripting/angelscript/asmodule.cpp index 153fc5d59..31f165f00 100644 --- a/Source/Scripting/angelscript/asmodule.cpp +++ b/Source/Scripting/angelscript/asmodule.cpp @@ -614,7 +614,7 @@ void VarStorage::destroy() { delete (float*)var; break; case _vs_enum: - delete[](char*) var; + delete[] (char*)var; break; case _vs_app_obj: { AppObject* ao = (AppObject*)var; diff --git a/Source/Sound/sound.cpp b/Source/Sound/sound.cpp index cf9d6b1ed..5c303545d 100644 --- a/Source/Sound/sound.cpp +++ b/Source/Sound/sound.cpp @@ -60,7 +60,7 @@ bool g_sound_enable_layered_soundtrack_limiter = false; //----------------------------------------------------------------------------- #define REF_DISTANCE 1.0f -//#define REF_DISTANCE 8.0f +// #define REF_DISTANCE 8.0f Sound::Sound(const char *preferred_device) : m_last_game_time_scale(1.0f), m_last_game_timestep(0.0f),