Skip to content

Commit 30a5cd2

Browse files
committed
Use smallest usable type (uint8_t) for some enums
1 parent 91011cd commit 30a5cd2

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

src/expire-config.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
* For a full list of authors see the git log.
1111
*/
1212

13+
#include <cstdint>
1314
#include <cstdlib>
1415

15-
enum class expire_mode
16+
enum class expire_mode : uint8_t
1617
{
1718
full_area, // Expire all tiles covered by polygon.
1819
boundary_only, // Expire only tiles covered by polygon boundary.

src/flex-table.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <cassert>
2424
#include <chrono>
2525
#include <cstddef>
26+
#include <cstdint>
2627
#include <future>
2728
#include <limits>
2829
#include <memory>
@@ -35,7 +36,7 @@
3536
* output. This is not a real primary key, because the values are not
3637
* necessarily unique.
3738
*/
38-
enum class flex_table_index_type {
39+
enum class flex_table_index_type : uint8_t {
3940
no_index,
4041
node, // index by node id
4142
way, // index by way id
@@ -57,7 +58,7 @@ class flex_table_t
5758
* Table creation type: interim tables are created as UNLOGGED and with
5859
* autovacuum disabled.
5960
*/
60-
enum class table_type {
61+
enum class table_type : uint8_t {
6162
interim,
6263
permanent
6364
};

src/logging.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
#include <fmt/color.h>
1919

2020
#include <atomic>
21+
#include <cstdint>
2122
#include <cstdio>
2223
#include <utility>
2324

24-
enum class log_level
25+
enum class log_level : uint8_t
2526
{
2627
debug = 1,
2728
info = 2,

src/middle.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <osmium/memory/buffer.hpp>
1414
#include <osmium/osm/entity_bits.hpp>
1515

16+
#include <cstdint>
1617
#include <memory>
1718

1819
#include "osmtypes.hpp"
@@ -171,7 +172,7 @@ class middle_t
171172
}
172173

173174
#ifndef NDEBUG
174-
enum class middle_state
175+
enum class middle_state : uint8_t
175176
{
176177
constructed,
177178
started,

src/options.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
class reprojection;
2323

24-
enum class command_t
24+
enum class command_t : uint8_t
2525
{
2626
help,
2727
version,

0 commit comments

Comments
 (0)