Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/sys add void casts to CMSG_
details: https://anonhg.NetBSD.org/src/rev/74b434faf4d9
branches: trunk
changeset: 335670:74b434faf4d9
user: christos <christos%NetBSD.org@localhost>
date: Tue Jan 20 01:10:16 2015 +0000
description:
add void casts to CMSG_
diffstat:
sys/sys/socket.h | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diffs (48 lines):
diff -r 8af9b4d7181e -r 74b434faf4d9 sys/sys/socket.h
--- a/sys/sys/socket.h Tue Jan 20 01:02:25 2015 +0000
+++ b/sys/sys/socket.h Tue Jan 20 01:10:16 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: socket.h,v 1.112 2015/01/20 01:02:25 christos Exp $ */
+/* $NetBSD: socket.h,v 1.113 2015/01/20 01:10:16 christos Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -528,10 +528,11 @@
/* given pointer to struct cmsghdr, return pointer to data */
#define CMSG_DATA(cmsg) \
- ((u_char *)(void *)(cmsg) + __CMSG_ALIGN(sizeof(struct cmsghdr)))
+ ((void *)((u_char *)(void *)(cmsg) + \
+ __CMSG_ALIGN(sizeof(struct cmsghdr))))
#define CCMSG_DATA(cmsg) \
- ((const u_char *)(const void *)(cmsg) + \
- __CMSG_ALIGN(sizeof(struct cmsghdr)))
+ ((const void *)((const u_char *)(const void *)(cmsg) + \
+ __CMSG_ALIGN(sizeof(struct cmsghdr))))
/*
* Alignment requirement for CMSG struct manipulation.
@@ -549,11 +550,11 @@
/* given pointer to struct cmsghdr, return pointer to next cmsghdr */
#define CMSG_NXTHDR(mhdr, cmsg) \
- (((char *)(cmsg) + __CMSG_ALIGN((cmsg)->cmsg_len) + \
+ (((char *)(void *)(cmsg) + __CMSG_ALIGN((cmsg)->cmsg_len) + \
__CMSG_ALIGN(sizeof(struct cmsghdr)) > \
- (((char *)(mhdr)->msg_control) + (mhdr)->msg_controllen)) ? \
+ (((char *)(void *)(mhdr)->msg_control) + (mhdr)->msg_controllen)) ?\
(struct cmsghdr *)0 : \
- (struct cmsghdr *)(void *)((char *)(cmsg) + \
+ (struct cmsghdr *)(void *)((char *)(void *)(cmsg) + \
__CMSG_ALIGN((cmsg)->cmsg_len)))
/*
@@ -562,7 +563,7 @@
*/
#define CMSG_FIRSTHDR(mhdr) \
((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
- (struct cmsghdr *)(mhdr)->msg_control : \
+ (struct cmsghdr *)(void *)(mhdr)->msg_control : \
(struct cmsghdr *)0)
#define CMSG_SPACE(l) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(l))
Home |
Main Index |
Thread Index |
Old Index