diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-03-09 10:41:27 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-03-10 18:31:59 +0100 |
commit | 34dc2317b2f9e5f181dc0a5420e24cafc3561a09 (patch) | |
tree | 621ffc15dfd91fb50426236d8b0491e64b6976c9 /sal/osl | |
parent | 278983f5d805d61d0982cd2d4ed36eb3989b05c5 (diff) |
Drop __osl_ prefix from static entities (avoid reserved identifiers)
Change-Id: I68e51e09ffea9328034254b694b01082dbb4e3bd
Diffstat (limited to 'sal/osl')
-rw-r--r-- | sal/osl/unx/socket.cxx | 58 | ||||
-rw-r--r-- | sal/osl/unx/sockimpl.hxx | 3 |
2 files changed, 29 insertions, 32 deletions
diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx index 8b7feb4bc8c6..0fdad31b86ed 100644 --- a/sal/osl/unx/socket.cxx +++ b/sal/osl/unx/socket.cxx @@ -429,7 +429,7 @@ oslSocketResult SAL_CALL osl_psz_getDottedInetAddrOfSocketAddr ( void SAL_CALL osl_psz_getLastSocketErrorDescription ( oslSocket Socket, sal_Char* pBuffer, sal_uInt32 BufferSize); -oslSocket __osl_createSocketImpl(int Socket) +static oslSocket createSocketImpl(int Socket) { oslSocket pSocket; @@ -446,26 +446,26 @@ oslSocket __osl_createSocketImpl(int Socket) return pSocket; } -void __osl_destroySocketImpl(oslSocket Socket) +static void destroySocketImpl(oslSocket Socket) { if ( Socket != nullptr) free(Socket); } -static oslSocketAddr __osl_createSocketAddr() +static oslSocketAddr createSocketAddr() { oslSocketAddr pAddr = static_cast<oslSocketAddr>(rtl_allocateZeroMemory( sizeof( struct oslSocketAddrImpl ))); return pAddr; } -static oslSocketAddr __osl_createSocketAddrWithFamily( +static oslSocketAddr createSocketAddrWithFamily( oslAddrFamily family, sal_Int32 port, sal_uInt32 nAddr ) { oslSocketAddr pAddr; SAL_WARN_IF( family != osl_Socket_FamilyInet, "sal.osl", "creating socket for non-IP address family" ); - pAddr = __osl_createSocketAddr(); + pAddr = createSocketAddr(); switch( family ) { case osl_Socket_FamilyInet: @@ -483,14 +483,14 @@ static oslSocketAddr __osl_createSocketAddrWithFamily( return pAddr; } -static oslSocketAddr __osl_createSocketAddrFromSystem( struct sockaddr *pSystemSockAddr ) +static oslSocketAddr createSocketAddrFromSystem( struct sockaddr *pSystemSockAddr ) { - oslSocketAddr pAddr = __osl_createSocketAddr(); + oslSocketAddr pAddr = createSocketAddr(); memcpy( &(pAddr->m_sockaddr), pSystemSockAddr, sizeof( struct sockaddr ) ); return pAddr; } -static void __osl_destroySocketAddr( oslSocketAddr addr ) +static void destroySocketAddr( oslSocketAddr addr ) { rtl_freeMemory( addr ); } @@ -502,11 +502,11 @@ oslSocketAddr SAL_CALL osl_createEmptySocketAddr(oslAddrFamily Family) /* is it an internet-Addr? */ if (Family == osl_Socket_FamilyInet) { - pAddr = __osl_createSocketAddrWithFamily(Family, 0 , htonl(INADDR_ANY) ); + pAddr = createSocketAddrWithFamily(Family, 0 , htonl(INADDR_ANY) ); } else { - pAddr = __osl_createSocketAddrWithFamily( Family , 0 , 0 ); + pAddr = createSocketAddrWithFamily( Family , 0 , 0 ); } return pAddr; @@ -517,7 +517,7 @@ oslSocketAddr SAL_CALL osl_copySocketAddr(oslSocketAddr Addr) oslSocketAddr pCopy = nullptr; if (Addr) { - pCopy = __osl_createSocketAddr(); + pCopy = createSocketAddr(); if (pCopy) memcpy(&(pCopy->m_sockaddr),&(Addr->m_sockaddr), sizeof(struct sockaddr)); @@ -613,7 +613,7 @@ oslSocketAddr SAL_CALL osl_createInetBroadcastAddr ( nAddr = htonl(nAddr); } - pAddr = __osl_createSocketAddrWithFamily( osl_Socket_FamilyInet, htons(Port), nAddr ); + pAddr = createSocketAddrWithFamily( osl_Socket_FamilyInet, htons(Port), nAddr ); return pAddr; } @@ -654,7 +654,7 @@ oslSocketAddr SAL_CALL osl_psz_createInetSocketAddr ( if(Addr != -1) { /* valid dotted addr */ - pAddr = __osl_createSocketAddrWithFamily( osl_Socket_FamilyInet, htons(Port) , Addr ); + pAddr = createSocketAddrWithFamily( osl_Socket_FamilyInet, htons(Port) , Addr ); } return pAddr; } @@ -782,7 +782,7 @@ static oslHostAddr _osl_hostentToHostAddr (const struct hostent *he) return nullptr; } - pSockAddr = __osl_createSocketAddr(); + pSockAddr = createSocketAddr(); SAL_WARN_IF( !pSockAddr, "sal.osl", "insufficient memory" ); if (pSockAddr == nullptr) { @@ -806,7 +806,7 @@ static oslHostAddr _osl_hostentToHostAddr (const struct hostent *he) SAL_WARN( "sal.osl", "unknown address family" ); - __osl_destroySocketAddr( pSockAddr ); + destroySocketAddr( pSockAddr ); free (cn); return nullptr; } @@ -815,7 +815,7 @@ static oslHostAddr _osl_hostentToHostAddr (const struct hostent *he) SAL_WARN_IF( !pAddr, "sal.osl", "allocation error" ); if (pAddr == nullptr) { - __osl_destroySocketAddr( pSockAddr ); + destroySocketAddr( pSockAddr ); free (cn); return nullptr; } @@ -1173,7 +1173,7 @@ sal_Int32 SAL_CALL osl_psz_getServicePort(const sal_Char* pszServicename, void SAL_CALL osl_destroySocketAddr(oslSocketAddr pAddr) { - __osl_destroySocketAddr( pAddr ); + destroySocketAddr( pAddr ); } oslAddrFamily SAL_CALL osl_getFamilyOfSocketAddr(oslSocketAddr pAddr) @@ -1297,7 +1297,7 @@ oslSocket SAL_CALL osl_createSocket(oslAddrFamily Family, oslSocket pSocket; /* alloc memory */ - pSocket= __osl_createSocketImpl(OSL_INVALID_SOCKET); + pSocket= createSocketImpl(OSL_INVALID_SOCKET); /* create socket */ pSocket->m_Socket= socket(FAMILY_TO_NATIVE(Family), @@ -1310,7 +1310,7 @@ oslSocket SAL_CALL osl_createSocket(oslAddrFamily Family, int nErrno = errno; SAL_WARN( "sal.osl", "socket creation failed: (" << nErrno << ") " << strerror(nErrno) ); - __osl_destroySocketImpl((pSocket)); + destroySocketImpl((pSocket)); pSocket= nullptr; } else @@ -1352,7 +1352,7 @@ void SAL_CALL osl_releaseSocket( oslSocket pSocket ) } #endif /* CLOSESOCKET_DOESNT_WAKE_UP_ACCEPT */ osl_closeSocket( pSocket ); - __osl_destroySocketImpl( pSocket ); + destroySocketImpl( pSocket ); } } @@ -1450,7 +1450,7 @@ oslSocketAddr SAL_CALL osl_getLocalAddrOfSocket(oslSocket pSocket) if (getsockname(pSocket->m_Socket, &Addr, &AddrLen) == OSL_SOCKET_ERROR) return nullptr; - pAddr = __osl_createSocketAddrFromSystem( &Addr ); + pAddr = createSocketAddrFromSystem( &Addr ); return pAddr; } @@ -1473,7 +1473,7 @@ oslSocketAddr SAL_CALL osl_getPeerAddrOfSocket(oslSocket pSocket) pSocket->m_nLastError=errno; return nullptr; } - return __osl_createSocketAddrFromSystem( &Addr ); + return createSocketAddrFromSystem( &Addr ); } sal_Bool SAL_CALL osl_bindAddrToSocket(oslSocket pSocket, @@ -1717,11 +1717,11 @@ oslSocket SAL_CALL osl_acceptConnectionOnSocket(oslSocket pSocket, if(ppAddr) { - *ppAddr= __osl_createSocketAddrFromSystem(&Addr); + *ppAddr= createSocketAddrFromSystem(&Addr); } /* alloc memory */ - pConnectionSockImpl= __osl_createSocketImpl(OSL_INVALID_SOCKET); + pConnectionSockImpl= createSocketImpl(OSL_INVALID_SOCKET); /* set close-on-exec flag */ if ((Flags = fcntl(Connection, F_GETFD, 0)) != -1) @@ -1976,7 +1976,7 @@ sal_Int32 SAL_CALL osl_writeSocket( #ifdef HAVE_POLL_H /* poll() */ -bool __osl_socket_poll ( +static bool socket_poll ( oslSocket pSocket, const TimeValue* pTimeout, short nEvent) @@ -2022,7 +2022,7 @@ bool __osl_socket_poll ( #else /* select() */ -sal_Bool __osl_socket_poll ( +static sal_Bool socket_poll ( oslSocket pSocket, const TimeValue* pTimeout, short nEvent) @@ -2082,7 +2082,7 @@ sal_Bool SAL_CALL osl_isReceiveReady ( return sal_False; } - return __osl_socket_poll (pSocket, pTimeout, POLLIN); + return socket_poll (pSocket, pTimeout, POLLIN); } sal_Bool SAL_CALL osl_isSendReady ( @@ -2095,7 +2095,7 @@ sal_Bool SAL_CALL osl_isSendReady ( return sal_False; } - return __osl_socket_poll (pSocket, pTimeout, POLLOUT); + return socket_poll (pSocket, pTimeout, POLLOUT); } sal_Bool SAL_CALL osl_isExceptionPending ( @@ -2108,7 +2108,7 @@ sal_Bool SAL_CALL osl_isExceptionPending ( return sal_False; } - return __osl_socket_poll (pSocket, pTimeout, POLLPRI); + return socket_poll (pSocket, pTimeout, POLLPRI); } sal_Bool SAL_CALL osl_shutdownSocket(oslSocket pSocket, diff --git a/sal/osl/unx/sockimpl.hxx b/sal/osl/unx/sockimpl.hxx index 0b702c6db3c7..70cd578888d5 100644 --- a/sal/osl/unx/sockimpl.hxx +++ b/sal/osl/unx/sockimpl.hxx @@ -54,9 +54,6 @@ struct oslPipeImpl { #endif }; -oslSocket __osl_createSocketImpl(int Socket); -void __osl_destroySocketImpl(oslSocket pImpl); - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |