From 9dc97f3ab68c4ca1af93bb9d093a5570fe42b20f Mon Sep 17 00:00:00 2001 From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Mon, 8 May 2023 19:02:21 -0400 Subject: Use the intended date types for variables passed as or compared to other types. --- instrument-functions.c | 2 +- pcap-bpf.c | 4 ++-- pcap-dpdk.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/instrument-functions.c b/instrument-functions.c index 2c1ad332..67bcbd3e 100644 --- a/instrument-functions.c +++ b/instrument-functions.c @@ -77,7 +77,7 @@ static void print_debug(void *this_fn, void *call_site, action_type action) static int instrument_set; static int instrument_off; static int instrument_global; - int i; + long i; if (!instrument_set) { static char *instrument_type; diff --git a/pcap-bpf.c b/pcap-bpf.c index 92e73adf..f8d10833 100644 --- a/pcap-bpf.c +++ b/pcap-bpf.c @@ -1061,7 +1061,7 @@ static int pcap_read_bpf(pcap_t *p, int cnt, pcap_handler callback, u_char *user) { struct pcap_bpf *pb = p->priv; - int cc; + ssize_t cc; int n = 0; register u_char *bp, *ep; u_char *datap; @@ -1107,7 +1107,7 @@ pcap_read_bpf(pcap_t *p, int cnt, pcap_handler callback, u_char *user) } else #endif { - cc = (int)read(p->fd, p->buffer, p->bufsize); + cc = read(p->fd, p->buffer, p->bufsize); } if (cc < 0) { /* Don't choke when we get ptraced */ diff --git a/pcap-dpdk.c b/pcap-dpdk.c index 025a6748..844db652 100644 --- a/pcap-dpdk.c +++ b/pcap-dpdk.c @@ -529,8 +529,8 @@ static void eth_addr_str(ETHER_ADDR_TYPE *addrp, char* mac_str, int len) static uint16_t portid_by_device(char * device) { uint16_t ret = DPDK_PORTID_MAX; - int len = strlen(device); - int prefix_len = strlen(DPDK_PREFIX); + size_t len = strlen(device); + size_t prefix_len = strlen(DPDK_PREFIX); unsigned long ret_ul = 0L; char *pEnd; if (len<=prefix_len || strncmp(device, DPDK_PREFIX, prefix_len)) // check prefix dpdk: -- cgit v1.2.1