Kaydet (Commit) 2cbd4121 authored tarafından Chris Sherlock's avatar Chris Sherlock

cppu: remove unnecessary LOG_LIFECYCLE_* macros

Change-Id: I0f19cf7045e6ff2906404a73ce710e42800c0a72
Reviewed-on: https://gerrit.libreoffice.org/39994Reviewed-by: 's avatarChris Sherlock <chris.sherlock79@gmail.com>
Tested-by: 's avatarChris Sherlock <chris.sherlock79@gmail.com>
üst fab72885
...@@ -28,19 +28,6 @@ ...@@ -28,19 +28,6 @@
#include "cppu/helper/purpenv/Mapping.hxx" #include "cppu/helper/purpenv/Mapping.hxx"
#ifdef debug
# define LOG_LIFECYCLE_AffineBridge
#endif
#ifdef LOG_LIFECYCLE_AffineBridge
# include <iostream>
# define LOG_LIFECYCLE_AffineBridge_emit(x) x
#else
# define LOG_LIFECYCLE_AffineBridge_emit(x)
#endif
class InnerThread; class InnerThread;
class OuterThread; class OuterThread;
...@@ -147,12 +134,12 @@ AffineBridge::AffineBridge() ...@@ -147,12 +134,12 @@ AffineBridge::AffineBridge()
m_outerThreadId(0), m_outerThreadId(0),
m_pOuterThread (nullptr) m_pOuterThread (nullptr)
{ {
LOG_LIFECYCLE_AffineBridge_emit(fprintf(stderr, "LIFE: %s -> %p\n", "AffineBridge::AffineBridge(uno_Environment * pEnv)", this)); SAL_INFO("cppu.affinebridge", "LIFE: AffineBridge::AffineBridge(uno_Environment * pEnv) -> " << this);
} }
AffineBridge::~AffineBridge() AffineBridge::~AffineBridge()
{ {
LOG_LIFECYCLE_AffineBridge_emit(fprintf(stderr, "LIFE: %s -> %p\n", "AffineBridge::~AffineBridge()", this)); SAL_INFO("cppu.affinebridge", "LIFE: AffineBridge::~AffineBridge() -> " << this);
if (m_pInnerThread && osl::Thread::getCurrentIdentifier() != m_innerThreadId) if (m_pInnerThread && osl::Thread::getCurrentIdentifier() != m_innerThreadId)
{ {
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include "osl/mutex.hxx" #include "osl/mutex.hxx"
#include "osl/thread.h" #include "osl/thread.h"
#include "osl/thread.hxx" #include "osl/thread.hxx"
...@@ -27,21 +26,6 @@ ...@@ -27,21 +26,6 @@
#include "cppu/helper/purpenv/Environment.hxx" #include "cppu/helper/purpenv/Environment.hxx"
#include "cppu/helper/purpenv/Mapping.hxx" #include "cppu/helper/purpenv/Mapping.hxx"
#ifdef debug
# define LOG_LIFECYCLE_UnsafeBridge
#endif
#ifdef LOG_LIFECYCLE_UnsafeBridge
# include <iostream>
# define LOG_LIFECYCLE_UnsafeBridge_emit(x) x
#else
# define LOG_LIFECYCLE_UnsafeBridge_emit(x)
#endif
class UnsafeBridge : public cppu::Enterable class UnsafeBridge : public cppu::Enterable
{ {
osl::Mutex m_mutex; osl::Mutex m_mutex;
...@@ -66,12 +50,12 @@ UnsafeBridge::UnsafeBridge() ...@@ -66,12 +50,12 @@ UnsafeBridge::UnsafeBridge()
: m_count (0), : m_count (0),
m_threadId(0) m_threadId(0)
{ {
LOG_LIFECYCLE_UnsafeBridge_emit(fprintf(stderr, "LIFE: %s -> %p\n", "UnsafeBridge::UnsafeBridge(uno_Environment * pEnv)", this)); SAL_INFO("cppu.unsafebridge", "LIFE: UnsafeBridge::UnsafeBridge(uno_Environment * pEnv) -> " << this);
} }
UnsafeBridge::~UnsafeBridge() UnsafeBridge::~UnsafeBridge()
{ {
LOG_LIFECYCLE_UnsafeBridge_emit(fprintf(stderr, "LIFE: %s -> %p\n", "UnsafeBridge::~UnsafeBridge()", this)); SAL_INFO("cppu.unsafebridge", "LIFE: UnsafeBridge::~UnsafeBridge() -> " << this);
SAL_WARN_IF(m_count < 0, "cppu.unsafebridge", "m_count is less than 0"); SAL_WARN_IF(m_count < 0, "cppu.unsafebridge", "m_count is less than 0");
} }
......
...@@ -27,20 +27,6 @@ ...@@ -27,20 +27,6 @@
#include "typelib/typedescription.h" #include "typelib/typedescription.h"
#include "osl/interlck.h" #include "osl/interlck.h"
#ifdef debug
# define LOG_LIFECYCLE_cppu_helper_purpenv_Base
#endif
#ifdef LOG_LIFECYCLE_cppu_helper_purpenv_Base
# include <iostream>
# define LOG_LIFECYCLE_cppu_helper_purpenv_Base_emit(x) x
#else
# define LOG_LIFECYCLE_cppu_helper_purpenv_Base_emit(x)
#endif
extern "C" { extern "C" {
typedef void SAL_CALL EnvFun_P (uno_Environment *); typedef void SAL_CALL EnvFun_P (uno_Environment *);
typedef void SAL_CALL EnvFun_PP_P(uno_Environment ** ppHardEnv, uno_Environment *); typedef void SAL_CALL EnvFun_PP_P(uno_Environment ** ppHardEnv, uno_Environment *);
...@@ -241,7 +227,7 @@ Base::Base(uno_Environment * pEnv, cppu::Enterable * pEnterable) ...@@ -241,7 +227,7 @@ Base::Base(uno_Environment * pEnv, cppu::Enterable * pEnterable)
m_env_acquireInterface (pEnv->pExtEnv->acquireInterface), m_env_acquireInterface (pEnv->pExtEnv->acquireInterface),
m_env_releaseInterface (pEnv->pExtEnv->releaseInterface) m_env_releaseInterface (pEnv->pExtEnv->releaseInterface)
{ {
LOG_LIFECYCLE_cppu_helper_purpenv_Base_emit(fprintf(stderr, "LIFE: %s -> %p\n", "cppu::helper::purpenv::Base::Base(uno_Environment * pEnv)", this)); SAL_INFO("cppu.purpenv", "LIFE: cppu::helper::purpenv::Base::Base(uno_Environment * pEnv) -> " << this);
OSL_ENSURE( OSL_ENSURE(
rtl_ustr_ascii_compare_WithLength(pEnv->pTypeName->buffer, rtl_str_getLength(UNO_LB_UNO), UNO_LB_UNO) rtl_ustr_ascii_compare_WithLength(pEnv->pTypeName->buffer, rtl_str_getLength(UNO_LB_UNO), UNO_LB_UNO)
== 0, == 0,
...@@ -267,7 +253,7 @@ Base::Base(uno_Environment * pEnv, cppu::Enterable * pEnterable) ...@@ -267,7 +253,7 @@ Base::Base(uno_Environment * pEnv, cppu::Enterable * pEnterable)
Base::~Base() Base::~Base()
{ {
LOG_LIFECYCLE_cppu_helper_purpenv_Base_emit(fprintf(stderr, "LIFE: %s -> %p\n", "cppu::helper::purpenv::Base::~Base()", this)); SAL_INFO("cppu.purpenv", "LIFE: cppu::helper::purpenv::Base::~Base() -> " << this);
m_pEnv->acquire = m_env_acquire; m_pEnv->acquire = m_env_acquire;
m_pEnv->release = m_env_release; m_pEnv->release = m_env_release;
......
...@@ -27,24 +27,8 @@ ...@@ -27,24 +27,8 @@
#include "uno/dispatcher.h" #include "uno/dispatcher.h"
#include "typelib/typedescription.h" #include "typelib/typedescription.h"
#ifdef debug
# define LOG_LIFECYCLE_cppu_helper_purpenv_Mapping
#endif
#ifdef LOG_LIFECYCLE_cppu_helper_purpenv_Mapping
# include <iostream>
# define LOG_LIFECYCLE_cppu_helper_purpenv_Mapping_emit(x) x
#else
# define LOG_LIFECYCLE_cppu_helper_purpenv_Mapping_emit(x)
#endif
using namespace com::sun::star; using namespace com::sun::star;
class Mapping : public uno_Mapping class Mapping : public uno_Mapping
{ {
uno::Environment m_from; uno::Environment m_from;
...@@ -128,7 +112,7 @@ Mapping::Mapping(uno_Environment * pFrom, ...@@ -128,7 +112,7 @@ Mapping::Mapping(uno_Environment * pFrom,
m_probeFun(probeFun), m_probeFun(probeFun),
m_pContext(pProbeContext) m_pContext(pProbeContext)
{ {
LOG_LIFECYCLE_cppu_helper_purpenv_Mapping_emit(fprintf(stderr, "LIFE: %s -> %p\n", "Mapping::Mapping(uno_Environment * pFrom, uno_Environment * pTo)", this)); SAL_INFO("cppu.purpenv", "LIFE: Mapping::Mapping(uno_Environment * pFrom, uno_Environment * pTo -> " << this);
uno_Mapping::acquire = s_acquire; uno_Mapping::acquire = s_acquire;
uno_Mapping::release = s_release; uno_Mapping::release = s_release;
...@@ -137,7 +121,7 @@ Mapping::Mapping(uno_Environment * pFrom, ...@@ -137,7 +121,7 @@ Mapping::Mapping(uno_Environment * pFrom,
Mapping::~Mapping() Mapping::~Mapping()
{ {
LOG_LIFECYCLE_cppu_helper_purpenv_Mapping_emit(fprintf(stderr, "LIFE: %s -> %p\n", "Mapping::~Mapping()", this)); SAL_INFO("cppu.purpenv", "LIFE: Mapping:~Mapping() -> " << this);
} }
......
...@@ -25,21 +25,8 @@ ...@@ -25,21 +25,8 @@
#include "typelib/typedescription.hxx" #include "typelib/typedescription.hxx"
#include "cppu/EnvDcp.hxx" #include "cppu/EnvDcp.hxx"
//#define LOG_LIFECYCLE_Proxy
#ifdef LOG_LIFECYCLE_Proxy
# include <iostream>
# define LOG_LIFECYCLE_Proxy_emit(x) x
#else
# define LOG_LIFECYCLE_Proxy_emit(x)
#endif
using namespace com::sun::star; using namespace com::sun::star;
static bool relatesToInterface(typelib_TypeDescription * pTypeDescr) static bool relatesToInterface(typelib_TypeDescription * pTypeDescr)
{ {
switch (pTypeDescr->eTypeClass) switch (pTypeDescr->eTypeClass)
...@@ -222,7 +209,7 @@ Proxy::Proxy(uno::Mapping const & to_from, ...@@ -222,7 +209,7 @@ Proxy::Proxy(uno::Mapping const & to_from,
m_probeFun (probeFun), m_probeFun (probeFun),
m_pProbeContext(pProbeContext) m_pProbeContext(pProbeContext)
{ {
LOG_LIFECYCLE_Proxy_emit(fprintf(stderr, "LIFE: %s -> %p\n", "Proxy::Proxy(<>)", this)); SAL_INFO("cppu.purpenv", "LIFE: Proxy::Proxy(<>) -> " << this);
typelib_typedescription_acquire(&m_pTypeDescr->aBase); typelib_typedescription_acquire(&m_pTypeDescr->aBase);
if (!m_pTypeDescr->aBase.bComplete) if (!m_pTypeDescr->aBase.bComplete)
...@@ -249,7 +236,7 @@ extern "C" { static void s_releaseAndRevoke_v(va_list * pParam) ...@@ -249,7 +236,7 @@ extern "C" { static void s_releaseAndRevoke_v(va_list * pParam)
Proxy::~Proxy() Proxy::~Proxy()
{ {
LOG_LIFECYCLE_Proxy_emit(fprintf(stderr, "LIFE: %s -> %p\n", "Proxy::~Proxy()", this)); SAL_INFO("cppu.purpenv", "LIFE: Proxy::~Proxy() -> " << this);
uno_Environment_invoke(m_to.get(), s_releaseAndRevoke_v, m_to.get(), m_pUnoI); uno_Environment_invoke(m_to.get(), s_releaseAndRevoke_v, m_to.get(), m_pUnoI);
......
...@@ -28,16 +28,6 @@ ...@@ -28,16 +28,6 @@
#include "cascade_mapping.hxx" #include "cascade_mapping.hxx"
#ifdef LOG_LIFECYLE_MediatorMapping
# include <iostream>
# define LOG_LIFECYLE_MediatorMapping_emit(x) x
#else
# define LOG_LIFECYLE_MediatorMapping_emit(x)
#endif
using namespace com::sun::star; using namespace com::sun::star;
class MediatorMapping : public uno_Mapping class MediatorMapping : public uno_Mapping
...@@ -98,7 +88,7 @@ MediatorMapping::MediatorMapping(uno_Environment * pFrom, ...@@ -98,7 +88,7 @@ MediatorMapping::MediatorMapping(uno_Environment * pFrom,
m_interm (pInterm), m_interm (pInterm),
m_to (pTo) m_to (pTo)
{ {
LOG_LIFECYLE_MediatorMapping_emit(std::cerr << __FUNCTION__ << std::endl); SAL_INFO("cppu.mapping", __FUNCTION__);
if (!m_from2uno.get() || !m_uno2to.get()) if (!m_from2uno.get() || !m_uno2to.get())
abort(); abort();
...@@ -110,19 +100,19 @@ MediatorMapping::MediatorMapping(uno_Environment * pFrom, ...@@ -110,19 +100,19 @@ MediatorMapping::MediatorMapping(uno_Environment * pFrom,
MediatorMapping::~MediatorMapping() MediatorMapping::~MediatorMapping()
{ {
LOG_LIFECYLE_MediatorMapping_emit(std::cerr << __FUNCTION__ << std::endl); SAL_INFO("cppu.mapping", __FUNCTION__);
} }
void MediatorMapping::acquire() void MediatorMapping::acquire()
{ {
LOG_LIFECYLE_MediatorMapping_emit(std::cerr << __FUNCTION__ << std::endl); SAL_INFO("cppu.mapping", __FUNCTION__);
osl_atomic_increment(&m_refCount); osl_atomic_increment(&m_refCount);
} }
void MediatorMapping::release() void MediatorMapping::release()
{ {
LOG_LIFECYLE_MediatorMapping_emit(std::cerr << __FUNCTION__ << std::endl); SAL_INFO("cppu.mapping", __FUNCTION__);
if (osl_atomic_decrement(&m_refCount) == 0) if (osl_atomic_decrement(&m_refCount) == 0)
{ {
......
...@@ -101,7 +101,10 @@ certain functionality. ...@@ -101,7 +101,10 @@ certain functionality.
@li @c cppu.log @li @c cppu.log
@li @c cppu.threadpool @li @c cppu.threadpool
@li @c cppu.typelib @li @c cppu.typelib
@li @c cppu.purpenv
@li @c cppu.mapping
@li @c cppu.unsafebridge @li @c cppu.unsafebridge
@li @c cppu.affinebridge
@section cppuhelper @section cppuhelper
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment