diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-11-19 12:18:43 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-11-19 13:01:35 +0100 |
commit | d0e7d020fa405ab94f19916ec96fbd4611da0031 (patch) | |
tree | 4bfd1eeea75d2adffe850b1bf600bb547c6b154b /sal/osl/unx | |
parent | e814dacc817e3d2f82c5c6c705152293baeedfe4 (diff) |
socket.c -> socket.cxx
(At least some glibc make FD_ISSET happen to be of type bool in C++, that's why
we explicitly cast it to bool instead of comparing != 0 to avoid
loplugin:implicitboolconversion; cf.
<https://sourceware.org/ml/libc-help/2014-11/msg00018.html> "Type of FD_ISSET
happens to be bool in C++.")
Change-Id: I6da67620067392f5866d053b074198413da814b1
Diffstat (limited to 'sal/osl/unx')
-rw-r--r-- | sal/osl/unx/socket.cxx (renamed from sal/osl/unx/socket.c) | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sal/osl/unx/socket.c b/sal/osl/unx/socket.cxx index ceed56d7e92c..b8ac5ea1da47 100644 --- a/sal/osl/unx/socket.c +++ b/sal/osl/unx/socket.cxx @@ -762,13 +762,13 @@ static sal_Char* _osl_getFullQualifiedDomainName (const sal_Char *pHostName) return pFullQualifiedName; } -static sal_Bool _osl_isFullQualifiedDomainName (const sal_Char *pHostName) +static bool _osl_isFullQualifiedDomainName (const sal_Char *pHostName) { /* a FQDN (aka 'hostname.domain.top_level_domain' ) * is a name which contains a dot '.' in it ( would * match as well for 'hostname.' but is good enough * for now )*/ - return (sal_Bool)( strchr( pHostName, (int)'.' ) != NULL ); + return strchr( pHostName, (int)'.' ) != NULL; } struct oslHostAddrImpl @@ -825,7 +825,7 @@ static oslHostAddr _osl_hostentToHostAddr (const struct hostent *he) /* future extensions for new families might be implemented here */ OSL_TRACE("_osl_hostentToHostAddr: unknown address family."); - OSL_ASSERT(sal_False); + OSL_ASSERT(false); __osl_destroySocketAddr( pSockAddr ); free (cn); @@ -1988,7 +1988,7 @@ sal_Int32 SAL_CALL osl_writeSocket( #ifdef HAVE_POLL_H /* poll() */ -sal_Bool __osl_socket_poll ( +bool __osl_socket_poll ( oslSocket pSocket, const TimeValue* pTimeout, short nEvent) @@ -1999,7 +1999,7 @@ sal_Bool __osl_socket_poll ( OSL_ASSERT(0 != pSocket); if (0 == pSocket) - return sal_False; /* EINVAL */ + return false; /* EINVAL */ pSocket->m_nLastError = 0; @@ -2021,12 +2021,12 @@ sal_Bool __osl_socket_poll ( pSocket->m_nLastError = errno; OSL_TRACE("__osl_socket_poll(): poll error: %d (%s)", errno, strerror(errno)); - return sal_False; + return false; } if (result == 0) { /* Timeout */ - return sal_False; + return false; } return ((fds.revents & nEvent) == nEvent); @@ -2431,7 +2431,7 @@ sal_Bool SAL_CALL osl_isInSocketSet(oslSocketSet Set, oslSocket pSocket) pSet= (TSocketSetImpl*)Set; - return (FD_ISSET(pSocket->m_Socket, &pSet->m_Set) != 0); + return bool(FD_ISSET(pSocket->m_Socket, &pSet->m_Set)); } sal_Int32 SAL_CALL osl_demultiplexSocketEvents(oslSocketSet IncomingSet, |