summaryrefslogtreecommitdiff
path: root/ace/INET_Addr.i
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2002-10-05 00:25:54 +0000
committerSteve Huston <shuston@riverace.com>2002-10-05 00:25:54 +0000
commit0f9d1b93c445df745f37cb1f616cd9fd155a1b7c (patch)
tree7caccdf49e172841bf42289e545ee8ab18383951 /ace/INET_Addr.i
parent6327549fb88cee71553dc8a77222891d5f3600e3 (diff)
downloadATCD-0f9d1b93c445df745f37cb1f616cd9fd155a1b7c.tar.gz
ChangeLogTag:Fri Oct 4 20:22:41 2002 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ace/INET_Addr.i')
-rw-r--r--ace/INET_Addr.i14
1 files changed, 9 insertions, 5 deletions
diff --git a/ace/INET_Addr.i b/ace/INET_Addr.i
index 44e74f0f88f..0808b595e20 100644
--- a/ace/INET_Addr.i
+++ b/ace/INET_Addr.i
@@ -35,22 +35,26 @@ ACE_INET_Addr::ip_addr_pointer (void) const
#endif
}
-ACE_INLINE size_t
+ACE_INLINE int
ACE_INET_Addr::ip_addr_size (void) const
{
+ // Since this size value is used to pass to other host db-type
+ // functions (gethostbyaddr, etc.) the length is of int type.
+ // Thus, cast all these sizes back to int. They're all well
+ // within the range of an int anyway.
#if defined (ACE_HAS_IPV6)
if (this->get_type () == PF_INET)
- return sizeof this->inet_addr_.in4_.sin_addr;
+ return ACE_static_cast (int, sizeof this->inet_addr_.in4_.sin_addr);
else
- return sizeof this->inet_addr_.in6_.sin6_addr;
+ return ACE_static_cast (int, sizeof this->inet_addr_.in6_.sin6_addr);
#else
// These _UNICOS changes were picked up from pre-IPv6 code in
// get_host_name_i... the IPv6 section above may need something
// similar, so keep an eye out for it.
# if !defined(_UNICOS)
- return sizeof this->inet_addr_.in4_.sin_addr.s_addr;
+ return ACE_static_cast (int, sizeof this->inet_addr_.in4_.sin_addr.s_addr);
# else /* _UNICOS */
- return sizeof this->inet_addr_.in4_.sin_addr;
+ return ACE_static_cast (int, sizeof this->inet_addr_.in4_.sin_addr);
# endif /* ! _UNICOS */
#endif /* ACE_HAS_IPV6 */
}