Kaydet (Commit) 34a44156 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

cppu: sal_Bool -> bool

Change-Id: I1288f1f6f38d1475b4eb5272509e479bd9f2552d
üst 5dd4a069
......@@ -98,7 +98,7 @@ static typelib_InterfaceTypeDescription * get_type_XCurrentContext()
//==================================================================================================
class ThreadKey
{
sal_Bool _bInit;
bool _bInit;
oslThreadKey _hThreadKey;
oslThreadKeyCallbackFunction _pCallback;
......@@ -110,7 +110,7 @@ public:
};
//__________________________________________________________________________________________________
inline ThreadKey::ThreadKey( oslThreadKeyCallbackFunction pCallback ) SAL_THROW(())
: _bInit( sal_False )
: _bInit( false )
, _pCallback( pCallback )
{
}
......@@ -131,7 +131,7 @@ inline oslThreadKey ThreadKey::getThreadKey() SAL_THROW(())
if (! _bInit)
{
_hThreadKey = ::osl_createThreadKey( _pCallback );
_bInit = sal_True;
_bInit = true;
}
}
return _hThreadKey;
......@@ -170,7 +170,7 @@ IdContainer * getIdContainer() SAL_THROW(())
pId = new IdContainer();
pId->pCurrentContext = 0;
pId->pCurrentContextEnv = 0;
pId->bInit = sal_False;
pId->bInit = false;
::osl_setThreadKeyData( aKey, pId );
}
return pId;
......
......@@ -33,7 +33,7 @@ struct IdContainer
void * pCurrentContext;
uno_ExtEnvironment * pCurrentContextEnv;
//
sal_Bool bInit;
bool bInit;
sal_Sequence * pLocalThreadId;
sal_Int32 nRefCountOfCurrentId;
sal_Sequence * pCurrentId;
......
......@@ -28,7 +28,7 @@ namespace cppu_threadpool {
JobQueue::JobQueue() :
m_nToDo( 0 ),
m_bSuspended( sal_False ),
m_bSuspended( false ),
m_cndWait( osl_createCondition() )
{
osl_resetCondition( m_cndWait );
......@@ -53,7 +53,7 @@ namespace cppu_threadpool {
m_nToDo ++;
}
void *JobQueue::enter( sal_Int64 nDisposeId , sal_Bool bReturnWhenNoJob )
void *JobQueue::enter( sal_Int64 nDisposeId , bool bReturnWhenNoJob )
{
void *pReturn = 0;
{
......@@ -157,32 +157,32 @@ namespace cppu_threadpool {
void JobQueue::suspend()
{
MutexGuard guard( m_mutex );
m_bSuspended = sal_True;
m_bSuspended = true;
}
void JobQueue::resume()
{
MutexGuard guard( m_mutex );
m_bSuspended = sal_False;
m_bSuspended = false;
if( ! m_lstJob.empty() )
{
osl_setCondition( m_cndWait );
}
}
sal_Bool JobQueue::isEmpty() const
bool JobQueue::isEmpty() const
{
MutexGuard guard( m_mutex );
return m_lstJob.empty();
}
sal_Bool JobQueue::isCallstackEmpty() const
bool JobQueue::isCallstackEmpty() const
{
MutexGuard guard( m_mutex );
return m_lstCallstack.empty();
}
sal_Bool JobQueue::isBusy() const
bool JobQueue::isBusy() const
{
MutexGuard guard( m_mutex );
return m_nToDo > 0;
......
......@@ -53,22 +53,22 @@ namespace cppu_threadpool
void add( void *pThreadSpecificData, RequestFun * doRequest );
void *enter( sal_Int64 nDisposeId , sal_Bool bReturnWhenNoJob = sal_False );
void *enter( sal_Int64 nDisposeId , bool bReturnWhenNoJob = false );
void dispose( sal_Int64 nDisposeId );
void suspend();
void resume();
sal_Bool isEmpty() const;
sal_Bool isCallstackEmpty() const;
sal_Bool isBusy() const;
bool isEmpty() const;
bool isCallstackEmpty() const;
bool isBusy() const;
private:
mutable ::osl::Mutex m_mutex;
JobList m_lstJob;
CallStackList m_lstCallstack;
sal_Int32 m_nToDo;
sal_Bool m_bSuspended;
bool m_bSuspended;
oslCondition m_cndWait;
DisposedCallerAdminHolder m_DisposedCallerAdmin;
};
......
......@@ -103,7 +103,7 @@ namespace cppu_threadpool {
ORequestThread::ORequestThread( ThreadPoolHolder const &aThreadPool,
JobQueue *pQueue,
const ByteSequence &aThreadId,
sal_Bool bAsynchron )
bool bAsynchron )
: m_aThreadPool( aThreadPool )
, m_pQueue( pQueue )
, m_aThreadId( aThreadId )
......@@ -114,7 +114,7 @@ namespace cppu_threadpool {
void ORequestThread::setTask( JobQueue *pQueue,
const ByteSequence &aThreadId,
sal_Bool bAsynchron )
bool bAsynchron )
{
m_pQueue = pQueue;
m_aThreadId = aThreadId;
......@@ -169,7 +169,7 @@ namespace cppu_threadpool {
m_pQueue->enter(
sal::static_int_cast< sal_Int64 >(
reinterpret_cast< sal_IntPtr >(this)),
sal_True );
true );
if( m_pQueue->isEmpty() )
{
......
......@@ -41,10 +41,10 @@ namespace cppu_threadpool {
ORequestThread( ThreadPoolHolder const &aThreadPool,
JobQueue * ,
const ::rtl::ByteSequence &aThreadId,
sal_Bool bAsynchron );
bool bAsynchron );
virtual ~ORequestThread();
void setTask( JobQueue * , const ::rtl::ByteSequence & aThreadId , sal_Bool bAsynchron );
void setTask( JobQueue * , const ::rtl::ByteSequence & aThreadId , bool bAsynchron );
void launch();
......@@ -61,7 +61,7 @@ namespace cppu_threadpool {
ThreadPoolHolder m_aThreadPool;
JobQueue *m_pQueue;
::rtl::ByteSequence m_aThreadId;
sal_Bool m_bAsynchron;
bool m_bAsynchron;
};
} // end cppu_threadpool
......
......@@ -68,7 +68,7 @@ uno_getIdOfCurrentThread( sal_Sequence **ppThreadId )
p->nRefCountOfCurrentId = 1;
rtl_byte_sequence_acquire( p->pLocalThreadId );
rtl_byte_sequence_acquire( p->pCurrentId );
p->bInit = sal_True;
p->bInit = true;
}
else
{
......@@ -108,7 +108,7 @@ extern "C" sal_Bool SAL_CALL uno_bindIdToCurrentThread( sal_Sequence *pThreadId
p->nRefCountOfCurrentId = 1;
p->pCurrentId = pThreadId;
rtl_byte_sequence_acquire( p->pCurrentId );
p->bInit = sal_True;
p->bInit = true;
}
else
{
......
......@@ -82,7 +82,7 @@ namespace cppu_threadpool
}
}
sal_Bool DisposedCallerAdmin::isDisposed( sal_Int64 nDisposeId )
bool DisposedCallerAdmin::isDisposed( sal_Int64 nDisposeId )
{
MutexGuard guard( m_mutex );
for( DisposedCallerList::iterator ii = m_lst.begin() ;
......@@ -91,10 +91,10 @@ namespace cppu_threadpool
{
if( (*ii) == nDisposeId )
{
return sal_True;
return true;
}
}
return sal_False;
return false;
}
......@@ -191,9 +191,9 @@ namespace cppu_threadpool
void ThreadPool::createThread( JobQueue *pQueue ,
const ByteSequence &aThreadId,
sal_Bool bAsynchron )
bool bAsynchron )
{
sal_Bool bCreate = sal_True;
bool bCreate = true;
{
// Can a thread be reused ?
MutexGuard guard( m_mutexWaitingThreadList );
......@@ -209,7 +209,7 @@ namespace cppu_threadpool
// let the thread go
osl_setCondition( pWaitingThread->condition );
bCreate = sal_False;
bCreate = false;
}
}
......@@ -221,7 +221,7 @@ namespace cppu_threadpool
}
}
sal_Bool ThreadPool::revokeQueue( const ByteSequence &aThreadId, sal_Bool bAsynchron )
bool ThreadPool::revokeQueue( const ByteSequence &aThreadId, bool bAsynchron )
{
MutexGuard guard( m_mutex );
......@@ -233,7 +233,7 @@ namespace cppu_threadpool
if( ! (*ii).second.second->isEmpty() )
{
// another thread has put something into the queue
return sal_False;
return false;
}
(*ii).second.second = 0;
......@@ -249,7 +249,7 @@ namespace cppu_threadpool
if( ! (*ii).second.first->isEmpty() )
{
// another thread has put something into the queue
return sal_False;
return false;
}
(*ii).second.first = 0;
}
......@@ -259,17 +259,17 @@ namespace cppu_threadpool
m_mapQueue.erase( ii );
}
return sal_True;
return true;
}
void ThreadPool::addJob(
const ByteSequence &aThreadId ,
sal_Bool bAsynchron,
bool bAsynchron,
void *pThreadSpecificData,
RequestFun * doRequest )
{
sal_Bool bCreateThread = sal_False;
bool bCreateThread = false;
JobQueue *pQueue = 0;
{
MutexGuard guard( m_mutex );
......@@ -288,7 +288,7 @@ namespace cppu_threadpool
if( ! (*ii).second.second )
{
(*ii).second.second = new JobQueue();
bCreateThread = sal_True;
bCreateThread = true;
}
pQueue = (*ii).second.second;
}
......@@ -297,7 +297,7 @@ namespace cppu_threadpool
if( ! (*ii).second.first )
{
(*ii).second.first = new JobQueue();
bCreateThread = sal_True;
bCreateThread = true;
}
pQueue = (*ii).second.first;
......@@ -349,7 +349,7 @@ namespace cppu_threadpool
if( pQueue->isCallstackEmpty() )
{
if( revokeQueue( aThreadId , sal_False) )
if( revokeQueue( aThreadId , false) )
{
// remove queue
delete pQueue;
......@@ -370,7 +370,7 @@ using namespace cppu_threadpool;
struct uno_ThreadPool_Equal
{
sal_Bool operator () ( const uno_ThreadPool &a , const uno_ThreadPool &b ) const
bool operator () ( const uno_ThreadPool &a , const uno_ThreadPool &b ) const
{
return a == b;
}
......
......@@ -90,7 +90,7 @@ namespace cppu_threadpool {
void dispose( sal_Int64 nDisposeId );
void destroy( sal_Int64 nDisposeId );
sal_Bool isDisposed( sal_Int64 nDisposeId );
bool isDisposed( sal_Int64 nDisposeId );
private:
::osl::Mutex m_mutex;
......@@ -128,7 +128,7 @@ namespace cppu_threadpool {
void destroy( sal_Int64 nDisposeId );
void addJob( const ByteSequence &aThreadId,
sal_Bool bAsynchron,
bool bAsynchron,
void *pThreadSpecificData,
RequestFun * doRequest );
......@@ -138,7 +138,7 @@ namespace cppu_threadpool {
/********
* @return true, if queue could be successfully revoked.
********/
sal_Bool revokeQueue( const ByteSequence & aThreadId , sal_Bool bAsynchron );
bool revokeQueue( const ByteSequence & aThreadId , bool bAsynchron );
void waitInPool( rtl::Reference< ORequestThread > const & pThread );
......@@ -147,7 +147,7 @@ namespace cppu_threadpool {
ThreadAdmin & getThreadAdmin() { return m_aThreadAdmin; }
private:
void createThread( JobQueue *pQueue, const ByteSequence &aThreadId, sal_Bool bAsynchron);
void createThread( JobQueue *pQueue, const ByteSequence &aThreadId, bool bAsynchron);
ThreadIdHashMap m_mapQueue;
......
......@@ -99,7 +99,7 @@ static inline sal_Int32 newAlignedSize(
return (OldSize + NeededAlignment -1) / NeededAlignment * NeededAlignment + ElementSize;
}
static inline sal_Bool reallyWeak( typelib_TypeClass eTypeClass )
static inline bool reallyWeak( typelib_TypeClass eTypeClass )
SAL_THROW(())
{
return TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( eTypeClass );
......@@ -159,7 +159,7 @@ extern "C" void SAL_CALL typelib_typedescriptionreference_getByName(
//-----------------------------------------------------------------------------
struct equalStr_Impl
{
sal_Bool operator()(const sal_Unicode * const & s1, const sal_Unicode * const & s2) const SAL_THROW(())
bool operator()(const sal_Unicode * const & s1, const sal_Unicode * const & s2) const SAL_THROW(())
{ return 0 == rtl_ustr_compare( s1, s2 ); }
};
......@@ -1617,7 +1617,7 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_register(
}
//------------------------------------------------------------------------
static inline sal_Bool type_equals(
static inline bool type_equals(
typelib_TypeDescriptionReference * p1, typelib_TypeDescriptionReference * p2 )
SAL_THROW(())
{
......@@ -1888,7 +1888,7 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_getByName(
*ppRet = 0;
}
static sal_Bool bInited = sal_False;
static bool bInited = false;
TypeDescriptor_Init_Impl &rInit = Init::get();
if( !bInited )
......@@ -1898,7 +1898,7 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_getByName(
if( !bInited )
{
// avoid recursion during the next ...new calls
bInited = sal_True;
bInited = true;
rtl_uString * pTypeName = 0;
typelib_TypeDescription * pType = 0;
......@@ -2400,7 +2400,7 @@ extern "C" CPPU_DLLPUBLIC sal_Bool SAL_CALL typelib_typedescriptionreference_isA
TYPELIB_DANGER_RELEASE( pFromDescr );
return sal_False;
}
sal_Bool bRet = typelib_typedescriptionreference_isAssignableFrom(
bool bRet = typelib_typedescriptionreference_isAssignableFrom(
pAssignable,
((typelib_TypeDescription *)((typelib_CompoundTypeDescription *)pFromDescr)->pBaseTypeDescription)->pWeakRef );
TYPELIB_DANGER_RELEASE( pFromDescr );
......
This diff is collapsed.
......@@ -140,7 +140,7 @@ void destructStruct(
_destructStruct( pValue, pTypeDescr, release );
}
//==================================================================================================
sal_Bool equalStruct(
bool equalStruct(
void * pDest, void *pSource,
typelib_CompoundTypeDescription * pTypeDescr,
uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release )
......@@ -149,7 +149,7 @@ sal_Bool equalStruct(
return _equalStruct( pDest, pSource, pTypeDescr, queryInterface, release );
}
//==================================================================================================
sal_Bool assignStruct(
bool assignStruct(
void * pDest, void * pSource,
typelib_CompoundTypeDescription * pTypeDescr,
uno_QueryInterfaceFunc queryInterface, uno_AcquireFunc acquire, uno_ReleaseFunc release )
......@@ -178,7 +178,7 @@ void destructSequence(
}
//==================================================================================================
sal_Bool equalSequence(
bool equalSequence(
uno_Sequence * pDest, uno_Sequence * pSource,
typelib_TypeDescriptionReference * pElementType,
uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release )
......
This diff is collapsed.
......@@ -68,7 +68,7 @@ public:
{ return operator = ( rMapping._pMapping ); }
inline uno_Mapping * SAL_CALL get() const SAL_THROW(())
{ return _pMapping; }
inline sal_Bool SAL_CALL is() const SAL_THROW(())
inline bool SAL_CALL is() const SAL_THROW(())
{ return (_pMapping != 0); }
};
//__________________________________________________________________________________________________
......@@ -356,7 +356,7 @@ static uno_ext_getMappingFunc selectMapFunc( const OUString & rBridgeName )
static inline oslModule loadModule( const OUString & rBridgeName )
SAL_THROW(())
{
sal_Bool bNeg;
bool bNeg;
{
MappingsData & rData = getMappingsData();
MutexGuard aGuard( rData.aNegativeLibsMutex );
......
......@@ -151,7 +151,7 @@ extern "C" void * binuno_queryInterface(
void * pUnoI, typelib_TypeDescriptionReference * pDestType );
//--------------------------------------------------------------------------------------------------
inline sal_Bool _type_equals(
inline bool _type_equals(
typelib_TypeDescriptionReference * pType1, typelib_TypeDescriptionReference * pType2 )
SAL_THROW(())
{
......
......@@ -72,7 +72,7 @@ template< class E >
inline Sequence< E >::Sequence( const E * pElements, sal_Int32 len )
{
const Type & rType = ::cppu::getTypeFavourUnsigned( this );
sal_Bool success =
bool success =
::uno_type_sequence_construct(
&_pSequence, rType.getTypeLibType(),
const_cast< E * >( pElements ), len, (uno_AcquireFunc)cpp_acquire );
......@@ -84,7 +84,7 @@ template< class E >
inline Sequence< E >::Sequence( sal_Int32 len )
{
const Type & rType = ::cppu::getTypeFavourUnsigned( this );
sal_Bool success =
bool success =
::uno_type_sequence_construct(
&_pSequence, rType.getTypeLibType(),
0, len, (uno_AcquireFunc)cpp_acquire );
......@@ -134,7 +134,7 @@ template< class E >
inline E * Sequence< E >::getArray()
{
const Type & rType = ::cppu::getTypeFavourUnsigned( this );
sal_Bool success =
bool success =
::uno_type_sequence_reference2One(
&_pSequence, rType.getTypeLibType(),
(uno_AcquireFunc)cpp_acquire, (uno_ReleaseFunc)cpp_release );
......@@ -172,7 +172,7 @@ template< class E >
inline void Sequence< E >::realloc( sal_Int32 nSize )
{
const Type & rType = ::cppu::getTypeFavourUnsigned( this );
sal_Bool success =
bool success =
::uno_type_sequence_realloc(
&_pSequence, rType.getTypeLibType(), nSize,
(uno_AcquireFunc)cpp_acquire, (uno_ReleaseFunc)cpp_release );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment