]> The Tcpdump Group git mirrors - libpcap/commitdiff
Use the intended date types for variables passed as or compared to other types. 1180/head
authorRose <[email protected]>
Mon, 8 May 2023 23:02:21 +0000 (19:02 -0400)
committerRose <[email protected]>
Mon, 8 May 2023 23:02:21 +0000 (19:02 -0400)
instrument-functions.c
pcap-bpf.c
pcap-dpdk.c

index 2c1ad3325bce1a468867e83fcc22a573b7ea432b..67bcbd3ee813336347fa4257d37ea607408d882a 100644 (file)
@@ -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;
index 92e73adff6c41493b4c114284f0aac2d589230da..f8d1083334509c442d5be26605991efd4ea795e9 100644 (file)
@@ -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 */
index 025a67482c0fafcc03638ea9baaf1011a7d84c77..844db652499a1e55d62c792f773cff99d6b57fc0 100644 (file)
@@ -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: