Skip to content

Commit df6bbb1

Browse files
committed
clang-tidy modernize-macro-to-enum fix
1 parent d03e115 commit df6bbb1

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

src/dns_server.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
#include "dns_server.h"
1111
#include "logging.h"
1212

13+
14+
enum {
15+
REQUEST_MAX = 1500 // A default MTU. We don't do TCP so any bigger is likely a waste
16+
};
17+
18+
1319
// Creates and bind a listening UDP socket for incoming requests.
1420
static int get_listen_sock(const char *listen_addr, int listen_port,
1521
unsigned int *addrlen) {
@@ -51,9 +57,6 @@ static int get_listen_sock(const char *listen_addr, int listen_port,
5157
return sock;
5258
}
5359

54-
// A default MTU. We don't do TCP so any bigger is likely a waste.
55-
#define REQUEST_MAX 1500
56-
5760
static void watcher_cb(struct ev_loop __attribute__((unused)) *loop,
5861
ev_io *w, int __attribute__((unused)) revents) {
5962
dns_server_t *d = (dns_server_t *)w->data;

src/https_client.c

100755100644
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
#include "options.h"
1414

1515
#define DOH_CONTENT_TYPE "application/dns-message"
16-
#define DOH_MAX_RESPONSE_SIZE 65535
16+
enum {
17+
DOH_MAX_RESPONSE_SIZE = 65535
18+
};
1719

1820
// the following macros require to have ctx pointer to https_fetch_ctx structure
1921
// else: compilation failure will occur

src/options.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
#define O_CLOEXEC 0
1616
#endif
1717

18-
#define DEFAULT_HTTP_VERSION 2
18+
enum {
19+
DEFAULT_HTTP_VERSION = 2
20+
};
1921

2022

2123
const char * options_sw_version() {

0 commit comments

Comments
 (0)