From 3597772a08cab7c35ed1057afbb03402bd68964c Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Tue, 8 Jun 2021 13:39:20 -0700 Subject: [PATCH] TMXR, ETHER: Silence potential compiler warnings --- sim_ether.c | 7 ++++--- sim_tmxr.c | 10 ++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/sim_ether.c b/sim_ether.c index 98f179fd..18241831 100644 --- a/sim_ether.c +++ b/sim_ether.c @@ -868,7 +868,7 @@ char* eth_getdesc_byname(char* name, char* temp) static ETH_DEV **eth_open_devices = NULL; static int eth_open_device_count = 0; -static char* (*p_pcap_lib_version) (void); +static char *(*p_pcap_lib_version) (void); static void _eth_add_to_open_list (ETH_DEV* dev) { @@ -1046,12 +1046,13 @@ typedef void * pcap_t; /* Pseudo Type to avoid compiler errors */ */ static int eth_host_pcap_devices(int used, int max, ETH_LIST* list) { -pcap_t* conn = NULL; -int i, j, datalink = 0; +int i; for (i=0; i 0 && idx <= max) /* then if some lines are restrictied or unspecified */ - for (line = (uint32) min; line <= max; line++) /* then fill them in sequentially */ + if ((val != 0) || ((idx > 0) && (idx <= max))) /* then if some lines are restrictied or unspecified */ + for (line = (uint32)min; line <= (uint32)max; line++)/* then fill them in sequentially */ if (set [line] == FALSE) /* setting each unspecified line */ list [idx++] = line; /* into the line order */ @@ -5268,13 +5268,15 @@ while (*cptr != '\0') { /* while characters break; /* and terminate the parse */ } - else if (low < min || low > max || high > max) { /* otherwise if the line number is invalid */ + else if ((low < min) || + (low > max) || + (high > max)) { /* otherwise if the line number is invalid */ result = SCPE_SUB; /* then report the subscript is out of range */ break; /* and terminate the parse */ } else /* otherwise it's a valid range */ - for (line = (uint32) low; line <= high; line++) /* so add the line(s) to the order */ + for (line = (uint32)low; line <= (uint32)high; line++)/* so add the line(s) to the order */ if (set [line] == FALSE) { /* if the line number has not been specified */ set [line] = TRUE; /* then now it is */ list [idx++] = line; /* and add it to the connection order */