forked from Harrm/scale-codec
-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Mismatch of the type for the shifted value with the result type leads to errors for int64_t and uint64_t.
erorr use sufix ul:
static constexpr auto sign_bit = [](size_t num_bytes) -> uint64_t {
return 0x80ul << (num_bytes * 8);
};
static constexpr auto multiplier = [](size_t num_bytes) -> uint64_t {
return 0x1ul << (num_bytes * 8);
};
need use sufix ull:
static constexpr auto sign_bit = [](size_t num_bytes) -> uint64_t {
return 0x80ull << (num_bytes * 8);
};
static constexpr auto multiplier = [](size_t num_bytes) -> uint64_t {
return 0x1ull << (num_bytes * 8);
};
additionally, for correct use macros OUTCOME_TRY with different compilers, you need to add a keyword auto before variable name.
For smarter compilers:
OUTCOME_TRY(var_name ...)
For less smart compilers need add auto before variable name
OUTCOME_TRY(auto var_name ...)
Metadata
Metadata
Assignees
Labels
No labels