diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2023-02-13 17:04:25 +0100 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2023-02-13 17:04:25 +0100 |
commit | 90371aba592ff8153762036e2b0d5bd723af4a7d (patch) | |
tree | d100ba5a54792617feaecc567b04554e447c399f | |
parent | 94392eaddf51af04621f46337b392c688171434f (diff) | |
download | ATCD-90371aba592ff8153762036e2b0d5bd723af4a7d.tar.gz |
Generate some parts as constexpr
* ACE/apps/gperf/src/Key_List.cpp:
-rw-r--r-- | ACE/apps/gperf/src/Key_List.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ACE/apps/gperf/src/Key_List.cpp b/ACE/apps/gperf/src/Key_List.cpp index 1d02a425acb..edfc738a947 100644 --- a/ACE/apps/gperf/src/Key_List.cpp +++ b/ACE/apps/gperf/src/Key_List.cpp @@ -501,7 +501,6 @@ Key_List::reorder () // Outputs the maximum and minimum hash values. Since the list is // already sorted by hash value all we need to do is find the final // item! - void Key_List::output_min_max () { @@ -817,7 +816,7 @@ Key_List::output_keyword_table () int pointer_and_type_enabled = option[POINTER] && option[TYPE]; ACE_OS::printf ("%sstatic %s%swordlist[] =\n%s%s{\n", indent, - option[CONSTANT] || pointer_and_type_enabled == 0 ? "const " : "", + option[CONSTANT] || pointer_and_type_enabled == 0 ? "constexpr " : "", struct_tag, indent, indent); @@ -1145,7 +1144,7 @@ Key_List::output_hash_function () // Generate the asso_values table. ACE_OS::printf (" static %sunsigned %s asso_values[] =\n {", - option[CONSTANT] ? "const " : "", + option[CONSTANT] ? "constexpr " : "", max_hash_value < ((int) UCHAR_MAX) ? "char" : (max_hash_value < ((int) USHRT_MAX) ? "short" : "int")); #if ACE_STANDARD_CHARACTER_SET_SIZE == ACE_EBCDIC_SIZE @@ -1443,7 +1442,7 @@ Key_List::output_lookup_array () const char *indent = option[GLOBAL] ? "" : " "; - ACE_OS::printf ("%sstatic %ssigned %s lookup[] =\n%s%s{\n%s", indent, option[CONSTANT] ? "const " : "", + ACE_OS::printf ("%sstatic %ssigned %s lookup[] =\n%s%s{\n%s", indent, option[CONSTANT] ? "constexpr " : "", max <= SCHAR_MAX ? "char" : (max <= SHRT_MAX ? "short" : "int"), indent, indent, option[DEBUGGING] ? "" : " "); |