diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-11-26 09:44:30 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-11-26 09:44:30 +0000 |
commit | c3301189bde66bceb3e949e4938b167fc847dd86 (patch) | |
tree | 2e449aae3fb42846f0338645ed73ef6311341902 /inet/netinet | |
parent | 8b6e67674da3b9db3208b914bd8d892abb62ec48 (diff) | |
download | glibc-c3301189bde66bceb3e949e4938b167fc847dd86.tar.gz glibc-c3301189bde66bceb3e949e4938b167fc847dd86.tar.xz glibc-c3301189bde66bceb3e949e4938b167fc847dd86.zip |
Update.
2000-11-26 Ulrich Drepper <drepper@redhat.com> * inet/getnameinfo.c: Adjust casts to avoid warnings. * inet/rcmd.c: Likewise. * inet/ruserpass.c: Likewise. * inet/netinet/in.h (IN6_IS_ADDR_UNSPECIFIED, IN6_IS_ADDR_LOOPBACK, IN6_IS_ADDR_MULTICAST, IN6_IS_ADDR_LINKLOCAL, IN6_IS_ADDR_SITELOCAL, IN6_IS_ADDR_V4MAPPED, IN6_IS_ADDR_V4COMPAT, IN6_ARE_ADDR_EQUAL, IN6_IS_ADDR_MC_NODELOCAL, IN6_IS_ADDR_MC_LINKLOCAL, IN6_IS_ADDR_MC_SITELOCAL, IN6_IS_ADDR_MC_ORGLOCAL, IN6_IS_ADDR_MC_GLOBAL): Preserve const in cast. * include/aliases.h: Add prototypes for internal __getalias* functions. * include/netdb.h: Add prototypes for __old_gethostent_r, __old_gethostbyaddr_r, __old_gethostbyname_r, __old_gethostbyname2_r, __old_getnetent_r, __old_getnetbyaddr_r, __old_getnetbyname_r, __old_getservent_r, __old_getservbyname_r, __old_getservbyport_r, __old_getprotoent_r, __old_getprotobyname_r, __old_getprotobynumber_r. * include/rpc/netdb.h: Add prototypes for __old_getrpcbyname_r, __old_getrpcbynumber_r, __old_getrpcent_r. * include/rpc/netdb.h: Add __getrpcbyname_r, __getrpcbynumber_r, __getrpcent_r prototypes.
Diffstat (limited to 'inet/netinet')
-rw-r--r-- | inet/netinet/in.h | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/inet/netinet/in.h b/inet/netinet/in.h index 1857c199cb..4bceaef869 100644 --- a/inet/netinet/in.h +++ b/inet/netinet/in.h @@ -268,34 +268,43 @@ extern uint16_t htons (uint16_t __hostshort) #endif #define IN6_IS_ADDR_UNSPECIFIED(a) \ - (((uint32_t *) (a))[0] == 0 && ((uint32_t *) (a))[1] == 0 && \ - ((uint32_t *) (a))[2] == 0 && ((uint32_t *) (a))[3] == 0) + (((__const uint32_t *) (a))[0] == 0 \ + && ((__const uint32_t *) (a))[1] == 0 \ + && ((__const uint32_t *) (a))[2] == 0 \ + && ((__const uint32_t *) (a))[3] == 0) #define IN6_IS_ADDR_LOOPBACK(a) \ - (((uint32_t *) (a))[0] == 0 && ((uint32_t *) (a))[1] == 0 && \ - ((uint32_t *) (a))[2] == 0 && ((uint32_t *) (a))[3] == htonl (1)) + (((__const uint32_t *) (a))[0] == 0 \ + && ((__const uint32_t *) (a))[1] == 0 \ + && ((__const uint32_t *) (a))[2] == 0 \ + && ((__const uint32_t *) (a))[3] == htonl (1)) -#define IN6_IS_ADDR_MULTICAST(a) (((uint8_t *) (a))[0] == 0xff) +#define IN6_IS_ADDR_MULTICAST(a) (((__const uint8_t *) (a))[0] == 0xff) #define IN6_IS_ADDR_LINKLOCAL(a) \ - ((((uint32_t *) (a))[0] & htonl (0xffc00000)) == htonl (0xfe800000)) + ((((__const uint32_t *) (a))[0] & htonl (0xffc00000)) \ + == htonl (0xfe800000)) #define IN6_IS_ADDR_SITELOCAL(a) \ - ((((uint32_t *) (a))[0] & htonl (0xffc00000)) == htonl (0xfec00000)) + ((((__const uint32_t *) (a))[0] & htonl (0xffc00000)) \ + == htonl (0xfec00000)) #define IN6_IS_ADDR_V4MAPPED(a) \ - ((((uint32_t *) (a))[0] == 0) && (((uint32_t *) (a))[1] == 0) && \ - (((uint32_t *) (a))[2] == htonl (0xffff))) + ((((__const uint32_t *) (a))[0] == 0) \ + && (((__const uint32_t *) (a))[1] == 0) \ + && (((__const uint32_t *) (a))[2] == htonl (0xffff))) #define IN6_IS_ADDR_V4COMPAT(a) \ - ((((uint32_t *) (a))[0] == 0) && (((uint32_t *) (a))[1] == 0) && \ - (((uint32_t *) (a))[2] == 0) && (ntohl (((uint32_t *) (a))[3]) > 1)) + ((((__const uint32_t *) (a))[0] == 0) \ + && (((__const uint32_t *) (a))[1] == 0) \ + && (((__const uint32_t *) (a))[2] == 0) \ + && (ntohl (((__const uint32_t *) (a))[3]) > 1)) #define IN6_ARE_ADDR_EQUAL(a,b) \ - ((((uint32_t *) (a))[0] == ((uint32_t *) (b))[0]) && \ - (((uint32_t *) (a))[1] == ((uint32_t *) (b))[1]) && \ - (((uint32_t *) (a))[2] == ((uint32_t *) (b))[2]) && \ - (((uint32_t *) (a))[3] == ((uint32_t *) (b))[3])) + ((((__const uint32_t *) (a))[0] == ((__const uint32_t *) (b))[0]) \ + && (((__const uint32_t *) (a))[1] == ((__const uint32_t *) (b))[1]) \ + && (((__const uint32_t *) (a))[2] == ((__const uint32_t *) (b))[2]) \ + && (((__const uint32_t *) (a))[3] == ((__const uint32_t *) (b))[3])) /* Bind socket to a privileged IP port. */ extern int bindresvport (int __sockfd, struct sockaddr_in *__sock_in) __THROW; @@ -306,19 +315,24 @@ extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in) #define IN6_IS_ADDR_MC_NODELOCAL(a) \ - (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0x1)) + (IN6_IS_ADDR_MULTICAST(a) \ + && ((((__const uint8_t *) (a))[1] & 0xf) == 0x1)) #define IN6_IS_ADDR_MC_LINKLOCAL(a) \ - (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0x2)) + (IN6_IS_ADDR_MULTICAST(a) \ + && ((((__const uint8_t *) (a))[1] & 0xf) == 0x2)) #define IN6_IS_ADDR_MC_SITELOCAL(a) \ - (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0x5)) + (IN6_IS_ADDR_MULTICAST(a) \ + && ((((__const uint8_t *) (a))[1] & 0xf) == 0x5)) #define IN6_IS_ADDR_MC_ORGLOCAL(a) \ - (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0x8)) + (IN6_IS_ADDR_MULTICAST(a) \ + && ((((__const uint8_t *) (a))[1] & 0xf) == 0x8)) #define IN6_IS_ADDR_MC_GLOBAL(a) \ - (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0xe)) + (IN6_IS_ADDR_MULTICAST(a) \ + && ((((__const uint8_t *) (a))[1] & 0xf) == 0xe)) /* IPv6 packet information. */ struct in6_pktinfo |