From f331887b7fb609b299dbb0eff2b2eb4a665ce0fb Mon Sep 17 00:00:00 2001 From: Malcolm Robb Date: Sat, 22 Feb 2014 22:20:25 +0000 Subject: [PATCH] antirez Constant replaced with macro MODES_NET_SERVICES_NUM. --- dump1090.h | 1 + net_io.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dump1090.h b/dump1090.h index 6099c91..24d971b 100644 --- a/dump1090.h +++ b/dump1090.h @@ -163,6 +163,7 @@ #define MODES_INTERACTIVE_DELETE_TTL 300 // Delete from the list after 300 seconds #define MODES_INTERACTIVE_DISPLAY_TTL 60 // Delete from display after 60 seconds +#define MODES_NET_SERVICES_NUM 6 #define MODES_NET_MAX_FD 1024 #define MODES_NET_INPUT_RAW_PORT 30001 #define MODES_NET_OUTPUT_RAW_PORT 30002 diff --git a/net_io.c b/net_io.c index 3c96aa6..a0a9838 100644 --- a/net_io.c +++ b/net_io.c @@ -51,7 +51,7 @@ void modesInitNet(void) { char *descr; int *socket; int port; - } services[6] = { + } 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}, {"Beast TCP output", &Modes.bos, Modes.net_output_beast_port}, @@ -64,7 +64,7 @@ void modesInitNet(void) { memset(Modes.clients,0,sizeof(Modes.clients)); Modes.maxfd = -1; - for (j = 0; j < 6; 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",