[Libreoffice-commits] .: 2 commits - comphelper/source i18npool/source sax/test svtools/inc svtools/source unotools/inc vcl/aqua vcl/inc vcl/source vcl/unx vos/inc vos/source
Norbert Thiebaud
nthiebaud at kemper.freedesktop.org
Sun Oct 10 19:41:03 PDT 2010
comphelper/source/eventattachermgr/eventattachermgr.cxx | 18
comphelper/source/xml/attributelist.cxx | 10
i18npool/source/localedata/saxparser.cxx | 2
sax/test/saxdemo.cxx | 2
sax/test/testcomponent.cxx | 2
svtools/inc/pch/precompiled_svtools.hxx | 3
svtools/source/control/inettbc.cxx | 4
unotools/inc/unotools/ucblockbytes.hxx | 2
vcl/aqua/inc/salinst.h | 8
vcl/aqua/source/app/salinst.cxx | 8
vcl/inc/vcl/salgdi.hxx | 2
vcl/inc/vcl/svapp.hxx | 4
vcl/inc/vcl/svdata.hxx | 16
vcl/inc/vcl/unobrok.hxx | 2
vcl/source/app/svapp.cxx | 2
vcl/source/app/svmain.cxx | 2
vcl/source/helper/threadex.cxx | 2
vcl/unx/gtk/app/gtkdata.cxx | 1
vcl/unx/gtk/app/gtkinst.cxx | 12
vcl/unx/headless/svpinst.cxx | 8
vcl/unx/headless/svpinst.hxx | 6
vcl/unx/inc/salinst.h | 8
vcl/unx/inc/salsys.h | 4
vcl/unx/source/app/saldisp.cxx | 2
vcl/unx/source/app/salinst.cxx | 8
vos/inc/vos/diagnose.hxx | 56 --
vos/inc/vos/ref.hxx | 20
vos/inc/vos/ref.inl | 8
vos/inc/vos/refobj.hxx | 10
vos/inc/vos/refobj.inl | 2
vos/source/conditn.cxx | 2
vos/source/module.cxx | 8
vos/source/mutex.cxx | 2
vos/source/object.cxx | 12
vos/source/pipe.cxx | 28 -
vos/source/process.cxx | 2
vos/source/refernce.cxx | 4
vos/source/security.cxx | 12
vos/source/signal.cxx | 2
vos/source/socket.cxx | 395 +++++++---------
vos/source/thread.cxx | 76 +--
vos/source/timer.cxx | 18
42 files changed, 367 insertions(+), 428 deletions(-)
New commits:
commit 57ba3a55b9a9c7668cbc30a8ea7ffcadd162e9b4
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Sun Oct 10 21:29:08 2010 -0500
merge vosremoval-thread patch
diff --git a/svtools/inc/pch/precompiled_svtools.hxx b/svtools/inc/pch/precompiled_svtools.hxx
index 75023cc..fed3a2b 100644
--- a/svtools/inc/pch/precompiled_svtools.hxx
+++ b/svtools/inc/pch/precompiled_svtools.hxx
@@ -352,7 +352,6 @@
#include <cppuhelper/weakref.hxx>
#include <osl/conditn.hxx>
-#include <osl/conditn.hxx>
#include <osl/diagnose.h>
#include <osl/endian.h>
#include <osl/file.h>
@@ -428,7 +427,7 @@
#include <vos/ref.hxx>
#include <vos/refernce.hxx>
#include <vos/security.hxx>
-#include <vos/thread.hxx>
+#include <osl/thread.hxx>
#include <vos/timer.hxx>
//---MARKER---
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index ce4baee..b75931e 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -52,7 +52,7 @@
#include <comphelper/processfactory.hxx>
#include <vcl/toolbox.hxx>
-#include <vos/thread.hxx>
+#include <osl/thread.hxx>
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
#include <unotools/historyoptions.hxx>
@@ -110,7 +110,7 @@ public:
};
// -----------------------------------------------------------------------
-class SvtMatchContext_Impl : public ::vos::OThread
+class SvtMatchContext_Impl : public ::osl::Thread
{
static ::vos::OMutex* pDirMutex;
diff --git a/unotools/inc/unotools/ucblockbytes.hxx b/unotools/inc/unotools/ucblockbytes.hxx
index 3295e60..73185ac 100644
--- a/unotools/inc/unotools/ucblockbytes.hxx
+++ b/unotools/inc/unotools/ucblockbytes.hxx
@@ -33,7 +33,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include "unotools/unotoolsdllapi.h"
-#include <vos/thread.hxx>
+#include <osl/thread.hxx>
#include <vos/conditn.hxx>
#include <vos/mutex.hxx>
#include <tools/stream.hxx>
diff --git a/vcl/aqua/inc/salinst.h b/vcl/aqua/inc/salinst.h
index 38c9878..03ddbd5 100644
--- a/vcl/aqua/inc/salinst.h
+++ b/vcl/aqua/inc/salinst.h
@@ -30,7 +30,7 @@
#include "vcl/sv.h"
#include "vos/mutex.hxx"
-#include "vos/thread.hxx"
+#include "osl/thread.hxx"
#include "vcl/salinst.hxx"
#include "osl/conditn.h"
@@ -49,7 +49,7 @@ class Image;
class SalYieldMutex : public vos::OMutex
{
ULONG mnCount;
- vos::OThread::TThreadIdentifier mnThreadId;
+ oslThreadIdentifier mnThreadId;
public:
SalYieldMutex();
@@ -57,7 +57,7 @@ public:
virtual void release();
virtual sal_Bool tryToAcquire();
ULONG GetAcquireCount() const { return mnCount; }
- vos::OThread::TThreadIdentifier GetThreadId() const { return mnThreadId; }
+ oslThreadIdentifier GetThreadId() const { return mnThreadId; }
};
#define YIELD_GUARD vos::OGuard aGuard( GetSalData()->mpFirstInstance->GetYieldMutex() )
@@ -92,7 +92,7 @@ class AquaSalInstance : public SalInstance
public:
SalYieldMutex* mpSalYieldMutex; // Sal-Yield-Mutex
rtl::OUString maDefaultPrinter;
- vos::OThread::TThreadIdentifier maMainThread;
+ oslThreadIdentifier maMainThread;
bool mbWaitingYield;
int mnActivePrintJobs;
std::list< SalUserEvent > maUserEvents;
diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index fb2785a..94067b2 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -371,13 +371,13 @@ SalYieldMutex::SalYieldMutex()
void SalYieldMutex::acquire()
{
OMutex::acquire();
- mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier();
+ mnThreadId = osl::Thread::getCurrentIdentifier();
mnCount++;
}
void SalYieldMutex::release()
{
- if ( mnThreadId == NAMESPACE_VOS(OThread)::getCurrentIdentifier() )
+ if ( mnThreadId == osl::Thread::getCurrentIdentifier() )
{
if ( mnCount == 1 )
mnThreadId = 0;
@@ -390,7 +390,7 @@ sal_Bool SalYieldMutex::tryToAcquire()
{
if ( OMutex::tryToAcquire() )
{
- mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier();
+ mnThreadId = osl::Thread::getCurrentIdentifier();
mnCount++;
return sal_True;
}
@@ -536,7 +536,7 @@ ULONG AquaSalInstance::ReleaseYieldMutex()
{
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
if ( pYieldMutex->GetThreadId() ==
- NAMESPACE_VOS(OThread)::getCurrentIdentifier() )
+ osl::Thread::getCurrentIdentifier() )
{
ULONG nCount = pYieldMutex->GetAcquireCount();
ULONG n = nCount;
diff --git a/vcl/inc/vcl/salgdi.hxx b/vcl/inc/vcl/salgdi.hxx
index 64789c2..3ba2dbf 100644
--- a/vcl/inc/vcl/salgdi.hxx
+++ b/vcl/inc/vcl/salgdi.hxx
@@ -33,7 +33,7 @@
#include "vcl/sv.h"
#include "vcl/dllapi.h"
#include "vcl/salgtype.hxx"
-#include "vos/thread.hxx"
+#include "osl/thread.hxx"
#include "vcl/outdev.hxx"
#include "vcl/salnativewidgets.hxx"
#include "vcl/salctrlhandle.hxx"
diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx
index 5101e36..a527f2e 100644
--- a/vcl/inc/vcl/svapp.hxx
+++ b/vcl/inc/vcl/svapp.hxx
@@ -28,7 +28,7 @@
#ifndef _SV_SVAPP_HXX
#define _SV_SVAPP_HXX
-#include <vos/thread.hxx>
+#include <osl/thread.hxx>
#include <vos/mutex.hxx>
#include <tools/string.hxx>
#include <tools/link.hxx>
@@ -277,7 +277,7 @@ public:
static void Yield( bool bAllEvents = false );
static void EndYield();
static vos::IMutex& GetSolarMutex();
- static vos::OThread::TThreadIdentifier GetMainThreadIdentifier();
+ static oslThreadIdentifier GetMainThreadIdentifier();
static ULONG ReleaseSolarMutex();
static void AcquireSolarMutex( ULONG nCount );
static void EnableNoYieldMode( bool i_bNoYield );
diff --git a/vcl/inc/vcl/svdata.hxx b/vcl/inc/vcl/svdata.hxx
index 9856465..1ef285b 100644
--- a/vcl/inc/vcl/svdata.hxx
+++ b/vcl/inc/vcl/svdata.hxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -28,7 +28,7 @@
#ifndef _SV_SVDATA_HXX
#define _SV_SVDATA_HXX
-#include <vos/thread.hxx>
+#include <osl/thread.hxx>
#include <tools/string.hxx>
#include <tools/gen.hxx>
#include <tools/shl.hxx>
@@ -174,8 +174,8 @@ struct ImplSVAppData
*/
ImeStatusWindowMode meShowImeStatusWindow;
- DECL_STATIC_LINK( ImplSVAppData, ImplQuitMsg, void* );
-
+ DECL_STATIC_LINK( ImplSVAppData, ImplQuitMsg, void* );
+
};
@@ -352,8 +352,8 @@ struct ImplSVData
DockingManager* mpDockingManager;
BOOL mbIsTestTool;
- vos::OThread::TThreadIdentifier mnMainThreadId;
- ::com::sun::star::uno::Reference<
+ oslThreadIdentifier mnMainThreadId;
+ ::com::sun::star::uno::Reference<
::com::sun::star::awt::XDisplayConnection > mxDisplayConnection;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxAccessBridge;
@@ -397,9 +397,9 @@ bool ImplInitAccessBridge( BOOL bAllowCancel, BOOL &rCancelled );
// Empty-SV-String
-inline const String& ImplGetSVEmptyStr()
+inline const String& ImplGetSVEmptyStr()
{ return String::EmptyString(); }
-inline const ByteString& ImplGetSVEmptyByteStr()
+inline const ByteString& ImplGetSVEmptyByteStr()
{ return ByteString::EmptyString(); }
// -----------------------------------------------------------------------
diff --git a/vcl/inc/vcl/unobrok.hxx b/vcl/inc/vcl/unobrok.hxx
index 36bcc34..d726d52 100644
--- a/vcl/inc/vcl/unobrok.hxx
+++ b/vcl/inc/vcl/unobrok.hxx
@@ -29,7 +29,7 @@
#define _UNOBROK_HXX
#include <vcl/svdata.hxx>
-#include <vos/thread.hxx>
+#include <osl/thread.hxx>
namespace vcl_accept
{
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 1f0bb80..c87aca5 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -529,7 +529,7 @@ vos::IMutex& Application::GetSolarMutex()
// -----------------------------------------------------------------------
-vos::OThread::TThreadIdentifier Application::GetMainThreadIdentifier()
+oslThreadIdentifier Application::GetMainThreadIdentifier()
{
return ImplGetSVData()->mnMainThreadId;
}
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index b421b04..0345903 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -293,7 +293,7 @@ BOOL InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XM
pSVData->maAppData.mxMSF = rSMgr;
// Main-Thread-Id merken
- pSVData->mnMainThreadId = ::vos::OThread::getCurrentIdentifier();
+ pSVData->mnMainThreadId = ::osl::Thread::getCurrentIdentifier();
vos::OStartupInfo aStartInfo;
rtl::OUString aExeFileName;
diff --git a/vcl/source/helper/threadex.cxx b/vcl/source/helper/threadex.cxx
index 710f1b7..fee22c2 100644
--- a/vcl/source/helper/threadex.cxx
+++ b/vcl/source/helper/threadex.cxx
@@ -101,7 +101,7 @@ IMPL_LINK( SolarThreadExecutor, worker, void*, EMPTYARG )
long SolarThreadExecutor::impl_execute( const TimeValue* _pTimeout )
{
- if( ::vos::OThread::getCurrentIdentifier() == Application::GetMainThreadIdentifier() )
+ if( ::osl::Thread::getCurrentIdentifier() == Application::GetMainThreadIdentifier() )
{
osl_setCondition( m_aStart );
m_nReturn = doIt();
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 1b7ddf5..806bc9e 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -53,6 +53,7 @@
#include <osl/thread.h>
#include <osl/process.h>
+#include <osl/conditn.h>
#include <tools/debug.hxx>
#include "i18n_im.hxx"
#include "i18n_xkb.hxx"
diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
index 970c639..be263b6 100644
--- a/vcl/unx/gtk/app/gtkinst.cxx
+++ b/vcl/unx/gtk/app/gtkinst.cxx
@@ -76,7 +76,7 @@ void GtkHookedYieldMutex::ThreadsLeave()
#if OSL_DEBUG_LEVEL > 1
if( mnThreadId &&
- mnThreadId != NAMESPACE_VOS(OThread)::getCurrentIdentifier())
+ mnThreadId != osl::Thread::getCurrentIdentifier())
fprintf( stderr, "\n\n--- A different thread owns the mutex ...---\n\n\n");
#endif
@@ -242,7 +242,7 @@ GtkYieldMutex::GtkYieldMutex()
void GtkYieldMutex::acquire()
{
- vos::OThread::TThreadIdentifier aCurrentThread = vos::OThread::getCurrentIdentifier();
+ oslThreadIdentifier aCurrentThread = osl::Thread::getCurrentIdentifier();
// protect member manipulation
OMutex::acquire();
if( mnCount > 0 && mnThreadId == aCurrentThread )
@@ -265,7 +265,7 @@ void GtkYieldMutex::acquire()
void GtkYieldMutex::release()
{
- vos::OThread::TThreadIdentifier aCurrentThread = vos::OThread::getCurrentIdentifier();
+ oslThreadIdentifier aCurrentThread = osl::Thread::getCurrentIdentifier();
// protect member manipulation
OMutex::acquire();
// strange things happen, do nothing if we don't own the mutex
@@ -283,7 +283,7 @@ void GtkYieldMutex::release()
sal_Bool GtkYieldMutex::tryToAcquire()
{
- vos::OThread::TThreadIdentifier aCurrentThread = vos::OThread::getCurrentIdentifier();
+ oslThreadIdentifier aCurrentThread = osl::Thread::getCurrentIdentifier();
// protect member manipulation
OMutex::acquire();
if( mnCount > 0 )
@@ -327,9 +327,9 @@ int GtkYieldMutex::Grab()
OMutex::acquire();
int nRet = mnCount;
if( mnCount == 0 ) // recursive else
- mnThreadId = vos::OThread::getCurrentIdentifier();
+ mnThreadId = osl::Thread::getCurrentIdentifier();
#if OSL_DEBUG_LEVEL > 1
- else if( mnThreadId != vos::OThread::getCurrentIdentifier() )
+ else if( mnThreadId != osl::Thread::getCurrentIdentifier() )
{
fprintf( stderr, "Yield mutex grabbed in different thread !\n" );
abort();
diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx
index 01e9a39..e0621d5 100644
--- a/vcl/unx/headless/svpinst.cxx
+++ b/vcl/unx/headless/svpinst.cxx
@@ -302,7 +302,7 @@ vos::IMutex* SvpSalInstance::GetYieldMutex()
ULONG SvpSalInstance::ReleaseYieldMutex()
{
if ( m_aYieldMutex.GetThreadId() ==
- NAMESPACE_VOS(OThread)::getCurrentIdentifier() )
+ osl::Thread::getCurrentIdentifier() )
{
ULONG nCount = m_aYieldMutex.GetAcquireCount();
ULONG n = nCount;
@@ -464,13 +464,13 @@ SvpSalYieldMutex::SvpSalYieldMutex()
void SvpSalYieldMutex::acquire()
{
OMutex::acquire();
- mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier();
+ mnThreadId = osl::Thread::getCurrentIdentifier();
mnCount++;
}
void SvpSalYieldMutex::release()
{
- if ( mnThreadId == NAMESPACE_VOS(OThread)::getCurrentIdentifier() )
+ if ( mnThreadId == osl::Thread::getCurrentIdentifier() )
{
if ( mnCount == 1 )
mnThreadId = 0;
@@ -483,7 +483,7 @@ sal_Bool SvpSalYieldMutex::tryToAcquire()
{
if ( OMutex::tryToAcquire() )
{
- mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier();
+ mnThreadId = osl::Thread::getCurrentIdentifier();
mnCount++;
return sal_True;
}
diff --git a/vcl/unx/headless/svpinst.hxx b/vcl/unx/headless/svpinst.hxx
index c92ccb9..5154be1 100644
--- a/vcl/unx/headless/svpinst.hxx
+++ b/vcl/unx/headless/svpinst.hxx
@@ -32,7 +32,7 @@
#include <vcl/salwtype.hxx>
#include <vcl/saltimer.hxx>
#include <vos/mutex.hxx>
-#include <vos/thread.hxx>
+#include <osl/thread.hxx>
#include <list>
@@ -50,7 +50,7 @@ class SvpSalYieldMutex : public NAMESPACE_VOS(OMutex)
{
protected:
ULONG mnCount;
- NAMESPACE_VOS(OThread)::TThreadIdentifier mnThreadId;
+ oslThreadIdentifier mnThreadId;
public:
SvpSalYieldMutex();
@@ -60,7 +60,7 @@ public:
virtual sal_Bool tryToAcquire();
ULONG GetAcquireCount() const { return mnCount; }
- NAMESPACE_VOS(OThread)::TThreadIdentifier GetThreadId() const { return mnThreadId; }
+ oslThreadIdentifier GetThreadId() const { return mnThreadId; }
};
// ---------------
diff --git a/vcl/unx/inc/salinst.h b/vcl/unx/inc/salinst.h
index 45846b1..826ae14 100644
--- a/vcl/unx/inc/salinst.h
+++ b/vcl/unx/inc/salinst.h
@@ -33,8 +33,8 @@
#ifndef _VOS_MUTEX_HXX
#include <vos/mutex.hxx>
#endif
-#ifndef _VOS_THREAD_HXX
-#include <vos/thread.hxx>
+#ifndef _THREAD_HXX_
+#include <osl/thread.hxx>
#endif
#include <vcl/dllapi.h>
#include <vcl/salinst.hxx>
@@ -43,7 +43,7 @@ class VCL_DLLPUBLIC SalYieldMutex : public NAMESPACE_VOS(OMutex)
{
protected:
ULONG mnCount;
- NAMESPACE_VOS(OThread)::TThreadIdentifier mnThreadId;
+ oslThreadIdentifier mnThreadId;
public:
SalYieldMutex();
@@ -53,7 +53,7 @@ public:
virtual sal_Bool tryToAcquire();
ULONG GetAcquireCount() const { return mnCount; }
- NAMESPACE_VOS(OThread)::TThreadIdentifier GetThreadId() const { return mnThreadId; }
+ oslThreadIdentifier GetThreadId() const { return mnThreadId; }
};
// -=-= SalInstanceData =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
diff --git a/vcl/unx/inc/salsys.h b/vcl/unx/inc/salsys.h
index 22c1275..f9c5cc7 100644
--- a/vcl/unx/inc/salsys.h
+++ b/vcl/unx/inc/salsys.h
@@ -33,8 +33,8 @@
#ifndef _VOS_MUTEX_HXX
#include <vos/mutex.hxx>
#endif
-#ifndef _VOS_THREAD_HXX
-#include <vos/thread.hxx>
+#ifndef _THREAD_HXX_
+#include <osl/thread.hxx>
#endif
#include <vcl/salsys.hxx>
#include <vcl/dllapi.h>
diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx
index f65915d..2a17766 100644
--- a/vcl/unx/source/app/saldisp.cxx
+++ b/vcl/unx/source/app/saldisp.cxx
@@ -2345,7 +2345,7 @@ void SalX11Display::Yield()
XEvent aEvent;
DBG_ASSERT( static_cast<SalYieldMutex*>(GetSalData()->m_pInstance->GetYieldMutex())->GetThreadId() ==
- NAMESPACE_VOS(OThread)::getCurrentIdentifier(),
+ osl::Thread::getCurrentIdentifier(),
"will crash soon since solar mutex not locked in SalDisplay::Yield" );
XNextEvent( pDisp_, &aEvent );
diff --git a/vcl/unx/source/app/salinst.cxx b/vcl/unx/source/app/salinst.cxx
index dc32dd2..681e0c6 100644
--- a/vcl/unx/source/app/salinst.cxx
+++ b/vcl/unx/source/app/salinst.cxx
@@ -66,13 +66,13 @@ SalYieldMutex::SalYieldMutex()
void SalYieldMutex::acquire()
{
OMutex::acquire();
- mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier();
+ mnThreadId = osl::Thread::getCurrentIdentifier();
mnCount++;
}
void SalYieldMutex::release()
{
- if ( mnThreadId == NAMESPACE_VOS(OThread)::getCurrentIdentifier() )
+ if ( mnThreadId == osl::Thread::getCurrentIdentifier() )
{
if ( mnCount == 1 )
mnThreadId = 0;
@@ -85,7 +85,7 @@ sal_Bool SalYieldMutex::tryToAcquire()
{
if ( OMutex::tryToAcquire() )
{
- mnThreadId = NAMESPACE_VOS(OThread)::getCurrentIdentifier();
+ mnThreadId = osl::Thread::getCurrentIdentifier();
mnCount++;
return True;
}
@@ -231,7 +231,7 @@ ULONG X11SalInstance::ReleaseYieldMutex()
{
SalYieldMutex* pYieldMutex = mpSalYieldMutex;
if ( pYieldMutex->GetThreadId() ==
- NAMESPACE_VOS(OThread)::getCurrentIdentifier() )
+ osl::Thread::getCurrentIdentifier() )
{
ULONG nCount = pYieldMutex->GetAcquireCount();
ULONG n = nCount;
commit 8a572e7ee2556d307e008303e57d3908eab58361
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Sun Oct 10 19:46:49 2010 -0500
merge vosremoval-diagnoses patch
diff --git a/comphelper/source/eventattachermgr/eventattachermgr.cxx b/comphelper/source/eventattachermgr/eventattachermgr.cxx
index 8f66cce..361da50 100644
--- a/comphelper/source/eventattachermgr/eventattachermgr.cxx
+++ b/comphelper/source/eventattachermgr/eventattachermgr.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -30,11 +30,11 @@
#include <deque>
-#if defined( OS2 ) || defined( UNX )
+#if defined( OS2 ) || defined( UNX )
#include <wchar.h>
#endif
#include <osl/mutex.hxx>
-#include <vos/diagnose.hxx>
+#include <osl/diagnose.h>
#include <vos/macros.hxx>
#include <comphelper/eventattachermgr.hxx>
#include <com/sun/star/beans/XIntrospection.hpp>
@@ -97,25 +97,25 @@ struct AttacherIndex_Impl
#if 0
bool AttachedObject_Impl::operator<( const AttachedObject_Impl & r ) const
{
- VOS_ENSHURE( FALSE, "not implemented" );
+ OSL_ENSURE( FALSE, "not implemented" );
return FALSE;
return this < &r;
}
bool AttachedObject_Impl::operator==( const AttachedObject_Impl & r ) const
{
- VOS_ENSHURE( FALSE, "not implemented" );
+ OSL_ENSURE( FALSE, "not implemented" );
return this == &r;
}
bool AttacherIndex_Impl::operator<( const AttacherIndex_Impl & r ) const
{
- VOS_ENSHURE( FALSE, "not implemented" );
+ OSL_ENSURE( FALSE, "not implemented" );
return this < &r;
}
bool AttacherIndex_Impl::operator==( const AttacherIndex_Impl & r ) const
{
- VOS_ENSHURE( FALSE, "not implemented" );
+ OSL_ENSURE( FALSE, "not implemented" );
return this == &r;
}
#endif
@@ -526,7 +526,7 @@ void SAL_CALL ImplEventAttacherManager::registerScriptEvent
throw( IllegalArgumentException, RuntimeException )
{
Guard< Mutex > aGuard( aLock );
-
+
// Index pruefen und Array anpassen
::std::deque<AttacherIndex_Impl>::iterator aIt = implCheckIndex( nIndex );
@@ -1014,7 +1014,7 @@ void SAL_CALL ImplEventAttacherManager::read(const Reference< XObjectInputStream
// Ganze richtig sein. Sonst ist etwas voellig daneben gegangen.
if( nRealLen > nLen || nVersion == 1 )
{
- VOS_ENSHURE( sal_False, "ImplEventAttacherManager::read(): Fatal Error, wrong object length" );
+ OSL_ENSURE( sal_False, "ImplEventAttacherManager::read(): Fatal Error, wrong object length" );
}
else
{
diff --git a/comphelper/source/xml/attributelist.cxx b/comphelper/source/xml/attributelist.cxx
index c41c604..d9669aa 100644
--- a/comphelper/source/xml/attributelist.cxx
+++ b/comphelper/source/xml/attributelist.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_comphelper.hxx"
#include <comphelper/attributelist.hxx>
-#include <vos/diagnose.hxx>
+#include <osl/diagnose.h>
#include <vector>
@@ -135,7 +135,7 @@ void AttributeList::Clear()
{
m_pImpl->vecAttribute.clear();
- VOS_ENSURE( ! getLength(), "Length > 0 after AttributeList::Clear!");
+ OSL_ENSURE( ! getLength(), "Length > 0 after AttributeList::Clear!");
}
void AttributeList::RemoveAttribute( const OUString sName )
@@ -159,7 +159,7 @@ void AttributeList::SetAttributeList( const uno::Reference< ::com::sun::star::xm
void AttributeList::AppendAttributeList( const uno::Reference< ::com::sun::star::xml::sax::XAttributeList > &r )
{
- VOS_ENSURE( r.is(), "r isn't!" );
+ OSL_ENSURE( r.is(), "r isn't!" );
sal_Int32 nMax = r->getLength();
sal_Int32 nTotalSize = m_pImpl->vecAttribute.size() + nMax;
@@ -172,7 +172,7 @@ void AttributeList::AppendAttributeList( const uno::Reference< ::com::sun::star:
r->getValueByIndex( i )));
}
- VOS_ENSURE( nTotalSize == getLength(), "nTotalSize != getLength()");
+ OSL_ENSURE( nTotalSize == getLength(), "nTotalSize != getLength()");
}
} // namespace comphelper
diff --git a/i18npool/source/localedata/saxparser.cxx b/i18npool/source/localedata/saxparser.cxx
index 6ebdec1..70eda2d 100644
--- a/i18npool/source/localedata/saxparser.cxx
+++ b/i18npool/source/localedata/saxparser.cxx
@@ -48,7 +48,7 @@
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/implbase3.hxx>
-#include <vos/diagnose.hxx>
+#include <osl/diagnose.h>
#include "LocaleNode.hxx"
diff --git a/sax/test/saxdemo.cxx b/sax/test/saxdemo.cxx
index ffd8bf1..91e4063 100644
--- a/sax/test/saxdemo.cxx
+++ b/sax/test/saxdemo.cxx
@@ -51,7 +51,7 @@
#include <cppuhelper/implbase3.hxx>
#include <vos/dynload.hxx>
-#include <vos/diagnose.hxx>
+#include <osl/diagnose.h>
using namespace ::rtl;
using namespace ::std;
diff --git a/sax/test/testcomponent.cxx b/sax/test/testcomponent.cxx
index cef75e8..77b5cc2 100644
--- a/sax/test/testcomponent.cxx
+++ b/sax/test/testcomponent.cxx
@@ -42,7 +42,7 @@
#include <cppuhelper/servicefactory.hxx>
#include <vos/dynload.hxx>
-#include <vos/diagnose.hxx>
+#include <osl/diagnose.h>
using namespace ::rtl;
using namespace ::cppu;
diff --git a/vos/inc/vos/diagnose.hxx b/vos/inc/vos/diagnose.hxx
deleted file mode 100644
index 907e201..0000000
--- a/vos/inc/vos/diagnose.hxx
+++ /dev/null
@@ -1,56 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#ifndef _VOS_DIAGNOSE_H_
-#define _VOS_DIAGNOSE_H_
-
-
-#ifndef _OSL_DIAGNOSE_H_
- #include <osl/diagnose.h>
-#endif
-
-
-/*
- Diagnostic support
-*/
-
-#define VOS_THIS_FILE __FILE__
-
-#define VOS_DEBUG_ONLY(s) _OSL_DEBUG_ONLY(s)
-#define VOS_TRACE _OSL_TRACE
-#define VOS_ASSERT(c) _OSL_ASSERT(c, VOS_THIS_FILE, __LINE__)
-#define VOS_VERIFY(c) OSL_VERIFY(c)
-#define VOS_ENSHURE(c, m) _OSL_ENSURE(c, VOS_THIS_FILE, __LINE__, m)
-#define VOS_ENSURE(c, m) _OSL_ENSURE(c, VOS_THIS_FILE, __LINE__, m)
-
-#define VOS_PRECOND(c, m) VOS_ENSHURE(c, m)
-#define VOS_POSTCOND(c, m) VOS_ENSHURE(c, m)
-
-#endif /* _VOS_DIAGNOSE_H_ */
-
-
diff --git a/vos/inc/vos/ref.hxx b/vos/inc/vos/ref.hxx
index 6d005bd..14cf745 100644
--- a/vos/inc/vos/ref.hxx
+++ b/vos/inc/vos/ref.hxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -32,24 +32,22 @@
/**
ORef<T>
- template type to implement handle/body behaviour
+ template type to implement handle/body behaviour
with reference-counting.
Note that the template-type T MUST implement IReferenceCounter.
*/
-# include <vos/refernce.hxx>
-#ifndef _VOS_DIAGNOSE_HXX_
-# include <vos/diagnose.hxx>
-#endif
+#include <vos/refernce.hxx>
+#include <osl/diagnose.h>
namespace vos
-{
+{
template <class T>
-class ORef
+class ORef
{
public:
@@ -123,7 +121,7 @@ public:
*/
T* SAL_CALL operator->() const;
- /** Gives access to the handles body.
+ /** Gives access to the handles body.
*/
T& SAL_CALL getBody() const;
@@ -137,7 +135,7 @@ public:
does not point to a valid body).
*/
sal_Bool SAL_CALL isEmpty() const;
-
+
/** Returns True is the body is "full" (the handle
does point to a valid body).
*/
@@ -177,7 +175,7 @@ protected:
// include template implementation
#include <vos/ref.inl>
-}
+}
#endif // _VOS_REF_HXX_
diff --git a/vos/inc/vos/ref.inl b/vos/inc/vos/ref.inl
index f6c0fb0..5bee251 100644
--- a/vos/inc/vos/ref.inl
+++ b/vos/inc/vos/ref.inl
@@ -109,28 +109,28 @@ inline void ORef<T>::operator= (T* pBody)
template <class T>
inline T& ORef<T>::operator() () const
{
- VOS_PRECOND(m_refBody, "ORef::operator(): can't deref nil body!");
+ OSL_PRECOND(m_refBody, "ORef::operator(): can't deref nil body!");
return *m_refBody;
}
template <class T>
inline T& ORef<T>::operator* () const
{
- VOS_PRECOND(m_refBody, "ORef::operator*: can't deref nil body!");
+ OSL_PRECOND(m_refBody, "ORef::operator*: can't deref nil body!");
return *m_refBody;
}
template <class T>
inline T* ORef<T>::operator->() const
{
- VOS_PRECOND(m_refBody, "ORef::operator->: nil body!");
+ OSL_PRECOND(m_refBody, "ORef::operator->: nil body!");
return m_refBody;
}
template <class T>
inline T& ORef<T>::getBody() const
{
- VOS_PRECOND(m_refBody, "ORef::getBody(): can't deref nil body!");
+ OSL_PRECOND(m_refBody, "ORef::getBody(): can't deref nil body!");
return *m_refBody;
}
diff --git a/vos/inc/vos/refobj.hxx b/vos/inc/vos/refobj.hxx
index 7a6a3de..ff7c374 100644
--- a/vos/inc/vos/refobj.hxx
+++ b/vos/inc/vos/refobj.hxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -36,10 +36,8 @@
with reference-counting.
*/
-# include <vos/refernce.hxx>
-#ifndef _VOS_DIAGNOSE_HXX_
-# include <vos/diagnose.hxx>
-#endif
+#include <vos/refernce.hxx>
+#include <osl/diagnose.h>
namespace vos
{
@@ -49,7 +47,7 @@ class ORefObj : public IReference
{
public:
ORefObj(const T& Obj);
-
+
inline ~ORefObj();
virtual RefCount SAL_CALL acquire()
diff --git a/vos/inc/vos/refobj.inl b/vos/inc/vos/refobj.inl
index 3d1700f..d849ed3 100644
--- a/vos/inc/vos/refobj.inl
+++ b/vos/inc/vos/refobj.inl
@@ -37,7 +37,7 @@ ORefObj<T>::ORefObj(const T& Obj)
template <class T>
inline ORefObj<T>::~ORefObj()
{
- VOS_ASSERT(m_RefCount.referenced() == 0);
+ OSL_ASSERT(m_RefCount.referenced() == 0);
}
template <class T>
diff --git a/vos/source/conditn.cxx b/vos/source/conditn.cxx
index 8ba109b..5c92d06 100644
--- a/vos/source/conditn.cxx
+++ b/vos/source/conditn.cxx
@@ -27,7 +27,7 @@
#include <osl/time.h>
#include <vos/conditn.hxx>
-#include <vos/diagnose.hxx>
+#include <osl/diagnose.h>
using namespace vos;
diff --git a/vos/source/module.cxx b/vos/source/module.cxx
index 25d0c48..819f126 100644
--- a/vos/source/module.cxx
+++ b/vos/source/module.cxx
@@ -27,7 +27,7 @@
#include <vos/module.hxx>
-#include <vos/diagnose.hxx>
+#include <osl/diagnose.h>
using namespace vos;
@@ -55,7 +55,7 @@ OModule::~OModule()
sal_Bool OModule::load(const rtl::OUString& ustrModuleName, sal_Int32 nRtldMode)
{
- VOS_ASSERT(ustrModuleName);
+ OSL_ASSERT(ustrModuleName);
unload();
@@ -80,8 +80,8 @@ sal_Bool OModule::isLoaded()
void *OModule::getSymbol(const rtl::OUString& strSymbolName)
{
- VOS_ASSERT(strSymbolName);
- VOS_ASSERT(m_Module);
+ OSL_ASSERT(strSymbolName);
+ OSL_ASSERT(m_Module);
return ( osl_getSymbol( m_Module, strSymbolName.pData ) );
}
diff --git a/vos/source/mutex.cxx b/vos/source/mutex.cxx
index e2f2a71..a5caff0 100644
--- a/vos/source/mutex.cxx
+++ b/vos/source/mutex.cxx
@@ -25,7 +25,7 @@
*
************************************************************************/
-#include <vos/diagnose.hxx>
+#include <osl/diagnose.h>
#include <vos/object.hxx>
#include <vos/mutex.hxx>
diff --git a/vos/source/object.cxx b/vos/source/object.cxx
index bc210b1..6e88cbb 100644
--- a/vos/source/object.cxx
+++ b/vos/source/object.cxx
@@ -30,7 +30,7 @@
#include <rtl/alloc.h>
#include <rtl/memory.h>
-#include <vos/diagnose.hxx>
+#include <osl/diagnose.h>
#include <vos/object.hxx>
@@ -57,7 +57,7 @@ void* OObject::operator new(size_t size)
{
void* p = rtl_allocateMemory(size);
- VOS_ASSERT(p != NULL);
+ OSL_ASSERT(p != NULL);
return (p);
}
@@ -84,7 +84,7 @@ const OClassInfo& OObject::getClassInfo() const
sal_Bool OObject::isKindOf(const OClassInfo& rClass) const
{
- VOS_ASSERT(this != NULL);
+ OSL_ASSERT(this != NULL);
const OClassInfo& rClassThis = getClassInfo();
@@ -121,7 +121,7 @@ OObject* OClassInfo::createObject(const OCreateParam& rParam) const
sal_Bool OClassInfo::isDerivedFrom(const OClassInfo& rClass) const
{
- VOS_ASSERT(this != NULL);
+ OSL_ASSERT(this != NULL);
const OClassInfo* pClassThis = this;
@@ -138,7 +138,7 @@ sal_Bool OClassInfo::isDerivedFrom(const OClassInfo& rClass) const
const OClassInfo* OClassInfo::getClassInfo(const sal_Char* pClassName)
{
- VOS_ASSERT(pClassName != NULL);
+ OSL_ASSERT(pClassName != NULL);
const OClassInfo* pClass = &VOS_CLASSINFO(VOS_NAMESPACE(OObject, vos));
@@ -155,7 +155,7 @@ const OClassInfo* OClassInfo::getClassInfo(const sal_Char* pClassName)
VOS_CLASSINIT::VOS_CLASSINIT(register OClassInfo* pNewClass)
{
- VOS_ASSERT(pNewClass != NULL);
+ OSL_ASSERT(pNewClass != NULL);
OClassInfo* pClassRoot = (OClassInfo*)&VOS_CLASSINFO(VOS_NAMESPACE(OObject, vos));
diff --git a/vos/source/pipe.cxx b/vos/source/pipe.cxx
index b8c2965..4fd2919 100644
--- a/vos/source/pipe.cxx
+++ b/vos/source/pipe.cxx
@@ -27,7 +27,7 @@
#include <vos/pipe.hxx>
-#include <vos/diagnose.hxx>
+#include <osl/diagnose.h>
using namespace vos;
@@ -58,8 +58,8 @@ OPipe::OPipe( const rtl::OUString& strName, TPipeOption Options)
(oslPipeOptions)Options,
NULL) );
- VOS_POSTCOND(m_pPipeRef != 0, "OPipe(): new failed.\n");
- VOS_POSTCOND((*m_pPipeRef)(), "OPipe(): creation of pipe failed!\n");
+ OSL_POSTCOND(m_pPipeRef != 0, "OPipe(): new failed.\n");
+ OSL_POSTCOND((*m_pPipeRef)(), "OPipe(): creation of pipe failed!\n");
}
/*****************************************************************************/
@@ -75,8 +75,8 @@ OPipe::OPipe( const rtl::OUString& strName,
(oslPipeOptions)Options,
(oslSecurity)rSecurity));
- VOS_POSTCOND(m_pPipeRef != 0, "OPipe(): new failed.\n");
- VOS_POSTCOND((*m_pPipeRef)(), "OPipe(): creation of pipe failed!\n");
+ OSL_POSTCOND(m_pPipeRef != 0, "OPipe(): new failed.\n");
+ OSL_POSTCOND((*m_pPipeRef)(), "OPipe(): creation of pipe failed!\n");
}
/*****************************************************************************/
@@ -86,7 +86,7 @@ OPipe::OPipe(const OPipe& pipe) :
OReference(), OObject()
{
- VOS_ASSERT(pipe.m_pPipeRef != 0);
+ OSL_ASSERT(pipe.m_pPipeRef != 0);
m_pPipeRef= pipe.m_pPipeRef;
@@ -128,7 +128,7 @@ sal_Bool OPipe::create( const rtl::OUString& strName, TPipeOption Options )
(oslPipeOptions)Options,
NULL));
- VOS_POSTCOND(m_pPipeRef != 0, "OPipe(): new failed.\n");
+ OSL_POSTCOND(m_pPipeRef != 0, "OPipe(): new failed.\n");
return (*m_pPipeRef)() != 0;
}
@@ -153,7 +153,7 @@ sal_Bool OPipe::create( const rtl::OUString& strName,
(oslPipeOptions)Options,
(oslSecurity)rSecurity));
- VOS_POSTCOND(m_pPipeRef != 0, "OPipe(): new failed.\n");
+ OSL_POSTCOND(m_pPipeRef != 0, "OPipe(): new failed.\n");
return (*m_pPipeRef)() != 0;
}
@@ -163,7 +163,7 @@ sal_Bool OPipe::create( const rtl::OUString& strName,
/*****************************************************************************/
OPipe& OPipe::operator= (const OPipe& pipe)
{
- VOS_PRECOND(pipe.m_pPipeRef != 0, "OPipe::operator=: tried to assign an empty/invalid pipe\n");
+ OSL_PRECOND(pipe.m_pPipeRef != 0, "OPipe::operator=: tried to assign an empty/invalid pipe\n");
if (m_pPipeRef == pipe.m_pPipeRef)
return *this;
@@ -188,7 +188,7 @@ OPipe& OPipe::operator= (const OPipe& pipe)
/*****************************************************************************/
OPipe::operator oslPipe() const
{
- VOS_ASSERT(m_pPipeRef);
+ OSL_ASSERT(m_pPipeRef);
return (*m_pPipeRef)();
}
@@ -298,7 +298,7 @@ OStreamPipe::OStreamPipe(oslPipe Pipe) :
OStreamPipe::OStreamPipe(const OStreamPipe& pipe) :
OPipe(), IStream()
{
- VOS_ASSERT(pipe.m_pPipeRef != 0);
+ OSL_ASSERT(pipe.m_pPipeRef != 0);
m_pPipeRef= pipe.m_pPipeRef;
@@ -328,7 +328,7 @@ OStreamPipe& OStreamPipe::operator=(oslPipe Pipe)
m_pPipeRef= new PipeRef(Pipe);
- VOS_POSTCOND(m_pPipeRef != 0, "OPipe(): new failed.\n");
+ OSL_POSTCOND(m_pPipeRef != 0, "OPipe(): new failed.\n");
return *this;
}
@@ -348,7 +348,7 @@ OStreamPipe& OStreamPipe::operator= (const OPipe& pipe)
/*****************************************************************************/
sal_Int32 OStreamPipe::read(void* pBuffer, sal_uInt32 n) const
{
- VOS_ASSERT(m_pPipeRef && (*m_pPipeRef)());
+ OSL_ASSERT(m_pPipeRef && (*m_pPipeRef)());
/* loop until all desired bytes were read or an error occured */
sal_Int32 BytesRead= 0;
@@ -379,7 +379,7 @@ sal_Int32 OStreamPipe::read(void* pBuffer, sal_uInt32 n) const
/*****************************************************************************/
sal_Int32 OStreamPipe::write(const void* pBuffer, sal_uInt32 n)
{
- VOS_ASSERT(m_pPipeRef && (*m_pPipeRef)());
+ OSL_ASSERT(m_pPipeRef && (*m_pPipeRef)());
/* loop until all desired bytes were send or an error occured */
sal_Int32 BytesSend= 0;
diff --git a/vos/source/process.cxx b/vos/source/process.cxx
index 6a13a8d..a9c734f 100644
--- a/vos/source/process.cxx
+++ b/vos/source/process.cxx
@@ -32,7 +32,7 @@
#include <rtl/instance.hxx>
#include "vos/process.hxx"
-#include "vos/diagnose.hxx"
+#include "osl/diagnose.h"
#include <osl/file.hxx>
#define MAX_RESOURCES 100
diff --git a/vos/source/refernce.cxx b/vos/source/refernce.cxx
index ca2b270..aeb9259 100644
--- a/vos/source/refernce.cxx
+++ b/vos/source/refernce.cxx
@@ -27,7 +27,7 @@
#include <limits.h>
-#include <vos/diagnose.hxx>
+#include <osl/diagnose.h>
#include <vos/refernce.hxx>
@@ -45,7 +45,7 @@ OReference::OReference()
OReference::~OReference()
{
- VOS_ASSERT(m_RefCount.referenced() == 0);
+ OSL_ASSERT(m_RefCount.referenced() == 0);
}
IReference::RefCount OReference::acquire()
diff --git a/vos/source/security.cxx b/vos/source/security.cxx
index 1cb2b41..cbad9bc 100644
--- a/vos/source/security.cxx
+++ b/vos/source/security.cxx
@@ -27,7 +27,7 @@
#include <vos/security.hxx>
-#include <vos/diagnose.hxx>
+#include <osl/diagnose.h>
using namespace vos;
@@ -73,7 +73,7 @@ sal_Bool OSecurity::logonUser( const rtl::OUString& strName,
sal_Bool OSecurity::getUserIdent( rtl::OUString& strIdent) const
{
- VOS_ASSERT(m_oslSecurity);
+ OSL_ASSERT(m_oslSecurity);
return osl_getUserIdent( m_oslSecurity, &strIdent.pData );
}
@@ -81,7 +81,7 @@ sal_Bool OSecurity::getUserIdent( rtl::OUString& strIdent) const
sal_Bool OSecurity::getUserName( rtl::OUString& strName ) const
{
- VOS_ASSERT(m_oslSecurity);
+ OSL_ASSERT(m_oslSecurity);
return osl_getUserName( m_oslSecurity, &strName.pData );
}
@@ -89,7 +89,7 @@ sal_Bool OSecurity::getUserName( rtl::OUString& strName ) const
sal_Bool OSecurity::getHomeDir( rtl::OUString& strDirectory) const
{
- VOS_ASSERT(m_oslSecurity);
+ OSL_ASSERT(m_oslSecurity);
return osl_getHomeDir(m_oslSecurity, &strDirectory.pData );
}
@@ -97,14 +97,14 @@ sal_Bool OSecurity::getHomeDir( rtl::OUString& strDirectory) const
sal_Bool OSecurity::getConfigDir( rtl::OUString& strDirectory ) const
{
- VOS_ASSERT(m_oslSecurity);
+ OSL_ASSERT(m_oslSecurity);
return osl_getConfigDir( m_oslSecurity, &strDirectory.pData );
}
sal_Bool OSecurity::isAdministrator() const
{
- VOS_ASSERT(m_oslSecurity);
+ OSL_ASSERT(m_oslSecurity);
return osl_isAdministrator(m_oslSecurity);
}
diff --git a/vos/source/signal.cxx b/vos/source/signal.cxx
index 0d073cd..8b909fe 100644
--- a/vos/source/signal.cxx
+++ b/vos/source/signal.cxx
@@ -26,7 +26,7 @@
************************************************************************/
-#include <vos/diagnose.hxx>
+#include <osl/diagnose.h>
#include <vos/object.hxx>
#include <vos/signal.hxx>
diff --git a/vos/source/socket.cxx b/vos/source/socket.cxx
index 2cc8419..12bbe75 100644
--- a/vos/source/socket.cxx
+++ b/vos/source/socket.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -30,13 +30,12 @@
#include <rtl/memory.h>
#include <osl/time.h>
#include <vos/socket.hxx>
-#include <vos/diagnose.hxx>
using namespace vos;
-VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OSocketAddr, vos),
- VOS_NAMESPACE(OSocketAddr, vos),
+VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OSocketAddr, vos),
+ VOS_NAMESPACE(OSocketAddr, vos),
VOS_NAMESPACE(OObject, vos), 0);
@@ -149,8 +148,8 @@ OSocketAddr& OSocketAddr::operator=(const OSocketAddr& Addr)
}
-VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OInetSocketAddr, vos),
- VOS_NAMESPACE(OInetSocketAddr, vos),
+VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OInetSocketAddr, vos),
+ VOS_NAMESPACE(OInetSocketAddr, vos),
VOS_NAMESPACE(OSocketAddr, vos), 0);
@@ -159,7 +158,7 @@ VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OInetSocketAddr, vos),
// OInetSocketAddr
// creates arbitrary inet-address (INADDR_ANY)
/*****************************************************************************/
-OInetSocketAddr::OInetSocketAddr()
+OInetSocketAddr::OInetSocketAddr()
{
m_SockAddr= osl_createEmptySocketAddr(osl_Socket_FamilyInet);
}
@@ -171,7 +170,7 @@ OInetSocketAddr::OInetSocketAddr()
OInetSocketAddr::OInetSocketAddr(oslSocketAddr Addr) :
OSocketAddr(Addr)
{
- VOS_ASSERT(osl_getFamilyOfSocketAddr(Addr) == osl_Socket_FamilyInet);
+ OSL_ASSERT(osl_getFamilyOfSocketAddr(Addr) == osl_Socket_FamilyInet);
}
/*****************************************************************************/
@@ -183,7 +182,7 @@ OInetSocketAddr::OInetSocketAddr(const rtl::OUString& ustrAddrOrHostname, sal_In
{
// first try as dotted address.
m_SockAddr= osl_createInetSocketAddr(ustrAddrOrHostname.pData, Port);
-
+
// create failed, maybe it's an hostname
if(m_SockAddr == 0)
{
@@ -193,7 +192,7 @@ OInetSocketAddr::OInetSocketAddr(const rtl::OUString& ustrAddrOrHostname, sal_In
if(m_SockAddr)
{
// set port will fail if addrtype is not osl_Socket_FamilyInet
- VOS_VERIFY(osl_setInetPortOfSocketAddr(m_SockAddr, Port));
+ OSL_VERIFY(osl_setInetPortOfSocketAddr(m_SockAddr, Port));
}
}
}
@@ -204,8 +203,8 @@ OInetSocketAddr::OInetSocketAddr(const rtl::OUString& ustrAddrOrHostname, sal_In
OInetSocketAddr::OInetSocketAddr(const OInetSocketAddr& sa) :
OSocketAddr(sa)
{
- VOS_ASSERT(getFamily() == TFamily_Inet);
-}
+ OSL_ASSERT(getFamily() == TFamily_Inet);
+}
/*****************************************************************************/
// OInetSocketAddr(const OSocketAddr&)
@@ -213,8 +212,8 @@ OInetSocketAddr::OInetSocketAddr(const OInetSocketAddr& sa) :
OInetSocketAddr::OInetSocketAddr(const OSocketAddr& sa) :
OSocketAddr(sa)
{
- VOS_ASSERT(sa.getFamily() == TFamily_Inet);
-}
+ OSL_ASSERT(sa.getFamily() == TFamily_Inet);
+}
/*****************************************************************************/
// ~OInetSocketAddr
@@ -228,7 +227,7 @@ OInetSocketAddr::~OInetSocketAddr()
/*****************************************************************************/
void OInetSocketAddr::operator= (oslSocketAddr Addr)
{
- VOS_PRECOND(osl_getFamilyOfSocketAddr(Addr) == osl_Socket_FamilyInet,
+ OSL_PRECOND(osl_getFamilyOfSocketAddr(Addr) == osl_Socket_FamilyInet,
"oslSocketAddr not of type osl_Socket_FamilyInet!");
OSocketAddr::operator=(Addr);
@@ -247,7 +246,7 @@ sal_Bool OInetSocketAddr::operator== (oslSocketAddr Addr)
/*****************************************************************************/
OInetSocketAddr& OInetSocketAddr::operator=(const OInetSocketAddr& Addr)
{
- VOS_ASSERT(Addr.getFamily() == TFamily_Inet);
+ OSL_ASSERT(Addr.getFamily() == TFamily_Inet);
OSocketAddr::operator=(Addr);
@@ -259,7 +258,7 @@ OInetSocketAddr& OInetSocketAddr::operator=(const OInetSocketAddr& Addr)
/*****************************************************************************/
OInetSocketAddr& OInetSocketAddr::operator=(const OSocketAddr& Addr)
{
- VOS_ASSERT(Addr.getFamily() == TFamily_Inet);
+ OSL_ASSERT(Addr.getFamily() == TFamily_Inet);
OSocketAddr::operator=(Addr);
@@ -269,7 +268,7 @@ OInetSocketAddr& OInetSocketAddr::operator=(const OSocketAddr& Addr)
/*****************************************************************************/
// getServicePort()
/*****************************************************************************/
-sal_Int32 OInetSocketAddr::getServicePort(const rtl::OUString& ustrServiceName,
+sal_Int32 OInetSocketAddr::getServicePort(const rtl::OUString& ustrServiceName,
const rtl::OUString& ustrProtocolName)
{
return osl_getServicePort(ustrServiceName.pData, ustrProtocolName.pData);
@@ -308,20 +307,20 @@ OSocketAddr::TResult OInetSocketAddr::getDottedAddr( rtl::OUString& pBuffer ) co
sal_Bool OInetSocketAddr::setAddr(const rtl::OUString& ustrAddrOrHostname)
{
sal_Int32 Port = 0;
-
+
if(m_SockAddr) {
-
+
// retrieve old port
Port= getPort();
// free old address
osl_destroySocketAddr(m_SockAddr);
m_SockAddr= 0;
- }
+ }
// first try as dotted address.
m_SockAddr= osl_createInetSocketAddr(ustrAddrOrHostname.pData, Port);
-
+
// create failed, maybe it's an hostname
if(m_SockAddr == 0)
{
@@ -335,7 +334,7 @@ sal_Bool OInetSocketAddr::setAddr(const rtl::OUString& ustrAddrOrHostname)
}
// set port will fail if addrtype is not osl_Socket_FamilyInet
- VOS_VERIFY(osl_setInetPortOfSocketAddr(m_SockAddr, Port));
+ OSL_VERIFY(osl_setInetPortOfSocketAddr(m_SockAddr, Port));
}
@@ -345,8 +344,8 @@ sal_Bool OInetSocketAddr::setAddr(const rtl::OUString& ustrAddrOrHostname)
///////////////////////////////////////////////////////////////////////////////
// OIpxSocketAddr
-VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OIpxSocketAddr, vos),
- VOS_NAMESPACE(OIpxSocketAddr, vos),
+VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OIpxSocketAddr, vos),
+ VOS_NAMESPACE(OIpxSocketAddr, vos),
VOS_NAMESPACE(OSocketAddr, vos), 0);
@@ -364,7 +363,7 @@ OIpxSocketAddr::OIpxSocketAddr()
OIpxSocketAddr::OIpxSocketAddr(oslSocketAddr Addr) :
OSocketAddr(Addr)
{
- VOS_ASSERT(osl_getFamilyOfSocketAddr(Addr) == osl_Socket_FamilyIpx);
+ OSL_ASSERT(osl_getFamilyOfSocketAddr(Addr) == osl_Socket_FamilyIpx);
}
/*****************************************************************************/
@@ -383,7 +382,7 @@ OIpxSocketAddr::OIpxSocketAddr(const rtl::OUString&,
OIpxSocketAddr::OIpxSocketAddr(const OIpxSocketAddr& sa) :
OSocketAddr(sa)
{
- VOS_ASSERT(sa.getFamily() == TFamily_Ipx);
+ OSL_ASSERT(sa.getFamily() == TFamily_Ipx);
}
@@ -393,7 +392,7 @@ OIpxSocketAddr::OIpxSocketAddr(const OIpxSocketAddr& sa) :
OIpxSocketAddr::OIpxSocketAddr(const OSocketAddr& sa) :
OSocketAddr(sa)
{
- VOS_ASSERT(sa.getFamily() == TFamily_Ipx);
+ OSL_ASSERT(sa.getFamily() == TFamily_Ipx);
}
/*****************************************************************************/
@@ -409,7 +408,7 @@ OIpxSocketAddr::~OIpxSocketAddr()
/*****************************************************************************/
void OIpxSocketAddr::operator= (oslSocketAddr Addr)
{
- VOS_PRECOND(osl_getFamilyOfSocketAddr(Addr) == osl_Socket_FamilyIpx,
+ OSL_PRECOND(osl_getFamilyOfSocketAddr(Addr) == osl_Socket_FamilyIpx,
"oslSocketAddr not of type osl_Socket_FamilyIpx!");
OSocketAddr::operator=(Addr);
@@ -428,7 +427,7 @@ sal_Bool OIpxSocketAddr::operator== (oslSocketAddr Addr)
/*****************************************************************************/
OIpxSocketAddr& OIpxSocketAddr::operator=(const OIpxSocketAddr& Addr)
{
- VOS_ASSERT(Addr.getFamily() == TFamily_Ipx);
+ OSL_ASSERT(Addr.getFamily() == TFamily_Ipx);
OSocketAddr::operator=(Addr);
@@ -440,7 +439,7 @@ OIpxSocketAddr& OIpxSocketAddr::operator=(const OIpxSocketAddr& Addr)
/*****************************************************************************/
OIpxSocketAddr& OIpxSocketAddr::operator=(const OSocketAddr& Addr)
{
- VOS_ASSERT(Addr.getFamily() == TFamily_Ipx);
+ OSL_ASSERT(Addr.getFamily() == TFamily_Ipx);
OSocketAddr::operator=(Addr);
@@ -489,8 +488,8 @@ void OIpxSocketAddr::getAddressString( rtl::OUString& ) const
// Socket
-VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OSocket, vos),
- VOS_NAMESPACE(OSocket, vos),
+VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OSocket, vos),
+ VOS_NAMESPACE(OSocket, vos),
VOS_NAMESPACE(OObject, vos), 0);
/*****************************************************************************/
@@ -508,20 +507,20 @@ OSocket::OSocket()
/*****************************************************************************/
// OSocket()
/*****************************************************************************/
-OSocket::OSocket(TSocketType Type,
- TAddrFamily Family,
- TProtocol Protocol)
+OSocket::OSocket(TSocketType Type,
+ TAddrFamily Family,
+ TProtocol Protocol)
{
m_pRecvTimeout = 0;
m_pSendTimeout = 0;
- m_pSockRef=
- new SockRef(osl_createSocket((oslAddrFamily)Family,
- (oslSocketType)Type,
+ m_pSockRef=
+ new SockRef(osl_createSocket((oslAddrFamily)Family,
+ (oslSocketType)Type,
(oslProtocol)Protocol));
-
- VOS_POSTCOND(m_pSockRef != 0, "OSocket(): new failed.\n");
- VOS_POSTCOND((*m_pSockRef)(), "OSocket(): creation of socket failed!\n");
+
+ OSL_POSTCOND(m_pSockRef != 0, "OSocket(): new failed.\n");
+ OSL_POSTCOND((*m_pSockRef)(), "OSocket(): creation of socket failed!\n");
}
/*****************************************************************************/
@@ -533,16 +532,16 @@ ISocketTypes(), OReference(), OObject()
m_pRecvTimeout = 0;
m_pSendTimeout = 0;
m_pSockRef=0;
-
- VOS_ASSERT(sock.m_pSockRef != 0);
+
+ OSL_ASSERT(sock.m_pSockRef != 0);
if ( sock.m_pSockRef !=0 )
- {
+ {
m_pSockRef= sock.m_pSockRef;
setRecvTimeout(sock.m_pRecvTimeout);
setSendTimeout(sock.m_pSendTimeout);
-
+
m_pSockRef->acquire();
}
}
@@ -574,8 +573,8 @@ OSocket::~OSocket()
/*****************************************************************************/
// create
/*****************************************************************************/
-sal_Bool OSocket::create(TSocketType Type,
- TAddrFamily Family,
+sal_Bool OSocket::create(TSocketType Type,
+ TAddrFamily Family,
TProtocol Protocol)
{
// if this was a valid socket, decrease reference
@@ -586,12 +585,12 @@ sal_Bool OSocket::create(TSocketType Type,
m_pSockRef= 0;
}
- m_pSockRef=
- new SockRef(osl_createSocket((oslAddrFamily)Family,
- (oslSocketType)Type,
+ m_pSockRef=
+ new SockRef(osl_createSocket((oslAddrFamily)Family,
+ (oslSocketType)Type,
(oslProtocol)Protocol));
- VOS_POSTCOND(m_pSockRef != 0, "OSocket(): new failed.\n");
+ OSL_POSTCOND(m_pSockRef != 0, "OSocket(): new failed.\n");
return (*m_pSockRef)() != 0;
}
@@ -601,7 +600,7 @@ sal_Bool OSocket::create(TSocketType Type,
/*****************************************************************************/
OSocket& OSocket::operator= (const OSocket& sock)
{
- VOS_PRECOND(sock.m_pSockRef != 0, "OSocket::operator=: tried to assign an empty/invalid socket\n");
+ OSL_PRECOND(sock.m_pSockRef != 0, "OSocket::operator=: tried to assign an empty/invalid socket\n");
if (m_pSockRef == sock.m_pSockRef)
return *this;
@@ -629,7 +628,7 @@ OSocket& OSocket::operator= (const OSocket& sock)
/*****************************************************************************/
OSocket::operator oslSocket() const
{
- VOS_ASSERT(m_pSockRef);
+ OSL_ASSERT(m_pSockRef);
return (*m_pSockRef)();
}
@@ -647,7 +646,7 @@ sal_Bool OSocket::isValid() const
/*****************************************************************************/
void OSocket::close()
{
- if (m_pSockRef && (*m_pSockRef)() && (m_pSockRef->release() == 0))
+ if (m_pSockRef && (*m_pSockRef)() && (m_pSockRef->release() == 0))
{
osl_releaseSocket((*m_pSockRef)());
delete m_pSockRef;
@@ -661,10 +660,10 @@ void OSocket::close()
/*****************************************************************************/
void OSocket::getLocalAddr(OSocketAddr& sa) const
{
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() )
- {
+ {
sa= osl_getLocalAddrOfSocket((*m_pSockRef)());
}
}
@@ -672,23 +671,23 @@ void OSocket::getLocalAddr(OSocketAddr& sa) const
/*****************************************************************************/
// getLocalPort
/*****************************************************************************/
-sal_Int32 OSocket::getLocalPort() const
+sal_Int32 OSocket::getLocalPort() const
{
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
sal_Int32 Port= OSL_INVALID_PORT;
if ( m_pSockRef && (*m_pSockRef)() )
- {
+ {
oslSocketAddr Addr= osl_getLocalAddrOfSocket((*m_pSockRef)());
-
- if(Addr)
+
+ if(Addr)
{
Port= osl_getInetPortOfSocketAddr(Addr);
osl_destroySocketAddr(Addr);
}
}
-
+
return Port;
}
@@ -697,25 +696,25 @@ sal_Int32 OSocket::getLocalPort() const
/*****************************************************************************/
OSocket::TResult OSocket::getLocalHost( rtl::OUString& pBuffer) const
{
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() )
- {
+ {
oslSocketAddr Addr= osl_getLocalAddrOfSocket((*m_pSockRef)());
-
- if(Addr)
+
+ if(Addr)
{
-// TResult Result= (TResult)osl_getHostnameOfSocketAddr(Addr,
+// TResult Result= (TResult)osl_getHostnameOfSocketAddr(Addr,
// pBuffer, BufferSize);
- TResult Result= (TResult)osl_getHostnameOfSocketAddr(Addr,
+ TResult Result= (TResult)osl_getHostnameOfSocketAddr(Addr,
&pBuffer.pData );
-
+
osl_destroySocketAddr(Addr);
return Result;
}
}
-
+
return TResult_Error;
}
@@ -724,10 +723,10 @@ OSocket::TResult OSocket::getLocalHost( rtl::OUString& pBuffer) const
/*****************************************************************************/
void OSocket::getPeerAddr(OSocketAddr& sa) const
{
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() )
- {
+ {
sa= osl_getPeerAddrOfSocket((*m_pSockRef)());
}
}
@@ -737,15 +736,15 @@ void OSocket::getPeerAddr(OSocketAddr& sa) const
/*****************************************************************************/
sal_Int32 OSocket::getPeerPort() const
{
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
sal_Int32 Port= OSL_INVALID_PORT;
-
+
if ( m_pSockRef && (*m_pSockRef)() )
- {
+ {
oslSocketAddr Addr= osl_getPeerAddrOfSocket((*m_pSockRef)());
- if(Addr)
+ if(Addr)
{
Port= osl_getInetPortOfSocketAddr(Addr);
osl_destroySocketAddr(Addr);
@@ -760,17 +759,17 @@ sal_Int32 OSocket::getPeerPort() const
/*****************************************************************************/
OSocket::TResult OSocket::getPeerHost( rtl::OUString& pBuffer ) const
{
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() )
{
oslSocketAddr Addr= osl_getPeerAddrOfSocket((*m_pSockRef)());
- if(Addr)
+ if(Addr)
{
-// TResult Result= (TResult)osl_getHostnameOfSocketAddr(Addr,
+// TResult Result= (TResult)osl_getHostnameOfSocketAddr(Addr,
// pBuffer, BufferSize);
- TResult Result= (TResult)osl_getHostnameOfSocketAddr(Addr,
+ TResult Result= (TResult)osl_getHostnameOfSocketAddr(Addr,
&pBuffer.pData );
osl_destroySocketAddr(Addr);
@@ -787,13 +786,13 @@ OSocket::TResult OSocket::getPeerHost( rtl::OUString& pBuffer ) const
/*****************************************************************************/
sal_Bool OSocket::bind(const OSocketAddr& Addr)
{
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() )
{
return osl_bindAddrToSocket((*m_pSockRef)(), (oslSocketAddr)Addr);
}
-
+
return sal_False;
}
@@ -829,13 +828,13 @@ void OSocket::setRecvTimeout(const TimeValue* pTimeout)
/*****************************************************************************/
sal_Bool OSocket::isRecvReady(const TimeValue* pTimeout) const
{
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() )
- {
+ {
return osl_isReceiveReady((*m_pSockRef)(), pTimeout);
}
-
+
return sal_False;
}
@@ -844,7 +843,7 @@ sal_Bool OSocket::isRecvReady(const TimeValue* pTimeout) const
/*****************************************************************************/
sal_Bool OSocket::isSendReady(const TimeValue* pTimeout) const
{
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() )
{
@@ -859,13 +858,13 @@ sal_Bool OSocket::isSendReady(const TimeValue* pTimeout) const
/*****************************************************************************/
sal_Bool OSocket::isExceptionPending(const TimeValue* pTimeout) const
{
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() )
- {
+ {
return osl_isExceptionPending((*m_pSockRef)(), pTimeout);
}
-
+
return sal_False;
}
@@ -873,19 +872,19 @@ sal_Bool OSocket::isExceptionPending(const TimeValue* pTimeout) const
/*****************************************************************************/
// getOption
/*****************************************************************************/
-sal_Int32 OSocket::getOption(TSocketOption Option,
+sal_Int32 OSocket::getOption(TSocketOption Option,
void* pBuffer,
sal_uInt32 BufferLen,
TSocketOptionLevel Level) const
{
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() )
{
return osl_getSocketOption((*m_pSockRef)(),
(oslSocketOptionLevel)Level,
(oslSocketOption)Option,
- pBuffer,
+ pBuffer,
BufferLen);
}
@@ -895,19 +894,19 @@ sal_Int32 OSocket::getOption(TSocketOption Option,
/*****************************************************************************/
// setOption
/*****************************************************************************/
-sal_Bool OSocket::setOption(TSocketOption Option,
+sal_Bool OSocket::setOption(TSocketOption Option,
void* pBuffer,
sal_uInt32 BufferLen,
TSocketOptionLevel Level) const
{
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() )
- {
+ {
return osl_setSocketOption((*m_pSockRef)(),
(oslSocketOptionLevel)Level,
(oslSocketOption)Option,
- pBuffer,
+ pBuffer,
BufferLen);
}
@@ -920,10 +919,10 @@ sal_Bool OSocket::setOption(TSocketOption Option,
/*****************************************************************************/
sal_Bool OSocket::enableNonBlockingMode(sal_Bool On)
{
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() )
- {
+ {
return osl_enableNonBlockingMode((*m_pSockRef)(), On);
}
@@ -935,10 +934,10 @@ sal_Bool OSocket::enableNonBlockingMode(sal_Bool On)
/*****************************************************************************/
sal_Bool OSocket::isNonBlockingMode() const
{
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() )
- {
+ {
return osl_isNonBlockingMode((*m_pSockRef)());
}
@@ -950,10 +949,10 @@ sal_Bool OSocket::isNonBlockingMode() const
/*****************************************************************************/
OSocket::TSocketType OSocket::getType() const
{
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() )
- {
+ {
return (TSocketType)osl_getSocketType((*m_pSockRef)());
}
@@ -980,10 +979,10 @@ sal_Int32 OSocket::setDebug(sal_Int32 opt) const
sal_Int32 old= 0;
getOption(TOption_Debug, &old, sizeof(old));
-
+
if (opt != -1)
setOption(TOption_Debug, &opt, sizeof(opt));
-
+
return old;
}
@@ -993,9 +992,9 @@ sal_Int32 OSocket::setDebug(sal_Int32 opt) const
sal_Int32 OSocket::setReuseAddr(sal_Int32 opt) const
{
sal_Int32 old = 0;
-
+
getOption(TOption_ReuseAddr, &old, sizeof(old));
-
+
if (opt != -1)
setOption(TOption_ReuseAddr, &opt, sizeof(opt));
@@ -1008,12 +1007,12 @@ sal_Int32 OSocket::setReuseAddr(sal_Int32 opt) const
sal_Int32 OSocket::setKeepAlive(sal_Int32 opt) const
{
sal_Int32 old = 0;
-
+
getOption(TOption_KeepAlive, &old, sizeof(old));
if (opt != -1)
setOption(TOption_KeepAlive, &opt, sizeof(opt));
-
+
return (old);
}
@@ -1023,12 +1022,12 @@ sal_Int32 OSocket::setKeepAlive(sal_Int32 opt) const
sal_Int32 OSocket::setDontRoute(sal_Int32 opt) const
{
sal_Int32 old = 0;
-
+
getOption(TOption_DontRoute, &old, sizeof(old));
-
+
if (opt != -1)
setOption(TOption_DontRoute, &opt, sizeof(opt));
-
+
return (old);
}
@@ -1038,12 +1037,12 @@ sal_Int32 OSocket::setDontRoute(sal_Int32 opt) const
sal_Int32 OSocket::setBroadcast(sal_Int32 opt) const
{
sal_Int32 old = 0;
-
+
getOption(TOption_Broadcast, &old, sizeof(old));
-
+
if (opt != -1)
setOption(TOption_Broadcast, &opt, sizeof(opt));
-
+
return (old);
}
@@ -1053,12 +1052,12 @@ sal_Int32 OSocket::setBroadcast(sal_Int32 opt) const
sal_Int32 OSocket::setOobinline(sal_Int32 opt) const
{
sal_Int32 old = 0;
-
+
getOption(TOption_OOBinLine, &old, sizeof(old));
-
+
if (opt != -1)
setOption(TOption_OOBinLine, &opt, sizeof(opt));
-
+
return (old);
}
@@ -1068,7 +1067,7 @@ sal_Int32 OSocket::setOobinline(sal_Int32 opt) const
sal_Int32 OSocket::setLinger(sal_Int32 time) const
{
/* local decl. of linger-struct */
- struct SockLinger
+ struct SockLinger
{
sal_Int32 m_onoff; // option on/off
sal_Int32 m_linger; // linger time
@@ -1076,10 +1075,10 @@ sal_Int32 OSocket::setLinger(sal_Int32 time) const
SockLinger old = { 0, 0 };
-
+
getOption(TOption_Linger, &old, sizeof(old));
-
- if (time > 0) // enable linger with wait-times > 0
+
+ if (time > 0) // enable linger with wait-times > 0
{
SockLinger nw = { 1, time };
setOption(TOption_Linger, &nw, sizeof(nw));
@@ -1115,12 +1114,12 @@ sal_Int32 OSocket::setSendBufSize(sal_Int32 sz) const
sal_Int32 OSocket::setRecvBufSize(sal_Int32 sz) const
{
sal_Int32 old = 0;
-
+
getOption(TOption_RcvBuf, &old, sizeof(old));
-
+
if (sz >= 0)
setOption(TOption_RcvBuf, &sz, sizeof(sz));
-
+
return (old);
}
@@ -1130,12 +1129,12 @@ sal_Int32 OSocket::setRecvBufSize(sal_Int32 sz) const
sal_Int32 OSocket::setTcpNoDelay(sal_Int32 sz) const
{
sal_Int32 old = 0;
-
+
getOption(TOption_TcpNoDelay, &old, sizeof(old), TLevel_Tcp);
-
+
if (sz >= 0)
setOption(TOption_TcpNoDelay, &sz, sizeof(sz), TLevel_Tcp);
-
+
return (old);
}
@@ -1145,7 +1144,7 @@ sal_Int32 OSocket::setTcpNoDelay(sal_Int32 sz) const
//void OSocket::getError(sal_Char* pBuffer, sal_uInt32 nSize) const
void OSocket::getError( rtl::OUString& pBuffer ) const
{
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if (m_pSockRef && (*m_pSockRef)())
osl_getLastSocketErrorDescription((*m_pSockRef)(), &pBuffer.pData );
@@ -1158,7 +1157,7 @@ void OSocket::getError( rtl::OUString& pBuffer ) const
/*****************************************************************************/
OSocket::TSocketError OSocket::getError() const
{
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if (m_pSockRef && (*m_pSockRef)())
return (TSocketError)osl_getLastSocketError((*m_pSockRef)());
@@ -1168,15 +1167,15 @@ OSocket::TSocketError OSocket::getError() const
-VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OAcceptorSocket, vos),
- VOS_NAMESPACE(OAcceptorSocket, vos),
+VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OAcceptorSocket, vos),
+ VOS_NAMESPACE(OAcceptorSocket, vos),
VOS_NAMESPACE(OSocket, vos), 0);
/*****************************************************************************/
// OAcceptorSocket
/*****************************************************************************/
-OAcceptorSocket::OAcceptorSocket(TAddrFamily Family,
+OAcceptorSocket::OAcceptorSocket(TAddrFamily Family,
TProtocol Protocol,
TSocketType Type) :
OSocket(Type, Family, Protocol)
@@ -1187,21 +1186,21 @@ OAcceptorSocket::OAcceptorSocket(TAddrFamily Family,
// OAcceptorSocket
/*****************************************************************************/
OAcceptorSocket::OAcceptorSocket(const OAcceptorSocket& sock) :
- OSocket(sock)
+ OSocket(sock)
{
}
/*****************************************************************************/
// ~OAcceptorSocket
/*****************************************************************************/
-OAcceptorSocket::~OAcceptorSocket()
+OAcceptorSocket::~OAcceptorSocket()
{
if (m_pSockRef && (*m_pSockRef)() && (m_pSockRef->release() == 0))
{
/* mfe: prepare for forthcoming api change */
- osl_closeSocket((*m_pSockRef)());
+ osl_closeSocket((*m_pSockRef)());
osl_releaseSocket((*m_pSockRef)());
- delete m_pSockRef;
+ delete m_pSockRef;
m_pSockRef = 0;
}
}
@@ -1215,7 +1214,7 @@ void OAcceptorSocket::close()
{
osl_closeSocket((*m_pSockRef)());
}
-
+
m_pSockRef= 0;
}
@@ -1224,13 +1223,13 @@ void OAcceptorSocket::close()
/*****************************************************************************/
sal_Bool OAcceptorSocket::listen(sal_Int32 MaxPendingConnections)
{
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() )
- {
+ {
return osl_listenOnSocket((*m_pSockRef)(), MaxPendingConnections);
}
-
+
return sal_False;
}
@@ -1240,27 +1239,27 @@ sal_Bool OAcceptorSocket::listen(sal_Int32 MaxPendingConnections)
/*****************************************************************************/
OSocket::TResult OAcceptorSocket::acceptConnection(OStreamSocket& connection)
{
- if (m_pRecvTimeout && ! isRecvReady(m_pRecvTimeout))
+ if (m_pRecvTimeout && ! isRecvReady(m_pRecvTimeout))
return TResult_TimedOut;
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
OStreamSocket aSocket;
-
+
if ( m_pSockRef && (*m_pSockRef)() )
- {
+ {
aSocket = osl_acceptConnectionOnSocket((*m_pSockRef)(), 0);
}
-
+
if( aSocket.isValid() )
{
connection = aSocket;
return TResult_Ok;
}
else
- {
+ {
return TResult_Error;
}
-
+
}
/*****************************************************************************/
@@ -1272,22 +1271,22 @@ OSocket::TResult OAcceptorSocket::acceptConnection(OStreamSocket& connection,
oslSocketAddr PeerAddr = 0;
oslSocket Socket = 0;
- if (m_pRecvTimeout && ! isRecvReady(m_pRecvTimeout))
+ if (m_pRecvTimeout && ! isRecvReady(m_pRecvTimeout))
return TResult_TimedOut;
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() )
- {
+ {
Socket= osl_acceptConnectionOnSocket((*m_pSockRef)(), &PeerAddr);
}
-
+
if (Socket)
{
sa= PeerAddr;
connection= Socket;
return TResult_Ok;
- }
+ }
else
{
return TResult_Error;
@@ -1295,8 +1294,8 @@ OSocket::TResult OAcceptorSocket::acceptConnection(OStreamSocket& connection,
}
-VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OStreamSocket, vos),
- VOS_NAMESPACE(OStreamSocket, vos),
+VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OStreamSocket, vos),
+ VOS_NAMESPACE(OStreamSocket, vos),
VOS_NAMESPACE(OSocket, vos), 0);
@@ -1311,7 +1310,7 @@ OStreamSocket::OStreamSocket()
/*****************************************************************************/
// OStreamSocket
/*****************************************************************************/
-OStreamSocket::OStreamSocket(TAddrFamily Family,
+OStreamSocket::OStreamSocket(TAddrFamily Family,
TProtocol Protocol,
TSocketType Type) :
OSocket(Type, Family, Protocol)
@@ -1405,16 +1404,16 @@ sal_Int32 OStreamSocket::read(void* pBuffer, sal_uInt32 n) const
{
sal_uInt8 *Ptr = (sal_uInt8 *)pBuffer;
- if (m_pRecvTimeout && ! isRecvReady(m_pRecvTimeout))
+ if (m_pRecvTimeout && ! isRecvReady(m_pRecvTimeout))
return 0;
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( ! ( m_pSockRef && (*m_pSockRef)() ) )
{
- return -1;
+ return -1;
}
-
+
/* loop until all desired bytes were read or an error occured */
sal_uInt32 BytesRead= 0;
sal_uInt32 BytesToRead= n;
@@ -1455,13 +1454,13 @@ sal_Int32 OStreamSocket::write(const void* pBuffer, sal_uInt32 n)
if (m_pSendTimeout && ! isSendReady(m_pSendTimeout))
return 0;
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( ! ( m_pSockRef && (*m_pSockRef)() ) )
{
- return -1;
+ return -1;
}
-
+
/* loop until all desired bytes were send or an error occured */
sal_uInt32 BytesSend= 0;
sal_uInt32 BytesToSend= n;
@@ -1508,13 +1507,13 @@ sal_Int32 OStreamSocket::recv(void* pBuffer,
if (m_pRecvTimeout && ! isRecvReady(m_pRecvTimeout))
return 0;
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( ! ( m_pSockRef && (*m_pSockRef)() ) )
{
return -1;
}
-
+
return osl_receiveSocket((*m_pSockRef)(),
pBuffer,
BytesToRead,
@@ -1524,22 +1523,22 @@ sal_Int32 OStreamSocket::recv(void* pBuffer,
/*****************************************************************************/
// send
/*****************************************************************************/
-sal_Int32 OStreamSocket::send(const void* pBuffer,
- sal_uInt32 BytesToSend,
+sal_Int32 OStreamSocket::send(const void* pBuffer,
+ sal_uInt32 BytesToSend,
TSocketMsgFlag Flag)
{
- if (m_pSendTimeout && ! isSendReady(m_pSendTimeout))
+ if (m_pSendTimeout && ! isSendReady(m_pSendTimeout))
return 0;
-
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( ! ( m_pSockRef && (*m_pSockRef)() ) )
{
return -1;
}
-
- return osl_sendSocket((*m_pSockRef)(),
- pBuffer,
+
+ return osl_sendSocket((*m_pSockRef)(),
+ pBuffer,
BytesToSend,
(oslSocketMsgFlag)Flag);
}
@@ -1549,20 +1548,20 @@ sal_Int32 OStreamSocket::send(const void* pBuffer,
/*****************************************************************************/
sal_Bool OStreamSocket::shutdown(TSocketDirection Direction)
{
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() )
{
return osl_shutdownSocket((*m_pSockRef)(), (oslSocketDirection)Direction);
}
-
+
return sal_False;
}
-VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OConnectorSocket, vos),
- VOS_NAMESPACE(OConnectorSocket, vos),
+VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OConnectorSocket, vos),
+ VOS_NAMESPACE(OConnectorSocket, vos),
VOS_NAMESPACE(OStreamSocket, vos), 0);
@@ -1570,7 +1569,7 @@ VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OConnectorSocket, vos),
/*****************************************************************************/
// OConnectorSocket
/*****************************************************************************/
-OConnectorSocket::OConnectorSocket(TAddrFamily Family,
+OConnectorSocket::OConnectorSocket(TAddrFamily Family,
TProtocol Protocol,
TSocketType Type) :
OStreamSocket(Family, Protocol, Type)
@@ -1595,32 +1594,32 @@ OConnectorSocket::~OConnectorSocket()
/*****************************************************************************/
// connect
/*****************************************************************************/
-OSocket::TResult OConnectorSocket::connect(const OSocketAddr& Addr,
+OSocket::TResult OConnectorSocket::connect(const OSocketAddr& Addr,
const TimeValue* pTimeout)
{
-
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() )
- {
+ {
return (TResult)osl_connectSocketTo((*m_pSockRef)(),
(oslSocketAddr)Addr,
pTimeout);
}
-
+
return TResult_Error;
}
-VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(ODatagramSocket, vos),
- VOS_NAMESPACE(ODatagramSocket, vos),
+VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(ODatagramSocket, vos),
+ VOS_NAMESPACE(ODatagramSocket, vos),
VOS_NAMESPACE(OSocket, vos), 0);
/*****************************************************************************/
// ODatagramSocket
/*****************************************************************************/
-ODatagramSocket::ODatagramSocket(TAddrFamily Family,
+ODatagramSocket::ODatagramSocket(TAddrFamily Family,
TProtocol Protocol,
TSocketType Type) :
OSocket(Type, Family, Protocol)
@@ -1646,22 +1645,22 @@ ODatagramSocket::~ODatagramSocket()
/*****************************************************************************/
// recvFrom
/*****************************************************************************/
-sal_Int32 ODatagramSocket::recvFrom(void* pBuffer,
- sal_uInt32 BufferSize,
+sal_Int32 ODatagramSocket::recvFrom(void* pBuffer,
+ sal_uInt32 BufferSize,
OSocketAddr* pSenderAddr,
TSocketMsgFlag Flag)
{
- if (m_pRecvTimeout && ! isRecvReady(m_pRecvTimeout))
+ if (m_pRecvTimeout && ! isRecvReady(m_pRecvTimeout))
return 0;
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( ! ( m_pSockRef && (*m_pSockRef)() ) )
{
return -1;
}
-
+
sal_Int32 BytesRead;
if(pSenderAddr)
@@ -1697,22 +1696,22 @@ sal_Int32 ODatagramSocket::recvFrom(void* pBuffer,
/*****************************************************************************/
// sendTo
/*****************************************************************************/
-sal_Int32 ODatagramSocket::sendTo(const OSocketAddr& ReceiverAddr,
+sal_Int32 ODatagramSocket::sendTo(const OSocketAddr& ReceiverAddr,
const void* pBuffer,
- sal_uInt32 BufferSize,
+ sal_uInt32 BufferSize,
TSocketMsgFlag Flag)
{
- if (m_pSendTimeout && ! isSendReady(m_pSendTimeout))
+ if (m_pSendTimeout && ! isSendReady(m_pSendTimeout))
return 0;
- VOS_ASSERT(m_pSockRef && (*m_pSockRef)());
+ OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( ( m_pSockRef && (*m_pSockRef)() ) )
{
-
- return osl_sendToSocket((*m_pSockRef)(),
+
+ return osl_sendToSocket((*m_pSockRef)(),
(oslSocketAddr)ReceiverAddr,
- pBuffer,
+ pBuffer,
BufferSize,
(oslSocketMsgFlag)Flag);
}
diff --git a/vos/source/thread.cxx b/vos/source/thread.cxx
index 24b546a..b819bf6 100644
--- a/vos/source/thread.cxx
+++ b/vos/source/thread.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -26,9 +26,9 @@
************************************************************************/
#include <osl/time.h>
-#include <vos/diagnose.hxx>
#include <vos/object.hxx>
#include <vos/thread.hxx>
+#include <osl/diagnose.h>
using namespace vos;
@@ -39,7 +39,7 @@ void vos::threadWorkerFunction_impl(void * pthis)
// call Handler-Function of OThread-derived class
pThis->run();
- // if not already terminating, by a kill do normal shutdown
+ // if not already terminating, by a kill do normal shutdown
if (! pThis->m_bTerminating)
{
pThis->m_bTerminating = sal_True;
@@ -53,62 +53,62 @@ void vos::threadWorkerFunction_impl(void * pthis)
// Thread class
//
-VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OThread, vos),
- VOS_NAMESPACE(OThread, vos),
+VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OThread, vos),
+ VOS_NAMESPACE(OThread, vos),
VOS_NAMESPACE(OObject, vos), 0);
-OThread::OThread()
+OThread::OThread()
{
m_hThread = 0;
m_bTerminating = sal_False;
m_aCondition = osl_createCondition();
}
-OThread::~OThread()
+OThread::~OThread()
{
if (m_hThread != 0)
{
osl_destroyThread(m_hThread);
}
-
+
osl_destroyCondition( m_aCondition );
}
-sal_Bool OThread::create()
+sal_Bool OThread::create()
{
- VOS_ASSERT(m_hThread == 0); // only one running thread per instance
+ OSL_ASSERT(m_hThread == 0); // only one running thread per instance
m_hThread = osl_createSuspendedThread(
threadWorkerFunction_impl, (void*)this);
if (m_hThread)
- osl_resumeThread(m_hThread);
+ osl_resumeThread(m_hThread);
return m_hThread != 0;
}
-sal_Bool OThread::createSuspended()
+sal_Bool OThread::createSuspended()
{
- VOS_ASSERT(m_hThread == 0); // only one running thread per instance
+ OSL_ASSERT(m_hThread == 0); // only one running thread per instance
m_hThread= osl_createSuspendedThread(threadWorkerFunction_impl, (void*)this);
return m_hThread != 0;
}
-void OThread::suspend()
+void OThread::suspend()
{
- VOS_ASSERT(m_hThread != 0); // use only on running thread
+ OSL_ASSERT(m_hThread != 0); // use only on running thread
osl_suspendThread(m_hThread);
}
-void OThread::resume()
+void OThread::resume()
{
- VOS_ASSERT(m_hThread != 0); // use only on running thread
+ OSL_ASSERT(m_hThread != 0); // use only on running thread
osl_resumeThread(m_hThread);
}
-sal_Bool OThread::isRunning()
+sal_Bool OThread::isRunning()
{
return m_hThread != 0 && osl_isThreadRunning(m_hThread);
}
@@ -123,33 +123,33 @@ OThread::TThreadIdentifier OThread::getCurrentIdentifier()
return (TThreadIdentifier)osl_getThreadIdentifier(0);
}
-void OThread::join()
+void OThread::join()
{
if (m_hThread) {
- VOS_ASSERT(getCurrentIdentifier() != getIdentifier());
+ OSL_ASSERT(getCurrentIdentifier() != getIdentifier());
osl_joinWithThread(m_hThread);
}
}
-OThread::TThreadSleep OThread::sleep(const TimeValue& Delay)
+OThread::TThreadSleep OThread::sleep(const TimeValue& Delay)
{
TThreadSleep eRet;
-
+
switch( osl_waitCondition( m_aCondition, &Delay ) )
{
case osl_cond_result_ok:
eRet = TSleep_Normal;
break;
-
+
case osl_cond_result_timeout:
eRet = TSleep_Cancel;
- break;
-
+ break;
+
default:
eRet = TSleep_Error;
break;
}
-
+
return eRet;
}
@@ -157,13 +157,13 @@ void OThread::wait(const TimeValue& Delay) {
osl_waitThread(&Delay);
}
-sal_Bool OThread::awake()
+sal_Bool OThread::awake()
{
osl_setCondition( m_aCondition );
return osl_resetCondition( m_aCondition );
}
-void OThread::terminate()
+void OThread::terminate()
{
osl_terminateThread(m_hThread);
}
@@ -172,9 +172,9 @@ sal_Bool OThread::schedule() {
return osl_scheduleThread(m_hThread);
}
-void OThread::kill()
+void OThread::kill()
{
- if (osl_isThreadRunning(m_hThread))
+ if (osl_isThreadRunning(m_hThread))
{
// flag we are shutting down
m_bTerminating = sal_True;
@@ -195,12 +195,12 @@ OThread::TThreadPriority OThread::getPriority()
}
-void OThread::yield()
-{
+void OThread::yield()
+{
osl_yieldThread();
}
-void OThread::onTerminated()
+void OThread::onTerminated()
{
}
@@ -209,14 +209,14 @@ void OThread::onTerminated()
// ThreadData class
//
-VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OThreadData, vos),
- VOS_NAMESPACE(OThreadData, vos),
+VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OThreadData, vos),
+ VOS_NAMESPACE(OThreadData, vos),
VOS_NAMESPACE(OObject, vos), 0);
OThreadData::OThreadData( oslThreadKeyCallbackFunction pCallback )
{
m_hKey = osl_createThreadKey( pCallback );
- VOS_VERIFY(m_hKey);
+ OSL_VERIFY(m_hKey);
}
OThreadData::~OThreadData()
@@ -226,14 +226,14 @@ OThreadData::~OThreadData()
sal_Bool OThreadData::setData(void *pData)
{
- VOS_ASSERT(m_hKey != 0);
+ OSL_ASSERT(m_hKey != 0);
return (osl_setThreadKeyData(m_hKey, pData));
}
void *OThreadData::getData()
{
- VOS_ASSERT(m_hKey != 0);
+ OSL_ASSERT(m_hKey != 0);
return (osl_getThreadKeyData(m_hKey));
}
diff --git a/vos/source/timer.cxx b/vos/source/timer.cxx
index 624b3d7..19dcb38 100644
--- a/vos/source/timer.cxx
+++ b/vos/source/timer.cxx
@@ -28,7 +28,7 @@
#include <osl/time.h>
#include <vos/timer.hxx>
-#include <vos/diagnose.hxx>
+#include <osl/diagnose.h>
#include <vos/ref.hxx>
#include <vos/thread.hxx>
#include <vos/conditn.hxx>
@@ -147,7 +147,7 @@ void OTimer::start()
OTimerManager *pManager = OTimerManager::getTimerManager();
- VOS_ASSERT(pManager);
+ OSL_ASSERT(pManager);
if ( pManager != 0 )
{
@@ -160,7 +160,7 @@ void OTimer::stop()
{
OTimerManager *pManager = OTimerManager::getTimerManager();
- VOS_ASSERT(pManager);
+ OSL_ASSERT(pManager);
if ( pManager != 0 )
{
@@ -172,7 +172,7 @@ sal_Bool OTimer::isTicking() const
{
OTimerManager *pManager = OTimerManager::getTimerManager();
- VOS_ASSERT(pManager);
+ OSL_ASSERT(pManager);
if (pManager)
return pManager->lookupTimer(this);
@@ -192,7 +192,7 @@ sal_Bool OTimer::isExpired() const
sal_Bool OTimer::expiresBefore(const OTimer* pTimer) const
{
- VOS_ASSERT(pTimer);
+ OSL_ASSERT(pTimer);
if ( pTimer != 0 )
{
@@ -274,7 +274,7 @@ OTimerManager::OTimerManager()
{
OGuard Guard(&m_Access);
- VOS_ASSERT(m_pManager == 0);
+ OSL_ASSERT(m_pManager == 0);
m_pManager = this;
@@ -311,7 +311,7 @@ OTimerManager* OTimerManager::getTimerManager()
sal_Bool OTimerManager::registerTimer(OTimer* pTimer)
{
- VOS_ASSERT(pTimer);
+ OSL_ASSERT(pTimer);
if ( pTimer == 0 )
{
@@ -352,7 +352,7 @@ sal_Bool OTimerManager::registerTimer(OTimer* pTimer)
sal_Bool OTimerManager::unregisterTimer(OTimer* pTimer)
{
- VOS_ASSERT(pTimer);
+ OSL_ASSERT(pTimer);
if ( pTimer == 0 )
{
@@ -380,7 +380,7 @@ sal_Bool OTimerManager::unregisterTimer(OTimer* pTimer)
sal_Bool OTimerManager::lookupTimer(const OTimer* pTimer)
{
- VOS_ASSERT(pTimer);
+ OSL_ASSERT(pTimer);
if ( pTimer == 0 )
{
More information about the Libreoffice-commits
mailing list