summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRose <83477269+AtariDreams@users.noreply.github.com>2023-05-08 19:02:21 -0400
committerRose <83477269+AtariDreams@users.noreply.github.com>2023-05-08 19:02:21 -0400
commit9dc97f3ab68c4ca1af93bb9d093a5570fe42b20f (patch)
treedfcd68d0c3117d21ab24c17e49a94e40a66ad51f
parentd70e9a2b36a52f673dd35e8492dc862445c3207e (diff)
downloadlibpcap-9dc97f3ab68c4ca1af93bb9d093a5570fe42b20f.tar.gz
Use the intended date types for variables passed as or compared to other types.
-rw-r--r--instrument-functions.c2
-rw-r--r--pcap-bpf.c4
-rw-r--r--pcap-dpdk.c4
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: