summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-11-19 12:18:43 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-11-19 13:01:35 +0100
commitd0e7d020fa405ab94f19916ec96fbd4611da0031 (patch)
tree4bfd1eeea75d2adffe850b1bf600bb547c6b154b /sal
parente814dacc817e3d2f82c5c6c705152293baeedfe4 (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')
-rw-r--r--sal/Library_sal.mk2
-rw-r--r--sal/osl/unx/socket.cxx (renamed from sal/osl/unx/socket.c)16
2 files changed, 9 insertions, 9 deletions
diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
index 6ae0d24c2b56..85d7c1985da4 100644
--- a/sal/Library_sal.mk
+++ b/sal/Library_sal.mk
@@ -169,12 +169,12 @@ $(eval $(call gb_Library_add_exception_objects,sal,\
sal/osl/unx/profile \
sal/osl/unx/readwrite_helper \
sal/osl/unx/security \
+ sal/osl/unx/socket \
sal/osl/unx/tempfile \
sal/osl/unx/thread \
$(if $(filter DESKTOP,$(BUILD_TYPE)), sal/osl/unx/salinit) \
))
$(eval $(call gb_Library_add_cobjects,sal,\
- sal/osl/unx/socket \
sal/osl/unx/system \
sal/osl/unx/time \
))
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,