From 13f78d96adf52101aa480e8c83d041f62fcfa1c8 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Fri, 3 Aug 2012 08:10:17 +0200 Subject: [PATCH] getdents.2, select_tut.2, atof.3, atoi.3, pthread_create.3, pthread_sigmask.3, rtime.3, setbuf.3, tsearch.3, netlink.7: Remove unneeded casts Reported-by: Jan Engelhardt Signed-off-by: Michael Kerrisk --- man2/getdents.2 | 4 ++-- man2/select_tut.2 | 4 ++-- man3/atof.3 | 4 ++-- man3/atoi.3 | 4 ++-- man3/pthread_create.3 | 4 ++-- man3/pthread_sigmask.3 | 4 ++-- man3/rtime.3 | 6 +++--- man3/setbuf.3 | 4 ++-- man3/tsearch.3 | 4 ++-- man7/netlink.7 | 6 +++--- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/man2/getdents.2 b/man2/getdents.2 index 60d9a11ee..0d61bc6b2 100644 --- a/man2/getdents.2 +++ b/man2/getdents.2 @@ -24,7 +24,7 @@ .\" Modified 22 July 1995 by Michael Chastain : .\" Derived from 'readdir.2'. .\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond -.TH GETDENTS 2 2012-07-13 "Linux" "Linux Programmer's Manual" +.TH GETDENTS 2 2012-08-03 "Linux" "Linux Programmer's Manual" .SH NAME getdents \- get directory entries .SH SYNOPSIS @@ -268,7 +268,7 @@ main(int argc, char *argv[]) (d_type == DT_BLK) ? "block dev" : (d_type == DT_CHR) ? "char dev" : "???"); printf("%4d %10lld %s\\n", d\->d_reclen, - (long long) d\->d_off, (char *) d->d_name); + (long long) d\->d_off, d->d_name); bpos += d\->d_reclen; } } diff --git a/man2/select_tut.2 b/man2/select_tut.2 index 17c74ac9b..d9fb610c2 100644 --- a/man2/select_tut.2 +++ b/man2/select_tut.2 @@ -27,7 +27,7 @@ .\" various other changes .\" 2008-01-26, mtk, substantial changes and rewrites .\" -.TH SELECT_TUT 2 2010-06-10 "Linux" "Linux Programmer's Manual" +.TH SELECT_TUT 2 2012-08-03 "Linux" "Linux Programmer's Manual" .SH NAME select, pselect, FD_CLR, FD_ISSET, FD_SET, FD_ZERO \- synchronous I/O multiplexing @@ -561,7 +561,7 @@ listen_socket(int listen_port) } yes = 1; if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, - (char *) &yes, sizeof(yes)) == \-1) { + &yes, sizeof(yes)) == \-1) { perror("setsockopt"); close(s); return \-1; diff --git a/man3/atof.3 b/man3/atof.3 index f5f53ea7f..029f915e2 100644 --- a/man3/atof.3 +++ b/man3/atof.3 @@ -26,7 +26,7 @@ .\" 386BSD man pages .\" Modified Mon Mar 29 22:39:24 1993, David Metcalfe .\" Modified Sat Jul 24 21:39:22 1993, Rik Faith (faith@cs.unc.edu) -.TH ATOF 3 1993-03-29 "GNU" "Linux Programmer's Manual" +.TH ATOF 3 2012-08-03 "GNU" "Linux Programmer's Manual" .SH NAME atof \- convert a string to a double .SH SYNOPSIS @@ -44,7 +44,7 @@ pointed to by \fInptr\fP to The behavior is the same as .sp .in +4n -strtod(nptr, (char **) NULL); +strtod(nptr, NULL); .in .sp except that diff --git a/man3/atoi.3 b/man3/atoi.3 index 31c35ca07..41a4c599d 100644 --- a/man3/atoi.3 +++ b/man3/atoi.3 @@ -28,7 +28,7 @@ .\" Modified Sat Jul 24 21:38:42 1993, Rik Faith (faith@cs.unc.edu) .\" Modified Sun Dec 17 18:35:06 2000, Joseph S. Myers .\" -.TH ATOI 3 2010-09-20 "GNU" "Linux Programmer's Manual" +.TH ATOI 3 2012-08-03 "GNU" "Linux Programmer's Manual" .SH NAME atoi, atol, atoll, atoq \- convert a string to an integer .SH SYNOPSIS @@ -68,7 +68,7 @@ pointed to by \fInptr\fP to The behavior is the same as .sp .in +4n -strtol(nptr, (char **) NULL, 10); +strtol(nptr, NULL, 10); .in .sp except that diff --git a/man3/pthread_create.3 b/man3/pthread_create.3 index 66190bb7f..42df8591f 100644 --- a/man3/pthread_create.3 +++ b/man3/pthread_create.3 @@ -21,7 +21,7 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.TH PTHREAD_CREATE 3 2012-03-15 "Linux" "Linux Programmer's Manual" +.TH PTHREAD_CREATE 3 2012-08-03 "Linux" "Linux Programmer's Manual" .SH NAME pthread_create \- create a new thread .SH SYNOPSIS @@ -265,7 +265,7 @@ struct thread_info { /* Used as argument to thread_start() */ static void * thread_start(void *arg) { - struct thread_info *tinfo = (struct thread_info *) arg; + struct thread_info *tinfo = arg; char *uargv, *p; printf("Thread %d: top of stack near %p; argv_string=%s\\n", diff --git a/man3/pthread_sigmask.3 b/man3/pthread_sigmask.3 index ffdc6ca94..de78dac7b 100644 --- a/man3/pthread_sigmask.3 +++ b/man3/pthread_sigmask.3 @@ -21,7 +21,7 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.TH PTHREAD_SIGMASK 3 2011-10-16 "Linux" "Linux Programmer's Manual" +.TH PTHREAD_SIGMASK 3 2012-08-03 "Linux" "Linux Programmer's Manual" .SH NAME pthread_sigmask \- examine and change mask of blocked signals .SH SYNOPSIS @@ -92,7 +92,7 @@ Signal handling thread got signal 10 static void * sig_thread(void *arg) { - sigset_t *set = (sigset_t *) arg; + sigset_t *set = arg; int s, sig; for (;;) { diff --git a/man3/rtime.3 b/man3/rtime.3 index e19429e39..c37672a4b 100644 --- a/man3/rtime.3 +++ b/man3/rtime.3 @@ -5,7 +5,7 @@ .\" .\" Slightly polished, aeb, 2003-04-06 .\" -.TH RTIME 3 2010-02-25 "GNU" "Linux Programmer's Manual" +.TH RTIME 3 2012-08-03 "GNU" "Linux Programmer's Manual" .SH NAME rtime \- get time from a remote machine .SH SYNOPSIS @@ -103,10 +103,10 @@ main(void) struct hostent *hent; int ret; - memset((char *) &name, 0, sizeof(name)); + memset(&name, 0, sizeof(name)); sethostent(1); hent = gethostbyname(servername); - memcpy((char *) &name.sin_addr, hent\->h_addr, hent\->h_length); + memcpy(&name.sin_addr, hent\->h_addr, hent\->h_length); ret = rtime(&name, &time1, use_tcp ? NULL : &timeout); if (ret < 0) diff --git a/man3/setbuf.3 b/man3/setbuf.3 index b9d41a91d..49fca4dc7 100644 --- a/man3/setbuf.3 +++ b/man3/setbuf.3 @@ -43,7 +43,7 @@ .\" Correction, 2000-03-03, Andreas Jaeger .\" Added return value for setvbuf, aeb, .\" -.TH SETBUF 3 2008-06-26 "Linux" "Linux Programmer's Manual" +.TH SETBUF 3 2012-08-03 "Linux" "Linux Programmer's Manual" .SH NAME setbuf, setbuffer, setlinebuf, setvbuf \- stream buffering operations .SH SYNOPSIS @@ -145,7 +145,7 @@ The function is exactly equivalent to the call: .PP .in +4n -setvbuf(stream, (char *) NULL, _IOLBF, 0); +setvbuf(stream, NULL, _IOLBF, 0); .in .SH "RETURN VALUE" The function diff --git a/man3/tsearch.3 b/man3/tsearch.3 index bb96740f3..daedc88cf 100644 --- a/man3/tsearch.3 +++ b/man3/tsearch.3 @@ -21,7 +21,7 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.TH TSEARCH 3 2012-06-11 "GNU" "Linux Programmer's Manual" +.TH TSEARCH 3 2012-08-03 "GNU" "Linux Programmer's Manual" .SH NAME tsearch, tfind, tdelete, twalk, tdestroy \- manage a binary tree .SH SYNOPSIS @@ -273,7 +273,7 @@ main(void) srand(time(NULL)); for (i = 0; i < 12; i++) { - ptr = (int *) xmalloc(sizeof(int)); + ptr = xmalloc(sizeof(int)); *ptr = rand() & 0xff; val = tsearch((void *) ptr, &root, compare); if (val == NULL) diff --git a/man7/netlink.7 b/man7/netlink.7 index 2b60fe309..35016a287 100644 --- a/man7/netlink.7 +++ b/man7/netlink.7 @@ -417,10 +417,10 @@ in order to reliably track acknowledgements. .nf struct nlmsghdr *nh; /* The nlmsghdr with payload to send. */ struct sockaddr_nl sa; -struct iovec iov = { (void *) nh, nh\->nlmsg_len }; +struct iovec iov = { nh, nh\->nlmsg_len }; struct msghdr msg; -msg = { (void *)&sa, sizeof(sa), &iov, 1, NULL, 0, 0 }; +msg = { &sa, sizeof(sa), &iov, 1, NULL, 0, 0 }; memset(&sa, 0, sizeof(sa)); sa.nl_family = AF_NETLINK; nh\->nlmsg_pid = 0; @@ -443,7 +443,7 @@ struct sockaddr_nl sa; struct msghdr msg; struct nlmsghdr *nh; -msg = { (void *)&sa, sizeof(sa), &iov, 1, NULL, 0, 0 }; +msg = { &sa, sizeof(sa), &iov, 1, NULL, 0, 0 }; len = recvmsg(fd, &msg, 0); for (nh = (struct nlmsghdr *) buf; NLMSG_OK (nh, len);