summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2022-11-15 08:54:09 -0800
committerGitHub <noreply@github.com>2022-11-15 08:54:09 -0800
commitd3e4ab30720c48d0c019fa521d70362b1bdd2bae (patch)
tree1a7a5f0d0e80b4c33038ae63c7362518f5a18f88 /src
parentf7a3ab3f33c9119d1dffaa0c642436049e2a21d3 (diff)
downloadwabt-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 'src')
-rw-r--r--src/binary-writer.cc2
-rw-r--r--src/test-hexfloat.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/binary-writer.cc b/src/binary-writer.cc
index 93db5b19..41b682a7 100644
--- a/src/binary-writer.cc
+++ b/src/binary-writer.cc
@@ -96,7 +96,7 @@ namespace {
/* TODO(binji): better leb size guess. Some sections we know will only be 1
byte, but others we can be fairly certain will be larger. */
-static const size_t LEB_SECTION_SIZE_GUESS = 1;
+constexpr size_t LEB_SECTION_SIZE_GUESS = 1;
#define ALLOC_FAILURE \
fprintf(stderr, "%s:%d: allocation failed\n", __FILE__, __LINE__)
diff --git a/src/test-hexfloat.cc b/src/test-hexfloat.cc
index 6dba8c06..d732c992 100644
--- a/src/test-hexfloat.cc
+++ b/src/test-hexfloat.cc
@@ -67,7 +67,7 @@ static bool is_infinity_or_nan(uint64_t double_bits) {
class ThreadedTest : public ::testing::Test {
protected:
- static const int kDefaultNumThreads = 2;
+ static constexpr int kDefaultNumThreads = 2;
virtual void SetUp() {
num_threads_ = std::thread::hardware_concurrency();