From: Alejandro Colomar Date: Sun, 5 Jan 2025 13:18:49 +0000 (+0100) Subject: man/man3/: EXAMPLES: Remove unnecessary parentheses X-Git-Tag: man-pages-6.10~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a12960d9df82e1ad9f16d95dbc6cb06022cb422;p=thirdparty%2Fman-pages.git man/man3/: EXAMPLES: Remove unnecessary parentheses Signed-off-by: Alejandro Colomar --- diff --git a/man/man3/dlopen.3 b/man/man3/dlopen.3 index 8c4d368dc..c3c6a9a91 100644 --- a/man/man3/dlopen.3 +++ b/man/man3/dlopen.3 @@ -582,7 +582,7 @@ main(void) POSIX.1\-2001 and POSIX.1\-2008 accepted this state of affairs and proposed the following workaround: \& - *(void **) (&cosine) = dlsym(handle, "cos"); + *(void **) &cosine = dlsym(handle, "cos"); \& This (clumsy) cast conforms with the ISO C standard and will avoid any compiler warnings. diff --git a/man/man3/hsearch.3 b/man/man3/hsearch.3 index 1ba6d0a0b..2ea6f111a 100644 --- a/man/man3/hsearch.3 +++ b/man/man3/hsearch.3 @@ -341,7 +341,7 @@ main(void) e.key = data[i]; ep = hsearch(e, FIND); printf("%9.9s \-> %9.9s:%d\[rs]n", e.key, - ep ? ep\->key : "NULL", ep ? (int)(ep\->data) : 0); + ep ? ep\->key : "NULL", ep ? (int) ep\->data : 0); } hdestroy(); exit(EXIT_SUCCESS); diff --git a/man/man3/rtnetlink.3 b/man/man3/rtnetlink.3 index 57dba37f8..8a833d2a6 100644 --- a/man/man3/rtnetlink.3 +++ b/man/man3/rtnetlink.3 @@ -106,7 +106,7 @@ req.nh.nlmsg_type = RTM_NEWLINK; req.if.ifi_family = AF_UNSPEC; req.if.ifi_index = INTERFACE_INDEX; req.if.ifi_change = 0xffffffff; /* ??? */ -rta = (struct rtattr *)(((char *) &req) + +rta = (struct rtattr *) ((char *) &req + NLMSG_ALIGN(req.nh.nlmsg_len)); rta\->rta_type = IFLA_MTU; rta\->rta_len = RTA_LENGTH(sizeof(mtu));