fixed gnu warnings

This commit is contained in:
Jeff Hill
2002-11-01 18:13:51 +00:00
parent 250a5418c1
commit e772ce948c
8 changed files with 23 additions and 19 deletions

View File

@@ -137,7 +137,7 @@ cac::cac ( cacNotify & notifyIn, bool enablePreemptiveCallbackIn ) :
programBeginTime ( epicsTime::getCurrent() ),
connTMO ( CA_CONN_VERIFY_PERIOD ),
cbMutex ( ! enablePreemptiveCallbackIn ),
globalServiceList ( globalServiceListCAC ),
globalServiceList ( globalServiceListCAC.getReference () ),
timerQueue ( epicsTimerQueueActive::allocate ( false,
lowestPriorityLevelAbove(epicsThreadGetPrioritySelf()) ) ),
pUserName ( 0 ),

View File

@@ -74,7 +74,7 @@ void cacChannel::hostName ( char *pBuf, unsigned bufLength ) const
{
if ( bufLength ) {
epicsSingleton < localHostName >::reference
ref ( localHostNameAtLoadTime );
ref ( localHostNameAtLoadTime.getReference () );
ref->copy ( pBuf, bufLength );
}
}
@@ -84,7 +84,7 @@ void cacChannel::hostName ( char *pBuf, unsigned bufLength ) const
const char * cacChannel::pHostName () const
{
epicsSingleton < localHostName >::reference
ref ( localHostNameAtLoadTime );
ref ( localHostNameAtLoadTime.getReference () );
return ref->pointer ();
}

View File

@@ -894,7 +894,7 @@ void tcpiiu::hostNameSetRequest ( epicsGuard < cacMutex > & )
}
epicsSingleton < localHostName >::reference
ref ( localHostNameAtLoadTime );
ref ( localHostNameAtLoadTime.getReference () );
const char * pName = ref->pointer ();
unsigned size = strlen ( pName ) + 1u;
unsigned postSize = CA_MESSAGE_ALIGN ( size );

View File

@@ -60,7 +60,8 @@ dbBaseIO::dbBaseIO () {}
dbServiceIOLoadTimeInit::dbServiceIOLoadTimeInit ()
{
epicsSingleton < cacServiceList > :: reference ref ( globalServiceListCAC );
epicsSingleton < cacServiceList > :: reference
ref ( globalServiceListCAC.getReference () );
ref->registerService ( this->dbio );
}

View File

@@ -65,19 +65,19 @@ epicsSingleton < tsFreeList < class epicsOnceImpl, 16 > > epicsOnceImpl::freeLis
inline void * epicsOnceImpl::operator new ( size_t size )
{
epicsSingleton < tsFreeList < class epicsOnceImpl, 16 > > :: reference ref =
epicsOnceImpl::freeList;
epicsOnceImpl::freeList.getReference ();
return ref->allocate ( size );
}
inline void epicsOnceImpl::operator delete ( void *pCadaver, size_t size )
{
epicsSingleton < tsFreeList < class epicsOnceImpl, 16 > > :: reference ref =
epicsOnceImpl::freeList;
epicsOnceImpl::freeList.getReference ();
ref->release ( pCadaver, size );
}
inline epicsOnceImpl::epicsOnceImpl ( epicsOnceNotify & notifyIn ) :
mutexRef ( epicsOnceImpl::mutex ), notify ( notifyIn ), onceFlag ( false )
mutexRef ( epicsOnceImpl::mutex.getReference() ), notify ( notifyIn ), onceFlag ( false )
{
}

View File

@@ -78,8 +78,8 @@ public:
};
// lock overhead every time these are called
operator typename epicsSingleton<TYPE>::reference ();
operator const typename epicsSingleton<TYPE>::reference () const;
typename epicsSingleton<TYPE>::reference getReference ();
const typename epicsSingleton<TYPE>::reference getReference () const;
private:
TYPE * pSingleton;
@@ -103,21 +103,23 @@ inline epicsSingleton<TYPE>::~epicsSingleton ()
epicsShareFunc epicsMutex & epicsSingletonPrivateMutex ();
template < class TYPE >
epicsSingleton<TYPE>::operator typename epicsSingleton<TYPE>::reference ()
inline typename epicsSingleton<TYPE>::reference epicsSingleton<TYPE>::getReference ()
{
epicsGuard < epicsMutex > guard ( epicsSingletonPrivateMutex() );
if ( ! this->pSingleton ) {
this->pSingleton = new TYPE;
{
epicsGuard < epicsMutex > guard ( epicsSingletonPrivateMutex() );
if ( ! this->pSingleton ) {
this->pSingleton = new TYPE;
}
}
return reference ( * this->pSingleton );
}
template < class TYPE >
epicsSingleton<TYPE>::operator const typename epicsSingleton<TYPE>::reference () const
inline const typename epicsSingleton<TYPE>::reference epicsSingleton<TYPE>::getReference () const
{
epicsSingleton < TYPE > * pConstCastAway =
const_cast < epicsSingleton < TYPE > * > ( this );
return *pConstCastAway;
return pConstCastAway->getReference ();
}
#endif // epicsSingleton_h

View File

@@ -73,7 +73,7 @@ epicsTimerQueueActiveForC::~epicsTimerQueueActiveForC ()
void epicsTimerQueueActiveForC::release () epicsThrows (())
{
epicsSingleton < timerQueueActiveMgr >::reference pMgr =
timerQueueMgrEPICS;
timerQueueMgrEPICS.getReference ();
pMgr->release ( *this );
}
@@ -179,7 +179,8 @@ extern "C" epicsTimerQueueId epicsShareAPI
epicsTimerQueueAllocate ( int okToShare, unsigned int threadPriority )
{
try {
epicsSingleton < timerQueueActiveMgr >::reference ref = timerQueueMgrEPICS;
epicsSingleton < timerQueueActiveMgr >::reference ref =
timerQueueMgrEPICS.getReference ();
epicsTimerQueueActiveForC & tmr =
ref->allocate ( okToShare ? true : false, threadPriority );
return &tmr;

View File

@@ -36,7 +36,7 @@ epicsTimerQueueActive::~epicsTimerQueueActive () {}
epicsTimerQueueActive & epicsTimerQueueActive::allocate ( bool okToShare, unsigned threadPriority )
{
epicsSingleton < timerQueueActiveMgr >::reference pMgr =
timerQueueMgrEPICS;
timerQueueMgrEPICS.getReference ();
return pMgr->allocate ( okToShare, threadPriority );
}