diff options
author | James Zern <jzern@google.com> | 2023-03-10 15:00:23 -0800 |
---|---|---|
committer | James Zern <jzern@google.com> | 2023-03-10 15:00:23 -0800 |
commit | b87133b5d8ef3b7a9d1ec97d11480298c7d7cd23 (patch) | |
tree | 812ac0659635f92810c0be52e46ab5d7ab07fe82 | |
parent | 74e23150b9aed960e59c8d570d153a6e94cf122c (diff) | |
download | libwebm-b87133b5d8ef3b7a9d1ec97d11480298c7d7cd23.tar.gz |
Mark static const class/struct members as constexpr.
This change fixes declarations that have initial values but are
technically not definitions by marking them constexpr (which counts as a
definition). This enables, among other things, the modified constants to
be passed into functions and function templates that accept arguments by
reference. Without this change, such functions would cause linker
errors.
Change-Id: Id8798c69270f053ae29b02bef4c9fee616e2b17c
PiperOrigin-RevId: 307129442
-rw-r--r-- | mkvmuxer/mkvmuxer.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mkvmuxer/mkvmuxer.h b/mkvmuxer/mkvmuxer.h index f2db377..94773df 100644 --- a/mkvmuxer/mkvmuxer.h +++ b/mkvmuxer/mkvmuxer.h @@ -1425,7 +1425,7 @@ class SeekHead { bool Write(IMkvWriter* writer); // We are going to put a cap on the number of Seek Entries. - const static int32_t kSeekEntryCount = 5; + constexpr static int32_t kSeekEntryCount = 5; private: // Returns the maximum size in bytes of one seek entry. @@ -1505,8 +1505,8 @@ class Segment { kBeforeClusters = 0x1 // Position Cues before Clusters }; - static const uint32_t kDefaultDocTypeVersion = 4; - static const uint64_t kDefaultMaxClusterDuration = 30000000000ULL; + static constexpr uint32_t kDefaultDocTypeVersion = 4; + static constexpr uint64_t kDefaultMaxClusterDuration = 30000000000ULL; Segment(); ~Segment(); |