From d4cb389a5de5cc43d12c3a5e49a6c1114f671439 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 30 Oct 2002 18:29:40 +0000 Subject: [PATCH] upgraded compiler specific macros --- src/ca/autoPtrFreeList.h | 4 +- src/ca/bhe.cpp | 4 +- src/ca/bhe.h | 10 +- src/ca/ca_client_context.cpp | 30 +--- src/ca/cac.cpp | 22 +-- src/ca/cac.h | 4 +- src/ca/comBuf.cpp | 18 +-- src/ca/comBuf.h | 167 +++++++++++----------- src/ca/comQueRecv.cpp | 20 +-- src/ca/comQueRecv.h | 60 ++++---- src/ca/comQueSend.cpp | 41 +++--- src/ca/comQueSend.h | 80 +++++------ src/ca/msgForMultiplyDefinedPV.h | 5 +- src/ca/nciu.h | 4 +- src/ca/netIO.h | 18 +-- src/ca/oldAccess.h | 30 ++-- src/ca/repeaterClient.h | 6 +- src/ca/syncGroup.h | 16 +-- src/ca/syncgrp.cpp | 4 - src/ca/tcpiiu.cpp | 26 +--- src/ca/virtualCircuit.h | 4 +- src/cas/io/bsdSocket/casIOD.h | 6 +- src/db/dbCAC.h | 4 +- src/db/dbChannelIO.cpp | 2 +- src/db/dbChannelIO.h | 4 +- src/db/dbPutNotifyBlocker.cpp | 4 +- src/db/dbPutNotifyBlocker.h | 6 +- src/libCom/misc/cxxCompilerDependencies.h | 2 +- 28 files changed, 252 insertions(+), 349 deletions(-) diff --git a/src/ca/autoPtrFreeList.h b/src/ca/autoPtrFreeList.h index 374ba8d58..9a392d705 100644 --- a/src/ca/autoPtrFreeList.h +++ b/src/ca/autoPtrFreeList.h @@ -62,7 +62,9 @@ inline autoPtrFreeList::~autoPtrFreeList () { if ( this->p ) { this->p->~T(); -# if defined ( CXX_PLACEMENT_DELETE ) && 0 + // its probably a good idea to require that the class has placement delete + // by calling it during cleanup if the compiler supports it +# if defined ( CXX_PLACEMENT_DELETE ) T::operator delete ( this->p, this->freeList ); # else this->freeList.release ( this->p ); diff --git a/src/ca/bhe.cpp b/src/ca/bhe.cpp index eb55d7bd7..a87c89d0b 100644 --- a/src/ca/bhe.cpp +++ b/src/ca/bhe.cpp @@ -45,7 +45,7 @@ * between the 1st and 2nd beacons) */ bhe::bhe ( const epicsTime & initialTimeStamp, - unsigned initialBeaconNumber, const inetAddrID & addr ) epics_throws (()) : + unsigned initialBeaconNumber, const inetAddrID & addr ) epicsThrows (()) : inetAddrID ( addr ), timeStamp ( initialTimeStamp ), averagePeriod ( - DBL_MAX ), lastBeaconNumber ( initialBeaconNumber ) { @@ -224,7 +224,7 @@ void bhe::show ( unsigned /* level */ ) const static_cast ( this ), this->averagePeriod ); } -double bhe::period () const epics_throws (()) +double bhe::period () const epicsThrows (()) { return this->averagePeriod; } diff --git a/src/ca/bhe.h b/src/ca/bhe.h index 77f7ff410..ea5e0a13d 100644 --- a/src/ca/bhe.h +++ b/src/ca/bhe.h @@ -56,22 +56,20 @@ public: class bhe : public tsSLNode < bhe >, public inetAddrID { public: epicsShareFunc bhe ( const epicsTime & initialTimeStamp, - unsigned initialBeaconNumber, const inetAddrID & addr ) epics_throws (()); + unsigned initialBeaconNumber, const inetAddrID & addr ) epicsThrows (()); epicsShareFunc ~bhe (); epicsShareFunc bool updatePeriod ( const epicsTime & programBeginTime, const epicsTime & currentTime, ca_uint32_t beaconNumber, unsigned protocolRevision ); - epicsShareFunc double period () const epics_throws (()); + epicsShareFunc double period () const epicsThrows (()); epicsShareFunc epicsTime updateTime () const; epicsShareFunc void show ( unsigned level) const; epicsShareFunc void registerIIU ( tcpiiu & ); epicsShareFunc void unregisterIIU ( tcpiiu & ); - epicsShareFunc void * operator new ( size_t size, - bheMemoryManager & ); + epicsShareFunc void * operator new ( size_t size, bheMemoryManager & ); #ifdef CXX_PLACEMENT_DELETE - epicsShareFunc void operator delete ( void *, - bheMemoryManager & ); + epicsShareFunc void operator delete ( void *, bheMemoryManager & ) epicsThrows (()); #endif private: tsDLList < tcpiiu > iiuList; diff --git a/src/ca/ca_client_context.cpp b/src/ca/ca_client_context.cpp index a54d2879c..f806ce36f 100644 --- a/src/ca/ca_client_context.cpp +++ b/src/ca/ca_client_context.cpp @@ -49,51 +49,31 @@ ca_client_context::~ca_client_context () void ca_client_context::destroyChannel ( oldChannelNotify & chan ) { chan.~oldChannelNotify (); -# if defined ( CXX_PLACEMENT_DELETE ) && 0 - oldChannelNotify::operator delete ( & chan, this->oldChannelNotifyFreeList ); -# else - this->oldChannelNotifyFreeList.release ( & chan ); -# endif + this->oldChannelNotifyFreeList.release ( & chan ); } void ca_client_context::destroyGetCopy ( getCopy & gc ) { gc.~getCopy (); -# if defined ( CXX_PLACEMENT_DELETE ) && 0 - getCopy::operator delete ( & gc, this->getCopyFreeList ); -# else - this->getCopyFreeList.release ( & gc ); -# endif + this->getCopyFreeList.release ( & gc ); } void ca_client_context::destroyGetCallback ( getCallback & gcb ) { gcb.~getCallback (); -# if defined ( CXX_PLACEMENT_DELETE ) && 0 - getCallback::operator delete ( & gcb, this->getCallbackFreeList ); -# else - this->getCallbackFreeList.release ( & gcb ); -# endif + this->getCallbackFreeList.release ( & gcb ); } void ca_client_context::destroyPutCallback ( putCallback & pcb ) { pcb.~putCallback (); -# if defined ( CXX_PLACEMENT_DELETE ) && 0 - putCallback::operator delete ( & pcb, this->putCallbackFreeList ); -# else - this->putCallbackFreeList.release ( & pcb ); -# endif + this->putCallbackFreeList.release ( & pcb ); } void ca_client_context::destroySubscription ( oldSubscription & os ) { os.~oldSubscription (); -# if defined ( CXX_PLACEMENT_DELETE ) && 0 - oldSubscription::operator delete ( & os, this->subscriptionFreeList ); -# else - this->subscriptionFreeList.release ( & os ); -# endif + this->subscriptionFreeList.release ( & os ); } void ca_client_context::changeExceptionEvent ( caExceptionHandler *pfunc, void *arg ) diff --git a/src/ca/cac.cpp b/src/ca/cac.cpp index 0776e36bf..87b12ea45 100644 --- a/src/ca/cac.cpp +++ b/src/ca/cac.cpp @@ -277,11 +277,7 @@ cac::~cac () this->beaconTable.removeAll ( tmpBeaconList ); while ( bhe * pBHE = tmpBeaconList.get() ) { pBHE->~bhe (); -# if defined ( CXX_PLACEMENT_DELETE ) && 0 - bhe::operator delete ( pBHE, this->bheFreeList ); -# else - this->bheFreeList.release ( pBHE ); -# endif + this->bheFreeList.release ( pBHE ); } osiSockRelease (); @@ -416,11 +412,7 @@ void cac::beaconNotify ( const inetAddrID & addr, const epicsTime & currentTime, if ( pBHE ) { if ( this->beaconTable.add ( *pBHE ) < 0 ) { pBHE->~bhe (); -# if defined ( CXX_PLACEMENT_DELETE ) && 0 - bhe::operator delete ( pBHE, this->bheFreeList ); -# else - this->bheFreeList.release ( pBHE ); -# endif + this->bheFreeList.release ( pBHE ); } } return; @@ -714,11 +706,7 @@ void cac::destroyChannel ( nciu & chan ) // run channel's destructor and return it to the free list chan.~nciu (); -# if defined ( CXX_PLACEMENT_DELETE ) && 0 - nciu::operator delete ( & chan, this->channelFreeList ); -# else - this->channelFreeList.release ( & chan ); -# endif + this->channelFreeList.release ( & chan ); } int cac::printf ( const char *pformat, ... ) const @@ -1586,12 +1574,12 @@ void cac::initiateConnect ( nciu & chan ) this->pudpiiu->installChannel ( chan ); } -void *cacComBufMemoryManager::allocate ( size_t size ) epics_throws (( std::bad_alloc )) +void *cacComBufMemoryManager::allocate ( size_t size ) epicsThrows (( std::bad_alloc )) { return this->freeList.allocate ( size ); } -void cacComBufMemoryManager::release ( void * pCadaver ) epics_throws (()) +void cacComBufMemoryManager::release ( void * pCadaver ) epicsThrows (()) { return this->freeList.release ( pCadaver ); } diff --git a/src/ca/cac.h b/src/ca/cac.h index e64145508..b5dd95df9 100644 --- a/src/ca/cac.h +++ b/src/ca/cac.h @@ -100,8 +100,8 @@ private: class cacComBufMemoryManager : public comBufMemoryManager { public: - void * allocate ( size_t ) epics_throws (( std::bad_alloc )); - void release ( void * ) epics_throws (()); + void * allocate ( size_t ) epicsThrows (( std::bad_alloc )); + void release ( void * ) epicsThrows (()); private: tsFreeList < class comBuf, 0x20 > freeList; }; diff --git a/src/ca/comBuf.cpp b/src/ca/comBuf.cpp index 6170fba7c..d3b33616f 100644 --- a/src/ca/comBuf.cpp +++ b/src/ca/comBuf.cpp @@ -29,7 +29,7 @@ #include "comBuf.h" #include "errlog.h" -bool comBuf::flushToWire ( wireSendAdapter & wire ) epics_throws (()) +bool comBuf::flushToWire ( wireSendAdapter & wire ) epicsThrows (()) { unsigned occupied = this->occupiedBytes (); while ( occupied ) { @@ -44,7 +44,7 @@ bool comBuf::flushToWire ( wireSendAdapter & wire ) epics_throws (()) return true; } -unsigned comBuf::push ( const epicsInt16 * pValue, unsigned nElem ) epics_throws (()) +unsigned comBuf::push ( const epicsInt16 * pValue, unsigned nElem ) epicsThrows (()) { nElem = this->unoccupiedElem ( sizeof (*pValue), nElem ); for ( unsigned i = 0u; i < nElem; i++ ) { @@ -56,7 +56,7 @@ unsigned comBuf::push ( const epicsInt16 * pValue, unsigned nElem ) epics_throws return nElem; } -unsigned comBuf::push ( const epicsUInt16 * pValue, unsigned nElem ) epics_throws (()) +unsigned comBuf::push ( const epicsUInt16 * pValue, unsigned nElem ) epicsThrows (()) { nElem = this->unoccupiedElem ( sizeof (*pValue), nElem ); for ( unsigned i = 0u; i < nElem; i++ ) { @@ -68,7 +68,7 @@ unsigned comBuf::push ( const epicsUInt16 * pValue, unsigned nElem ) epics_throw return nElem; } -unsigned comBuf::push ( const epicsInt32 * pValue, unsigned nElem ) epics_throws (()) +unsigned comBuf::push ( const epicsInt32 * pValue, unsigned nElem ) epicsThrows (()) { nElem = this->unoccupiedElem ( sizeof (*pValue), nElem ); for ( unsigned i = 0u; i < nElem; i++ ) { @@ -84,7 +84,7 @@ unsigned comBuf::push ( const epicsInt32 * pValue, unsigned nElem ) epics_throws return nElem; } -unsigned comBuf::push ( const epicsUInt32 * pValue, unsigned nElem ) epics_throws (()) +unsigned comBuf::push ( const epicsUInt32 * pValue, unsigned nElem ) epicsThrows (()) { nElem = this->unoccupiedElem ( sizeof (*pValue), nElem ); for ( unsigned i = 0u; i < nElem; i++ ) { @@ -100,7 +100,7 @@ unsigned comBuf::push ( const epicsUInt32 * pValue, unsigned nElem ) epics_throw return nElem; } -unsigned comBuf::push ( const epicsFloat32 * pValue, unsigned nElem ) epics_throws (()) +unsigned comBuf::push ( const epicsFloat32 * pValue, unsigned nElem ) epicsThrows (()) { nElem = this->unoccupiedElem ( sizeof (*pValue), nElem ); for ( unsigned i = 0u; i < nElem; i++ ) { @@ -111,7 +111,7 @@ unsigned comBuf::push ( const epicsFloat32 * pValue, unsigned nElem ) epics_thro return nElem; } -unsigned comBuf::push ( const epicsFloat64 * pValue, unsigned nElem ) epics_throws (()) +unsigned comBuf::push ( const epicsFloat64 * pValue, unsigned nElem ) epicsThrows (()) { nElem = this->unoccupiedElem ( sizeof (*pValue), nElem ); for ( unsigned i = 0u; i < nElem; i++ ) { @@ -125,12 +125,12 @@ unsigned comBuf::push ( const epicsFloat64 * pValue, unsigned nElem ) epics_thro // throwing the exception from a function that isnt inline // shrinks the GNU compiled object code void comBuf::throwInsufficentBytesException () - epics_throws (( comBuf::insufficentBytesAvailable )) + epicsThrows (( comBuf::insufficentBytesAvailable )) { throw comBuf::insufficentBytesAvailable (); } -void comBuf::operator delete ( void * ) epics_throws (()) +void comBuf::operator delete ( void * ) epicsThrows (()) { // Visual C++ .net appears to require operator delete if // placement operator delete is defined? I smell a ms rat diff --git a/src/ca/comBuf.h b/src/ca/comBuf.h index 8818c3daa..1cf202774 100644 --- a/src/ca/comBuf.h +++ b/src/ca/comBuf.h @@ -43,128 +43,125 @@ class comBufMemoryManager { public: virtual ~comBufMemoryManager (); virtual void * allocate ( size_t ) - epics_throws (( std::bad_alloc )) = 0; + epicsThrows (( std::bad_alloc )) = 0; virtual void release ( void * ) - epics_throws (()) = 0; + epicsThrows (()) = 0; }; class wireSendAdapter { // X aCC 655 public: virtual unsigned sendBytes ( const void *pBuf, - unsigned nBytesInBuf ) epics_throws (()) = 0; + unsigned nBytesInBuf ) epicsThrows (()) = 0; }; class wireRecvAdapter { // X aCC 655 public: virtual unsigned recvBytes ( void *pBuf, - unsigned nBytesInBuf ) epics_throws (()) = 0; + unsigned nBytesInBuf ) epicsThrows (()) = 0; }; class comBuf : public tsDLNode < comBuf > { public: class insufficentBytesAvailable {}; - comBuf () epics_throws (()); - unsigned unoccupiedBytes () const epics_throws (()); - unsigned occupiedBytes () const epics_throws (()); - unsigned uncommittedBytes () const epics_throws (()); - static unsigned capacityBytes () epics_throws (()); - void clear () epics_throws (()); - unsigned copyInBytes ( const void *pBuf, unsigned nBytes ) epics_throws (()); - unsigned push ( comBuf & ) epics_throws (()); - bool push ( const epicsInt8 & value ) epics_throws (()); - bool push ( const epicsUInt8 & value ) epics_throws (()); - bool push ( const epicsInt16 & value ) epics_throws (()); - bool push ( const epicsUInt16 & value ) epics_throws (()); - bool push ( const epicsInt32 & value ) epics_throws (()); - bool push ( const epicsUInt32 & value ) epics_throws (()); - bool push ( const epicsFloat32 & value ) epics_throws (()); - bool push ( const epicsFloat64 & value ) epics_throws (()); - bool push ( const epicsOldString & value ) epics_throws (()); - unsigned push ( const epicsInt8 *pValue, unsigned nElem ) epics_throws (()); - unsigned push ( const epicsUInt8 *pValue, unsigned nElem ) epics_throws (()); - unsigned push ( const epicsInt16 *pValue, unsigned nElem ) epics_throws (()); - unsigned push ( const epicsUInt16 *pValue, unsigned nElem ) epics_throws (()); - unsigned push ( const epicsInt32 *pValue, unsigned nElem ) epics_throws (()); - unsigned push ( const epicsUInt32 *pValue, unsigned nElem ) epics_throws (()); - unsigned push ( const epicsFloat32 *pValue, unsigned nElem ) epics_throws (()); - unsigned push ( const epicsFloat64 *pValue, unsigned nElem ) epics_throws (()); - unsigned push ( const epicsOldString *pValue, unsigned nElem ) epics_throws (()); - void commitIncomming () epics_throws (()); - void clearUncommittedIncomming () epics_throws (()); - bool copyInAllBytes ( const void *pBuf, unsigned nBytes ) epics_throws (()); - unsigned copyOutBytes ( void *pBuf, unsigned nBytes ) epics_throws (()); - bool copyOutAllBytes ( void *pBuf, unsigned nBytes ) epics_throws (()); - unsigned removeBytes ( unsigned nBytes ) epics_throws (()); - bool flushToWire ( wireSendAdapter & ) epics_throws (()); - unsigned fillFromWire ( wireRecvAdapter & ) epics_throws (()); + comBuf () epicsThrows (()); + unsigned unoccupiedBytes () const epicsThrows (()); + unsigned occupiedBytes () const epicsThrows (()); + unsigned uncommittedBytes () const epicsThrows (()); + static unsigned capacityBytes () epicsThrows (()); + void clear () epicsThrows (()); + unsigned copyInBytes ( const void *pBuf, unsigned nBytes ) epicsThrows (()); + unsigned push ( comBuf & ) epicsThrows (()); + bool push ( const epicsInt8 & value ) epicsThrows (()); + bool push ( const epicsUInt8 & value ) epicsThrows (()); + bool push ( const epicsInt16 & value ) epicsThrows (()); + bool push ( const epicsUInt16 & value ) epicsThrows (()); + bool push ( const epicsInt32 & value ) epicsThrows (()); + bool push ( const epicsUInt32 & value ) epicsThrows (()); + bool push ( const epicsFloat32 & value ) epicsThrows (()); + bool push ( const epicsFloat64 & value ) epicsThrows (()); + bool push ( const epicsOldString & value ) epicsThrows (()); + unsigned push ( const epicsInt8 *pValue, unsigned nElem ) epicsThrows (()); + unsigned push ( const epicsUInt8 *pValue, unsigned nElem ) epicsThrows (()); + unsigned push ( const epicsInt16 *pValue, unsigned nElem ) epicsThrows (()); + unsigned push ( const epicsUInt16 *pValue, unsigned nElem ) epicsThrows (()); + unsigned push ( const epicsInt32 *pValue, unsigned nElem ) epicsThrows (()); + unsigned push ( const epicsUInt32 *pValue, unsigned nElem ) epicsThrows (()); + unsigned push ( const epicsFloat32 *pValue, unsigned nElem ) epicsThrows (()); + unsigned push ( const epicsFloat64 *pValue, unsigned nElem ) epicsThrows (()); + unsigned push ( const epicsOldString *pValue, unsigned nElem ) epicsThrows (()); + void commitIncomming () epicsThrows (()); + void clearUncommittedIncomming () epicsThrows (()); + bool copyInAllBytes ( const void *pBuf, unsigned nBytes ) epicsThrows (()); + unsigned copyOutBytes ( void *pBuf, unsigned nBytes ) epicsThrows (()); + bool copyOutAllBytes ( void *pBuf, unsigned nBytes ) epicsThrows (()); + unsigned removeBytes ( unsigned nBytes ) epicsThrows (()); + bool flushToWire ( wireSendAdapter & ) epicsThrows (()); + unsigned fillFromWire ( wireRecvAdapter & ) epicsThrows (()); epicsUInt8 popUInt8 () - epics_throws (( comBuf::insufficentBytesAvailable )); + epicsThrows (( comBuf::insufficentBytesAvailable )); epicsUInt16 popUInt16 () - epics_throws (( comBuf::insufficentBytesAvailable )); + epicsThrows (( comBuf::insufficentBytesAvailable )); epicsUInt32 popUInt32 () - epics_throws (( comBuf::insufficentBytesAvailable )); + epicsThrows (( comBuf::insufficentBytesAvailable )); static void throwInsufficentBytesException () - epics_throws (( comBuf::insufficentBytesAvailable )); + epicsThrows (( comBuf::insufficentBytesAvailable )); void * operator new ( size_t size, - comBufMemoryManager & ) epics_throws (( std::bad_alloc )); -# ifdef CXX_PLACEMENT_DELETE - void operator delete ( void *, - comBufMemoryManager & ) epics_throws (()); -# endif + comBufMemoryManager & ) epicsThrows (( std::bad_alloc )); + epicsPlacementDeleteOperator (( void *, comBufMemoryManager & )) private: unsigned commitIndex; unsigned nextWriteIndex; unsigned nextReadIndex; epicsUInt8 buf [ comBufSize ]; - unsigned unoccupiedElem ( unsigned elemSize, unsigned nElem ) epics_throws (()); - unsigned occupiedElem ( unsigned elemSize, unsigned nElem ) epics_throws (()); - void * operator new ( size_t size ) epics_throws (( std::bad_alloc )); - void operator delete ( void * ) epics_throws (()); + unsigned unoccupiedElem ( unsigned elemSize, unsigned nElem ) epicsThrows (()); + unsigned occupiedElem ( unsigned elemSize, unsigned nElem ) epicsThrows (()); + void * operator new ( size_t size ) epicsThrows (( std::bad_alloc )); + void operator delete ( void * ) epicsThrows (()); }; inline void * comBuf::operator new ( size_t size, comBufMemoryManager & mgr ) - epics_throws (( std::bad_alloc )) + epicsThrows (( std::bad_alloc )) { return mgr.allocate ( size ); } #ifdef CXX_PLACEMENT_DELETE inline void comBuf::operator delete ( void * pCadaver, - comBufMemoryManager & mgr ) epics_throws (()) + comBufMemoryManager & mgr ) epicsThrows (()) { mgr.release ( pCadaver ); } #endif -inline comBuf::comBuf () epics_throws (()) : commitIndex ( 0u ), +inline comBuf::comBuf () epicsThrows (()) : commitIndex ( 0u ), nextWriteIndex ( 0u ), nextReadIndex ( 0u ) { } -inline void comBuf::clear () epics_throws (()) +inline void comBuf::clear () epicsThrows (()) { this->commitIndex = 0u; this->nextWriteIndex = 0u; this->nextReadIndex = 0u; } -inline unsigned comBuf::unoccupiedBytes () const epics_throws (()) +inline unsigned comBuf::unoccupiedBytes () const epicsThrows (()) { return sizeof ( this->buf ) - this->nextWriteIndex; } -inline unsigned comBuf::occupiedBytes () const epics_throws (()) +inline unsigned comBuf::occupiedBytes () const epicsThrows (()) { return this->commitIndex - this->nextReadIndex; } -inline unsigned comBuf::uncommittedBytes () const epics_throws (()) +inline unsigned comBuf::uncommittedBytes () const epicsThrows (()) { return this->nextWriteIndex - this->commitIndex; } -inline unsigned comBuf::push ( comBuf & bufIn ) epics_throws (()) +inline unsigned comBuf::push ( comBuf & bufIn ) epicsThrows (()) { unsigned nBytes = this->copyInBytes ( & bufIn.buf[ bufIn.nextReadIndex ], @@ -173,12 +170,12 @@ inline unsigned comBuf::push ( comBuf & bufIn ) epics_throws (()) return nBytes; } -inline unsigned comBuf::capacityBytes () epics_throws (()) +inline unsigned comBuf::capacityBytes () epicsThrows (()) { return comBufSize; } -inline unsigned comBuf::fillFromWire ( wireRecvAdapter & wire ) epics_throws (()) +inline unsigned comBuf::fillFromWire ( wireRecvAdapter & wire ) epicsThrows (()) { unsigned nNewBytes = wire.recvBytes ( & this->buf[this->nextWriteIndex], @@ -187,7 +184,7 @@ inline unsigned comBuf::fillFromWire ( wireRecvAdapter & wire ) epics_throws (() return nNewBytes; } -inline unsigned comBuf::unoccupiedElem ( unsigned elemSize, unsigned nElem ) epics_throws (()) +inline unsigned comBuf::unoccupiedElem ( unsigned elemSize, unsigned nElem ) epicsThrows (()) { unsigned avail = this->unoccupiedBytes (); if ( elemSize * nElem > avail ) { @@ -196,7 +193,7 @@ inline unsigned comBuf::unoccupiedElem ( unsigned elemSize, unsigned nElem ) epi return nElem; } -inline bool comBuf::push ( const epicsInt8 & value ) epics_throws (()) +inline bool comBuf::push ( const epicsInt8 & value ) epicsThrows (()) { if ( this->unoccupiedBytes () < sizeof ( value ) ) { return false; @@ -206,7 +203,7 @@ inline bool comBuf::push ( const epicsInt8 & value ) epics_throws (()) return true; } -inline bool comBuf::push ( const epicsUInt8 & value ) epics_throws (()) +inline bool comBuf::push ( const epicsUInt8 & value ) epicsThrows (()) { if ( this->unoccupiedBytes () < sizeof ( value ) ) { return false; @@ -215,7 +212,7 @@ inline bool comBuf::push ( const epicsUInt8 & value ) epics_throws (()) return true; } -inline bool comBuf::push ( const epicsInt16 & value ) epics_throws (()) +inline bool comBuf::push ( const epicsInt16 & value ) epicsThrows (()) { if ( this->unoccupiedBytes () < sizeof ( value ) ) { return false; @@ -227,7 +224,7 @@ inline bool comBuf::push ( const epicsInt16 & value ) epics_throws (()) return true; } -inline bool comBuf::push ( const epicsUInt16 & value ) epics_throws (()) +inline bool comBuf::push ( const epicsUInt16 & value ) epicsThrows (()) { if ( this->unoccupiedBytes () < sizeof ( value ) ) { return false; @@ -239,7 +236,7 @@ inline bool comBuf::push ( const epicsUInt16 & value ) epics_throws (()) return true; } -inline bool comBuf::push ( const epicsInt32 & value ) epics_throws (()) +inline bool comBuf::push ( const epicsInt32 & value ) epicsThrows (()) { if ( this->unoccupiedBytes () < sizeof ( value ) ) { return false; @@ -255,7 +252,7 @@ inline bool comBuf::push ( const epicsInt32 & value ) epics_throws (()) return true; } -inline bool comBuf::push ( const epicsUInt32 & value ) epics_throws (()) +inline bool comBuf::push ( const epicsUInt32 & value ) epicsThrows (()) { if ( this->unoccupiedBytes () < sizeof ( value ) ) { return false; @@ -271,7 +268,7 @@ inline bool comBuf::push ( const epicsUInt32 & value ) epics_throws (()) return true; } -inline bool comBuf::push ( const epicsFloat32 & value ) epics_throws (()) +inline bool comBuf::push ( const epicsFloat32 & value ) epicsThrows (()) { if ( this->unoccupiedBytes () < sizeof ( value ) ) { return false; @@ -282,7 +279,7 @@ inline bool comBuf::push ( const epicsFloat32 & value ) epics_throws (()) return true; } -inline bool comBuf::push ( const epicsFloat64 & value ) epics_throws (()) +inline bool comBuf::push ( const epicsFloat64 & value ) epicsThrows (()) { if ( this->unoccupiedBytes () < sizeof ( value ) ) { return false; @@ -293,7 +290,7 @@ inline bool comBuf::push ( const epicsFloat64 & value ) epics_throws (()) return true; } -inline bool comBuf::push ( const epicsOldString & value ) epics_throws (()) +inline bool comBuf::push ( const epicsOldString & value ) epicsThrows (()) { if ( this->unoccupiedBytes () < sizeof ( value ) ) { return false; @@ -303,17 +300,17 @@ inline bool comBuf::push ( const epicsOldString & value ) epics_throws (()) return true; } -inline unsigned comBuf::push ( const epicsInt8 *pValue, unsigned nElem ) epics_throws (()) +inline unsigned comBuf::push ( const epicsInt8 *pValue, unsigned nElem ) epicsThrows (()) { return copyInBytes ( pValue, nElem ); } -inline unsigned comBuf::push ( const epicsUInt8 *pValue, unsigned nElem ) epics_throws (()) +inline unsigned comBuf::push ( const epicsUInt8 *pValue, unsigned nElem ) epicsThrows (()) { return copyInBytes ( pValue, nElem ); } -inline unsigned comBuf::push ( const epicsOldString *pValue, unsigned nElem ) epics_throws (()) +inline unsigned comBuf::push ( const epicsOldString *pValue, unsigned nElem ) epicsThrows (()) { nElem = this->unoccupiedElem ( sizeof (*pValue), nElem ); unsigned size = nElem * sizeof ( *pValue ); @@ -322,7 +319,7 @@ inline unsigned comBuf::push ( const epicsOldString *pValue, unsigned nElem ) ep return nElem; } -inline unsigned comBuf::occupiedElem ( unsigned elemSize, unsigned nElem ) epics_throws (()) +inline unsigned comBuf::occupiedElem ( unsigned elemSize, unsigned nElem ) epicsThrows (()) { unsigned avail = this->occupiedBytes (); if ( elemSize * nElem > avail ) { @@ -331,17 +328,17 @@ inline unsigned comBuf::occupiedElem ( unsigned elemSize, unsigned nElem ) epics return nElem; } -inline void comBuf::commitIncomming () epics_throws (()) +inline void comBuf::commitIncomming () epicsThrows (()) { this->commitIndex = this->nextWriteIndex; } -inline void comBuf::clearUncommittedIncomming () epics_throws (()) +inline void comBuf::clearUncommittedIncomming () epicsThrows (()) { this->nextWriteIndex = this->commitIndex; } -inline bool comBuf::copyInAllBytes ( const void *pBuf, unsigned nBytes ) epics_throws (()) +inline bool comBuf::copyInAllBytes ( const void *pBuf, unsigned nBytes ) epicsThrows (()) { if ( nBytes <= this->unoccupiedBytes () ) { memcpy ( & this->buf[this->nextWriteIndex], pBuf, nBytes ); @@ -351,7 +348,7 @@ inline bool comBuf::copyInAllBytes ( const void *pBuf, unsigned nBytes ) epics_t return false; } -inline unsigned comBuf::copyInBytes ( const void *pBuf, unsigned nBytes ) epics_throws (()) +inline unsigned comBuf::copyInBytes ( const void *pBuf, unsigned nBytes ) epicsThrows (()) { if ( nBytes > 0u ) { unsigned available = this->unoccupiedBytes (); @@ -364,7 +361,7 @@ inline unsigned comBuf::copyInBytes ( const void *pBuf, unsigned nBytes ) epics_ return nBytes; } -inline bool comBuf::copyOutAllBytes ( void * pBuf, unsigned nBytes ) epics_throws (()) +inline bool comBuf::copyOutAllBytes ( void * pBuf, unsigned nBytes ) epicsThrows (()) { if ( nBytes <= this->occupiedBytes () ) { memcpy ( pBuf, &this->buf[this->nextReadIndex], nBytes); @@ -374,7 +371,7 @@ inline bool comBuf::copyOutAllBytes ( void * pBuf, unsigned nBytes ) epics_throw return false; } -inline unsigned comBuf::copyOutBytes ( void *pBuf, unsigned nBytes ) epics_throws (()) +inline unsigned comBuf::copyOutBytes ( void *pBuf, unsigned nBytes ) epicsThrows (()) { unsigned occupied = this->occupiedBytes (); if ( nBytes > occupied ) { @@ -385,7 +382,7 @@ inline unsigned comBuf::copyOutBytes ( void *pBuf, unsigned nBytes ) epics_throw return nBytes; } -inline unsigned comBuf::removeBytes ( unsigned nBytes ) epics_throws (()) +inline unsigned comBuf::removeBytes ( unsigned nBytes ) epicsThrows (()) { unsigned occupied = this->occupiedBytes (); if ( nBytes > occupied ) { @@ -396,7 +393,7 @@ inline unsigned comBuf::removeBytes ( unsigned nBytes ) epics_throws (()) } inline epicsUInt8 comBuf::popUInt8 () - epics_throws (( comBuf::insufficentBytesAvailable )) + epicsThrows (( comBuf::insufficentBytesAvailable )) { if ( this->occupiedBytes () < 1u ) { comBuf::throwInsufficentBytesException (); @@ -405,7 +402,7 @@ inline epicsUInt8 comBuf::popUInt8 () } inline epicsUInt16 comBuf::popUInt16 () - epics_throws (( comBuf::insufficentBytesAvailable )) + epicsThrows (( comBuf::insufficentBytesAvailable )) { if ( this->occupiedBytes () < 2u ) { comBuf::throwInsufficentBytesException (); @@ -416,7 +413,7 @@ inline epicsUInt16 comBuf::popUInt16 () } inline epicsUInt32 comBuf::popUInt32 () - epics_throws (( comBuf::insufficentBytesAvailable )) + epicsThrows (( comBuf::insufficentBytesAvailable )) { if ( this->occupiedBytes () < 4u ) { comBuf::throwInsufficentBytesException (); diff --git a/src/ca/comQueRecv.cpp b/src/ca/comQueRecv.cpp index fa6efeb2b..fa84386de 100644 --- a/src/ca/comQueRecv.cpp +++ b/src/ca/comQueRecv.cpp @@ -27,17 +27,17 @@ #include "iocinf.h" #include "virtualCircuit.h" -comQueRecv::comQueRecv ( comBufMemoryManager & comBufMemoryManagerIn ) epics_throws (()) : +comQueRecv::comQueRecv ( comBufMemoryManager & comBufMemoryManagerIn ) epicsThrows (()) : comBufMemMgr ( comBufMemoryManagerIn ), nBytesPending ( 0u ) { } -comQueRecv::~comQueRecv () epics_throws (()) +comQueRecv::~comQueRecv () epicsThrows (()) { this->clear (); } -void comQueRecv::clear () epics_throws (()) +void comQueRecv::clear () epicsThrows (()) { comBuf *pBuf; while ( ( pBuf = this->bufs.get () ) ) { @@ -47,7 +47,7 @@ void comQueRecv::clear () epics_throws (()) this->nBytesPending = 0u; } -unsigned comQueRecv::copyOutBytes ( epicsInt8 *pBuf, unsigned nBytes ) epics_throws (()) +unsigned comQueRecv::copyOutBytes ( epicsInt8 *pBuf, unsigned nBytes ) epicsThrows (()) { unsigned totalBytes = 0u; do { @@ -68,7 +68,7 @@ unsigned comQueRecv::copyOutBytes ( epicsInt8 *pBuf, unsigned nBytes ) epics_thr return totalBytes; } -unsigned comQueRecv::removeBytes ( unsigned nBytes ) epics_throws (()) +unsigned comQueRecv::removeBytes ( unsigned nBytes ) epicsThrows (()) { unsigned totalBytes = 0u; unsigned bytesLeft = nBytes; @@ -95,7 +95,7 @@ unsigned comQueRecv::removeBytes ( unsigned nBytes ) epics_throws (()) } void comQueRecv::popString ( epicsOldString *pStr ) - epics_throws (( comBuf::insufficentBytesAvailable )) + epicsThrows (( comBuf::insufficentBytesAvailable )) { for ( unsigned i = 0u; i < sizeof ( *pStr ); i++ ) { pStr[0][i] = this->popInt8 (); @@ -103,7 +103,7 @@ void comQueRecv::popString ( epicsOldString *pStr ) } void comQueRecv::pushLastComBufReceived ( comBuf & bufIn ) - epics_throws (()) + epicsThrows (()) { bufIn.commitIncomming (); comBuf * pComBuf = this->bufs.last (); @@ -128,7 +128,7 @@ void comQueRecv::pushLastComBufReceived ( comBuf & bufIn ) // 2) using canonical unsigned tmp avoids ANSI C conversions to int // 3) cast required because sizeof(unsigned) >= sizeof(epicsUInt32) epicsUInt16 comQueRecv::multiBufferPopUInt16 () - epics_throws (( comBuf::insufficentBytesAvailable )) + epicsThrows (( comBuf::insufficentBytesAvailable )) { epicsUInt16 tmp; if ( this->occupiedBytes() >= sizeof (tmp) ) { @@ -147,7 +147,7 @@ epicsUInt16 comQueRecv::multiBufferPopUInt16 () // 2) using canonical unsigned temporary avoids ANSI C conversions to int // 3) cast required because sizeof(unsigned) >= sizeof(epicsUInt32) epicsUInt32 comQueRecv::multiBufferPopUInt32 () - epics_throws (( comBuf::insufficentBytesAvailable )) + epicsThrows (( comBuf::insufficentBytesAvailable )) { epicsUInt32 tmp; if ( this->occupiedBytes() >= sizeof (tmp) ) { @@ -169,7 +169,7 @@ epicsUInt32 comQueRecv::multiBufferPopUInt32 () return tmp; } -void comQueRecv::removeAndDestroyBuf ( comBuf & buf ) epics_throws (()) +void comQueRecv::removeAndDestroyBuf ( comBuf & buf ) epicsThrows (()) { this->bufs.remove ( buf ); buf.~comBuf (); diff --git a/src/ca/comQueRecv.h b/src/ca/comQueRecv.h index e725485d0..88abe3733 100644 --- a/src/ca/comQueRecv.h +++ b/src/ca/comQueRecv.h @@ -31,54 +31,54 @@ class comQueRecv { public: - comQueRecv ( comBufMemoryManager & ) epics_throws (()); - ~comQueRecv () epics_throws (()); - unsigned occupiedBytes () const epics_throws (()); - unsigned copyOutBytes ( epicsInt8 *pBuf, unsigned nBytes ) epics_throws (()); - unsigned removeBytes ( unsigned nBytes ) epics_throws (()); - void pushLastComBufReceived ( comBuf & ) epics_throws (()); - void clear () epics_throws (()); - epicsInt8 popInt8 () epics_throws (( comBuf::insufficentBytesAvailable )); - epicsUInt8 popUInt8 () epics_throws (( comBuf::insufficentBytesAvailable )); - epicsInt16 popInt16 () epics_throws (( comBuf::insufficentBytesAvailable )); - epicsUInt16 popUInt16 () epics_throws (( comBuf::insufficentBytesAvailable )); - epicsInt32 popInt32 () epics_throws (( comBuf::insufficentBytesAvailable )); - epicsUInt32 popUInt32 () epics_throws (( comBuf::insufficentBytesAvailable )); - epicsFloat32 popFloat32 () epics_throws (( comBuf::insufficentBytesAvailable )); - epicsFloat64 popFloat64 () epics_throws (( comBuf::insufficentBytesAvailable )); - void popString ( epicsOldString * ) epics_throws (( comBuf::insufficentBytesAvailable )); + comQueRecv ( comBufMemoryManager & ) epicsThrows (()); + ~comQueRecv () epicsThrows (()); + unsigned occupiedBytes () const epicsThrows (()); + unsigned copyOutBytes ( epicsInt8 *pBuf, unsigned nBytes ) epicsThrows (()); + unsigned removeBytes ( unsigned nBytes ) epicsThrows (()); + void pushLastComBufReceived ( comBuf & ) epicsThrows (()); + void clear () epicsThrows (()); + epicsInt8 popInt8 () epicsThrows (( comBuf::insufficentBytesAvailable )); + epicsUInt8 popUInt8 () epicsThrows (( comBuf::insufficentBytesAvailable )); + epicsInt16 popInt16 () epicsThrows (( comBuf::insufficentBytesAvailable )); + epicsUInt16 popUInt16 () epicsThrows (( comBuf::insufficentBytesAvailable )); + epicsInt32 popInt32 () epicsThrows (( comBuf::insufficentBytesAvailable )); + epicsUInt32 popUInt32 () epicsThrows (( comBuf::insufficentBytesAvailable )); + epicsFloat32 popFloat32 () epicsThrows (( comBuf::insufficentBytesAvailable )); + epicsFloat64 popFloat64 () epicsThrows (( comBuf::insufficentBytesAvailable )); + void popString ( epicsOldString * ) epicsThrows (( comBuf::insufficentBytesAvailable )); private: tsDLList < comBuf > bufs; comBufMemoryManager & comBufMemMgr; unsigned nBytesPending; - epicsUInt16 multiBufferPopUInt16 () epics_throws (( comBuf::insufficentBytesAvailable )); - epicsUInt32 multiBufferPopUInt32 () epics_throws (( comBuf::insufficentBytesAvailable )); - void removeAndDestroyBuf ( comBuf & ) epics_throws (()); - comQueRecv ( const comQueRecv & ) epics_throws (()); - comQueRecv & operator = ( const comQueRecv & ) epics_throws (()); + epicsUInt16 multiBufferPopUInt16 () epicsThrows (( comBuf::insufficentBytesAvailable )); + epicsUInt32 multiBufferPopUInt32 () epicsThrows (( comBuf::insufficentBytesAvailable )); + void removeAndDestroyBuf ( comBuf & ) epicsThrows (()); + comQueRecv ( const comQueRecv & ) epicsThrows (()); + comQueRecv & operator = ( const comQueRecv & ) epicsThrows (()); }; inline unsigned comQueRecv::occupiedBytes () const - epics_throws (()) + epicsThrows (()) { return this->nBytesPending; } inline epicsInt8 comQueRecv::popInt8 () - epics_throws (( comBuf::insufficentBytesAvailable )) + epicsThrows (( comBuf::insufficentBytesAvailable )) { return static_cast < epicsInt8 > ( this->popUInt8() ); } inline epicsInt16 comQueRecv::popInt16 () - epics_throws (( comBuf::insufficentBytesAvailable )) + epicsThrows (( comBuf::insufficentBytesAvailable )) { return static_cast < epicsInt16 > ( ( this->popInt8() << 8u ) | ( this->popInt8() << 0u ) ); } inline epicsInt32 comQueRecv::popInt32 () - epics_throws (( comBuf::insufficentBytesAvailable )) + epicsThrows (( comBuf::insufficentBytesAvailable )) { epicsInt32 tmp ; tmp = this->popInt8() << 24u; @@ -89,7 +89,7 @@ inline epicsInt32 comQueRecv::popInt32 () } inline epicsFloat32 comQueRecv::popFloat32 () - epics_throws (( comBuf::insufficentBytesAvailable )) + epicsThrows (( comBuf::insufficentBytesAvailable )) { epicsFloat32 tmp; epicsUInt8 wire[ sizeof ( tmp ) ]; @@ -102,7 +102,7 @@ inline epicsFloat32 comQueRecv::popFloat32 () } inline epicsFloat64 comQueRecv::popFloat64 () - epics_throws (( comBuf::insufficentBytesAvailable )) + epicsThrows (( comBuf::insufficentBytesAvailable )) { epicsFloat64 tmp; epicsUInt8 wire[ sizeof ( tmp ) ]; @@ -115,7 +115,7 @@ inline epicsFloat64 comQueRecv::popFloat64 () } inline epicsUInt8 comQueRecv::popUInt8 () - epics_throws (( comBuf::insufficentBytesAvailable )) + epicsThrows (( comBuf::insufficentBytesAvailable )) { comBuf * pComBuf = this->bufs.first (); if ( ! pComBuf ) { @@ -131,7 +131,7 @@ inline epicsUInt8 comQueRecv::popUInt8 () // optimization here complicates this function somewhat inline epicsUInt16 comQueRecv::popUInt16 () - epics_throws (( comBuf::insufficentBytesAvailable )) + epicsThrows (( comBuf::insufficentBytesAvailable )) { comBuf *pComBuf = this->bufs.first (); if ( ! pComBuf ) { @@ -157,7 +157,7 @@ inline epicsUInt16 comQueRecv::popUInt16 () // optimization here complicates this function somewhat inline epicsUInt32 comQueRecv::popUInt32 () - epics_throws (( comBuf::insufficentBytesAvailable )) + epicsThrows (( comBuf::insufficentBytesAvailable )) { comBuf *pComBuf = this->bufs.first (); if ( ! pComBuf ) { diff --git a/src/ca/comQueSend.cpp b/src/ca/comQueSend.cpp index e3ea7aecf..195088ca8 100644 --- a/src/ca/comQueSend.cpp +++ b/src/ca/comQueSend.cpp @@ -81,35 +81,31 @@ const char cacNillBytes [] = }; comQueSend::comQueSend ( wireSendAdapter & wireIn, - comBufMemoryManager & comBufMemMgrIn ) epics_throws (()) : + comBufMemoryManager & comBufMemMgrIn ) epicsThrows (()) : comBufMemMgr ( comBufMemMgrIn ), wire ( wireIn ), nBytesPending ( 0u ) { } -comQueSend::~comQueSend () epics_throws (()) +comQueSend::~comQueSend () epicsThrows (()) { this->clear (); } -void comQueSend::clear () epics_throws (()) +void comQueSend::clear () epicsThrows (()) { comBuf *pBuf; while ( ( pBuf = this->bufs.get () ) ) { this->nBytesPending -= pBuf->occupiedBytes (); pBuf->~comBuf (); -# if defined ( CXX_PLACEMENT_DELETE ) && 0 - comBuf::operator delete ( pBuf, this->comBufMemMgr ); -# else - this->comBufMemMgr.release ( pBuf ); -# endif + this->comBufMemMgr.release ( pBuf ); } this->pFirstUncommited = tsDLIter < comBuf > (); assert ( this->nBytesPending == 0 ); } -void comQueSend::clearUncommitted () epics_throws (()) +void comQueSend::clearUncommitted () epicsThrows (()) { while ( this->pFirstUncommited.valid() ) { tsDLIter < comBuf > next = this->pFirstUncommited; @@ -118,43 +114,38 @@ void comQueSend::clearUncommitted () epics_throws (()) if ( this->pFirstUncommited->occupiedBytes() == 0u ) { this->bufs.remove ( *this->pFirstUncommited ); this->pFirstUncommited->~comBuf (); -# if defined ( CXX_PLACEMENT_DELETE ) && 0 - comBuf::operator delete - ( this->pFirstUncommited.pointer(), this->comBufMemMgr ); -# else - this->comBufMemMgr.release ( this->pFirstUncommited.pointer() ); -# endif + this->comBufMemMgr.release ( this->pFirstUncommited.pointer() ); } this->pFirstUncommited = next; } } -void comQueSend::copy_dbr_string ( const void *pValue, unsigned nElem ) epics_throws (()) +void comQueSend::copy_dbr_string ( const void *pValue, unsigned nElem ) epicsThrows (()) { this->push ( static_cast ( pValue ), nElem ); } -void comQueSend::copy_dbr_short ( const void *pValue, unsigned nElem ) epics_throws (()) +void comQueSend::copy_dbr_short ( const void *pValue, unsigned nElem ) epicsThrows (()) { this->push ( static_cast ( pValue ), nElem ); } -void comQueSend::copy_dbr_float ( const void *pValue, unsigned nElem ) epics_throws (()) +void comQueSend::copy_dbr_float ( const void *pValue, unsigned nElem ) epicsThrows (()) { this->push ( static_cast ( pValue ), nElem ); } -void comQueSend::copy_dbr_char ( const void *pValue, unsigned nElem ) epics_throws (()) +void comQueSend::copy_dbr_char ( const void *pValue, unsigned nElem ) epicsThrows (()) { this->push ( static_cast ( pValue ), nElem ); } -void comQueSend::copy_dbr_long ( const void *pValue, unsigned nElem ) epics_throws (()) +void comQueSend::copy_dbr_long ( const void *pValue, unsigned nElem ) epicsThrows (()) { this->push ( static_cast ( pValue ), nElem ); } -void comQueSend::copy_dbr_double ( const void *pValue, unsigned nElem ) epics_throws (()) +void comQueSend::copy_dbr_double ( const void *pValue, unsigned nElem ) epicsThrows (()) { this->push ( static_cast ( pValue ), nElem ); } @@ -201,7 +192,7 @@ const comQueSend::copyFunc_t comQueSend::dbrCopyVector [39] = { 0 // DBR_CLASS_NAME }; -comBuf * comQueSend::popNextComBufToSend () epics_throws (()) +comBuf * comQueSend::popNextComBufToSend () epicsThrows (()) { comBuf *pBuf = this->bufs.get (); if ( pBuf ) { @@ -225,7 +216,7 @@ void comQueSend::insertRequestHeader ( ca_uint16_t request, ca_uint32_t payloadSize, ca_uint16_t dataType, ca_uint32_t nElem, ca_uint32_t cid, ca_uint32_t requestDependent, bool v49Ok ) - epics_throws (( cacChannel::outOfBounds )) + epicsThrows (( cacChannel::outOfBounds )) { this->beginMsg (); if ( payloadSize < 0xffff && nElem < 0xffff ) { @@ -254,7 +245,7 @@ void comQueSend::insertRequestHeader ( void comQueSend::insertRequestWithPayLoad ( ca_uint16_t request, unsigned dataType, ca_uint32_t nElem, ca_uint32_t cid, ca_uint32_t requestDependent, const void * pPayload, - bool v49Ok ) epics_throws (( cacChannel::outOfBounds, cacChannel::badType )) + bool v49Ok ) epicsThrows (( cacChannel::outOfBounds, cacChannel::badType )) { if ( ! this->dbr_type_ok ( dataType ) ) { throw cacChannel::badType(); @@ -299,7 +290,7 @@ void comQueSend::insertRequestWithPayLoad ( this->commitMsg (); } -void comQueSend::commitMsg () epics_throws (()) +void comQueSend::commitMsg () epicsThrows (()) { while ( this->pFirstUncommited.valid() ) { this->nBytesPending += this->pFirstUncommited->uncommittedBytes (); diff --git a/src/ca/comQueSend.h b/src/ca/comQueSend.h index b8b8533d4..d1cbad875 100644 --- a/src/ca/comQueSend.h +++ b/src/ca/comQueSend.h @@ -39,56 +39,56 @@ // class comQueSend { public: - comQueSend ( wireSendAdapter &, comBufMemoryManager & ) epics_throws (()); - ~comQueSend () epics_throws (()); - void clear () epics_throws (()); - void beginMsg () epics_throws (()); - void commitMsg () epics_throws (()); - unsigned occupiedBytes () const epics_throws (()); - bool flushEarlyThreshold ( unsigned nBytesThisMsg ) const epics_throws (()); - bool flushBlockThreshold ( unsigned nBytesThisMsg ) const epics_throws (()); - bool dbr_type_ok ( unsigned type ) epics_throws (()); - void pushUInt16 ( const ca_uint16_t value ) epics_throws (()); - void pushUInt32 ( const ca_uint32_t value ) epics_throws (()); - void pushFloat32 ( const ca_float32_t value ) epics_throws (()); - void pushString ( const char *pVal, unsigned nChar ) epics_throws (()); + comQueSend ( wireSendAdapter &, comBufMemoryManager & ) epicsThrows (()); + ~comQueSend () epicsThrows (()); + void clear () epicsThrows (()); + void beginMsg () epicsThrows (()); + void commitMsg () epicsThrows (()); + unsigned occupiedBytes () const epicsThrows (()); + bool flushEarlyThreshold ( unsigned nBytesThisMsg ) const epicsThrows (()); + bool flushBlockThreshold ( unsigned nBytesThisMsg ) const epicsThrows (()); + bool dbr_type_ok ( unsigned type ) epicsThrows (()); + void pushUInt16 ( const ca_uint16_t value ) epicsThrows (()); + void pushUInt32 ( const ca_uint32_t value ) epicsThrows (()); + void pushFloat32 ( const ca_float32_t value ) epicsThrows (()); + void pushString ( const char *pVal, unsigned nChar ) epicsThrows (()); void insertRequestHeader ( ca_uint16_t request, ca_uint32_t payloadSize, ca_uint16_t dataType, ca_uint32_t nElem, ca_uint32_t cid, ca_uint32_t requestDependent, bool v49Ok ) - epics_throws (( cacChannel::outOfBounds )); + epicsThrows (( cacChannel::outOfBounds )); void insertRequestWithPayLoad ( ca_uint16_t request, unsigned dataType, ca_uint32_t nElem, ca_uint32_t cid, ca_uint32_t requestDependent, const void * pPayload, bool v49Ok ) - epics_throws (( cacChannel::outOfBounds, cacChannel::badType )); - void push_dbr_type ( unsigned type, const void *pVal, unsigned nElem ) epics_throws (()); - comBuf * popNextComBufToSend () epics_throws (()); + epicsThrows (( cacChannel::outOfBounds, cacChannel::badType )); + void push_dbr_type ( unsigned type, const void *pVal, unsigned nElem ) epicsThrows (()); + comBuf * popNextComBufToSend () epicsThrows (()); private: comBufMemoryManager & comBufMemMgr; tsDLList < comBuf > bufs; tsDLIter < comBuf > pFirstUncommited; wireSendAdapter & wire; unsigned nBytesPending; - void copy_dbr_string ( const void *pValue, unsigned nElem ) epics_throws (()); - void copy_dbr_short ( const void *pValue, unsigned nElem ) epics_throws (()); - void copy_dbr_float ( const void *pValue, unsigned nElem ) epics_throws (()); - void copy_dbr_char ( const void *pValue, unsigned nElem ) epics_throws (()); - void copy_dbr_long ( const void *pValue, unsigned nElem ) epics_throws (()); - void copy_dbr_double ( const void *pValue, unsigned nElem ) epics_throws (()); - void pushComBuf ( comBuf & ) epics_throws (()); + void copy_dbr_string ( const void *pValue, unsigned nElem ) epicsThrows (()); + void copy_dbr_short ( const void *pValue, unsigned nElem ) epicsThrows (()); + void copy_dbr_float ( const void *pValue, unsigned nElem ) epicsThrows (()); + void copy_dbr_char ( const void *pValue, unsigned nElem ) epicsThrows (()); + void copy_dbr_long ( const void *pValue, unsigned nElem ) epicsThrows (()); + void copy_dbr_double ( const void *pValue, unsigned nElem ) epicsThrows (()); + void pushComBuf ( comBuf & ) epicsThrows (()); typedef void ( comQueSend::*copyFunc_t ) ( const void *pValue, unsigned nElem ); static const copyFunc_t dbrCopyVector [39]; - void clearUncommitted () epics_throws (()); + void clearUncommitted () epicsThrows (()); // // visual C++ versions 6 & 7 do not allow out of // class member template function definition // template < class T > - inline void push ( const T *pVal, const unsigned nElem ) epics_throws (()) + inline void push ( const T *pVal, const unsigned nElem ) epicsThrows (()) { comBuf * pLastBuf = this->bufs.last (); unsigned nCopied; @@ -112,7 +112,7 @@ private: // class member template function definition // template < class T > - inline void push ( const T & val ) epics_throws (()) + inline void push ( const T & val ) epicsThrows (()) { comBuf * pComBuf = this->bufs.last (); if ( pComBuf && pComBuf->push ( val ) ) { @@ -123,13 +123,13 @@ private: this->pushComBuf ( *pComBuf ); } - comQueSend ( const comQueSend & ) epics_throws (()); - comQueSend & operator = ( const comQueSend & ) epics_throws (()); + comQueSend ( const comQueSend & ) epicsThrows (()); + comQueSend & operator = ( const comQueSend & ) epicsThrows (()); }; extern const char cacNillBytes[]; -inline bool comQueSend::dbr_type_ok ( unsigned type ) epics_throws (()) +inline bool comQueSend::dbr_type_ok ( unsigned type ) epicsThrows (()) { if ( type >= ( sizeof ( this->dbrCopyVector ) / sizeof ( this->dbrCopyVector[0] ) ) ) { return false; @@ -140,34 +140,34 @@ inline bool comQueSend::dbr_type_ok ( unsigned type ) epics_throws (()) return true; } -inline void comQueSend::pushUInt16 ( const ca_uint16_t value ) epics_throws (()) +inline void comQueSend::pushUInt16 ( const ca_uint16_t value ) epicsThrows (()) { this->push ( value ); } -inline void comQueSend::pushUInt32 ( const ca_uint32_t value ) epics_throws (()) +inline void comQueSend::pushUInt32 ( const ca_uint32_t value ) epicsThrows (()) { this->push ( value ); } -inline void comQueSend::pushFloat32 ( const ca_float32_t value ) epics_throws (()) +inline void comQueSend::pushFloat32 ( const ca_float32_t value ) epicsThrows (()) { this->push ( value ); } -inline void comQueSend::pushString ( const char *pVal, unsigned nChar ) epics_throws (()) +inline void comQueSend::pushString ( const char *pVal, unsigned nChar ) epicsThrows (()) { this->push ( pVal, nChar ); } // it is assumed that dbr_type_ok() was called prior to calling this routine // to check the type code -inline void comQueSend::push_dbr_type ( unsigned type, const void *pVal, unsigned nElem ) epics_throws (()) +inline void comQueSend::push_dbr_type ( unsigned type, const void *pVal, unsigned nElem ) epicsThrows (()) { ( this->*dbrCopyVector [type] ) ( pVal, nElem ); } -inline void comQueSend::pushComBuf ( comBuf & cb ) epics_throws (()) +inline void comQueSend::pushComBuf ( comBuf & cb ) epicsThrows (()) { this->bufs.add ( cb ); if ( ! this->pFirstUncommited.valid() ) { @@ -175,22 +175,22 @@ inline void comQueSend::pushComBuf ( comBuf & cb ) epics_throws (()) } } -inline unsigned comQueSend::occupiedBytes () const epics_throws (()) +inline unsigned comQueSend::occupiedBytes () const epicsThrows (()) { return this->nBytesPending; } -inline bool comQueSend::flushBlockThreshold ( unsigned nBytesThisMsg ) const epics_throws (()) +inline bool comQueSend::flushBlockThreshold ( unsigned nBytesThisMsg ) const epicsThrows (()) { return ( this->nBytesPending + nBytesThisMsg > 16 * comBuf::capacityBytes () ); } -inline bool comQueSend::flushEarlyThreshold ( unsigned nBytesThisMsg ) const epics_throws (()) +inline bool comQueSend::flushEarlyThreshold ( unsigned nBytesThisMsg ) const epicsThrows (()) { return ( this->nBytesPending + nBytesThisMsg > 4 * comBuf::capacityBytes () ); } -inline void comQueSend::beginMsg () epics_throws (()) +inline void comQueSend::beginMsg () epicsThrows (()) { if ( this->pFirstUncommited.valid() ) { this->clearUncommitted (); diff --git a/src/ca/msgForMultiplyDefinedPV.h b/src/ca/msgForMultiplyDefinedPV.h index e0ebff482..d42491983 100644 --- a/src/ca/msgForMultiplyDefinedPV.h +++ b/src/ca/msgForMultiplyDefinedPV.h @@ -43,11 +43,8 @@ class msgForMultiplyDefinedPV : public ipAddrToAsciiAsynchronous { public: msgForMultiplyDefinedPV ( callbackForMultiplyDefinedPV &, const char * pChannelName, const char * pAcc, const osiSockAddr & rej ); - //msgForMultiplyDefinedPV ( const osiSockAddr &addr, ipAddrToAsciiEngine &engine ); void * operator new ( size_t size, tsFreeList < class msgForMultiplyDefinedPV, 16 > & ); -# ifdef CXX_PLACEMENT_DELETE - void operator delete ( void *, tsFreeList < class msgForMultiplyDefinedPV, 16 > & ); -# endif + epicsPlacementDeleteOperator (( void *, tsFreeList < class msgForMultiplyDefinedPV, 16 > & )) private: char acc[64]; char channel[64]; diff --git a/src/ca/nciu.h b/src/ca/nciu.h index 1da20c0fd..ac1ec116c 100644 --- a/src/ca/nciu.h +++ b/src/ca/nciu.h @@ -98,9 +98,7 @@ public: int status, const char *pContext, unsigned type, arrayElementCount count ); cacChannel::priLev getPriority () const; void * operator new ( size_t size, tsFreeList < class nciu, 1024 > & ); -# ifdef CXX_PLACEMENT_DELETE - void operator delete ( void *, tsFreeList < class nciu, 1024 > & ); -# endif + epicsPlacementDeleteOperator (( void *, tsFreeList < class nciu, 1024 > & )) private: caAccessRights accessRightState; cac & cacCtx; diff --git a/src/ca/netIO.h b/src/ca/netIO.h index 365b99f62..542adcf4e 100644 --- a/src/ca/netIO.h +++ b/src/ca/netIO.h @@ -86,10 +86,8 @@ private: void operator delete ( void * ); void * operator new ( size_t, tsFreeList < class netSubscription, 1024, epicsMutexNOOP > & ); -# if defined ( CXX_PLACEMENT_DELETE ) - void operator delete ( void *, - tsFreeList < class netSubscription, 1024, epicsMutexNOOP > & ); -# endif + epicsPlacementDeleteOperator (( void *, + tsFreeList < class netSubscription, 1024, epicsMutexNOOP > & )) void destroy ( class cacRecycle & ); void completion (); void exception ( int status, @@ -119,10 +117,8 @@ private: void operator delete ( void * ); void * operator new ( size_t, tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & ); -# if defined ( CXX_PLACEMENT_DELETE ) - void operator delete ( void *, - tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & ); -# endif + epicsPlacementDeleteOperator (( void *, + tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & )) void destroy ( class cacRecycle & ); void completion (); void exception ( int status, const char *pContext ); @@ -151,10 +147,8 @@ private: void operator delete ( void * ); void * operator new ( size_t, tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & ); -# if defined ( CXX_PLACEMENT_DELETE ) - void operator delete ( void *, - tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & ); -# endif + epicsPlacementDeleteOperator (( void *, + tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & )) class netSubscription * isSubscription (); void destroy ( class cacRecycle & ); void completion (); diff --git a/src/ca/oldAccess.h b/src/ca/oldAccess.h index 4e08e83c5..614590840 100644 --- a/src/ca/oldAccess.h +++ b/src/ca/oldAccess.h @@ -87,10 +87,8 @@ public: ca_client_context & getClientCtx (); void * operator new ( size_t size, tsFreeList < struct oldChannelNotify, 1024 > & ); -# ifdef CXX_PLACEMENT_DELETE - void operator delete ( void * , - tsFreeList < struct oldChannelNotify, 1024 > & ); -# endif + epicsPlacementDeleteOperator (( void * , + tsFreeList < struct oldChannelNotify, 1024 > & )) private: ca_client_context & cacCtx; cacChannel & io; @@ -124,10 +122,8 @@ public: void cancel (); void * operator new ( size_t size, tsFreeList < class getCopy, 1024 > & ); -# ifdef CXX_PLACEMENT_DELETE - void operator delete ( void *, - tsFreeList < class getCopy, 1024 > & ); -# endif + epicsPlacementDeleteOperator (( void *, + tsFreeList < class getCopy, 1024 > & )) private: arrayElementCount count; ca_client_context &cacCtx; @@ -153,10 +149,8 @@ public: void destroy (); void * operator new ( size_t size, tsFreeList < class getCallback, 1024 > & ); -# ifdef CXX_PLACEMENT_DELETE - void operator delete ( void *, - tsFreeList < class getCallback, 1024 > & ); -# endif + epicsPlacementDeleteOperator (( void *, + tsFreeList < class getCallback, 1024 > & )) private: oldChannelNotify & chan; caEventCallBackFunc * pFunc; @@ -178,10 +172,8 @@ public: ~putCallback (); void * operator new ( size_t size, tsFreeList < class putCallback, 1024 > & ); -# ifdef CXX_PLACEMENT_DELETE - void operator delete ( void *, - tsFreeList < class putCallback, 1024 > & ); -# endif + epicsPlacementDeleteOperator (( void *, + tsFreeList < class putCallback, 1024 > & )) private: oldChannelNotify & chan; caEventCallBackFunc * pFunc; @@ -204,10 +196,8 @@ public: oldChannelNotify & channel () const; void * operator new ( size_t size, tsFreeList < struct oldSubscription, 1024 > & ); -# ifdef CXX_PLACEMENT_DELETE - void operator delete ( void *, - tsFreeList < struct oldSubscription, 1024 > & ); -# endif + epicsPlacementDeleteOperator (( void *, + tsFreeList < struct oldSubscription, 1024 > & )) void ioCancel (); private: oldChannelNotify & chan; diff --git a/src/ca/repeaterClient.h b/src/ca/repeaterClient.h index 2243ff1c4..16fcf990c 100644 --- a/src/ca/repeaterClient.h +++ b/src/ca/repeaterClient.h @@ -59,10 +59,8 @@ public: bool identicalPort ( const osiSockAddr &from ); void * operator new ( size_t size, tsFreeList < repeaterClient, 0x20 > & ); -#ifdef CXX_PLACEMENT_DELETE - void operator delete ( void *, - tsFreeList < repeaterClient, 0x20 > & ); -#endif + epicsPlacementDeleteOperator (( void *, + tsFreeList < repeaterClient, 0x20 > & )) private: osiSockAddr from; SOCKET sock; diff --git a/src/ca/syncGroup.h b/src/ca/syncGroup.h index b04a5c8cd..751e0f757 100644 --- a/src/ca/syncGroup.h +++ b/src/ca/syncGroup.h @@ -90,10 +90,8 @@ private: void operator delete ( void * ); void * operator new ( size_t, tsFreeList < class syncGroupReadNotify, 128, epicsMutexNOOP > & ); -# if defined ( CXX_PLACEMENT_DELETE ) - void operator delete ( void *, - tsFreeList < class syncGroupReadNotify, 128, epicsMutexNOOP > & ); -# endif + epicsPlacementDeleteOperator (( void *, + tsFreeList < class syncGroupReadNotify, 128, epicsMutexNOOP > & )) void completion ( unsigned type, arrayElementCount count, const void *pData ); void exception ( @@ -120,10 +118,8 @@ private: void operator delete ( void * ); void * operator new ( size_t, tsFreeList < class syncGroupWriteNotify, 128, epicsMutexNOOP > & ); -# if defined ( CXX_PLACEMENT_DELETE ) - void operator delete ( void *, - tsFreeList < class syncGroupWriteNotify, 128, epicsMutexNOOP > & ); -# endif + epicsPlacementDeleteOperator (( void *, + tsFreeList < class syncGroupWriteNotify, 128, epicsMutexNOOP > & )) void completion (); void exception ( int status, const char *pContext, unsigned type, arrayElementCount count ); @@ -163,9 +159,7 @@ public: const char *pFileName, unsigned lineNo, oldChannelNotify &chan, unsigned type, arrayElementCount count, unsigned op ); void * operator new ( size_t size, tsFreeList < struct CASG, 128 > & ); -# if defined ( CXX_PLACEMENT_DELETE ) - void operator delete ( void *, tsFreeList < struct CASG, 128 > & ); -# endif + epicsPlacementDeleteOperator (( void *, tsFreeList < struct CASG, 128 > & )) private: tsDLList < syncGroupNotify > ioPendingList; tsDLList < syncGroupNotify > ioCompletedList; diff --git a/src/ca/syncgrp.cpp b/src/ca/syncgrp.cpp index 9e5a88d10..cf9953469 100644 --- a/src/ca/syncgrp.cpp +++ b/src/ca/syncgrp.cpp @@ -65,11 +65,7 @@ extern "C" int epicsShareAPI ca_sg_delete ( const CA_SYNC_GID gid ) } pcasg->~CASG (); -# if defined ( CXX_PLACEMENT_DELETE ) && 0 - CASG::operator delete ( pcasg, pcac->casgFreeList ); -# else pcac->casgFreeList.release ( pcasg ); -# endif return ECA_NORMAL; } diff --git a/src/ca/tcpiiu.cpp b/src/ca/tcpiiu.cpp index 324751442..ae07ba812 100644 --- a/src/ca/tcpiiu.cpp +++ b/src/ca/tcpiiu.cpp @@ -139,7 +139,7 @@ void tcpSendThread::run () } unsigned tcpiiu::sendBytes ( const void *pBuf, - unsigned nBytesInBuf ) epics_throws (()) + unsigned nBytesInBuf ) epicsThrows (()) { int status; unsigned nBytes = 0u; @@ -202,7 +202,7 @@ unsigned tcpiiu::sendBytes ( const void *pBuf, return nBytes; } -unsigned tcpiiu::recvBytes ( void * pBuf, unsigned nBytesInBuf ) epics_throws (()) +unsigned tcpiiu::recvBytes ( void * pBuf, unsigned nBytesInBuf ) epicsThrows (()) { if ( this->state != iiucs_connected && this->state != iiucs_clean_shutdown ) { @@ -382,8 +382,8 @@ void tcpRecvThread::run () pComBuf = 0; // execute receive labor - bool noProtocolViolation = this->iiu.processIncoming ( guard ); - if ( ! noProtocolViolation ) { + bool protocolOK = this->iiu.processIncoming ( guard ); + if ( ! protocolOK ) { this->iiu.cacRef.initiateAbortShutdown ( this->iiu ); break; } @@ -408,11 +408,7 @@ void tcpRecvThread::run () if ( pComBuf ) { pComBuf->~comBuf (); -# if defined ( CXX_PLACEMENT_DELETE ) && 0 - comBuf::operator delete ( pComBuf, this->iiu.comBufMemMgr ); -# else - this->iiu.comBufMemMgr.release ( pComBuf ); -# endif + this->iiu.comBufMemMgr.release ( pComBuf ); } } catch ( ... ) { @@ -1206,21 +1202,13 @@ bool tcpiiu::flush () success = pBuf->flushToWire ( *this ); pBuf->~comBuf (); -# if defined ( CXX_PLACEMENT_DELETE ) && 0 - comBuf::operator delete ( pBuf, this->comBufMemMgr ); -# else - this->comBufMemMgr.release ( pBuf ); -# endif + this->comBufMemMgr.release ( pBuf ); if ( ! success ) { epicsGuard < cacMutex > autoMutex ( this->cacRef.mutexRef() ); while ( ( pBuf = this->sendQue.popNextComBufToSend () ) ) { pBuf->~comBuf (); -# if defined ( CXX_PLACEMENT_DELETE ) && 0 - comBuf::operator delete ( pBuf, this->comBufMemMgr ); -# else - this->comBufMemMgr.release ( pBuf ); -# endif + this->comBufMemMgr.release ( pBuf ); } break; } diff --git a/src/ca/virtualCircuit.h b/src/ca/virtualCircuit.h index 7f396df13..28ed5689f 100644 --- a/src/ca/virtualCircuit.h +++ b/src/ca/virtualCircuit.h @@ -170,8 +170,8 @@ private: bool recvProcessPostponedFlush; bool processIncoming ( epicsGuard < callbackMutex > & ); - unsigned sendBytes ( const void *pBuf, unsigned nBytesInBuf ) epics_throws (()); - unsigned recvBytes ( void *pBuf, unsigned nBytesInBuf ) epics_throws (()); + unsigned sendBytes ( const void *pBuf, unsigned nBytesInBuf ) epicsThrows (()); + unsigned recvBytes ( void *pBuf, unsigned nBytesInBuf ) epicsThrows (()); void connect (); const char * pHostName () const; diff --git a/src/cas/io/bsdSocket/casIOD.h b/src/cas/io/bsdSocket/casIOD.h index 934700b27..79b813f6d 100644 --- a/src/cas/io/bsdSocket/casIOD.h +++ b/src/cas/io/bsdSocket/casIOD.h @@ -46,10 +46,8 @@ public: resTableIndex hash () const; void * operator new ( size_t size, tsFreeList < class ipIgnoreEntry, 128 > & ); -# ifdef CXX_PLACEMENT_DELETE - void operator delete ( void *, - tsFreeList < class ipIgnoreEntry, 128 > & ); -# endif + epicsPlacementDeleteOperator (( void *, + tsFreeList < class ipIgnoreEntry, 128 > & )) private: unsigned ipAddr; ipIgnoreEntry ( const ipIgnoreEntry & ); diff --git a/src/db/dbCAC.h b/src/db/dbCAC.h index ced4bac91..8797a07a8 100644 --- a/src/db/dbCAC.h +++ b/src/db/dbCAC.h @@ -83,9 +83,7 @@ public: void channelDeleteException (); void show ( unsigned level ) const; void * operator new ( size_t size, tsFreeList < dbSubscriptionIO > & ); -# ifdef CXX_PLACEMENT_DELETE - void operator delete ( void *, tsFreeList < dbSubscriptionIO > & ); -# endif + epicsPlacementDeleteOperator (( void *, tsFreeList < dbSubscriptionIO > & )) private: cacStateNotify & notify; dbChannelIO & chan; diff --git a/src/db/dbChannelIO.cpp b/src/db/dbChannelIO.cpp index 1f4ff0d5d..31a9c5128 100644 --- a/src/db/dbChannelIO.cpp +++ b/src/db/dbChannelIO.cpp @@ -135,7 +135,7 @@ void * dbChannelIO::operator new ( size_t size, return freeList.allocate ( size ); } -# ifdef CXX_PLACEMENT_DELETE +#ifdef CXX_PLACEMENT_DELETE void dbChannelIO::operator delete ( void *pCadaver, tsFreeList < dbChannelIO > & freeList ) { diff --git a/src/db/dbChannelIO.h b/src/db/dbChannelIO.h index 7491a25ba..ff7634728 100644 --- a/src/db/dbChannelIO.h +++ b/src/db/dbChannelIO.h @@ -54,9 +54,7 @@ public: void show ( unsigned level ) const; const char *pName () const; void * operator new ( size_t size, tsFreeList < dbChannelIO > & ); -# ifdef CXX_PLACEMENT_DELETE - void operator delete ( void *, tsFreeList < dbChannelIO > & ); -# endif + epicsPlacementDeleteOperator (( void *, tsFreeList < dbChannelIO > & )) private: dbServiceIO & serviceIO; dbAddr addr; diff --git a/src/db/dbPutNotifyBlocker.cpp b/src/db/dbPutNotifyBlocker.cpp index e9a4dd082..78cd24eaf 100644 --- a/src/db/dbPutNotifyBlocker.cpp +++ b/src/db/dbPutNotifyBlocker.cpp @@ -188,13 +188,13 @@ void * dbPutNotifyBlocker::operator new ( size_t size, return freeList.allocate ( size ); } -# ifdef CXX_PLACEMENT_DELETE +#ifdef CXX_PLACEMENT_DELETE void dbPutNotifyBlocker::operator delete ( void *pCadaver, tsFreeList < dbPutNotifyBlocker > & freeList ) { freeList.release ( pCadaver ); } -# endif +#endif void dbPutNotifyBlocker::operator delete ( void * ) { diff --git a/src/db/dbPutNotifyBlocker.h b/src/db/dbPutNotifyBlocker.h index feddac67d..0badda962 100644 --- a/src/db/dbPutNotifyBlocker.h +++ b/src/db/dbPutNotifyBlocker.h @@ -50,10 +50,8 @@ public: void show ( unsigned level ) const; void * operator new ( size_t size, tsFreeList < dbPutNotifyBlocker > & ); -# ifdef CXX_PLACEMENT_DELETE - void operator delete ( void *, - tsFreeList < dbPutNotifyBlocker > & ); -# endif + epicsPlacementDeleteOperator (( void *, + tsFreeList < dbPutNotifyBlocker > & )) private: putNotify pn; // diff --git a/src/libCom/misc/cxxCompilerDependencies.h b/src/libCom/misc/cxxCompilerDependencies.h index 1c048e8a5..95d19ecec 100644 --- a/src/libCom/misc/cxxCompilerDependencies.h +++ b/src/libCom/misc/cxxCompilerDependencies.h @@ -61,7 +61,7 @@ // usage: epicsPlacementDeleteOperator (( void *, myMemoryManager & )) #if defined ( CXX_PLACEMENT_DELETE ) -# define epicsPlacementDeleteOperator(X) void operator delete X epicsThrows (); +# define epicsPlacementDeleteOperator(X) void operator delete X epicsThrows (()); #else # define epicsPlacementDeleteOperator(X) #endif