Skip to content

Commit

Permalink
meta: Enable some clang-tidy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
yeetari committed Feb 11, 2024
1 parent b08e128 commit 801c508
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
18 changes: 18 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ Checks: >
bugprone-copy-constructor-init,
bugprone-dangling-handle,
bugprone-dynamic-static-initializers,
bugprone-empty-catch,
bugprone-exception-escape,
bugprone-fold-init-type,
bugprone-forward-declaration-namespace,
bugprone-forwarding-reference-overload,
bugprone-implicit-widening-of-multiplication-result,
bugprone-inaccurate-erase,
bugprone-incorrect-roundings,
bugprone-infinite-loop,
Expand All @@ -24,24 +26,32 @@ Checks: >
bugprone-misplaced-pointer-arithmetic-in-alloc,
bugprone-misplaced-widening-cast,
bugprone-move-forwarding-reference,
bugprone-multiple-new-in-one-expression,
bugprone-multiple-statement-macro,
bugprone-no-escape,
bugprone-non-zero-enum-to-bool-conversion,
bugprone-not-null-terminated-result,
bugprone-parent-virtual-call,
bugprone-posix-return,
bugprone-redundant-branch-condition,
bugprone-reserved-identifier,
bugprone-shared-ptr-array-mismatch,
bugprone-signal-handler,
bugprone-signed-char-misuse,
bugprone-sizeof-container,
bugprone-sizeof-expression,
bugprone-spuriously-wake-up-functions,
bugprone-standalone-empty,
bugprone-string-constructor,
bugprone-string-integer-assignment,
bugprone-string-literal-with-embedded-nul,
bugprone-stringview-nullptr,
bugprone-suspicious-enum-usage,
bugprone-suspicious-include,
bugprone-suspicious-memory-comparison,
bugprone-suspicious-memset-usage,
bugprone-suspicious-missing-comma,
bugprone-suspicious-realloc-usage,
bugprone-suspicious-semicolon,
bugprone-suspicious-string-compare,
bugprone-swapped-arguments,
Expand All @@ -51,6 +61,8 @@ Checks: >
bugprone-undefined-memory-manipulation,
bugprone-undelegated-constructor,
bugprone-unhandled-self-assignment,
bugprone-unique-ptr-array-mismatch,
bugprone-unsafe-functions,
bugprone-unused-raii,
bugprone-unused-return-value,
bugprone-use-after-move,
Expand All @@ -77,6 +89,9 @@ Checks: >
llvm-include-order,
llvm-namespace-comment,
misc-definitions-in-headers,
misc-header-include-cycle,
misc-misleading-bidirectional,
misc-misleading-identifier,
misc-new-delete-overloads,
misc-non-copyable-objects,
misc-redundant-expression,
Expand All @@ -101,6 +116,7 @@ Checks: >
modernize-replace-random-shuffle,
modernize-return-braced-init-list,
modernize-shrink-to-fit,
modernize-type-traits,
modernize-unary-static-assert,
modernize-use-auto,
modernize-use-bool-literals,
Expand Down Expand Up @@ -166,5 +182,7 @@ Checks: >
FormatStyle: file
CheckOptions:
bugprone-assert-side-effect.AssertMacros: VULL_ASSERT,VULL_ASSERT_PEDANTIC
bugprone-implicit-widening-of-multiplication-result.UseCXXHeadersInCppSources: false
bugprone-sizeof-expression.WarnOnSizeOfPointerToAggregate: false
performance-unnecessary-value-param.AllowedTypes: Optional
readability-uppercase-literal-suffix.NewSuffixes: f;u;l;ul;ull
4 changes: 2 additions & 2 deletions engine/sources/graphics/skybox_renderer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ void SkyboxRenderer::build_pass(vk::RenderGraph &graph, vk::ResourceId &depth_im

void SkyboxRenderer::load(Stream &stream) {
const auto pixel_count = 1024 * 1024 * 6;
auto staging_buffer =
m_context.create_buffer(pixel_count * 4, vkb::BufferUsage::TransferSrc, vk::MemoryUsage::HostOnly);
auto staging_buffer = m_context.create_buffer(static_cast<vkb::DeviceSize>(pixel_count) * 4,
vkb::BufferUsage::TransferSrc, vk::MemoryUsage::HostOnly);
auto *staging_data = staging_buffer.mapped<uint8_t>();
for (uint32_t i = 0; i < pixel_count; i++) {
VULL_EXPECT(stream.read({staging_data, 3}));
Expand Down
4 changes: 2 additions & 2 deletions engine/sources/vulkan/allocator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ constexpr uint32_t k_fl_offset = k_sl_count_log2 + k_align_log2;
constexpr uint32_t k_fl_count = k_sl_count - k_fl_offset + 1u;
constexpr uint32_t k_minimum_allocation_size = 1u << k_align_log2;

constexpr vkb::DeviceSize k_big_heap_size = 128 * 1024 * 1024;
constexpr vkb::DeviceSize k_small_heap_cutoff = 1024 * 1024 * 1024;
constexpr auto k_big_heap_size = vkb::DeviceSize(128) * 1024 * 1024;
constexpr auto k_small_heap_cutoff = vkb::DeviceSize(1024) * 1024 * 1024;

struct Block {
Block *prev_free;
Expand Down

0 comments on commit 801c508

Please sign in to comment.