Skip to content

Commit

Permalink
Disallow C-style arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisThrasher committed Feb 19, 2024
1 parent 564de41 commit ad4ba7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Checks: >
portability-*,
readability-*,
-bugprone-easily-swappable-parameters,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-pro-bounds-constant-array-index,
Expand All @@ -18,7 +17,6 @@ Checks: >
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-special-member-functions,
-misc-non-private-member-variables-in-classes,
-modernize-avoid-c-arrays,
-modernize-use-trailing-return-type,
-performance-no-int-to-ptr,
-readability-braces-around-statements,
Expand Down
6 changes: 3 additions & 3 deletions imgui-SFML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ struct WindowContext {

bool windowHasFocus;
bool mouseMoved{false};
bool mousePressed[3] = {false};
std::array<bool, 3> mousePressed{};
ImGuiMouseCursor lastCursor{ImGuiMouseCursor_COUNT};

bool touchDown[3] = {false};
std::array<bool, 3> touchDown{};
sf::Vector2i touchPos;

unsigned int joystickId{getConnectedJoystickId()};
Expand Down Expand Up @@ -299,7 +299,7 @@ void ProcessEvent(const sf::Window& window, const sf::Event& event) {
const int button = static_cast<int>(event.mouseButton.button);
if (button >= 0 && button < 3) {
if (event.type == sf::Event::MouseButtonPressed) {
s_currWindowCtx->mousePressed[static_cast<int>(event.mouseButton.button)] =
s_currWindowCtx->mousePressed[static_cast<std::size_t>(event.mouseButton.button)] =
true;
io.AddMouseButtonEvent(button, true);
} else {
Expand Down

0 comments on commit ad4ba7d

Please sign in to comment.