Skip to content

Commit

Permalink
Add more clang-tidy checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisThrasher committed Feb 19, 2024
1 parent 45050eb commit 564de41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
6 changes: 1 addition & 5 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Checks: >
-*,
bugprone-*,
clang-analyzer-*,
concurrency-*,
Expand All @@ -9,13 +8,10 @@ Checks: >
performance-*,
portability-*,
readability-*,
-bugprone-branch-clone,
-bugprone-easily-swappable-parameters,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-type-cstyle-cast,
Expand All @@ -26,7 +22,6 @@ Checks: >
-modernize-use-trailing-return-type,
-performance-no-int-to-ptr,
-readability-braces-around-statements,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-magic-numbers,
Expand All @@ -36,6 +31,7 @@ CheckOptions:
- { key: readability-identifier-naming.NamespaceCase, value: CamelCase }
- { key: readability-identifier-naming.MemberCase, value: camelBack }
- { key: readability-identifier-naming.PrivateMemberCase, value: camelBack }
- { key: readability-function-cognitive-complexity.Threshold, value: 40 }
HeaderFilterRegex: '(./imgui-SFML*)'
WarningsAsErrors: '*'
UseColor: true
13 changes: 7 additions & 6 deletions imgui-SFML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <cstring> // memcpy

#include <algorithm>
#include <array>
#include <memory>
#include <vector>

Expand Down Expand Up @@ -866,12 +867,12 @@ void RenderDrawLists(ImDrawData* draw_data) {
// Backup GL state
GLint last_texture = 0;
glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture);
GLint last_polygon_mode[2];
glGetIntegerv(GL_POLYGON_MODE, last_polygon_mode);
GLint last_viewport[4];
glGetIntegerv(GL_VIEWPORT, last_viewport);
GLint last_scissor_box[4];
glGetIntegerv(GL_SCISSOR_BOX, last_scissor_box);
std::array<GLint, 2> last_polygon_mode{};
glGetIntegerv(GL_POLYGON_MODE, last_polygon_mode.data());
std::array<GLint, 4> last_viewport{};
glGetIntegerv(GL_VIEWPORT, last_viewport.data());
std::array<GLint, 4> last_scissor_box{};
glGetIntegerv(GL_SCISSOR_BOX, last_scissor_box.data());
GLint last_shade_model = 0;
glGetIntegerv(GL_SHADE_MODEL, &last_shade_model);
GLint last_tex_env_mode = 0;
Expand Down

0 comments on commit 564de41

Please sign in to comment.