From eec5a6989f24f2ca7e058ac897aa997ba9f70ced Mon Sep 17 00:00:00 2001 From: antirez Date: Sat, 14 Dec 2013 22:38:39 +0100 Subject: [PATCH] Constant replaced with macro MODES_NET_SERVICES_NUM. --- dump1090.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dump1090.c b/dump1090.c index 72c2201..ad179d3 100644 --- a/dump1090.c +++ b/dump1090.c @@ -1894,12 +1894,13 @@ void snipMode(int level) { */ /* Networking "stack" initialization. */ +#define MODES_NET_SERVICES_NUM 4 void modesInitNet(void) { struct { char *descr; int *socket; int port; - } services[4] = { + } services[MODES_NET_SERVICES_NUM] = { {"Raw TCP output", &Modes.ros, Modes.net_output_raw_port}, {"Raw TCP input", &Modes.ris, Modes.net_input_raw_port}, {"HTTP server", &Modes.https, Modes.net_http_port}, @@ -1910,7 +1911,7 @@ void modesInitNet(void) { memset(Modes.clients,0,sizeof(Modes.clients)); Modes.maxfd = -1; - for (j = 0; j < 4; j++) { + for (j = 0; j < MODES_NET_SERVICES_NUM; j++) { int s = anetTcpServer(Modes.aneterr, services[j].port, NULL); if (s == -1) { fprintf(stderr, "Error opening the listening port %d (%s): %s\n",