Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/common/lib/libc/net Lint seems to prefer that we cast via (v...



details:   https://anonhg.NetBSD.org/src/rev/0229052c96d5
branches:  trunk
changeset: 778311:0229052c96d5
user:      he <he%NetBSD.org@localhost>
date:      Wed Mar 21 20:02:56 2012 +0000

description:
Lint seems to prefer that we cast via (void*) and not directly to
(u_char*), so follow suit.

diffstat:

 common/lib/libc/net/htonl.c |  6 +++---
 common/lib/libc/net/htons.c |  6 +++---
 common/lib/libc/net/ntohl.c |  6 +++---
 common/lib/libc/net/ntohs.c |  6 +++---
 4 files changed, 12 insertions(+), 12 deletions(-)

diffs (108 lines):

diff -r 117612d6a90b -r 0229052c96d5 common/lib/libc/net/htonl.c
--- a/common/lib/libc/net/htonl.c       Wed Mar 21 19:59:18 2012 +0000
+++ b/common/lib/libc/net/htonl.c       Wed Mar 21 20:02:56 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: htonl.c,v 1.2 2011/07/04 21:29:16 joerg Exp $  */
+/*     $NetBSD: htonl.c,v 1.3 2012/03/21 20:02:56 he Exp $     */
 
 /*
  * Written by J.T. Conklin <jtc%NetBSD.org@localhost>.
@@ -7,7 +7,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: htonl.c,v 1.2 2011/07/04 21:29:16 joerg Exp $");
+__RCSID("$NetBSD: htonl.c,v 1.3 2012/03/21 20:02:56 he Exp $");
 #endif
 
 #include <sys/types.h>
@@ -18,7 +18,7 @@
 htonl(uint32_t x)
 {
 #if BYTE_ORDER == LITTLE_ENDIAN
-       u_char *s = (u_char *)&x;
+       u_char *s = (void *)&x;
        return (uint32_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]);
 #else
        return x;
diff -r 117612d6a90b -r 0229052c96d5 common/lib/libc/net/htons.c
--- a/common/lib/libc/net/htons.c       Wed Mar 21 19:59:18 2012 +0000
+++ b/common/lib/libc/net/htons.c       Wed Mar 21 20:02:56 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: htons.c,v 1.2 2011/07/04 21:29:16 joerg Exp $  */
+/*     $NetBSD: htons.c,v 1.3 2012/03/21 20:02:56 he Exp $     */
 
 /*
  * Written by J.T. Conklin <jtc%NetBSD.org@localhost>.
@@ -7,7 +7,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: htons.c,v 1.2 2011/07/04 21:29:16 joerg Exp $");
+__RCSID("$NetBSD: htons.c,v 1.3 2012/03/21 20:02:56 he Exp $");
 #endif
 
 #include <sys/types.h>
@@ -18,7 +18,7 @@
 htons(uint16_t x)
 {
 #if BYTE_ORDER == LITTLE_ENDIAN
-       u_char *s = (u_char *) &x;
+       u_char *s = (void *) &x;
        return (uint16_t)(s[0] << 8 | s[1]);
 #else
        return x;
diff -r 117612d6a90b -r 0229052c96d5 common/lib/libc/net/ntohl.c
--- a/common/lib/libc/net/ntohl.c       Wed Mar 21 19:59:18 2012 +0000
+++ b/common/lib/libc/net/ntohl.c       Wed Mar 21 20:02:56 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntohl.c,v 1.2 2011/07/04 21:29:16 joerg Exp $  */
+/*     $NetBSD: ntohl.c,v 1.3 2012/03/21 20:02:56 he Exp $     */
 
 /*
  * Written by J.T. Conklin <jtc%NetBSD.org@localhost>.
@@ -7,7 +7,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: ntohl.c,v 1.2 2011/07/04 21:29:16 joerg Exp $");
+__RCSID("$NetBSD: ntohl.c,v 1.3 2012/03/21 20:02:56 he Exp $");
 #endif
 
 #include <sys/types.h>
@@ -18,7 +18,7 @@
 ntohl(uint32_t x)
 {
 #if BYTE_ORDER == LITTLE_ENDIAN
-       u_char *s = (u_char *)&x;
+       u_char *s = (void *)&x;
        return (uint32_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]);
 #else
        return x;
diff -r 117612d6a90b -r 0229052c96d5 common/lib/libc/net/ntohs.c
--- a/common/lib/libc/net/ntohs.c       Wed Mar 21 19:59:18 2012 +0000
+++ b/common/lib/libc/net/ntohs.c       Wed Mar 21 20:02:56 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntohs.c,v 1.2 2011/07/04 21:29:16 joerg Exp $  */
+/*     $NetBSD: ntohs.c,v 1.3 2012/03/21 20:02:56 he Exp $     */
 
 /*
  * Written by J.T. Conklin <jtc%NetBSD.org@localhost>.
@@ -7,7 +7,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: ntohs.c,v 1.2 2011/07/04 21:29:16 joerg Exp $");
+__RCSID("$NetBSD: ntohs.c,v 1.3 2012/03/21 20:02:56 he Exp $");
 #endif
 
 #include <sys/types.h>
@@ -18,7 +18,7 @@
 ntohs(uint16_t x)
 {
 #if BYTE_ORDER == LITTLE_ENDIAN
-       u_char *s = (u_char *) &x;
+       u_char *s = (void *) &x;
        return (uint16_t)(s[0] << 8 | s[1]);
 #else
        return x;



Home | Main Index | Thread Index | Old Index