Fix UBSAN warnings about conversions and overflows.
[tinc] / src / compression.h
1 #ifndef TINC_COMPRESSION_H
2 #define TINC_COMPRESSION_H
3
4 typedef enum compression_level_t {
5         COMPRESS_NONE = 0,
6
7         COMPRESS_ZLIB_1 = 1,
8         COMPRESS_ZLIB_2 = 2,
9         COMPRESS_ZLIB_3 = 3,
10         COMPRESS_ZLIB_4 = 4,
11         COMPRESS_ZLIB_5 = 5,
12         COMPRESS_ZLIB_6 = 6,
13         COMPRESS_ZLIB_7 = 7,
14         COMPRESS_ZLIB_8 = 8,
15         COMPRESS_ZLIB_9 = 9,
16
17         COMPRESS_LZO_LO = 10,
18         COMPRESS_LZO_HI = 11,
19
20         COMPRESS_LZ4 = 12,
21
22         COMPRESS_GUARD = INT_MAX, /* ensure that sizeof(compression_level_t) == sizeof(int) */
23 } compression_level_t;
24
25 #endif