mirror of
https://passt.top/passt
synced 2025-05-30 12:55:42 +02:00
treewide: Make a bunch of pointer variables pointers to const
Sufficiently recent cppcheck (I'm using 2.13.0) seems to have added another warning for pointer variables which could be pointer to const but aren't. Use this to make a bunch of variables const pointers where they previously weren't for no particular reason. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
f60c85194b
commit
a179ca6707
11 changed files with 41 additions and 34 deletions
12
tap.c
12
tap.c
|
@ -600,10 +600,10 @@ static int tap4_handler(struct ctx *c, const struct pool *in,
|
|||
resume:
|
||||
for (seq_count = 0, seq = NULL; i < in->count; i++) {
|
||||
size_t l2_len, l3_len, hlen, l4_len;
|
||||
struct ethhdr *eh;
|
||||
const struct ethhdr *eh;
|
||||
const struct udphdr *uh;
|
||||
struct iphdr *iph;
|
||||
struct udphdr *uh;
|
||||
char *l4h;
|
||||
const char *l4h;
|
||||
|
||||
packet_get(in, i, 0, 0, &l2_len);
|
||||
|
||||
|
@ -765,9 +765,9 @@ resume:
|
|||
for (seq_count = 0, seq = NULL; i < in->count; i++) {
|
||||
size_t l4_len, plen, check;
|
||||
struct in6_addr *saddr, *daddr;
|
||||
const struct ethhdr *eh;
|
||||
const struct udphdr *uh;
|
||||
struct ipv6hdr *ip6h;
|
||||
struct ethhdr *eh;
|
||||
struct udphdr *uh;
|
||||
uint8_t proto;
|
||||
char *l4h;
|
||||
|
||||
|
@ -936,7 +936,7 @@ static void tap_sock_reset(struct ctx *c)
|
|||
void tap_handler_passt(struct ctx *c, uint32_t events,
|
||||
const struct timespec *now)
|
||||
{
|
||||
struct ethhdr *eh;
|
||||
const struct ethhdr *eh;
|
||||
ssize_t n, rem;
|
||||
char *p;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue