mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 01:58:20 +00:00
Type, util: add constexpr
to static variables
This allows the compiler to move them to section `.rodata`.
This commit is contained in:
parent
2694b4e2c8
commit
aacf84e552
2 changed files with 2 additions and 2 deletions
|
@ -19,7 +19,7 @@ BroType::TypeAliasMap BroType::type_aliases;
|
|||
// Note: This function must be thread-safe.
|
||||
const char* type_name(TypeTag t)
|
||||
{
|
||||
static const char* type_names[int(NUM_TYPES)] = {
|
||||
static constexpr const char* type_names[int(NUM_TYPES)] = {
|
||||
"void", // 0
|
||||
"bool", // 1
|
||||
"int", // 2
|
||||
|
|
|
@ -612,7 +612,7 @@ TEST_CASE("util uitoa_n")
|
|||
|
||||
char* uitoa_n(uint64_t value, char* str, int n, int base, const char* prefix)
|
||||
{
|
||||
static char dig[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
static constexpr char dig[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
|
||||
assert(n);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue