merge vosremoval-diagnoses patch

This commit is contained in:
Norbert Thiebaud
2010-10-10 19:46:49 -05:00
parent 0ecc627bc0
commit 5584c277cb
22 changed files with 124 additions and 185 deletions

View File

@@ -34,7 +34,7 @@
#include <wchar.h> #include <wchar.h>
#endif #endif
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <vos/diagnose.hxx> #include <osl/diagnose.h>
#include <vos/macros.hxx> #include <vos/macros.hxx>
#include <comphelper/eventattachermgr.hxx> #include <comphelper/eventattachermgr.hxx>
#include <com/sun/star/beans/XIntrospection.hpp> #include <com/sun/star/beans/XIntrospection.hpp>
@@ -97,25 +97,25 @@ struct AttacherIndex_Impl
#if 0 #if 0
bool AttachedObject_Impl::operator<( const AttachedObject_Impl & r ) const bool AttachedObject_Impl::operator<( const AttachedObject_Impl & r ) const
{ {
VOS_ENSHURE( FALSE, "not implemented" ); OSL_ENSURE( FALSE, "not implemented" );
return FALSE; return FALSE;
return this < &r; return this < &r;
} }
bool AttachedObject_Impl::operator==( const AttachedObject_Impl & r ) const bool AttachedObject_Impl::operator==( const AttachedObject_Impl & r ) const
{ {
VOS_ENSHURE( FALSE, "not implemented" ); OSL_ENSURE( FALSE, "not implemented" );
return this == &r; return this == &r;
} }
bool AttacherIndex_Impl::operator<( const AttacherIndex_Impl & r ) const bool AttacherIndex_Impl::operator<( const AttacherIndex_Impl & r ) const
{ {
VOS_ENSHURE( FALSE, "not implemented" ); OSL_ENSURE( FALSE, "not implemented" );
return this < &r; return this < &r;
} }
bool AttacherIndex_Impl::operator==( const AttacherIndex_Impl & r ) const bool AttacherIndex_Impl::operator==( const AttacherIndex_Impl & r ) const
{ {
VOS_ENSHURE( FALSE, "not implemented" ); OSL_ENSURE( FALSE, "not implemented" );
return this == &r; return this == &r;
} }
#endif #endif
@@ -1014,7 +1014,7 @@ void SAL_CALL ImplEventAttacherManager::read(const Reference< XObjectInputStream
// Ganze richtig sein. Sonst ist etwas voellig daneben gegangen. // Ganze richtig sein. Sonst ist etwas voellig daneben gegangen.
if( nRealLen > nLen || nVersion == 1 ) 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 else
{ {

View File

@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove // MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_comphelper.hxx" #include "precompiled_comphelper.hxx"
#include <comphelper/attributelist.hxx> #include <comphelper/attributelist.hxx>
#include <vos/diagnose.hxx> #include <osl/diagnose.h>
#include <vector> #include <vector>
@@ -135,7 +135,7 @@ void AttributeList::Clear()
{ {
m_pImpl->vecAttribute.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 ) 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 ) 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 nMax = r->getLength();
sal_Int32 nTotalSize = m_pImpl->vecAttribute.size() + nMax; sal_Int32 nTotalSize = m_pImpl->vecAttribute.size() + nMax;
@@ -172,7 +172,7 @@ void AttributeList::AppendAttributeList( const uno::Reference< ::com::sun::star:
r->getValueByIndex( i ))); r->getValueByIndex( i )));
} }
VOS_ENSURE( nTotalSize == getLength(), "nTotalSize != getLength()"); OSL_ENSURE( nTotalSize == getLength(), "nTotalSize != getLength()");
} }
} // namespace comphelper } // namespace comphelper

View File

@@ -48,7 +48,7 @@
#include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase1.hxx>
#include <cppuhelper/implbase3.hxx> #include <cppuhelper/implbase3.hxx>
#include <vos/diagnose.hxx> #include <osl/diagnose.h>
#include "LocaleNode.hxx" #include "LocaleNode.hxx"

View File

@@ -51,7 +51,7 @@
#include <cppuhelper/implbase3.hxx> #include <cppuhelper/implbase3.hxx>
#include <vos/dynload.hxx> #include <vos/dynload.hxx>
#include <vos/diagnose.hxx> #include <osl/diagnose.h>
using namespace ::rtl; using namespace ::rtl;
using namespace ::std; using namespace ::std;

View File

@@ -42,7 +42,7 @@
#include <cppuhelper/servicefactory.hxx> #include <cppuhelper/servicefactory.hxx>
#include <vos/dynload.hxx> #include <vos/dynload.hxx>
#include <vos/diagnose.hxx> #include <osl/diagnose.h>
using namespace ::rtl; using namespace ::rtl;
using namespace ::cppu; using namespace ::cppu;

View File

@@ -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_ */

View File

@@ -39,10 +39,8 @@
*/ */
# include <vos/refernce.hxx> #include <vos/refernce.hxx>
#ifndef _VOS_DIAGNOSE_HXX_ #include <osl/diagnose.h>
# include <vos/diagnose.hxx>
#endif
namespace vos namespace vos
{ {

View File

@@ -109,28 +109,28 @@ inline void ORef<T>::operator= (T* pBody)
template <class T> template <class T>
inline T& ORef<T>::operator() () const 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; return *m_refBody;
} }
template <class T> template <class T>
inline T& ORef<T>::operator* () const 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; return *m_refBody;
} }
template <class T> template <class T>
inline T* ORef<T>::operator->() const 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; return m_refBody;
} }
template <class T> template <class T>
inline T& ORef<T>::getBody() const 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; return *m_refBody;
} }

View File

@@ -36,10 +36,8 @@
with reference-counting. with reference-counting.
*/ */
# include <vos/refernce.hxx> #include <vos/refernce.hxx>
#ifndef _VOS_DIAGNOSE_HXX_ #include <osl/diagnose.h>
# include <vos/diagnose.hxx>
#endif
namespace vos namespace vos
{ {

View File

@@ -37,7 +37,7 @@ ORefObj<T>::ORefObj(const T& Obj)
template <class T> template <class T>
inline ORefObj<T>::~ORefObj() inline ORefObj<T>::~ORefObj()
{ {
VOS_ASSERT(m_RefCount.referenced() == 0); OSL_ASSERT(m_RefCount.referenced() == 0);
} }
template <class T> template <class T>

View File

@@ -27,7 +27,7 @@
#include <osl/time.h> #include <osl/time.h>
#include <vos/conditn.hxx> #include <vos/conditn.hxx>
#include <vos/diagnose.hxx> #include <osl/diagnose.h>
using namespace vos; using namespace vos;

View File

@@ -27,7 +27,7 @@
#include <vos/module.hxx> #include <vos/module.hxx>
#include <vos/diagnose.hxx> #include <osl/diagnose.h>
using namespace vos; using namespace vos;
@@ -55,7 +55,7 @@ OModule::~OModule()
sal_Bool OModule::load(const rtl::OUString& ustrModuleName, sal_Int32 nRtldMode) sal_Bool OModule::load(const rtl::OUString& ustrModuleName, sal_Int32 nRtldMode)
{ {
VOS_ASSERT(ustrModuleName); OSL_ASSERT(ustrModuleName);
unload(); unload();
@@ -80,8 +80,8 @@ sal_Bool OModule::isLoaded()
void *OModule::getSymbol(const rtl::OUString& strSymbolName) void *OModule::getSymbol(const rtl::OUString& strSymbolName)
{ {
VOS_ASSERT(strSymbolName); OSL_ASSERT(strSymbolName);
VOS_ASSERT(m_Module); OSL_ASSERT(m_Module);
return ( osl_getSymbol( m_Module, strSymbolName.pData ) ); return ( osl_getSymbol( m_Module, strSymbolName.pData ) );
} }

View File

@@ -25,7 +25,7 @@
* *
************************************************************************/ ************************************************************************/
#include <vos/diagnose.hxx> #include <osl/diagnose.h>
#include <vos/object.hxx> #include <vos/object.hxx>
#include <vos/mutex.hxx> #include <vos/mutex.hxx>

View File

@@ -30,7 +30,7 @@
#include <rtl/alloc.h> #include <rtl/alloc.h>
#include <rtl/memory.h> #include <rtl/memory.h>
#include <vos/diagnose.hxx> #include <osl/diagnose.h>
#include <vos/object.hxx> #include <vos/object.hxx>
@@ -57,7 +57,7 @@ void* OObject::operator new(size_t size)
{ {
void* p = rtl_allocateMemory(size); void* p = rtl_allocateMemory(size);
VOS_ASSERT(p != NULL); OSL_ASSERT(p != NULL);
return (p); return (p);
} }
@@ -84,7 +84,7 @@ const OClassInfo& OObject::getClassInfo() const
sal_Bool OObject::isKindOf(const OClassInfo& rClass) const sal_Bool OObject::isKindOf(const OClassInfo& rClass) const
{ {
VOS_ASSERT(this != NULL); OSL_ASSERT(this != NULL);
const OClassInfo& rClassThis = getClassInfo(); const OClassInfo& rClassThis = getClassInfo();
@@ -121,7 +121,7 @@ OObject* OClassInfo::createObject(const OCreateParam& rParam) const
sal_Bool OClassInfo::isDerivedFrom(const OClassInfo& rClass) const sal_Bool OClassInfo::isDerivedFrom(const OClassInfo& rClass) const
{ {
VOS_ASSERT(this != NULL); OSL_ASSERT(this != NULL);
const OClassInfo* pClassThis = this; const OClassInfo* pClassThis = this;
@@ -138,7 +138,7 @@ sal_Bool OClassInfo::isDerivedFrom(const OClassInfo& rClass) const
const OClassInfo* OClassInfo::getClassInfo(const sal_Char* pClassName) 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)); 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_CLASSINIT::VOS_CLASSINIT(register OClassInfo* pNewClass)
{ {
VOS_ASSERT(pNewClass != NULL); OSL_ASSERT(pNewClass != NULL);
OClassInfo* pClassRoot = (OClassInfo*)&VOS_CLASSINFO(VOS_NAMESPACE(OObject, vos)); OClassInfo* pClassRoot = (OClassInfo*)&VOS_CLASSINFO(VOS_NAMESPACE(OObject, vos));

View File

@@ -27,7 +27,7 @@
#include <vos/pipe.hxx> #include <vos/pipe.hxx>
#include <vos/diagnose.hxx> #include <osl/diagnose.h>
using namespace vos; using namespace vos;
@@ -58,8 +58,8 @@ OPipe::OPipe( const rtl::OUString& strName, TPipeOption Options)
(oslPipeOptions)Options, (oslPipeOptions)Options,
NULL) ); NULL) );
VOS_POSTCOND(m_pPipeRef != 0, "OPipe(): new failed.\n"); OSL_POSTCOND(m_pPipeRef != 0, "OPipe(): new failed.\n");
VOS_POSTCOND((*m_pPipeRef)(), "OPipe(): creation of pipe failed!\n"); OSL_POSTCOND((*m_pPipeRef)(), "OPipe(): creation of pipe failed!\n");
} }
/*****************************************************************************/ /*****************************************************************************/
@@ -75,8 +75,8 @@ OPipe::OPipe( const rtl::OUString& strName,
(oslPipeOptions)Options, (oslPipeOptions)Options,
(oslSecurity)rSecurity)); (oslSecurity)rSecurity));
VOS_POSTCOND(m_pPipeRef != 0, "OPipe(): new failed.\n"); OSL_POSTCOND(m_pPipeRef != 0, "OPipe(): new failed.\n");
VOS_POSTCOND((*m_pPipeRef)(), "OPipe(): creation of pipe failed!\n"); OSL_POSTCOND((*m_pPipeRef)(), "OPipe(): creation of pipe failed!\n");
} }
/*****************************************************************************/ /*****************************************************************************/
@@ -86,7 +86,7 @@ OPipe::OPipe(const OPipe& pipe) :
OReference(), OObject() OReference(), OObject()
{ {
VOS_ASSERT(pipe.m_pPipeRef != 0); OSL_ASSERT(pipe.m_pPipeRef != 0);
m_pPipeRef= pipe.m_pPipeRef; m_pPipeRef= pipe.m_pPipeRef;
@@ -128,7 +128,7 @@ sal_Bool OPipe::create( const rtl::OUString& strName, TPipeOption Options )
(oslPipeOptions)Options, (oslPipeOptions)Options,
NULL)); NULL));
VOS_POSTCOND(m_pPipeRef != 0, "OPipe(): new failed.\n"); OSL_POSTCOND(m_pPipeRef != 0, "OPipe(): new failed.\n");
return (*m_pPipeRef)() != 0; return (*m_pPipeRef)() != 0;
} }
@@ -153,7 +153,7 @@ sal_Bool OPipe::create( const rtl::OUString& strName,
(oslPipeOptions)Options, (oslPipeOptions)Options,
(oslSecurity)rSecurity)); (oslSecurity)rSecurity));
VOS_POSTCOND(m_pPipeRef != 0, "OPipe(): new failed.\n"); OSL_POSTCOND(m_pPipeRef != 0, "OPipe(): new failed.\n");
return (*m_pPipeRef)() != 0; return (*m_pPipeRef)() != 0;
} }
@@ -163,7 +163,7 @@ sal_Bool OPipe::create( const rtl::OUString& strName,
/*****************************************************************************/ /*****************************************************************************/
OPipe& OPipe::operator= (const OPipe& pipe) 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) if (m_pPipeRef == pipe.m_pPipeRef)
return *this; return *this;
@@ -188,7 +188,7 @@ OPipe& OPipe::operator= (const OPipe& pipe)
/*****************************************************************************/ /*****************************************************************************/
OPipe::operator oslPipe() const OPipe::operator oslPipe() const
{ {
VOS_ASSERT(m_pPipeRef); OSL_ASSERT(m_pPipeRef);
return (*m_pPipeRef)(); return (*m_pPipeRef)();
} }
@@ -298,7 +298,7 @@ OStreamPipe::OStreamPipe(oslPipe Pipe) :
OStreamPipe::OStreamPipe(const OStreamPipe& pipe) : OStreamPipe::OStreamPipe(const OStreamPipe& pipe) :
OPipe(), IStream() OPipe(), IStream()
{ {
VOS_ASSERT(pipe.m_pPipeRef != 0); OSL_ASSERT(pipe.m_pPipeRef != 0);
m_pPipeRef= pipe.m_pPipeRef; m_pPipeRef= pipe.m_pPipeRef;
@@ -328,7 +328,7 @@ OStreamPipe& OStreamPipe::operator=(oslPipe Pipe)
m_pPipeRef= new PipeRef(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; return *this;
} }
@@ -348,7 +348,7 @@ OStreamPipe& OStreamPipe::operator= (const OPipe& pipe)
/*****************************************************************************/ /*****************************************************************************/
sal_Int32 OStreamPipe::read(void* pBuffer, sal_uInt32 n) const 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 */ /* loop until all desired bytes were read or an error occured */
sal_Int32 BytesRead= 0; 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) 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 */ /* loop until all desired bytes were send or an error occured */
sal_Int32 BytesSend= 0; sal_Int32 BytesSend= 0;

View File

@@ -32,7 +32,7 @@
#include <rtl/instance.hxx> #include <rtl/instance.hxx>
#include "vos/process.hxx" #include "vos/process.hxx"
#include "vos/diagnose.hxx" #include "osl/diagnose.h"
#include <osl/file.hxx> #include <osl/file.hxx>
#define MAX_RESOURCES 100 #define MAX_RESOURCES 100

View File

@@ -27,7 +27,7 @@
#include <limits.h> #include <limits.h>
#include <vos/diagnose.hxx> #include <osl/diagnose.h>
#include <vos/refernce.hxx> #include <vos/refernce.hxx>
@@ -45,7 +45,7 @@ OReference::OReference()
OReference::~OReference() OReference::~OReference()
{ {
VOS_ASSERT(m_RefCount.referenced() == 0); OSL_ASSERT(m_RefCount.referenced() == 0);
} }
IReference::RefCount OReference::acquire() IReference::RefCount OReference::acquire()

View File

@@ -27,7 +27,7 @@
#include <vos/security.hxx> #include <vos/security.hxx>
#include <vos/diagnose.hxx> #include <osl/diagnose.h>
using namespace vos; using namespace vos;
@@ -73,7 +73,7 @@ sal_Bool OSecurity::logonUser( const rtl::OUString& strName,
sal_Bool OSecurity::getUserIdent( rtl::OUString& strIdent) const sal_Bool OSecurity::getUserIdent( rtl::OUString& strIdent) const
{ {
VOS_ASSERT(m_oslSecurity); OSL_ASSERT(m_oslSecurity);
return osl_getUserIdent( m_oslSecurity, &strIdent.pData ); 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 sal_Bool OSecurity::getUserName( rtl::OUString& strName ) const
{ {
VOS_ASSERT(m_oslSecurity); OSL_ASSERT(m_oslSecurity);
return osl_getUserName( m_oslSecurity, &strName.pData ); 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 sal_Bool OSecurity::getHomeDir( rtl::OUString& strDirectory) const
{ {
VOS_ASSERT(m_oslSecurity); OSL_ASSERT(m_oslSecurity);
return osl_getHomeDir(m_oslSecurity, &strDirectory.pData ); 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 sal_Bool OSecurity::getConfigDir( rtl::OUString& strDirectory ) const
{ {
VOS_ASSERT(m_oslSecurity); OSL_ASSERT(m_oslSecurity);
return osl_getConfigDir( m_oslSecurity, &strDirectory.pData ); return osl_getConfigDir( m_oslSecurity, &strDirectory.pData );
} }
sal_Bool OSecurity::isAdministrator() const sal_Bool OSecurity::isAdministrator() const
{ {
VOS_ASSERT(m_oslSecurity); OSL_ASSERT(m_oslSecurity);
return osl_isAdministrator(m_oslSecurity); return osl_isAdministrator(m_oslSecurity);
} }

View File

@@ -26,7 +26,7 @@
************************************************************************/ ************************************************************************/
#include <vos/diagnose.hxx> #include <osl/diagnose.h>
#include <vos/object.hxx> #include <vos/object.hxx>
#include <vos/signal.hxx> #include <vos/signal.hxx>

View File

@@ -30,7 +30,6 @@
#include <rtl/memory.h> #include <rtl/memory.h>
#include <osl/time.h> #include <osl/time.h>
#include <vos/socket.hxx> #include <vos/socket.hxx>
#include <vos/diagnose.hxx>
using namespace vos; using namespace vos;
@@ -171,7 +170,7 @@ OInetSocketAddr::OInetSocketAddr()
OInetSocketAddr::OInetSocketAddr(oslSocketAddr Addr) : OInetSocketAddr::OInetSocketAddr(oslSocketAddr Addr) :
OSocketAddr(Addr) OSocketAddr(Addr)
{ {
VOS_ASSERT(osl_getFamilyOfSocketAddr(Addr) == osl_Socket_FamilyInet); OSL_ASSERT(osl_getFamilyOfSocketAddr(Addr) == osl_Socket_FamilyInet);
} }
/*****************************************************************************/ /*****************************************************************************/
@@ -193,7 +192,7 @@ OInetSocketAddr::OInetSocketAddr(const rtl::OUString& ustrAddrOrHostname, sal_In
if(m_SockAddr) if(m_SockAddr)
{ {
// set port will fail if addrtype is not osl_Socket_FamilyInet // 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,7 +203,7 @@ OInetSocketAddr::OInetSocketAddr(const rtl::OUString& ustrAddrOrHostname, sal_In
OInetSocketAddr::OInetSocketAddr(const OInetSocketAddr& sa) : OInetSocketAddr::OInetSocketAddr(const OInetSocketAddr& sa) :
OSocketAddr(sa) OSocketAddr(sa)
{ {
VOS_ASSERT(getFamily() == TFamily_Inet); OSL_ASSERT(getFamily() == TFamily_Inet);
} }
/*****************************************************************************/ /*****************************************************************************/
@@ -213,7 +212,7 @@ OInetSocketAddr::OInetSocketAddr(const OInetSocketAddr& sa) :
OInetSocketAddr::OInetSocketAddr(const OSocketAddr& sa) : OInetSocketAddr::OInetSocketAddr(const OSocketAddr& sa) :
OSocketAddr(sa) OSocketAddr(sa)
{ {
VOS_ASSERT(sa.getFamily() == TFamily_Inet); OSL_ASSERT(sa.getFamily() == TFamily_Inet);
} }
/*****************************************************************************/ /*****************************************************************************/
@@ -228,7 +227,7 @@ OInetSocketAddr::~OInetSocketAddr()
/*****************************************************************************/ /*****************************************************************************/
void OInetSocketAddr::operator= (oslSocketAddr Addr) 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!"); "oslSocketAddr not of type osl_Socket_FamilyInet!");
OSocketAddr::operator=(Addr); OSocketAddr::operator=(Addr);
@@ -247,7 +246,7 @@ sal_Bool OInetSocketAddr::operator== (oslSocketAddr Addr)
/*****************************************************************************/ /*****************************************************************************/
OInetSocketAddr& OInetSocketAddr::operator=(const OInetSocketAddr& Addr) OInetSocketAddr& OInetSocketAddr::operator=(const OInetSocketAddr& Addr)
{ {
VOS_ASSERT(Addr.getFamily() == TFamily_Inet); OSL_ASSERT(Addr.getFamily() == TFamily_Inet);
OSocketAddr::operator=(Addr); OSocketAddr::operator=(Addr);
@@ -259,7 +258,7 @@ OInetSocketAddr& OInetSocketAddr::operator=(const OInetSocketAddr& Addr)
/*****************************************************************************/ /*****************************************************************************/
OInetSocketAddr& OInetSocketAddr::operator=(const OSocketAddr& Addr) OInetSocketAddr& OInetSocketAddr::operator=(const OSocketAddr& Addr)
{ {
VOS_ASSERT(Addr.getFamily() == TFamily_Inet); OSL_ASSERT(Addr.getFamily() == TFamily_Inet);
OSocketAddr::operator=(Addr); OSocketAddr::operator=(Addr);
@@ -335,7 +334,7 @@ sal_Bool OInetSocketAddr::setAddr(const rtl::OUString& ustrAddrOrHostname)
} }
// set port will fail if addrtype is not osl_Socket_FamilyInet // 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));
} }
@@ -364,7 +363,7 @@ OIpxSocketAddr::OIpxSocketAddr()
OIpxSocketAddr::OIpxSocketAddr(oslSocketAddr Addr) : OIpxSocketAddr::OIpxSocketAddr(oslSocketAddr Addr) :
OSocketAddr(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) : OIpxSocketAddr::OIpxSocketAddr(const OIpxSocketAddr& sa) :
OSocketAddr(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) : OIpxSocketAddr::OIpxSocketAddr(const OSocketAddr& sa) :
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) 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!"); "oslSocketAddr not of type osl_Socket_FamilyIpx!");
OSocketAddr::operator=(Addr); OSocketAddr::operator=(Addr);
@@ -428,7 +427,7 @@ sal_Bool OIpxSocketAddr::operator== (oslSocketAddr Addr)
/*****************************************************************************/ /*****************************************************************************/
OIpxSocketAddr& OIpxSocketAddr::operator=(const OIpxSocketAddr& Addr) OIpxSocketAddr& OIpxSocketAddr::operator=(const OIpxSocketAddr& Addr)
{ {
VOS_ASSERT(Addr.getFamily() == TFamily_Ipx); OSL_ASSERT(Addr.getFamily() == TFamily_Ipx);
OSocketAddr::operator=(Addr); OSocketAddr::operator=(Addr);
@@ -440,7 +439,7 @@ OIpxSocketAddr& OIpxSocketAddr::operator=(const OIpxSocketAddr& Addr)
/*****************************************************************************/ /*****************************************************************************/
OIpxSocketAddr& OIpxSocketAddr::operator=(const OSocketAddr& Addr) OIpxSocketAddr& OIpxSocketAddr::operator=(const OSocketAddr& Addr)
{ {
VOS_ASSERT(Addr.getFamily() == TFamily_Ipx); OSL_ASSERT(Addr.getFamily() == TFamily_Ipx);
OSocketAddr::operator=(Addr); OSocketAddr::operator=(Addr);
@@ -520,8 +519,8 @@ OSocket::OSocket(TSocketType Type,
(oslSocketType)Type, (oslSocketType)Type,
(oslProtocol)Protocol)); (oslProtocol)Protocol));
VOS_POSTCOND(m_pSockRef != 0, "OSocket(): new failed.\n"); OSL_POSTCOND(m_pSockRef != 0, "OSocket(): new failed.\n");
VOS_POSTCOND((*m_pSockRef)(), "OSocket(): creation of socket failed!\n"); OSL_POSTCOND((*m_pSockRef)(), "OSocket(): creation of socket failed!\n");
} }
/*****************************************************************************/ /*****************************************************************************/
@@ -534,7 +533,7 @@ ISocketTypes(), OReference(), OObject()
m_pSendTimeout = 0; m_pSendTimeout = 0;
m_pSockRef=0; m_pSockRef=0;
VOS_ASSERT(sock.m_pSockRef != 0); OSL_ASSERT(sock.m_pSockRef != 0);
if ( sock.m_pSockRef !=0 ) if ( sock.m_pSockRef !=0 )
{ {
@@ -591,7 +590,7 @@ sal_Bool OSocket::create(TSocketType Type,
(oslSocketType)Type, (oslSocketType)Type,
(oslProtocol)Protocol)); (oslProtocol)Protocol));
VOS_POSTCOND(m_pSockRef != 0, "OSocket(): new failed.\n"); OSL_POSTCOND(m_pSockRef != 0, "OSocket(): new failed.\n");
return (*m_pSockRef)() != 0; return (*m_pSockRef)() != 0;
} }
@@ -601,7 +600,7 @@ sal_Bool OSocket::create(TSocketType Type,
/*****************************************************************************/ /*****************************************************************************/
OSocket& OSocket::operator= (const OSocket& sock) 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) if (m_pSockRef == sock.m_pSockRef)
return *this; return *this;
@@ -629,7 +628,7 @@ OSocket& OSocket::operator= (const OSocket& sock)
/*****************************************************************************/ /*****************************************************************************/
OSocket::operator oslSocket() const OSocket::operator oslSocket() const
{ {
VOS_ASSERT(m_pSockRef); OSL_ASSERT(m_pSockRef);
return (*m_pSockRef)(); return (*m_pSockRef)();
} }
@@ -661,7 +660,7 @@ void OSocket::close()
/*****************************************************************************/ /*****************************************************************************/
void OSocket::getLocalAddr(OSocketAddr& sa) const void OSocket::getLocalAddr(OSocketAddr& sa) const
{ {
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() ) if ( m_pSockRef && (*m_pSockRef)() )
{ {
@@ -674,7 +673,7 @@ void OSocket::getLocalAddr(OSocketAddr& sa) const
/*****************************************************************************/ /*****************************************************************************/
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; sal_Int32 Port= OSL_INVALID_PORT;
@@ -697,7 +696,7 @@ sal_Int32 OSocket::getLocalPort() const
/*****************************************************************************/ /*****************************************************************************/
OSocket::TResult OSocket::getLocalHost( rtl::OUString& pBuffer) 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)() ) if ( m_pSockRef && (*m_pSockRef)() )
{ {
@@ -724,7 +723,7 @@ OSocket::TResult OSocket::getLocalHost( rtl::OUString& pBuffer) const
/*****************************************************************************/ /*****************************************************************************/
void OSocket::getPeerAddr(OSocketAddr& sa) const void OSocket::getPeerAddr(OSocketAddr& sa) const
{ {
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() ) if ( m_pSockRef && (*m_pSockRef)() )
{ {
@@ -737,7 +736,7 @@ void OSocket::getPeerAddr(OSocketAddr& sa) const
/*****************************************************************************/ /*****************************************************************************/
sal_Int32 OSocket::getPeerPort() const sal_Int32 OSocket::getPeerPort() const
{ {
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
sal_Int32 Port= OSL_INVALID_PORT; sal_Int32 Port= OSL_INVALID_PORT;
@@ -760,7 +759,7 @@ sal_Int32 OSocket::getPeerPort() const
/*****************************************************************************/ /*****************************************************************************/
OSocket::TResult OSocket::getPeerHost( rtl::OUString& pBuffer ) 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)() ) if ( m_pSockRef && (*m_pSockRef)() )
{ {
@@ -787,7 +786,7 @@ OSocket::TResult OSocket::getPeerHost( rtl::OUString& pBuffer ) const
/*****************************************************************************/ /*****************************************************************************/
sal_Bool OSocket::bind(const OSocketAddr& Addr) sal_Bool OSocket::bind(const OSocketAddr& Addr)
{ {
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() ) if ( m_pSockRef && (*m_pSockRef)() )
{ {
@@ -829,7 +828,7 @@ void OSocket::setRecvTimeout(const TimeValue* pTimeout)
/*****************************************************************************/ /*****************************************************************************/
sal_Bool OSocket::isRecvReady(const TimeValue* pTimeout) const 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)() ) if ( m_pSockRef && (*m_pSockRef)() )
{ {
@@ -844,7 +843,7 @@ sal_Bool OSocket::isRecvReady(const TimeValue* pTimeout) const
/*****************************************************************************/ /*****************************************************************************/
sal_Bool OSocket::isSendReady(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)() ) if ( m_pSockRef && (*m_pSockRef)() )
{ {
@@ -859,7 +858,7 @@ sal_Bool OSocket::isSendReady(const TimeValue* pTimeout) const
/*****************************************************************************/ /*****************************************************************************/
sal_Bool OSocket::isExceptionPending(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)() ) if ( m_pSockRef && (*m_pSockRef)() )
{ {
@@ -878,7 +877,7 @@ sal_Int32 OSocket::getOption(TSocketOption Option,
sal_uInt32 BufferLen, sal_uInt32 BufferLen,
TSocketOptionLevel Level) const TSocketOptionLevel Level) const
{ {
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() ) if ( m_pSockRef && (*m_pSockRef)() )
{ {
@@ -900,7 +899,7 @@ sal_Bool OSocket::setOption(TSocketOption Option,
sal_uInt32 BufferLen, sal_uInt32 BufferLen,
TSocketOptionLevel Level) const TSocketOptionLevel Level) const
{ {
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() ) if ( m_pSockRef && (*m_pSockRef)() )
{ {
@@ -920,7 +919,7 @@ sal_Bool OSocket::setOption(TSocketOption Option,
/*****************************************************************************/ /*****************************************************************************/
sal_Bool OSocket::enableNonBlockingMode(sal_Bool On) sal_Bool OSocket::enableNonBlockingMode(sal_Bool On)
{ {
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() ) if ( m_pSockRef && (*m_pSockRef)() )
{ {
@@ -935,7 +934,7 @@ sal_Bool OSocket::enableNonBlockingMode(sal_Bool On)
/*****************************************************************************/ /*****************************************************************************/
sal_Bool OSocket::isNonBlockingMode() const sal_Bool OSocket::isNonBlockingMode() const
{ {
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() ) if ( m_pSockRef && (*m_pSockRef)() )
{ {
@@ -950,7 +949,7 @@ sal_Bool OSocket::isNonBlockingMode() const
/*****************************************************************************/ /*****************************************************************************/
OSocket::TSocketType OSocket::getType() const OSocket::TSocketType OSocket::getType() const
{ {
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() ) if ( m_pSockRef && (*m_pSockRef)() )
{ {
@@ -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(sal_Char* pBuffer, sal_uInt32 nSize) const
void OSocket::getError( rtl::OUString& pBuffer ) 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)()) if (m_pSockRef && (*m_pSockRef)())
osl_getLastSocketErrorDescription((*m_pSockRef)(), &pBuffer.pData ); osl_getLastSocketErrorDescription((*m_pSockRef)(), &pBuffer.pData );
@@ -1158,7 +1157,7 @@ void OSocket::getError( rtl::OUString& pBuffer ) const
/*****************************************************************************/ /*****************************************************************************/
OSocket::TSocketError OSocket::getError() const OSocket::TSocketError OSocket::getError() const
{ {
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if (m_pSockRef && (*m_pSockRef)()) if (m_pSockRef && (*m_pSockRef)())
return (TSocketError)osl_getLastSocketError((*m_pSockRef)()); return (TSocketError)osl_getLastSocketError((*m_pSockRef)());
@@ -1224,7 +1223,7 @@ void OAcceptorSocket::close()
/*****************************************************************************/ /*****************************************************************************/
sal_Bool OAcceptorSocket::listen(sal_Int32 MaxPendingConnections) sal_Bool OAcceptorSocket::listen(sal_Int32 MaxPendingConnections)
{ {
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() ) if ( m_pSockRef && (*m_pSockRef)() )
{ {
@@ -1243,7 +1242,7 @@ OSocket::TResult OAcceptorSocket::acceptConnection(OStreamSocket& connection)
if (m_pRecvTimeout && ! isRecvReady(m_pRecvTimeout)) if (m_pRecvTimeout && ! isRecvReady(m_pRecvTimeout))
return TResult_TimedOut; return TResult_TimedOut;
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
OStreamSocket aSocket; OStreamSocket aSocket;
if ( m_pSockRef && (*m_pSockRef)() ) if ( m_pSockRef && (*m_pSockRef)() )
@@ -1275,7 +1274,7 @@ OSocket::TResult OAcceptorSocket::acceptConnection(OStreamSocket& connection,
if (m_pRecvTimeout && ! isRecvReady(m_pRecvTimeout)) if (m_pRecvTimeout && ! isRecvReady(m_pRecvTimeout))
return TResult_TimedOut; return TResult_TimedOut;
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() ) if ( m_pSockRef && (*m_pSockRef)() )
{ {
@@ -1408,7 +1407,7 @@ sal_Int32 OStreamSocket::read(void* pBuffer, sal_uInt32 n) const
if (m_pRecvTimeout && ! isRecvReady(m_pRecvTimeout)) if (m_pRecvTimeout && ! isRecvReady(m_pRecvTimeout))
return 0; return 0;
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( ! ( m_pSockRef && (*m_pSockRef)() ) ) if ( ! ( m_pSockRef && (*m_pSockRef)() ) )
{ {
@@ -1455,7 +1454,7 @@ sal_Int32 OStreamSocket::write(const void* pBuffer, sal_uInt32 n)
if (m_pSendTimeout && ! isSendReady(m_pSendTimeout)) if (m_pSendTimeout && ! isSendReady(m_pSendTimeout))
return 0; return 0;
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( ! ( m_pSockRef && (*m_pSockRef)() ) ) if ( ! ( m_pSockRef && (*m_pSockRef)() ) )
{ {
@@ -1508,7 +1507,7 @@ sal_Int32 OStreamSocket::recv(void* pBuffer,
if (m_pRecvTimeout && ! isRecvReady(m_pRecvTimeout)) if (m_pRecvTimeout && ! isRecvReady(m_pRecvTimeout))
return 0; return 0;
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( ! ( m_pSockRef && (*m_pSockRef)() ) ) if ( ! ( m_pSockRef && (*m_pSockRef)() ) )
{ {
@@ -1531,7 +1530,7 @@ sal_Int32 OStreamSocket::send(const void* pBuffer,
if (m_pSendTimeout && ! isSendReady(m_pSendTimeout)) if (m_pSendTimeout && ! isSendReady(m_pSendTimeout))
return 0; return 0;
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( ! ( m_pSockRef && (*m_pSockRef)() ) ) if ( ! ( m_pSockRef && (*m_pSockRef)() ) )
{ {
@@ -1549,7 +1548,7 @@ sal_Int32 OStreamSocket::send(const void* pBuffer,
/*****************************************************************************/ /*****************************************************************************/
sal_Bool OStreamSocket::shutdown(TSocketDirection Direction) sal_Bool OStreamSocket::shutdown(TSocketDirection Direction)
{ {
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() ) if ( m_pSockRef && (*m_pSockRef)() )
{ {
@@ -1599,7 +1598,7 @@ OSocket::TResult OConnectorSocket::connect(const OSocketAddr& Addr,
const TimeValue* pTimeout) const TimeValue* pTimeout)
{ {
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( m_pSockRef && (*m_pSockRef)() ) if ( m_pSockRef && (*m_pSockRef)() )
{ {
@@ -1655,7 +1654,7 @@ sal_Int32 ODatagramSocket::recvFrom(void* pBuffer,
if (m_pRecvTimeout && ! isRecvReady(m_pRecvTimeout)) if (m_pRecvTimeout && ! isRecvReady(m_pRecvTimeout))
return 0; return 0;
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( ! ( m_pSockRef && (*m_pSockRef)() ) ) if ( ! ( m_pSockRef && (*m_pSockRef)() ) )
{ {
@@ -1705,7 +1704,7 @@ sal_Int32 ODatagramSocket::sendTo(const OSocketAddr& ReceiverAddr,
if (m_pSendTimeout && ! isSendReady(m_pSendTimeout)) if (m_pSendTimeout && ! isSendReady(m_pSendTimeout))
return 0; return 0;
VOS_ASSERT(m_pSockRef && (*m_pSockRef)()); OSL_ASSERT(m_pSockRef && (*m_pSockRef)());
if ( ( m_pSockRef && (*m_pSockRef)() ) ) if ( ( m_pSockRef && (*m_pSockRef)() ) )
{ {

View File

@@ -26,9 +26,9 @@
************************************************************************/ ************************************************************************/
#include <osl/time.h> #include <osl/time.h>
#include <vos/diagnose.hxx>
#include <vos/object.hxx> #include <vos/object.hxx>
#include <vos/thread.hxx> #include <vos/thread.hxx>
#include <osl/diagnose.h>
using namespace vos; using namespace vos;
@@ -76,7 +76,7 @@ OThread::~OThread()
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( m_hThread = osl_createSuspendedThread(
threadWorkerFunction_impl, (void*)this); threadWorkerFunction_impl, (void*)this);
@@ -88,7 +88,7 @@ sal_Bool OThread::create()
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); m_hThread= osl_createSuspendedThread(threadWorkerFunction_impl, (void*)this);
return m_hThread != 0; return m_hThread != 0;
@@ -96,14 +96,14 @@ sal_Bool OThread::createSuspended()
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); 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); osl_resumeThread(m_hThread);
} }
@@ -126,7 +126,7 @@ OThread::TThreadIdentifier OThread::getCurrentIdentifier()
void OThread::join() void OThread::join()
{ {
if (m_hThread) { if (m_hThread) {
VOS_ASSERT(getCurrentIdentifier() != getIdentifier()); OSL_ASSERT(getCurrentIdentifier() != getIdentifier());
osl_joinWithThread(m_hThread); osl_joinWithThread(m_hThread);
} }
} }
@@ -216,7 +216,7 @@ VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OThreadData, vos),
OThreadData::OThreadData( oslThreadKeyCallbackFunction pCallback ) OThreadData::OThreadData( oslThreadKeyCallbackFunction pCallback )
{ {
m_hKey = osl_createThreadKey( pCallback ); m_hKey = osl_createThreadKey( pCallback );
VOS_VERIFY(m_hKey); OSL_VERIFY(m_hKey);
} }
OThreadData::~OThreadData() OThreadData::~OThreadData()
@@ -226,14 +226,14 @@ OThreadData::~OThreadData()
sal_Bool OThreadData::setData(void *pData) sal_Bool OThreadData::setData(void *pData)
{ {
VOS_ASSERT(m_hKey != 0); OSL_ASSERT(m_hKey != 0);
return (osl_setThreadKeyData(m_hKey, pData)); return (osl_setThreadKeyData(m_hKey, pData));
} }
void *OThreadData::getData() void *OThreadData::getData()
{ {
VOS_ASSERT(m_hKey != 0); OSL_ASSERT(m_hKey != 0);
return (osl_getThreadKeyData(m_hKey)); return (osl_getThreadKeyData(m_hKey));
} }

View File

@@ -28,7 +28,7 @@
#include <osl/time.h> #include <osl/time.h>
#include <vos/timer.hxx> #include <vos/timer.hxx>
#include <vos/diagnose.hxx> #include <osl/diagnose.h>
#include <vos/ref.hxx> #include <vos/ref.hxx>
#include <vos/thread.hxx> #include <vos/thread.hxx>
#include <vos/conditn.hxx> #include <vos/conditn.hxx>
@@ -147,7 +147,7 @@ void OTimer::start()
OTimerManager *pManager = OTimerManager::getTimerManager(); OTimerManager *pManager = OTimerManager::getTimerManager();
VOS_ASSERT(pManager); OSL_ASSERT(pManager);
if ( pManager != 0 ) if ( pManager != 0 )
{ {
@@ -160,7 +160,7 @@ void OTimer::stop()
{ {
OTimerManager *pManager = OTimerManager::getTimerManager(); OTimerManager *pManager = OTimerManager::getTimerManager();
VOS_ASSERT(pManager); OSL_ASSERT(pManager);
if ( pManager != 0 ) if ( pManager != 0 )
{ {
@@ -172,7 +172,7 @@ sal_Bool OTimer::isTicking() const
{ {
OTimerManager *pManager = OTimerManager::getTimerManager(); OTimerManager *pManager = OTimerManager::getTimerManager();
VOS_ASSERT(pManager); OSL_ASSERT(pManager);
if (pManager) if (pManager)
return pManager->lookupTimer(this); return pManager->lookupTimer(this);
@@ -192,7 +192,7 @@ sal_Bool OTimer::isExpired() const
sal_Bool OTimer::expiresBefore(const OTimer* pTimer) const sal_Bool OTimer::expiresBefore(const OTimer* pTimer) const
{ {
VOS_ASSERT(pTimer); OSL_ASSERT(pTimer);
if ( pTimer != 0 ) if ( pTimer != 0 )
{ {
@@ -274,7 +274,7 @@ OTimerManager::OTimerManager()
{ {
OGuard Guard(&m_Access); OGuard Guard(&m_Access);
VOS_ASSERT(m_pManager == 0); OSL_ASSERT(m_pManager == 0);
m_pManager = this; m_pManager = this;
@@ -311,7 +311,7 @@ OTimerManager* OTimerManager::getTimerManager()
sal_Bool OTimerManager::registerTimer(OTimer* pTimer) sal_Bool OTimerManager::registerTimer(OTimer* pTimer)
{ {
VOS_ASSERT(pTimer); OSL_ASSERT(pTimer);
if ( pTimer == 0 ) if ( pTimer == 0 )
{ {
@@ -352,7 +352,7 @@ sal_Bool OTimerManager::registerTimer(OTimer* pTimer)
sal_Bool OTimerManager::unregisterTimer(OTimer* pTimer) sal_Bool OTimerManager::unregisterTimer(OTimer* pTimer)
{ {
VOS_ASSERT(pTimer); OSL_ASSERT(pTimer);
if ( pTimer == 0 ) if ( pTimer == 0 )
{ {
@@ -380,7 +380,7 @@ sal_Bool OTimerManager::unregisterTimer(OTimer* pTimer)
sal_Bool OTimerManager::lookupTimer(const OTimer* pTimer) sal_Bool OTimerManager::lookupTimer(const OTimer* pTimer)
{ {
VOS_ASSERT(pTimer); OSL_ASSERT(pTimer);
if ( pTimer == 0 ) if ( pTimer == 0 )
{ {