Skip to content

Commit

Permalink
fix constexpr issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldreik committed Jun 9, 2019
1 parent cc5fc03 commit 5e230d6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/fuzzing/named_arg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

template <typename Item1>
void invoke_fmt(const uint8_t* Data, std::size_t Size, int argsize) {
const auto N1 = sizeof(Item1);
constexpr auto N1 = sizeof(Item1);
if (Size <= N1) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions test/fuzzing/one_arg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

template <typename Item>
void invoke_fmt(const uint8_t* Data, std::size_t Size) {
const auto N = sizeof(Item);
constexpr auto N = sizeof(Item);
if (Size <= N) {
return;
}
Expand Down Expand Up @@ -44,7 +44,7 @@ void invoke_fmt(const uint8_t* Data, std::size_t Size) {

void invoke_fmt_time(const uint8_t* Data, std::size_t Size) {
using Item = std::time_t;
const auto N = sizeof(Item);
constexpr auto N = sizeof(Item);
if (Size <= N) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions test/fuzzing/sprintf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ template <> bool assignFromBuf<bool>(const uint8_t* Data, std::size_t Size) {

template <typename Item1, typename Item2>
void invoke_fmt(const uint8_t* Data, std::size_t Size) {
const auto N1 = sizeof(Item1);
const auto N2 = sizeof(Item2);
constexpr auto N1 = sizeof(Item1);
constexpr auto N2 = sizeof(Item2);
static_assert(N1 <= Nmax, "size1 exceeded");
static_assert(N2 <= Nmax, "size2 exceeded");
if (Size <= Nmax + Nmax) {
Expand Down
4 changes: 2 additions & 2 deletions test/fuzzing/two_args.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ constexpr auto Nmax = std::max(sizeof(long double), sizeof(std::intmax_t));

template <typename Item1, typename Item2>
void invoke_fmt(const uint8_t* Data, std::size_t Size) {
const auto N1 = sizeof(Item1);
const auto N2 = sizeof(Item2);
constexpr auto N1 = sizeof(Item1);
constexpr auto N2 = sizeof(Item2);
static_assert(N1 <= Nmax, "size1 exceeded");
static_assert(N2 <= Nmax, "size2 exceeded");
if (Size <= Nmax + Nmax) {
Expand Down

0 comments on commit 5e230d6

Please sign in to comment.