diff options
author | Sam Clegg <sbc@chromium.org> | 2022-11-15 08:54:09 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-15 08:54:09 -0800 |
commit | d3e4ab30720c48d0c019fa521d70362b1bdd2bae (patch) | |
tree | 1a7a5f0d0e80b4c33038ae63c7362518f5a18f88 /include/wabt/interp/interp.h | |
parent | f7a3ab3f33c9119d1dffaa0c642436049e2a21d3 (diff) | |
download | wabt-d3e4ab30720c48d0c019fa521d70362b1bdd2bae.tar.gz wabt-d3e4ab30720c48d0c019fa521d70362b1bdd2bae.tar.bz2 wabt-d3e4ab30720c48d0c019fa521d70362b1bdd2bae.zip |
Prefer `constexpr` over `static const`. NFC (#2065)
IIUC this is preferred in modern C++ and expresses indent better.
Diffstat (limited to 'include/wabt/interp/interp.h')
-rw-r--r-- | include/wabt/interp/interp.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/wabt/interp/interp.h b/include/wabt/interp/interp.h index 6d4a6a01..bb3cf487 100644 --- a/include/wabt/interp/interp.h +++ b/include/wabt/interp/interp.h @@ -96,7 +96,7 @@ enum class ObjectKind { Last = Instance, }; -static const int kCommandTypeCount = WABT_ENUM_COUNT(ObjectKind); +constexpr int kCommandTypeCount = WABT_ENUM_COUNT(ObjectKind); const char* GetName(Mutability); const std::string GetName(ValueType); @@ -119,7 +119,7 @@ using RefVec = std::vector<Ref>; template <typename T, u8 L> struct Simd { using LaneType = T; - static const u8 lanes = L; + static constexpr u8 lanes = L; T v[L]; @@ -1086,8 +1086,8 @@ enum class RunResult { class Thread { public: struct Options { - static const u32 kDefaultValueStackSize = 64 * 1024 / sizeof(Value); - static const u32 kDefaultCallStackSize = 64 * 1024 / sizeof(Frame); + static constexpr u32 kDefaultValueStackSize = 64 * 1024 / sizeof(Value); + static constexpr u32 kDefaultCallStackSize = 64 * 1024 / sizeof(Frame); u32 value_stack_size = kDefaultValueStackSize; u32 call_stack_size = kDefaultCallStackSize; |