diff options
author | Rose <83477269+AtariDreams@users.noreply.github.com> | 2023-05-08 19:02:21 -0400 |
---|---|---|
committer | Rose <83477269+AtariDreams@users.noreply.github.com> | 2023-05-08 19:02:21 -0400 |
commit | 9dc97f3ab68c4ca1af93bb9d093a5570fe42b20f (patch) | |
tree | dfcd68d0c3117d21ab24c17e49a94e40a66ad51f | |
parent | d70e9a2b36a52f673dd35e8492dc862445c3207e (diff) | |
download | libpcap-9dc97f3ab68c4ca1af93bb9d093a5570fe42b20f.tar.gz |
Use the intended date types for variables passed as or compared to other types.
-rw-r--r-- | instrument-functions.c | 2 | ||||
-rw-r--r-- | pcap-bpf.c | 4 | ||||
-rw-r--r-- | 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; @@ -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: |