Skip to content

Commit

Permalink
Format source with Linux version of clang
Browse files Browse the repository at this point in the history
  • Loading branch information
kavika13 committed Mar 16, 2024
1 parent 174e19e commit 01862b6
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Source/AI/navmesh.cpp
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion Source/Compat/UNIX/unix_compat.h
Expand Up @@ -44,7 +44,7 @@
extern "C" {
void nonExistantFunctionToAlertYouToStubbedCode(void);
}
//#define STUBBED(txt) nonExistantFunctionToAlertYouToStubbedCode()
// #define STUBBED(txt) nonExistantFunctionToAlertYouToStubbedCode()
#define STUBBED(txt) \
{ \
static bool virgin = true; \
Expand Down
2 changes: 1 addition & 1 deletion Source/GUI/dimgui/dimgui.cpp
Expand Up @@ -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 <imgui_internal.h>
#include <imgui.h>
#include <imgui_color_picker.h>
Expand Down
2 changes: 1 addition & 1 deletion Source/Graphics/atlasnodetree.cpp
Expand Up @@ -217,5 +217,5 @@ AtlasNodeTree::AtlasNodeTree(ivec2 dim, unsigned smallest_size) {
}

AtlasNodeTree::~AtlasNodeTree() {
delete[](data);
delete[] (data);
}
2 changes: 1 addition & 1 deletion Source/Graphics/terrain.cpp
Expand Up @@ -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<unsigned char> image_data;
image_data.resize(total_bytes);
texture_data.GetUncompressedData(&image_data[0]);
Expand Down
4 changes: 2 additions & 2 deletions Source/Graphics/textures.cpp
Expand Up @@ -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];

Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion Source/Internal/SIMD.h
Expand Up @@ -120,7 +120,7 @@ inline vec4 vdot3( vec4 a, vec4 b )
}
*/

//#include "Platform.h"
// #include "Platform.h"

#if defined(CPR_OSX) && defined(__APPLE_ALTIVEC__)

Expand Down
2 changes: 1 addition & 1 deletion Source/Internal/buildver.cpp
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion Source/Internal/collisiondetection.cpp
Expand Up @@ -587,7 +587,7 @@ bool triBoxOverlap(const vec3 &box_min, const vec3 &box_max, const vec3 &vert1,

#include <math.h>

//#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|<EPSILON then dv=0.0f;
Expand Down
6 changes: 3 additions & 3 deletions Source/JSON/json-forwards.h
Expand Up @@ -95,14 +95,14 @@ license you like.
#define JSON_CONFIG_H_INCLUDED

/// If defined, indicates that json library is embedded in CppTL library.
//# define JSON_IN_CPPTL 1
// # define JSON_IN_CPPTL 1

/// If defined, indicates that json may leverage CppTL library
//# define JSON_USE_CPPTL 1
// # define JSON_USE_CPPTL 1
/// If defined, indicates that cpptl vector based map should be used instead of
/// std::map
/// as Value container.
//# define JSON_USE_CPPTL_SMALLMAP 1
// # define JSON_USE_CPPTL_SMALLMAP 1

// If non-zero, the library uses exceptions to report bad input instead of C
// assertion macros. The default is to use exceptions.
Expand Down
22 changes: 11 additions & 11 deletions Source/JSON/json.h
Expand Up @@ -116,14 +116,14 @@ license you like.
#define JSON_CONFIG_H_INCLUDED

/// If defined, indicates that json library is embedded in CppTL library.
//# define JSON_IN_CPPTL 1
// # define JSON_IN_CPPTL 1

/// If defined, indicates that json may leverage CppTL library
//# define JSON_USE_CPPTL 1
// # define JSON_USE_CPPTL 1
/// If defined, indicates that cpptl vector based map should be used instead of
/// std::map
/// as Value container.
//# define JSON_USE_CPPTL_SMALLMAP 1
// # define JSON_USE_CPPTL_SMALLMAP 1

// If non-zero, the library uses exceptions to report bad input instead of C
// assertion macros. The default is to use exceptions.
Expand Down Expand Up @@ -428,10 +428,10 @@ enum CommentPlacement {
numberOfCommentPlacement
};

//# ifdef JSON_USE_CPPTL
// typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;
// typedef CppTL::AnyEnumerator<const Value &> EnumValues;
//# endif
// # ifdef JSON_USE_CPPTL
// typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;
// typedef CppTL::AnyEnumerator<const Value &> EnumValues;
// # endif

/** \brief Lightweight wrapper to tag static string.
*
Expand Down Expand Up @@ -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.")
Expand Down
4 changes: 2 additions & 2 deletions Source/JSON/jsoncpp.cpp
Expand Up @@ -3306,7 +3306,7 @@ Value::Members Value::getMemberNames() const {
return members;
}
//
//# ifdef JSON_USE_CPPTL
// # ifdef JSON_USE_CPPTL
// EnumMemberNames
// Value::enumMemberNames() const
//{
Expand All @@ -3329,7 +3329,7 @@ Value::Members Value::getMemberNames() const {
// return EnumValues();
//}
//
//# endif
// # endif

static bool IsIntegral(double d) {
double integral_part;
Expand Down
6 changes: 3 additions & 3 deletions Source/Main/engine.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion Source/Main/scenegraph.cpp
Expand Up @@ -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]);
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Physics/bulletworld.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Source/Scripting/angelscript/asmodule.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Source/Sound/sound.cpp
Expand Up @@ -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),
Expand Down

0 comments on commit 01862b6

Please sign in to comment.