]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Convert some enums to static macros
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 27 Oct 2018 17:55:44 +0000 (18:55 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 27 Oct 2018 17:55:44 +0000 (18:55 +0100)
contrib/librdns/rdns.h
src/libcryptobox/blake2/blake2.h
src/libcryptobox/chacha20/chacha.h
src/libcryptobox/poly1305/ref-64.c
src/libutil/addr.c

index 8aca1f9f6933de823b282dbf863b855bca923a4c..016903ba600a1be58a2787d491ca8348ceb2a5ec 100644 (file)
@@ -105,7 +105,7 @@ union rdns_reply_element_un {
 
 struct rdns_reply_entry {
        union rdns_reply_element_un content;
-       uint16_t type;
+       enum rdns_request_type type;
        int32_t ttl;
        struct rdns_reply_entry *prev, *next;
 };
index 9966c66d29820fa0f50107035cc6087278f5c5f3..3da1958aeb91d676e49630d7575982bf4f4669c3 100644 (file)
 extern "C" {
 #endif
 
-enum blake2b_constant {
-       BLAKE2B_BLOCKBYTES = 128,
-       BLAKE2B_OUTBYTES = 64,
-       BLAKE2B_KEYBYTES = 64,
-       BLAKE2B_SALTBYTES = 16,
-       BLAKE2B_PERSONALBYTES = 16
-};
+
+#define BLAKE2B_BLOCKBYTES 128
+#define BLAKE2B_OUTBYTES 64
+#define BLAKE2B_KEYBYTES 64
+#define BLAKE2B_SALTBYTES 16
+#define BLAKE2B_PERSONALBYTES 16
+
 
 typedef struct blake2b_state_t {
        unsigned char opaque[256];
index f69a63db980a6e90c9d1236092538f9b10f24c47..7f93a451799550e69efb1290780f09c7bb360fad 100644 (file)
@@ -26,9 +26,8 @@
 #ifndef CHACHA_H_
 #define CHACHA_H_
 
-enum chacha_constants {
-       CHACHA_BLOCKBYTES = 64,
-};
+
+#define CHACHA_BLOCKBYTES 64
 
 typedef struct chacha_state_internal_t {
        unsigned char s[48];
index 48d5fbcc6b91d2f4e242434999066e0d00e553c5..cceb1476d07e716da3cf7c80e3868c4a91142c38 100644 (file)
@@ -7,9 +7,8 @@
 #include "config.h"
 #include "poly1305.h"
 #include "poly1305_internal.h"
-enum {
-       POLY1305_BLOCK_SIZE = 16
-};
+
+#define POLY1305_BLOCK_SIZE 16
 
 typedef struct poly1305_state_ref_t {
        uint64_t r[3];
index a6f1adaf8b1d17807ea7906c75ae1584bab041a6..5cbc1c0447f8ef32bbad18e87ceb535ccfa585eb 100644 (file)
@@ -1055,7 +1055,7 @@ rspamd_inet_address_listen (const rspamd_inet_addr_t *addr, gint type,
                }
        }
 
-       if (type != SOCK_DGRAM) {
+       if (type != (int)SOCK_DGRAM) {
 
                if (addr->af == AF_UNIX) {
                        path = addr->u.un->addr.sun_path;