summaryrefslogtreecommitdiff
path: root/include/osl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-01-27 10:45:55 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-01-27 10:47:33 +0100
commite344d2ac328332aeb0e326636a0a2cd61b812b6a (patch)
tree5563c5639c13810850253186cfd91aaf94488a57 /include/osl
parent65191cda819ee8f4d14f6cdf12568c35e46b5c66 (diff)
Let C++ inline functions return bool instead of sal_Bool
...to improve diagnosing misuses of boolean expressions in client code (cf. compilerplugins/clang/implicitboolconversion.cxx). This change should be transparent to client code. Change-Id: Ibf43c5ded609b489952e1cc666cac1e72ffa2386
Diffstat (limited to 'include/osl')
-rw-r--r--include/osl/conditn.hxx6
-rw-r--r--include/osl/file.hxx52
-rw-r--r--include/osl/module.hxx16
-rw-r--r--include/osl/mutex.hxx12
-rw-r--r--include/osl/pipe.hxx8
-rw-r--r--include/osl/pipe_decl.hxx10
-rw-r--r--include/osl/profile.hxx14
-rw-r--r--include/osl/security.hxx14
-rw-r--r--include/osl/security_decl.hxx14
-rw-r--r--include/osl/socket.hxx32
-rw-r--r--include/osl/socket_decl.hxx68
-rw-r--r--include/osl/thread.hxx14
12 files changed, 130 insertions, 130 deletions
diff --git a/include/osl/conditn.hxx b/include/osl/conditn.hxx
index 337d651ab2a0..fd0dfdfb303d 100644
--- a/include/osl/conditn.hxx
+++ b/include/osl/conditn.hxx
@@ -62,14 +62,14 @@ namespace osl
osl_destroyCondition(condition);
}
- /* Release all waiting threads, check returns sal_True.
+ /* Release all waiting threads, check returns true.
*/
void set()
{
osl_setCondition(condition);
}
- /* Reset condition to false: wait() will block, check() returns sal_False.
+ /* Reset condition to false: wait() will block, check() returns false.
*/
void reset() {
osl_resetCondition(condition);
@@ -84,7 +84,7 @@ namespace osl
/** Checks if the condition is set without blocking.
*/
- sal_Bool check()
+ bool check()
{
return osl_checkCondition(condition);
}
diff --git a/include/osl/file.hxx b/include/osl/file.hxx
index 7b50b537ea92..7bff7e6f20c2 100644
--- a/include/osl/file.hxx
+++ b/include/osl/file.hxx
@@ -453,10 +453,10 @@ public:
@param nMask
Set of flags for the fields to check.
- @return sal_True if all fields are valid else sal_False.
+ @return true if all fields are valid else false.
*/
- inline sal_Bool isValid( sal_uInt32 nMask ) const
+ inline bool isValid( sal_uInt32 nMask ) const
{
return ( nMask & _aInfo.uValidFields ) == nMask;
}
@@ -464,10 +464,10 @@ public:
/** Check the remote flag.
@return
- sal_True if Attributes are valid and the volume is remote else sal_False.
+ true if Attributes are valid and the volume is remote else false.
*/
- inline sal_Bool getRemoteFlag() const
+ inline bool getRemoteFlag() const
{
return 0 != (_aInfo.uAttributes & osl_Volume_Attribute_Remote);
}
@@ -475,10 +475,10 @@ public:
/** Check the removeable flag.
@return
- sal_True if attributes are valid and the volume is removable else sal_False.
+ true if attributes are valid and the volume is removable else false.
*/
- inline sal_Bool getRemoveableFlag() const
+ inline bool getRemoveableFlag() const
{
return 0 != (_aInfo.uAttributes & osl_Volume_Attribute_Removeable);
}
@@ -486,10 +486,10 @@ public:
/** Check the compact disc flag.
@return
- sal_True if attributes are valid and the volume is a CDROM else sal_False.
+ true if attributes are valid and the volume is a CDROM else false.
*/
- inline sal_Bool getCompactDiscFlag() const
+ inline bool getCompactDiscFlag() const
{
return 0 != (_aInfo.uAttributes & osl_Volume_Attribute_CompactDisc);
}
@@ -497,10 +497,10 @@ public:
/** Check the floppy disc flag.
@return
- sal_True if attributes are valid and the volume is a floppy disk else sal_False.
+ true if attributes are valid and the volume is a floppy disk else false.
*/
- inline sal_Bool getFloppyDiskFlag() const
+ inline bool getFloppyDiskFlag() const
{
return 0 != (_aInfo.uAttributes & osl_Volume_Attribute_FloppyDisk);
}
@@ -508,10 +508,10 @@ public:
/** Check the fixed disk flag.
@return
- sal_True if attributes are valid and the volume is a fixed disk else sal_False.
+ true if attributes are valid and the volume is a fixed disk else false.
*/
- inline sal_Bool getFixedDiskFlag() const
+ inline bool getFixedDiskFlag() const
{
return 0 != (_aInfo.uAttributes & osl_Volume_Attribute_FixedDisk);
}
@@ -519,10 +519,10 @@ public:
/** Check the RAM disk flag.
@return
- sal_True if attributes are valid and the volume is a RAM disk else sal_False.
+ true if attributes are valid and the volume is a RAM disk else false.
*/
- inline sal_Bool getRAMDiskFlag() const
+ inline bool getRAMDiskFlag() const
{
return 0 != (_aInfo.uAttributes & osl_Volume_Attribute_RAMDisk);
}
@@ -705,10 +705,10 @@ public:
Set of flags for the fields to check.
@return
- sal_True if all fields are valid else sal_False.
+ true if all fields are valid else false.
*/
- inline sal_Bool isValid( sal_uInt32 nMask ) const
+ inline bool isValid( sal_uInt32 nMask ) const
{
return ( nMask & _aStatus.uValidFields ) == nMask;
}
@@ -736,7 +736,7 @@ public:
@see getFileType
@since LibreOffice 3.6
*/
- inline sal_Bool isDirectory() const
+ inline bool isDirectory() const
{
return ( getFileType() == Directory || getFileType() == Volume );
}
@@ -751,7 +751,7 @@ public:
@see isLink
@since LibreOffice 3.6
*/
- inline sal_Bool isRegular() const
+ inline bool isRegular() const
{
return ( getFileType() == Regular );
}
@@ -764,7 +764,7 @@ public:
@see getFileType
@since LibreOffice 3.6
*/
- inline sal_Bool isLink() const
+ inline bool isLink() const
{
return ( getFileType() == Link );
}
@@ -1487,10 +1487,10 @@ public:
/** Check for validity of this instance.
@return
- sal_True if object is valid directory item else sal_False.
+ true if object is valid directory item else false.
*/
- inline sal_Bool is()
+ inline bool is()
{
return _pData != NULL;
}
@@ -1586,14 +1586,14 @@ public:
A directory handle to compare with the underlying object's item
@return
- sal_True: if the items point to an identical resource<br>
- sal_False: if the items point to a different resource, or a fatal error occured<br>
+ true: if the items point to an identical resource<br>
+ false: if the items point to a different resource, or a fatal error occured<br>
@see osl_getDirectoryItem()
@since LibreOffice 3.6
*/
- inline sal_Bool isIdenticalTo( const DirectoryItem &pOther )
+ inline bool isIdenticalTo( const DirectoryItem &pOther )
{
return osl_identicalDirectoryItem( _pData, pOther._pData );
}
@@ -1717,13 +1717,13 @@ public:
Query if directory is open and so item enumeration is valid.
@return
- sal_True if the directory is open else sal_False.
+ true if the directory is open else false.
@see open()
@see close()
*/
- inline sal_Bool isOpen() { return _pData != NULL; }
+ inline bool isOpen() { return _pData != NULL; }
/** Close a directory.
diff --git a/include/osl/module.hxx b/include/osl/module.hxx
index e78ff8842592..058a1d155abe 100644
--- a/include/osl/module.hxx
+++ b/include/osl/module.hxx
@@ -32,7 +32,7 @@ class Module
Module& operator = ( const Module&);
public:
- static sal_Bool getUrlFromAddress(void * addr, ::rtl::OUString & libraryUrl) {
+ static bool getUrlFromAddress(void * addr, ::rtl::OUString & libraryUrl) {
return osl_getModuleURLFromAddress(addr, &libraryUrl.pData);
}
@@ -49,15 +49,15 @@ public:
@return
<dl>
- <dt>sal_True</dt>
+ <dt>true</dt>
<dd>on success</dd>
- <dt>sal_False</dt>
+ <dt>false</dt>
<dd>can not get the URL from the specified function address or the parameter is invalid.</dd>
</dl>
@see getUrlFromAddress
*/
- static sal_Bool getUrlFromAddress( oslGenericFunction addr, ::rtl::OUString & libraryUrl){
+ static bool getUrlFromAddress( oslGenericFunction addr, ::rtl::OUString & libraryUrl){
return osl_getModuleURLFromFunctionAddress( addr, &libraryUrl.pData );
}
@@ -81,7 +81,7 @@ public:
#ifndef DISABLE_DYNLOADING
- sal_Bool SAL_CALL load( const ::rtl::OUString& strModuleName,
+ bool SAL_CALL load( const ::rtl::OUString& strModuleName,
sal_Int32 nRtldMode = SAL_LOADMODULE_DEFAULT)
{
unload();
@@ -90,7 +90,7 @@ public:
}
/// @since UDK 3.2.8
- sal_Bool SAL_CALL loadRelative(
+ bool SAL_CALL loadRelative(
::oslGenericFunction baseModule, ::rtl::OUString const & relativePath,
::sal_Int32 mode = SAL_LOADMODULE_DEFAULT)
{
@@ -100,7 +100,7 @@ public:
}
/// @since LibreOffice 3.5
- sal_Bool SAL_CALL loadRelative(
+ bool SAL_CALL loadRelative(
oslGenericFunction baseModule, char const * relativePath,
sal_Int32 mode = SAL_LOADMODULE_DEFAULT)
{
@@ -120,7 +120,7 @@ public:
#endif
- sal_Bool SAL_CALL is() const
+ bool SAL_CALL is() const
{
return m_Module != NULL;
}
diff --git a/include/osl/mutex.hxx b/include/osl/mutex.hxx
index 2aff64b8797d..17d57e80b473 100644
--- a/include/osl/mutex.hxx
+++ b/include/osl/mutex.hxx
@@ -50,28 +50,28 @@ namespace osl
}
/** Acquire the mutex, block if already acquired by another thread.
- @return sal_False if system-call fails.
+ @return false if system-call fails.
@see ::osl_acquireMutex()
*/
- sal_Bool acquire()
+ bool acquire()
{
return osl_acquireMutex(mutex);
}
/** Try to acquire the mutex without blocking.
- @return sal_False if it could not be acquired.
+ @return false if it could not be acquired.
@see ::osl_tryToAcquireMutex()
*/
- sal_Bool tryToAcquire()
+ bool tryToAcquire()
{
return osl_tryToAcquireMutex(mutex);
}
/** Release the mutex.
- @return sal_False if system-call fails.
+ @return false if system-call fails.
@see ::osl_releaseMutex()
*/
- sal_Bool release()
+ bool release()
{
return osl_releaseMutex(mutex);
}
diff --git a/include/osl/pipe.hxx b/include/osl/pipe.hxx
index e1bb0d32b926..fe4766f5ff99 100644
--- a/include/osl/pipe.hxx
+++ b/include/osl/pipe.hxx
@@ -67,7 +67,7 @@ namespace osl
}
//______________________________________________________________________________
- inline sal_Bool Pipe::create( const ::rtl::OUString & strName,
+ inline bool Pipe::create( const ::rtl::OUString & strName,
oslPipeOptions Options, const Security &rSec )
{
*this = Pipe( strName, Options, rSec );
@@ -75,7 +75,7 @@ namespace osl
}
//______________________________________________________________________________
- inline sal_Bool Pipe::create( const ::rtl::OUString & strName, oslPipeOptions Options )
+ inline bool Pipe::create( const ::rtl::OUString & strName, oslPipeOptions Options )
{
*this = Pipe( strName, Options );
return is();
@@ -99,13 +99,13 @@ namespace osl
}
//______________________________________________________________________________
- inline sal_Bool SAL_CALL Pipe::is() const
+ inline bool SAL_CALL Pipe::is() const
{
return m_handle != 0;
}
//______________________________________________________________________________
- inline sal_Bool SAL_CALL Pipe::operator==( const Pipe& rPipe ) const
+ inline bool SAL_CALL Pipe::operator==( const Pipe& rPipe ) const
{
return m_handle == rPipe.m_handle;
}
diff --git a/include/osl/pipe_decl.hxx b/include/osl/pipe_decl.hxx
index 0fb8c4429cd4..4ec681712646 100644
--- a/include/osl/pipe_decl.hxx
+++ b/include/osl/pipe_decl.hxx
@@ -71,7 +71,7 @@ public:
*/
inline ~Pipe();
- inline sal_Bool SAL_CALL is() const;
+ inline bool SAL_CALL is() const;
/** Creates an insecure pipe that is accessible for all users
with the given attributes.
@@ -81,7 +81,7 @@ public:
@param rSec
@return True if socket was successfully created.
*/
- inline sal_Bool create( const ::rtl::OUString & strName,
+ inline bool create( const ::rtl::OUString & strName,
oslPipeOptions Options, const Security &rSec );
/** Creates a secure that access rights depend on the umask settings
@@ -92,7 +92,7 @@ public:
@param Options
@return True if socket was successfully created.
*/
- inline sal_Bool create( const ::rtl::OUString & strName, oslPipeOptions Options = osl_Pipe_OPEN );
+ inline bool create( const ::rtl::OUString & strName, oslPipeOptions Options = osl_Pipe_OPEN );
/** releases the underlying handle
*/
@@ -111,9 +111,9 @@ public:
/** Checks if the pipe is valid.
@return True if the object represents a valid pipe.
*/
- inline sal_Bool SAL_CALL isValid() const;
+ inline bool SAL_CALL isValid() const;
- inline sal_Bool SAL_CALL operator==( const Pipe& rPipe ) const;
+ inline bool SAL_CALL operator==( const Pipe& rPipe ) const;
/** Closes the pipe.
*/
diff --git a/include/osl/profile.hxx b/include/osl/profile.hxx
index bd4794e04951..e2ae14529689 100644
--- a/include/osl/profile.hxx
+++ b/include/osl/profile.hxx
@@ -60,7 +60,7 @@ namespace osl {
}
- sal_Bool flush()
+ bool flush()
{
return osl_flushProfile(profile);
}
@@ -78,7 +78,7 @@ namespace osl {
}
- sal_Bool readBool( const rtl::OString& rSection, const rtl::OString& rEntry, sal_Bool bDefault )
+ bool readBool( const rtl::OString& rSection, const rtl::OString& rEntry, bool bDefault )
{
return osl_readProfileBool( profile, rSection.getStr(), rEntry.getStr(), bDefault );
}
@@ -102,18 +102,18 @@ namespace osl {
return nRet;
}
- sal_Bool writeString(const rtl::OString& rSection, const rtl::OString& rEntry,
+ bool writeString(const rtl::OString& rSection, const rtl::OString& rEntry,
const rtl::OString& rString)
{
return osl_writeProfileString(profile, rSection.getStr(), rEntry.getStr(), rString.getStr());
}
- sal_Bool writeBool(const rtl::OString& rSection, const rtl::OString& rEntry, sal_Bool Value)
+ bool writeBool(const rtl::OString& rSection, const rtl::OString& rEntry, bool Value)
{
return osl_writeProfileBool(profile, rSection.getStr(), rEntry.getStr(), Value);
}
- sal_Bool writeIdent(const rtl::OString& rSection, const rtl::OString& rEntry,
+ bool writeIdent(const rtl::OString& rSection, const rtl::OString& rEntry,
sal_uInt32 nFirstId, const std::list< rtl::OString >& rStrings,
sal_uInt32 nValue)
{
@@ -127,7 +127,7 @@ namespace osl {
++it;
}
pStrings[ nItems ] = NULL;
- sal_Bool bRet =
+ bool bRet =
osl_writeProfileIdent(profile, rSection.getStr(), rEntry.getStr(), nFirstId, pStrings, nValue );
delete pStrings;
return bRet;
@@ -138,7 +138,7 @@ namespace osl {
@param rEntry Name of the entry to remove.
@return False if section or entry could not be found.
*/
- sal_Bool removeEntry(const rtl::OString& rSection, const rtl::OString& rEntry)
+ bool removeEntry(const rtl::OString& rSection, const rtl::OString& rEntry)
{
return osl_removeProfileEntry(profile, rSection.getStr(), rEntry.getStr());
}
diff --git a/include/osl/security.hxx b/include/osl/security.hxx
index 46e27ecb6196..6f7b24819c5d 100644
--- a/include/osl/security.hxx
+++ b/include/osl/security.hxx
@@ -36,7 +36,7 @@ inline Security::~Security()
osl_freeSecurityHandle(m_handle);
}
-inline sal_Bool Security::logonUser(const rtl::OUString& strName,
+inline bool Security::logonUser(const rtl::OUString& strName,
const rtl::OUString& strPasswd)
{
osl_freeSecurityHandle(m_handle);
@@ -47,7 +47,7 @@ inline sal_Bool Security::logonUser(const rtl::OUString& strName,
== osl_Security_E_None);
}
-inline sal_Bool Security::logonUser( const rtl::OUString& strName,
+inline bool Security::logonUser( const rtl::OUString& strName,
const rtl::OUString& strPasswd,
const rtl::OUString& strFileServer )
{
@@ -59,30 +59,30 @@ inline sal_Bool Security::logonUser( const rtl::OUString& strName,
== osl_Security_E_None);
}
-inline sal_Bool Security::getUserIdent( rtl::OUString& strIdent) const
+inline bool Security::getUserIdent( rtl::OUString& strIdent) const
{
return osl_getUserIdent( m_handle, &strIdent.pData );
}
-inline sal_Bool Security::getUserName( rtl::OUString& strName ) const
+inline bool Security::getUserName( rtl::OUString& strName ) const
{
return osl_getUserName( m_handle, &strName.pData );
}
-inline sal_Bool Security::getHomeDir( rtl::OUString& strDirectory) const
+inline bool Security::getHomeDir( rtl::OUString& strDirectory) const
{
return osl_getHomeDir(m_handle, &strDirectory.pData );
}
-inline sal_Bool Security::getConfigDir( rtl::OUString& strDirectory ) const
+inline bool Security::getConfigDir( rtl::OUString& strDirectory ) const
{
return osl_getConfigDir( m_handle, &strDirectory.pData );
}
-inline sal_Bool Security::isAdministrator() const
+inline bool Security::isAdministrator() const
{
return osl_isAdministrator(m_handle);
}
diff --git a/include/osl/security_decl.hxx b/include/osl/security_decl.hxx
index 95785cd0b8d3..4e0ff268e5f2 100644
--- a/include/osl/security_decl.hxx
+++ b/include/osl/security_decl.hxx
@@ -48,7 +48,7 @@ public:
@return True, if the specified user is known by the underlying operating system,
otherwise False
*/
- inline sal_Bool SAL_CALL logonUser(const rtl::OUString& strName,
+ inline bool SAL_CALL logonUser(const rtl::OUString& strName,
const rtl::OUString& strPasswd);
/** get the security information for one user.
@@ -64,7 +64,7 @@ public:
@return True, if the specified user is known by file server and the
could be connected, otherwise False
*/
- inline sal_Bool SAL_CALL logonUser(const rtl::OUString & strName,
+ inline bool SAL_CALL logonUser(const rtl::OUString & strName,
const rtl::OUString & strPasswd,
const rtl::OUString & strFileServer);
@@ -72,30 +72,30 @@ public:
@param[out] strIdent is the OUString which returns the name
@return True, if any user is successfully logged in, otherwise False
*/
- inline sal_Bool SAL_CALL getUserIdent( rtl::OUString& strIdent) const;
+ inline bool SAL_CALL getUserIdent( rtl::OUString& strIdent) const;
/** get the name of the logged in user.
@param[out] strName is the OUString which returns the name
@return True, if any user is successfully logged in, otherwise False
*/
- inline sal_Bool SAL_CALL getUserName( rtl::OUString& strName) const;
+ inline bool SAL_CALL getUserName( rtl::OUString& strName) const;
/** get the home directory of the logged in user.
@param[out] strDirectory is the OUString which returns the directory name
@return True, if any user is successfully logged in, otherwise False
*/
- inline sal_Bool SAL_CALL getHomeDir( rtl::OUString& strDirectory) const;
+ inline bool SAL_CALL getHomeDir( rtl::OUString& strDirectory) const;
/** get the directory for configuration data of the logged in user.
@param[out] strDirectory is the OUString which returns the directory name
@return True, if any user is successfully logged in, otherwise False
*/
- inline sal_Bool SAL_CALL getConfigDir( rtl::OUString & strDirectory) const;
+ inline bool SAL_CALL getConfigDir( rtl::OUString & strDirectory) const;
/** Query if the user who is logged inhas administrator rights.
@return True, if the user has administrator rights, otherwise false.
*/
- inline sal_Bool SAL_CALL isAdministrator() const;
+ inline bool SAL_CALL isAdministrator() const;
/** Returns the underlying oslSecurity handle
*/
diff --git a/include/osl/socket.hxx b/include/osl/socket.hxx
index 2537d9f970a6..f62f6f340a91 100644
--- a/include/osl/socket.hxx
+++ b/include/osl/socket.hxx
@@ -91,19 +91,19 @@ namespace osl
}
//______________________________________________________________________________
- inline sal_Bool SAL_CALL SocketAddr::setPort( sal_Int32 nPort )
+ inline bool SAL_CALL SocketAddr::setPort( sal_Int32 nPort )
{
return osl_setInetPortOfSocketAddr(m_handle, nPort );
}
- inline sal_Bool SAL_CALL SocketAddr::setHostname( const ::rtl::OUString &sDottedIpOrHostname )
+ inline bool SAL_CALL SocketAddr::setHostname( const ::rtl::OUString &sDottedIpOrHostname )
{
*this = SocketAddr( sDottedIpOrHostname , getPort() );
return is();
}
//______________________________________________________________________________
- inline sal_Bool SAL_CALL SocketAddr::setAddr( const ::rtl::ByteSequence & address )
+ inline bool SAL_CALL SocketAddr::setAddr( const ::rtl::ByteSequence & address )
{
return osl_setAddrOfSocketAddr( m_handle, address.getHandle() )
== osl_Socket_Ok;
@@ -144,7 +144,7 @@ namespace osl
}
//______________________________________________________________________________
- inline sal_Bool SAL_CALL SocketAddr::operator== (oslSocketAddr Addr) const
+ inline bool SAL_CALL SocketAddr::operator== (oslSocketAddr Addr) const
{
return osl_isEqualSocketAddr( m_handle, Addr );
}
@@ -155,7 +155,7 @@ namespace osl
}
//______________________________________________________________________________
- inline sal_Bool SocketAddr::is() const
+ inline bool SocketAddr::is() const
{
return m_handle != 0;
}
@@ -233,13 +233,13 @@ namespace osl
}
//______________________________________________________________________________
- inline sal_Bool Socket::operator==( const Socket& rSocket ) const
+ inline bool Socket::operator==( const Socket& rSocket ) const
{
return m_handle == rSocket.getHandle();
}
//______________________________________________________________________________
- inline sal_Bool Socket::operator==( const oslSocket socketHandle ) const
+ inline bool Socket::operator==( const oslSocket socketHandle ) const
{
return m_handle == socketHandle;
}
@@ -301,25 +301,25 @@ namespace osl
}
//______________________________________________________________________________
- inline sal_Bool Socket::bind(const SocketAddr& LocalInterface)
+ inline bool Socket::bind(const SocketAddr& LocalInterface)
{
return osl_bindAddrToSocket( m_handle , LocalInterface.getHandle() );
}
//______________________________________________________________________________
- inline sal_Bool Socket::isRecvReady(const TimeValue *pTimeout ) const
+ inline bool Socket::isRecvReady(const TimeValue *pTimeout ) const
{
return osl_isReceiveReady( m_handle , pTimeout );
}
//______________________________________________________________________________
- inline sal_Bool Socket::isSendReady(const TimeValue *pTimeout ) const
+ inline bool Socket::isSendReady(const TimeValue *pTimeout ) const
{
return osl_isSendReady( m_handle, pTimeout );
}
//______________________________________________________________________________
- inline sal_Bool Socket::isExceptionPending(const TimeValue *pTimeout ) const
+ inline bool Socket::isExceptionPending(const TimeValue *pTimeout ) const
{
return osl_isExceptionPending( m_handle, pTimeout );
}
@@ -341,7 +341,7 @@ namespace osl
}
//______________________________________________________________________________
- inline sal_Bool Socket::setOption( oslSocketOption Option,
+ inline bool Socket::setOption( oslSocketOption Option,
void* pBuffer,
sal_uInt32 BufferLen,
oslSocketOptionLevel Level ) const
@@ -350,7 +350,7 @@ namespace osl
}
//______________________________________________________________________________
- inline sal_Bool Socket::setOption( oslSocketOption option, sal_Int32 nValue )
+ inline bool Socket::setOption( oslSocketOption option, sal_Int32 nValue )
{
return setOption( option, &nValue, sizeof( nValue ) );
}
@@ -364,13 +364,13 @@ namespace osl
}
//______________________________________________________________________________
- inline sal_Bool Socket::enableNonBlockingMode( sal_Bool bNonBlockingMode)
+ inline bool Socket::enableNonBlockingMode( bool bNonBlockingMode)
{
return osl_enableNonBlockingMode( m_handle , bNonBlockingMode );
}
//______________________________________________________________________________
- inline sal_Bool Socket::isNonBlockingMode() const
+ inline bool Socket::isNonBlockingMode() const
{
return osl_isNonBlockingMode( m_handle );
}
@@ -475,7 +475,7 @@ namespace osl
{}
//______________________________________________________________________________
- inline sal_Bool AcceptorSocket::listen(sal_Int32 MaxPendingConnections)
+ inline bool AcceptorSocket::listen(sal_Int32 MaxPendingConnections)
{
return osl_listenOnSocket( m_handle, MaxPendingConnections );
}
diff --git a/include/osl/socket_decl.hxx b/include/osl/socket_decl.hxx
index 38c9d7694c7f..5a4c5469c9e6 100644
--- a/include/osl/socket_decl.hxx
+++ b/include/osl/socket_decl.hxx
@@ -69,10 +69,10 @@ namespace osl
inline ~SocketAddr();
/** checks, if the SocketAddr was created successful.
- @return <code>sal_True</code> if there is a valid underlying handle,
- otherwise sal_False.
+ @return <code>true</code> if there is a valid underlying handle,
+ otherwise false.
*/
- inline sal_Bool is() const;
+ inline bool is() const;
/** Converts the address to a (human readable) domain-name.
@@ -86,7 +86,7 @@ namespace osl
/** Sets the ipaddress or hostname of the SocketAddress
*/
- inline sal_Bool SAL_CALL setHostname( const ::rtl::OUString &sDottedIpOrHostname );
+ inline bool SAL_CALL setHostname( const ::rtl::OUString &sDottedIpOrHostname );
/** Returns the port number of the address.
@return the port in host-byte order or or OSL_INVALID_PORT on errors.
@@ -96,12 +96,12 @@ namespace osl
/** Sets the port number of the address.
@return true if successfule.
*/
- inline sal_Bool SAL_CALL setPort( sal_Int32 nPort );
+ inline bool SAL_CALL setPort( sal_Int32 nPort );
/** Sets the address of the underlying socket address struct in network byte order.
@return true on success, false signales falure.
*/
- inline sal_Bool SAL_CALL setAddr( const ::rtl::ByteSequence & address );
+ inline bool SAL_CALL setAddr( const ::rtl::ByteSequence & address );
/** Returns the address of the underlying socket in network byte order
*/
@@ -123,11 +123,11 @@ namespace osl
/** Returns true if the underlying handle is identical to the Addr handle.
*/
- inline sal_Bool SAL_CALL operator== (oslSocketAddr Addr) const;
+ inline bool SAL_CALL operator== (oslSocketAddr Addr) const;
/** Returns true if the underlying handle is identical to the Addr handle.
*/
- inline sal_Bool SAL_CALL operator== (const SocketAddr & Addr) const;
+ inline bool SAL_CALL operator== (const SocketAddr & Addr) const;
/** Returns the underlying SocketAddr handle without copyconstructing it.
*/
@@ -201,16 +201,16 @@ namespace osl
inline Socket& SAL_CALL operator= (const Socket& sock);
/**
- @return <code>sal_True</code>, when the underlying handle of both
- Socket instances are identical, <code>sal_False</code> otherwise.
+ @return <code>true</code>, when the underlying handle of both
+ Socket instances are identical, <code>false</code> otherwise.
*/
- inline sal_Bool SAL_CALL operator==( const Socket& rSocket ) const ;
+ inline bool SAL_CALL operator==( const Socket& rSocket ) const ;
/**
- @return <code>sal_True</code>, when the underlying handle of both
- Socket instances are identical, <code>sal_False</code> otherwise.
+ @return <code>true</code>, when the underlying handle of both
+ Socket instances are identical, <code>false</code> otherwise.
*/
- inline sal_Bool SAL_CALL operator==( const oslSocket socketHandle ) const;
+ inline bool SAL_CALL operator==( const oslSocket socketHandle ) const;
/** Closes a definite or both directions of the bidirectional stream.
@@ -261,31 +261,31 @@ namespace osl
@param LocalInterface Address of the Interface
@return True if bind was successful.
*/
- inline sal_Bool SAL_CALL bind(const SocketAddr& LocalInterface);
+ inline bool SAL_CALL bind(const SocketAddr& LocalInterface);
/** Checks if read operations will block.
You can specify a timeout-value in seconds/nanoseconds that denotes
how the operation will block if the Socket is not ready.
- @return <code>sal_True</code> if read operations (recv, recvFrom, accept) on the Socket
- will NOT block; <code>sal_False</code> if it would block or if an error occurred.
+ @return <code>true</code> if read operations (recv, recvFrom, accept) on the Socket
+ will NOT block; <code>false</code> if it would block or if an error occurred.
@param pTimeout if 0, the operation will block without a timeout. Otherwise
the specified amout of time.
*/
- inline sal_Bool SAL_CALL isRecvReady(const TimeValue *pTimeout = 0) const;
+ inline bool SAL_CALL isRecvReady(const TimeValue *pTimeout = 0) const;
/** Checks if send operations will block.
You can specify a timeout-value in seconds/nanoseconds that denotes
how the operation will block if the Socket is not ready.
- @return <code>sal_True</code> if send operations (send, sendTo) on the Socket
- will NOT block; <code>sal_False</code> if it would block or if an error occurred.
+ @return <code>true</code> if send operations (send, sendTo) on the Socket
+ will NOT block; <code>false</code> if it would block or if an error occurred.
@param pTimeout if 0, the operation will block without a timeout. Otherwise
the specified amout of time.
*/
- inline sal_Bool SAL_CALL isSendReady(const TimeValue *pTimeout = 0) const;
+ inline bool SAL_CALL isSendReady(const TimeValue *pTimeout = 0) const;
/** Checks if a request for out-of-band data will block.
@@ -293,14 +293,14 @@ namespace osl
You can specify a timeout-value in seconds/nanoseconds that denotes
how the operation will block if the Socket has no pending OOB data.
- @return <code>sal_True</code> if OOB-request operations (recv with appropriate flags)
- on the Socket will NOT block; <code>sal_False</code> if it would block or if
+ @return <code>true</code> if OOB-request operations (recv with appropriate flags)
+ on the Socket will NOT block; <code>false</code> if it would block or if
an error occurred.
@param pTimeout if 0, the operation will block without a timeout. Otherwise
the specified amout of time.
*/
- inline sal_Bool SAL_CALL isExceptionPending(const TimeValue *pTimeout = 0) const;
+ inline bool SAL_CALL isExceptionPending(const TimeValue *pTimeout = 0) const;
/** Queries the socket for its type.
@@ -444,7 +444,7 @@ namespace osl
@return True if the option could be changed.
*/
- inline sal_Bool SAL_CALL setOption( oslSocketOption Option,
+ inline bool SAL_CALL setOption( oslSocketOption Option,
void* pBuffer,
sal_uInt32 BufferLen,
oslSocketOptionLevel Level= osl_Socket_LevelSocket ) const;
@@ -452,7 +452,7 @@ namespace osl
/** Convenience function for setting sal_Bool and sal_Int32 option values.
@see setOption()
*/
- inline sal_Bool setOption( oslSocketOption option, sal_Int32 nValue );
+ inline bool setOption( oslSocketOption option, sal_Int32 nValue );
/** Convenience function for retrieving sal_Bool and sal_Int32 option values.
@see setOption()
@@ -460,17 +460,17 @@ namespace osl
inline sal_Int32 getOption( oslSocketOption option ) const;
/** Enables/disables non-blocking mode of the socket.
- @param bNonBlockingMode If <code>sal_True</code>, blocking mode will be switched off
- If <code>sal_False</code>, the socket will become a blocking
+ @param bNonBlockingMode If <code>true</code>, blocking mode will be switched off
+ If <code>false</code>, the socket will become a blocking
socket (which is the default behaviour of a socket).
- @return <code>sal_True</code> if mode could be set.
+ @return <code>true</code> if mode could be set.
*/
- inline sal_Bool SAL_CALL enableNonBlockingMode( sal_Bool bNonBlockingMode);
+ inline bool SAL_CALL enableNonBlockingMode( bool bNonBlockingMode);
/** Query blocking mode of the socket.
- @return <code>sal_True</code> if non-blocking mode is set.
+ @return <code>true</code> if non-blocking mode is set.
*/
- inline sal_Bool SAL_CALL isNonBlockingMode() const;
+ inline bool SAL_CALL isNonBlockingMode() const;
/** clears the error status
@@ -621,9 +621,9 @@ namespace osl
@param MaxPendingConnections The maximum number of pending
connections (waiting to be accepted) on this socket. If you use
-1, a system default value is used.
- @return <code>sal_True</code> if call was successful.
+ @return <code>true</code> if call was successful.
*/
- inline sal_Bool SAL_CALL listen(sal_Int32 MaxPendingConnections= -1);
+ inline bool SAL_CALL listen(sal_Int32 MaxPendingConnections= -1);
/** Accepts incoming connections on the socket. You must
precede this call with osl::Socket::bind() and listen().
diff --git a/include/osl/thread.hxx b/include/osl/thread.hxx
index 2f91b29afa8c..398eca170f2f 100644
--- a/include/osl/thread.hxx
+++ b/include/osl/thread.hxx
@@ -69,7 +69,7 @@ public:
osl_destroyThread( m_hThread);
}
- sal_Bool SAL_CALL create()
+ bool SAL_CALL create()
{
assert(m_hThread == 0); // only one running thread per instance
m_hThread = osl_createSuspendedThread( threadFunc, (void*)this);
@@ -81,11 +81,11 @@ public:
return true;
}
- sal_Bool SAL_CALL createSuspended()
+ bool SAL_CALL createSuspended()
{
assert(m_hThread == 0); // only one running thread per instance
if( m_hThread)
- return sal_False;
+ return false;
m_hThread= osl_createSuspendedThread( threadFunc,
(void*)this);
return m_hThread != 0;
@@ -114,7 +114,7 @@ public:
osl_joinWithThread(m_hThread);
}
- sal_Bool SAL_CALL isRunning() const
+ bool SAL_CALL isRunning() const
{
return osl_isThreadRunning(m_hThread);
}
@@ -154,9 +154,9 @@ public:
osl_setThreadName(name);
}
- virtual sal_Bool SAL_CALL schedule()
+ virtual bool SAL_CALL schedule()
{
- return m_hThread ? osl_scheduleThread(m_hThread) : sal_False;
+ return m_hThread && osl_scheduleThread(m_hThread);
}
SAL_CALL operator oslThread() const
@@ -208,7 +208,7 @@ public:
/** Set the data associated with the data key.
@returns True if operation was successful
*/
- sal_Bool SAL_CALL setData(void *pData)
+ bool SAL_CALL setData(void *pData)
{
return (osl_setThreadKeyData(m_hKey, pData));
}