Skip to content

Commit

Permalink
clangformat
Browse files Browse the repository at this point in the history
  • Loading branch information
vittorioromeo committed May 28, 2024
1 parent 8998d7f commit 28edfb4
Show file tree
Hide file tree
Showing 74 changed files with 2,044 additions and 2,034 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ PointerBindsToType: true
SortIncludes: false
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: "Never"
SpaceBeforeParens: "ControlStatementsExceptControlMacros"
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInParentheses: false
Expand Down
2 changes: 1 addition & 1 deletion include/SSVOpenHexagon/Components/CCustomWall.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class CCustomWall
{
_oldVertexPositions = _vertexPositions;

for(sf::Vector2f& v : _vertexPositions)
for (sf::Vector2f& v : _vertexPositions)
{
v += offset;
}
Expand Down
6 changes: 3 additions & 3 deletions include/SSVOpenHexagon/Components/SpeedData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ struct SpeedData

void update(const ssvu::FT ft) noexcept
{
if(_accel == 0.f)
if (_accel == 0.f)
{
return;
}

_speed += _accel * ft;

if(_speed > _max)
if (_speed > _max)
{
_speed = _max;
_accel *= _pingPong;
}
else if(_speed < _min)
else if (_speed < _min)
{
_speed = _min;
_accel *= _pingPong;
Expand Down
4 changes: 2 additions & 2 deletions include/SSVOpenHexagon/Core/BindControl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ class KeyboardBindControl final : public BindControlBase
const std::vector<ssvs::Input::Combo> combos{
triggerGetter().getCombos()};

for(int i = 0; i < static_cast<int>(combos.size()); ++i)
for (int i = 0; i < static_cast<int>(combos.size()); ++i)
{
if(combos.at(i).getKeys()[int(hardcodedKey) + 1])
if (combos.at(i).getKeys()[int(hardcodedKey) + 1])
{
mFuncClear(i);
}
Expand Down
2 changes: 1 addition & 1 deletion include/SSVOpenHexagon/Core/HexagonGame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ class HexagonGame
{
return Utils::runLuaFunctionIfExists<T, TArgs...>(lua, mName, mArgs...);
}
catch(...)
catch (...)
{
luaExceptionLippincottHandler(mName);
return decltype(Utils::runLuaFunctionIfExists<T, TArgs...>(
Expand Down
4 changes: 2 additions & 2 deletions include/SSVOpenHexagon/Global/Assert.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ namespace hg::Impl {
constexpr const char* assert_code = \
VRM_PP_SEP_TOSTR(" ", VRM_PP_EMPTY(), __VA_ARGS__); \
\
if(!static_cast<bool>(__VA_ARGS__)) [[unlikely]] \
if (!static_cast<bool>(__VA_ARGS__)) [[unlikely]] \
{ \
::hg::Impl::assertionFailure(assert_code, __FILE__, __LINE__); \
} \
} \
while(false)
while (false)

#else

Expand Down
4 changes: 2 additions & 2 deletions include/SSVOpenHexagon/Global/Version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ struct GameVersion
[[nodiscard]] constexpr bool operator<(
const GameVersion& rhs) const noexcept
{
if(major != rhs.major)
if (major != rhs.major)
{
return major < rhs.major;
}

if(minor != rhs.minor)
if (minor != rhs.minor)
{
return minor < rhs.minor;
}
Expand Down
2 changes: 1 addition & 1 deletion include/SSVOpenHexagon/Online/Sodium.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ template <typename T>
std::string result;
result.reserve(sodiumKey.size());

for(const unsigned char c : sodiumKey)
for (const unsigned char c : sodiumKey)
{
result += std::to_string(static_cast<int>(c));
}
Expand Down
6 changes: 3 additions & 3 deletions include/SSVOpenHexagon/SSVUtilsJson/JsonCpp/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#define JSON_FAIL_MESSAGE(message) throw std::runtime_error(message);
#define JSON_ASSERT_MESSAGE(condition, message) \
if(!(condition)) \
if (!(condition)) \
{ \
JSON_FAIL_MESSAGE(message) \
}
Expand Down Expand Up @@ -186,8 +186,8 @@ class Value
}
inline int compare(const Value& other) const
{
if(*this < other) return -1;
if(*this > other) return 1;
if (*this < other) return -1;
if (*this > other) return 1;
return 0;
}
void swap(Value& other);
Expand Down
Loading

0 comments on commit 28edfb4

Please sign in to comment.