From dfb607c80700f1735a4c5037253bdd79a6f13b31 Mon Sep 17 00:00:00 2001 From: Oliver Hartkopp Date: Mon, 14 Mar 2022 18:21:45 +0100 Subject: [PATCH] remove obsolete char pointer casts Signed-off-by: Oliver Hartkopp --- cangw.c | 2 +- cansniffer.c | 4 ++-- isotpdump.c | 8 ++++---- isotpperf.c | 8 ++++---- isotprecv.c | 12 ++++++------ isotpsend.c | 10 +++++----- isotpserver.c | 14 +++++++------- isotpsniffer.c | 8 ++++---- isotptun.c | 12 ++++++------ 9 files changed, 39 insertions(+), 39 deletions(-) diff --git a/cangw.c b/cangw.c index 6369a9f..f7a6678 100644 --- a/cangw.c +++ b/cangw.c @@ -774,7 +774,7 @@ int main(int argc, char **argv) break; case 'u': - uid = strtoul(optarg, (char **)NULL, 16); + uid = strtoul(optarg, NULL, 16); break; case 'l': diff --git a/cansniffer.c b/cansniffer.c index d4e98f7..5aa5e7a 100644 --- a/cansniffer.c +++ b/cansniffer.c @@ -931,7 +931,7 @@ int readsettings(char* name) done = true; continue; } - unsigned long id = strtoul(&buf[1], (char **)NULL, 16); + unsigned long id = strtoul(&buf[1], NULL, 16); sniftab[idx].current.can_id = id; @@ -942,7 +942,7 @@ int readsettings(char* name) for (j = max_dlen - 1; j >= 0 ; j--) { sniftab[idx].notch.data[j] = - (__u8) strtoul(&buf[2*j+12], (char **)NULL, 16) & 0xFF; + (__u8) strtoul(&buf[2*j+12], NULL, 16) & 0xFF; buf[2*j+12] = 0; /* cut off each time */ } diff --git a/isotpdump.c b/isotpdump.c index 96ad307..d22725e 100644 --- a/isotpdump.c +++ b/isotpdump.c @@ -225,13 +225,13 @@ int main(int argc, char **argv) while ((opt = getopt(argc, argv, "s:d:ax:X:ct:u?")) != -1) { switch (opt) { case 's': - src = strtoul(optarg, (char **)NULL, 16); + src = strtoul(optarg, NULL, 16); if (strlen(optarg) > 7) src |= CAN_EFF_FLAG; break; case 'd': - dst = strtoul(optarg, (char **)NULL, 16); + dst = strtoul(optarg, NULL, 16); if (strlen(optarg) > 7) dst |= CAN_EFF_FLAG; break; @@ -249,7 +249,7 @@ int main(int argc, char **argv) if (!strncmp(optarg, "any", 3)) extany = 1; else - extaddr = strtoul(optarg, (char **)NULL, 16) & 0xFF; + extaddr = strtoul(optarg, NULL, 16) & 0xFF; break; case 'X': @@ -257,7 +257,7 @@ int main(int argc, char **argv) if (!strncmp(optarg, "any", 3)) rx_extany = 1; else - rx_extaddr = strtoul(optarg, (char **)NULL, 16) & 0xFF; + rx_extaddr = strtoul(optarg, NULL, 16) & 0xFF; break; case 't': diff --git a/isotpperf.c b/isotpperf.c index 6252ac9..154d5cd 100644 --- a/isotpperf.c +++ b/isotpperf.c @@ -121,25 +121,25 @@ int main(int argc, char **argv) while ((opt = getopt(argc, argv, "s:d:x:X:?")) != -1) { switch (opt) { case 's': - src = strtoul(optarg, (char **)NULL, 16); + src = strtoul(optarg, NULL, 16); if (strlen(optarg) > 7) src |= CAN_EFF_FLAG; break; case 'd': - dst = strtoul(optarg, (char **)NULL, 16); + dst = strtoul(optarg, NULL, 16); if (strlen(optarg) > 7) dst |= CAN_EFF_FLAG; break; case 'x': ext = 1; - extaddr = strtoul(optarg, (char **)NULL, 16) & 0xFF; + extaddr = strtoul(optarg, NULL, 16) & 0xFF; break; case 'X': rx_ext = 1; - rx_extaddr = strtoul(optarg, (char **)NULL, 16) & 0xFF; + rx_extaddr = strtoul(optarg, NULL, 16) & 0xFF; break; case '?': diff --git a/isotprecv.c b/isotprecv.c index 6b1600b..e07e36a 100644 --- a/isotprecv.c +++ b/isotprecv.c @@ -99,13 +99,13 @@ int main(int argc, char **argv) while ((opt = getopt(argc, argv, "s:d:x:p:P:b:m:w:f:lL:?")) != -1) { switch (opt) { case 's': - addr.can_addr.tp.tx_id = strtoul(optarg, (char **)NULL, 16); + addr.can_addr.tp.tx_id = strtoul(optarg, NULL, 16); if (strlen(optarg) > 7) addr.can_addr.tp.tx_id |= CAN_EFF_FLAG; break; case 'd': - addr.can_addr.tp.rx_id = strtoul(optarg, (char **)NULL, 16); + addr.can_addr.tp.rx_id = strtoul(optarg, NULL, 16); if (strlen(optarg) > 7) addr.can_addr.tp.rx_id |= CAN_EFF_FLAG; break; @@ -163,20 +163,20 @@ int main(int argc, char **argv) break; case 'b': - fcopts.bs = strtoul(optarg, (char **)NULL, 16) & 0xFF; + fcopts.bs = strtoul(optarg, NULL, 16) & 0xFF; break; case 'm': - fcopts.stmin = strtoul(optarg, (char **)NULL, 16) & 0xFF; + fcopts.stmin = strtoul(optarg, NULL, 16) & 0xFF; break; case 'w': - fcopts.wftmax = strtoul(optarg, (char **)NULL, 16) & 0xFF; + fcopts.wftmax = strtoul(optarg, NULL, 16) & 0xFF; break; case 'f': opts.flags |= CAN_ISOTP_FORCE_RXSTMIN; - force_rx_stmin = strtoul(optarg, (char **)NULL, 10); + force_rx_stmin = strtoul(optarg, NULL, 10); break; case 'l': diff --git a/isotpsend.c b/isotpsend.c index 642fd70..ef3d19d 100644 --- a/isotpsend.c +++ b/isotpsend.c @@ -104,13 +104,13 @@ int main(int argc, char **argv) while ((opt = getopt(argc, argv, "s:d:x:p:P:t:f:D:l:g:bSL:?")) != -1) { switch (opt) { case 's': - addr.can_addr.tp.tx_id = strtoul(optarg, (char **)NULL, 16); + addr.can_addr.tp.tx_id = strtoul(optarg, NULL, 16); if (strlen(optarg) > 7) addr.can_addr.tp.tx_id |= CAN_EFF_FLAG; break; case 'd': - addr.can_addr.tp.rx_id = strtoul(optarg, (char **)NULL, 16); + addr.can_addr.tp.rx_id = strtoul(optarg, NULL, 16); if (strlen(optarg) > 7) addr.can_addr.tp.rx_id |= CAN_EFF_FLAG; break; @@ -171,16 +171,16 @@ int main(int argc, char **argv) if (!strncmp(optarg, ZERO_STRING, strlen(ZERO_STRING))) opts.frame_txtime = CAN_ISOTP_FRAME_TXTIME_ZERO; else - opts.frame_txtime = strtoul(optarg, (char **)NULL, 10); + opts.frame_txtime = strtoul(optarg, NULL, 10); break; case 'f': opts.flags |= CAN_ISOTP_FORCE_TXSTMIN; - force_tx_stmin = strtoul(optarg, (char **)NULL, 10); + force_tx_stmin = strtoul(optarg, NULL, 10); break; case 'D': - datalen = strtoul(optarg, (char **)NULL, 10); + datalen = strtoul(optarg, NULL, 10); if (!datalen || datalen >= BUFSIZE) { print_usage(basename(argv[0])); exit(0); diff --git a/isotpserver.c b/isotpserver.c index 5c161d7..6fdb0db 100644 --- a/isotpserver.c +++ b/isotpserver.c @@ -166,17 +166,17 @@ int main(int argc, char **argv) while ((opt = getopt(argc, argv, "l:s:d:x:p:P:b:m:w:t:L:v?")) != -1) { switch (opt) { case 'l': - local_port = strtoul(optarg, (char **)NULL, 10); + local_port = strtoul(optarg, NULL, 10); break; case 's': - caddr.can_addr.tp.tx_id = strtoul(optarg, (char **)NULL, 16); + caddr.can_addr.tp.tx_id = strtoul(optarg, NULL, 16); if (strlen(optarg) > 7) caddr.can_addr.tp.tx_id |= CAN_EFF_FLAG; break; case 'd': - caddr.can_addr.tp.rx_id = strtoul(optarg, (char **)NULL, 16); + caddr.can_addr.tp.rx_id = strtoul(optarg, NULL, 16); if (strlen(optarg) > 7) caddr.can_addr.tp.rx_id |= CAN_EFF_FLAG; break; @@ -234,19 +234,19 @@ int main(int argc, char **argv) break; case 'b': - fcopts.bs = strtoul(optarg, (char **)NULL, 16) & 0xFF; + fcopts.bs = strtoul(optarg, NULL, 16) & 0xFF; break; case 'm': - fcopts.stmin = strtoul(optarg, (char **)NULL, 16) & 0xFF; + fcopts.stmin = strtoul(optarg, NULL, 16) & 0xFF; break; case 'w': - fcopts.wftmax = strtoul(optarg, (char **)NULL, 16) & 0xFF; + fcopts.wftmax = strtoul(optarg, NULL, 16) & 0xFF; break; case 't': - opts.frame_txtime = strtoul(optarg, (char **)NULL, 10); + opts.frame_txtime = strtoul(optarg, NULL, 10); break; case 'L': diff --git a/isotpsniffer.c b/isotpsniffer.c index bdd8211..2b6de40 100644 --- a/isotpsniffer.c +++ b/isotpsniffer.c @@ -200,25 +200,25 @@ int main(int argc, char **argv) while ((opt = getopt(argc, argv, "s:d:x:X:h:ct:f:L:?")) != -1) { switch (opt) { case 's': - src = strtoul(optarg, (char **)NULL, 16); + src = strtoul(optarg, NULL, 16); if (strlen(optarg) > 7) src |= CAN_EFF_FLAG; break; case 'd': - dst = strtoul(optarg, (char **)NULL, 16); + dst = strtoul(optarg, NULL, 16); if (strlen(optarg) > 7) dst |= CAN_EFF_FLAG; break; case 'x': opts.flags |= CAN_ISOTP_EXTEND_ADDR; - opts.ext_address = strtoul(optarg, (char **)NULL, 16) & 0xFF; + opts.ext_address = strtoul(optarg, NULL, 16) & 0xFF; break; case 'X': opts.flags |= CAN_ISOTP_RX_EXT_ADDR; - opts.rx_ext_address = strtoul(optarg, (char **)NULL, 16) & 0xFF; + opts.rx_ext_address = strtoul(optarg, NULL, 16) & 0xFF; break; case 'f': diff --git a/isotptun.c b/isotptun.c index a471025..ee473fd 100644 --- a/isotptun.c +++ b/isotptun.c @@ -154,13 +154,13 @@ int main(int argc, char **argv) while ((opt = getopt(argc, argv, "s:d:n:x:p:P:t:b:m:whL:vD?")) != -1) { switch (opt) { case 's': - addr.can_addr.tp.tx_id = strtoul(optarg, (char **)NULL, 16); + addr.can_addr.tp.tx_id = strtoul(optarg, NULL, 16); if (strlen(optarg) > 7) addr.can_addr.tp.tx_id |= CAN_EFF_FLAG; break; case 'd': - addr.can_addr.tp.rx_id = strtoul(optarg, (char **)NULL, 16); + addr.can_addr.tp.rx_id = strtoul(optarg, NULL, 16); if (strlen(optarg) > 7) addr.can_addr.tp.rx_id |= CAN_EFF_FLAG; break; @@ -228,19 +228,19 @@ int main(int argc, char **argv) break; case 't': - opts.frame_txtime = strtoul(optarg, (char **)NULL, 10); + opts.frame_txtime = strtoul(optarg, NULL, 10); break; case 'b': - fcopts.bs = strtoul(optarg, (char **)NULL, 16) & 0xFF; + fcopts.bs = strtoul(optarg, NULL, 16) & 0xFF; break; case 'm': - fcopts.stmin = strtoul(optarg, (char **)NULL, 16) & 0xFF; + fcopts.stmin = strtoul(optarg, NULL, 16) & 0xFF; break; case 'w': - fcopts.wftmax = strtoul(optarg, (char **)NULL, 16) & 0xFF; + fcopts.wftmax = strtoul(optarg, NULL, 16) & 0xFF; break; case 'h':