Skip to content

Commit

Permalink
build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
martinus committed Oct 9, 2023
1 parent ffb2577 commit e6bf24d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
19 changes: 0 additions & 19 deletions test/fuzz/provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,6 @@ class provider {
return static_cast<T>(static_cast<uint64_t>(min) + result);
}

template <typename TS, typename TU>
[[nodiscard]] static auto convert_unsigned_to_signed(TU value) -> TS {
static_assert(sizeof(TS) == sizeof(TU), "Incompatible data types.");
static_assert(!std::numeric_limits<TU>::is_signed, "Source type must be unsigned.");

if constexpr (std::numeric_limits<TS>::is_modulo) {
return static_cast<TS>(value);
} else {

// Avoid using implementation-defined unsigned to signed conversions.
// To learn more, see https://stackoverflow.com/questions/13150449.
if (value <= std::numeric_limits<TS>::max()) {
return static_cast<TS>(value);
}
constexpr auto ts_min = std::numeric_limits<TS>::min();
return static_cast<TS>(ts_min + static_cast<TS>(value - ts_min));
}
}

inline void advance_unchecked(size_t num_bytes) {
m_data += num_bytes;
m_remaining_bytes -= num_bytes;
Expand Down
1 change: 0 additions & 1 deletion test/fuzz/run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ auto env(char const* varname) -> std::optional<std::string> {
}
// could not read file
throw std::runtime_error(fmt::format("could not read '{}'", filename.string()));
return {};
}
if (p == p.root_path()) {
return {};
Expand Down
4 changes: 2 additions & 2 deletions test/unit/fuzz_replace_map.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <ankerl/unordered_dense.h>

#include <app/doctest.h>
#include <fuzz/run.h>

#include <app/doctest.h>
#include <unordered_map>

namespace {

Expand Down

0 comments on commit e6bf24d

Please sign in to comment.