Skip to content

Commit

Permalink
Adjust clang-tidy configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Dec 20, 2021
1 parent ad4c060 commit 9a6831a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
9 changes: 8 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# TODO: The bugprone-implicit-widening-of-multiplication-result is nice,
# but current implementation is over-pedantic.
# See https://github.com/llvm/llvm-project/issues/52806.

Checks: >
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
cert-*,
-cert-err58-cpp,
clang-analyzer-*,
Expand All @@ -15,11 +21,12 @@ Checks: >
readability-*,
-readability-braces-around-statements,
-readability-else-after-return,
-readability-function-cognitive-complexity,
-readability-implicit-bool-conversion,
-readability-magic-numbers,
-readability-named-parameter,
-readability-qualified-auto,
-readability-uppercase-literal-suffix,
WarningsAsErrors: '*'
FormatStyle: file
FormatStyle: file
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES Clang)
-Wno-double-promotion
-Wno-float-equal
-Wno-padded
-Wno-return-std-move-in-c++11
-Wno-switch-enum
)
endif()
Expand Down
2 changes: 1 addition & 1 deletion lib/fizzy/instantiate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ std::tuple<bytes_ptr, Limits> allocate_memory(const std::vector<Memory>& module_
}

// NOTE: fill it with zeroes
bytes_ptr memory{new bytes(memory_min * PageSize, 0), bytes_delete};
bytes_ptr memory{new bytes(uint32_t{memory_min * PageSize}, 0), bytes_delete};
return {std::move(memory), module_memories[0].limits};
}
else if (imported_memories.size() == 1)
Expand Down
2 changes: 1 addition & 1 deletion test/bench_internal/parser_benchmarks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ static void parse_string(benchmark::State& state)

state.SetItemsProcessed(static_cast<int64_t>(size));
}
BENCHMARK(parse_string)->RangeMultiplier(2)->Range(16, 4 * 1024);
BENCHMARK(parse_string)->RangeMultiplier(2)->Range(16, 4096);
4 changes: 2 additions & 2 deletions test/utils/typed_value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
namespace fizzy::test
{
/// Creates uint64_t value with intention to map it to i64 WebAssembly type.
inline constexpr uint64_t operator"" _u64(unsigned long long x)
inline constexpr uint64_t operator""_u64(unsigned long long x)
{
return uint64_t{x}; // Guarantees lossless conversion if needed.
}

/// Creates uint32_t value with intention to map it to i32 WebAssembly type.
inline constexpr uint32_t operator"" _u32(unsigned long long x)
inline constexpr uint32_t operator""_u32(unsigned long long x)
{
const auto v = static_cast<uint32_t>(x);
if (v != x)
Expand Down
2 changes: 1 addition & 1 deletion test/utils/wasm3_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ WasmEngine::Result Wasm3Engine::execute(
{
unsigned ret_valid;
uint64_t ret_value;
IM3Function function = reinterpret_cast<IM3Function>(func_ref);
auto function = reinterpret_cast<IM3Function>(func_ref); // NOLINT(performance-no-int-to-ptr)
auto const result = m3_CallProper(
function, static_cast<uint32_t>(args.size()), args.data(), &ret_valid, &ret_value);
if (result == m3Err_none)
Expand Down

0 comments on commit 9a6831a

Please sign in to comment.