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/istream.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/istream.h')
-rw-r--r-- | include/wabt/interp/istream.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/wabt/interp/istream.h b/include/wabt/interp/istream.h index 06e1cfca..f8eb6a26 100644 --- a/include/wabt/interp/istream.h +++ b/include/wabt/interp/istream.h @@ -95,7 +95,7 @@ class Istream { public: using SerializedOpcode = u32; // TODO: change to u16 using Offset = u32; - static const Offset kInvalidOffset = ~0; + static constexpr Offset kInvalidOffset = ~0; // Each br_table entry is made up of three instructions: // // interp_drop_keep $drop $keep @@ -103,7 +103,7 @@ class Istream { // br $label // // Each opcode is a SerializedOpcode, and each immediate is a u32. - static const Offset kBrTableEntrySize = + static constexpr Offset kBrTableEntrySize = sizeof(SerializedOpcode) * 3 + 4 * sizeof(u32); // Emit API. |