Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Dec 2001 09:40:40 +1100 (EST)
From:      Mark Andrews <mark.andrews@isc.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/32446: redundant casts
Message-ID:  <200112022240.fB2Mee134230@drugs.dv.isc.org>

next in thread | raw e-mail | index | archive | help

>Number:         32446
>Category:       kern
>Synopsis:       redundant casts
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 02 14:50:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Mark Andrews
>Release:        FreeBSD 4.4-STABLE i386
>Organization:
Internet Software Consortium
>Environment:
System: FreeBSD drugs.dv.isc.org 4.4-STABLE FreeBSD 4.4-STABLE #0: Tue Nov 13 19:04:45 EST 2001 marka@drugs.dv.isc.org:/usr/obj/usr/src/sys/DRUGS i386


>Description:
	redundant casts in sys/netinet6/in6.h
>How-To-Repeat:
	By inspection.
>Fix:

Index: sys/netinet6/in6.h
===================================================================
RCS file: /home/ncvs/src/sys/netinet6/in6.h,v
retrieving revision 1.7.2.4
diff -u -r1.7.2.4 in6.h
--- sys/netinet6/in6.h	2001/07/04 09:45:23	1.7.2.4
+++ sys/netinet6/in6.h	2001/12/02 22:33:53
@@ -250,37 +250,37 @@
  * Unspecified
  */
 #define IN6_IS_ADDR_UNSPECIFIED(a)	\
-	((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) &&	\
-	 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) &&	\
-	 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) &&	\
-	 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == 0))
+	((*(const u_int32_t *)(&(a)->s6_addr[0]) == 0) &&	\
+	 (*(const u_int32_t *)(&(a)->s6_addr[4]) == 0) &&	\
+	 (*(const u_int32_t *)(&(a)->s6_addr[8]) == 0) &&	\
+	 (*(const u_int32_t *)(&(a)->s6_addr[12]) == 0))
 
 /*
  * Loopback
  */
 #define IN6_IS_ADDR_LOOPBACK(a)		\
-	((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) &&	\
-	 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) &&	\
-	 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) &&	\
-	 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1)))
+	((*(const u_int32_t *)(&(a)->s6_addr[0]) == 0) &&	\
+	 (*(const u_int32_t *)(&(a)->s6_addr[4]) == 0) &&	\
+	 (*(const u_int32_t *)(&(a)->s6_addr[8]) == 0) &&	\
+	 (*(const u_int32_t *)(&(a)->s6_addr[12]) == ntohl(1)))
 
 /*
  * IPv4 compatible
  */
 #define IN6_IS_ADDR_V4COMPAT(a)		\
-	((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) &&	\
-	 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) &&	\
-	 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) &&	\
-	 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != 0) &&	\
-	 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1)))
+	((*(const u_int32_t *)(&(a)->s6_addr[0]) == 0) &&	\
+	 (*(const u_int32_t *)(&(a)->s6_addr[4]) == 0) &&	\
+	 (*(const u_int32_t *)(&(a)->s6_addr[8]) == 0) &&	\
+	 (*(const u_int32_t *)(&(a)->s6_addr[12]) != 0) &&	\
+	 (*(const u_int32_t *)(&(a)->s6_addr[12]) != ntohl(1)))
 
 /*
  * Mapped
  */
 #define IN6_IS_ADDR_V4MAPPED(a)		      \
-	((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) &&	\
-	 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) &&	\
-	 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
+	((*(const u_int32_t *)(&(a)->s6_addr[0]) == 0) &&	\
+	 (*(const u_int32_t *)(&(a)->s6_addr[4]) == 0) &&	\
+	 (*(const u_int32_t *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
 
 /*
  * KAME Scope Values
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200112022240.fB2Mee134230>