code around gnu g++ inline bug when -O isnt used

This commit is contained in:
Jeff Hill
1997-01-10 21:18:56 +00:00
parent 66c844cebf
commit d0c26b575e
15 changed files with 177 additions and 106 deletions

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.7 1996/11/02 00:54:08 jhill
* many improvements
*
* Revision 1.6 1996/09/16 18:24:00 jhill
* vxWorks port changes
*
@@ -56,8 +59,6 @@
#include <dgOutBufIL.h> // dgOutBuf inline func
#include <dgInBufIL.h> // dgInBuf inline func
#include <casCtxIL.h> // casCtx inline func
#include <inBufIL.h> // inBuf inline func
#include <outBufIL.h> // outBuf inline func
#include <casCoreClientIL.h> // casCoreClient inline func
#include <gddApps.h>

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.9 1996/12/06 22:33:49 jhill
* virtual ~casPVI(), ~casPVListChan(), ~casChannelI()
*
* Revision 1.8 1996/11/02 00:54:14 jhill
* many improvements
*
@@ -364,8 +367,16 @@ union ca_addr;
class casOpaqueAddr
{
public:
inline casOpaqueAddr();
inline void clear();
//
// casOpaqueAddr()
//
casOpaqueAddr();
//
// clear()
//
void clear();
inline int hasBeenInitialized() const;
inline casOpaqueAddr (const union ca_addr &addr);
inline void set (const union ca_addr &);
@@ -494,7 +505,7 @@ protected:
class casPVListChan : public casChannelI, public tsDLNode<casPVListChan>
{
public:
inline casPVListChan (const casCtx &ctx, casChannel &chanAdapter);
casPVListChan (const casCtx &ctx, casChannel &chanAdapter);
virtual ~casPVListChan();
};

View File

@@ -1,12 +1,28 @@
#include <casInternal.h>
#include <>
#include <casdef.h>
casOpaqueAddr::checkSize sizeChecker;
checkSize::checkSize()
//
// this needs to be here (and not in casOpaqueAddrIL.h) if we
// are to avoid undefined symbols under gcc 2.7.x without -O
//
//
// casOpaqueAddr::casOpaqueAddr()
//
casOpaqueAddr::casOpaqueAddr()
{
assert( sizeof(casOpaqueAddr::opaqueAddr) >= sizeof(caAddr));
this->clear();
}
//
// this needs to be here (and not in casOpaqueAddrIL.h) if we
// are to avoid undefined symbols under gcc 2.7.x without -O
//
//
// casOpaqueAddr::clear()
//
void casOpaqueAddr::clear()
{
this->init = 0;
}

View File

@@ -2,22 +2,6 @@
#ifndef casOpaqueAddrILh
#define casOpaqueAddrILh
//
// casOpaqueAddr::clear()
//
inline void casOpaqueAddr::clear()
{
this->init = 0;
}
//
// casOpaqueAddr::casOpaqueAddr()
//
inline casOpaqueAddr::casOpaqueAddr()
{
this->clear();
}
//
// casOpaqueAddr::hasBeenInitialized()
//

View File

@@ -30,6 +30,9 @@
*
* History
* $Log$
* Revision 1.1 1996/12/06 22:36:18 jhill
* use destroyInProgress flag now functional nativeCount()
*
*
*
*/
@@ -37,6 +40,20 @@
#include <server.h>
#include <casPVIIL.h>
//
// this needs to be here (and not in dgInBufIL.h) if we
// are to avoid undefined symbols under gcc 2.7.x with -g
//
//
// casPVListChan::casPVListChan()
//
casPVListChan::casPVListChan
(const casCtx &ctx, casChannel &chanAdapterIn) :
casChannelI(ctx, chanAdapterIn)
{
this->pv.installChannel(*this);
}
//
// casPVListChan::~casPVListChan()
//

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.3 1997/01/09 22:29:17 jhill
* installed hostBuild branch
*
* Revision 1.2 1996/12/06 22:36:20 jhill
* use destroyInProgress flag now functional nativeCount()
*
@@ -42,15 +45,13 @@
#ifndef casPVListChanIL_h
#define casPVListChanIL_h
#include <casPVIIL.h>
//
// casPVListChan::casPVListChan()
// empty for now since casPVListChan::casPVListChan()
// causes undefined sym when it is inline under g++ 2.7.x
// (without -O)
//
inline casPVListChan::casPVListChan
(const casCtx &ctx, casChannel &chanAdapterIn) :
casChannelI(ctx, chanAdapterIn)
{
this->pv.installChannel(*this);
}
#endif // casPVListChanIL_h

View File

@@ -1,7 +1,19 @@
#include <server.h>
#include <inBufIL.h>
#include <casOpaqueAddrIL.h>
//
// this needs to be here (and not in dgInBufIL.h) if we
// are to avoid undefined symbols under gcc 2.7.x without -O
//
// dgInBuf::dgInBuf ()
//
dgInBuf::dgInBuf (osiMutex &mutexIn, unsigned bufSizeIn) :
inBuf(mutexIn, bufSizeIn)
{
}
//
// dgInBuf::~dgInBuf()
// (force virtual constructor)
@@ -10,6 +22,17 @@ dgInBuf::~dgInBuf()
{
}
//
// this needs to be here (and not in dgInBufIL.h) if we
// are to avoid undefined symbols under gcc 2.7.x without -O
//
// dgInBuf::hasAddress()
//
int dgInBuf::hasAddress() const
{
return this->from.hasBeenInitialized();
}
//
// dgInBuf::xRecv ()
//

View File

@@ -5,22 +5,6 @@
#include <casOpaqueAddrIL.h>
#include <inBufIL.h>
//
// dgInBuf::dgInBuf()
//
inline dgInBuf::dgInBuf (osiMutex &mutexIn, unsigned bufSizeIn) :
inBuf(mutexIn, bufSizeIn)
{
}
//
// dgInBuf::hasAddress()
//
inline int dgInBuf::hasAddress() const
{
return this->from.hasBeenInitialized();
}
//
// dgInBuf::clear()
//

View File

@@ -1,6 +1,19 @@
#include <server.h>
#include <casOpaqueAddrIL.h>
#include <outBufIL.h>
//
// this needs to be here (and not in dgInBufIL.h) if we
// are to avoid undefined symbols under gcc 2.7.x when
// -O is not used
//
// dgOutBuf::dgOutBuf ()
//
dgOutBuf::dgOutBuf (osiMutex &mutexIn, unsigned bufSizeIn) :
outBuf(mutexIn, bufSizeIn)
{
}
//
// dgOutBuf::~dgOutBuf()
@@ -22,3 +35,37 @@ xSendStatus dgOutBuf::xSend (char *pBufIn,
this->to.get());
}
//
// this needs to be here (and not in dgInBufIL.h) if we
// are to avoid undefined symbols under gcc 2.7.x (without -O)
//
// dgOutBuf::clear()
//
void dgOutBuf::clear()
{
this->to.clear();
this->outBuf::clear();
}
//
// this needs to be here (and not in dgInBufIL.h) if we
// are to avoid undefined symbols under gcc 2.7.x (without -O)
//
// dgOutBuf::setRecipient()
//
void dgOutBuf::setRecipient(const caAddr &addr)
{
this->to.set(addr);
}
//
// this needs to be here (and not in dgInBufIL.h) if we
// are to avoid undefined symbols under gcc 2.7.x (without -O)
//
// dgOutBuf::getRecipient()
//
caAddr dgOutBuf::getRecipient()
{
return this->to.get();
}

View File

@@ -6,37 +6,9 @@
#include <outBufIL.h>
//
// dgOutBuf::dgOutBuf()
// All of the functions in this file moved to dgOutBuf.cc because
// of inline problems with g++ 2.7.2 (without -O)
//
inline dgOutBuf::dgOutBuf (osiMutex &mutexIn, unsigned bufSizeIn) :
outBuf(mutexIn, bufSizeIn)
{
}
//
// dgOutBuf::getRecipient()
//
inline caAddr dgOutBuf::getRecipient()
{
return this->to.get();
}
//
// dgOutBuf::setRecipient()
//
inline void dgOutBuf::setRecipient(const caAddr &addr)
{
this->to.set(addr);
}
//
// dgOutBuf::clear()
//
inline void dgOutBuf::clear()
{
this->to.clear();
this->outBuf::clear();
}
#endif // dgOutBufILh

View File

@@ -2,16 +2,12 @@
#ifndef inBufILh
#define inBufILh
//
// inBuf::inBuf()
//
inline inBuf::inBuf(osiMutex &mutexIn, unsigned bufSizeIn) :
mutex(mutexIn),
pBuf(NULL),
bufSize(bufSizeIn),
bytesInBuffer(0u),
nextReadIndex(0u)
mutex(mutexIn), pBuf(NULL), bufSize(bufSizeIn),
bytesInBuffer(0u), nextReadIndex(0u)
{
}

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.14 1996/12/11 00:57:56 jhill
* moved casEventMaskEntry here
*
* Revision 1.13 1996/12/06 22:36:30 jhill
* use destroyInProgress flag now functional nativeCount()
*
@@ -265,7 +268,11 @@ enum casFillCondition{
//
class inBuf {
public:
inline inBuf (osiMutex &, unsigned bufSizeIn);
//
// this needs to be here (and not in dgInBufIL.h) if we
// are to avoid undefined symbols under gcc 2.7.x without -O
//
inline inBuf(osiMutex &mutexIn, unsigned bufSizeIn);
inline caStatus init(); //constructor does not return status
virtual ~inBuf();
@@ -308,12 +315,12 @@ private:
//
class dgInBuf : public inBuf {
public:
inline dgInBuf (osiMutex &mutexIn, unsigned bufSizeIn);
dgInBuf (osiMutex &mutexIn, unsigned bufSizeIn);
virtual ~dgInBuf();
inline void clear();
inline int hasAddress() const;
int hasAddress() const;
caAddr getSender() const;
@@ -392,15 +399,15 @@ private:
//
class dgOutBuf : public outBuf {
public:
inline dgOutBuf (osiMutex &mutexIn, unsigned bufSizeIn);
dgOutBuf (osiMutex &mutexIn, unsigned bufSizeIn);
virtual ~dgOutBuf();
inline caAddr getRecipient();
caAddr getRecipient();
inline void setRecipient(const caAddr &addr);
void setRecipient(const caAddr &addr);
inline void clear();
void clear();
xSendStatus xSend (char *pBufIn, bufSizeT nBytesAvailableToSend,
bufSizeT nBytesNeedToBeSent, bufSizeT &nBytesSent);

View File

@@ -440,3 +440,20 @@ unsigned casDGIntfIO::serverPortNumber()
return this->connectWithThisPort;
}
//
// this was moved from casIODIL.h to here because
// of problems inline functions and g++ -g 2.7.2
//
// casDGIntfIO::processDG()
//
void casDGIntfIO::processDG()
{
assert(this->pAltOutIO);
//
// process the request DG and send a response DG
// if it is required
//
this->client.processDG(*this,*this->pAltOutIO);
}

View File

@@ -7,6 +7,9 @@
// Some BSD calls have crept in here
//
// $Log$
// Revision 1.6 1996/11/02 00:54:45 jhill
// many improvements
//
// Revision 1.5 1996/09/16 18:25:15 jhill
// vxWorks port changes
//
@@ -66,7 +69,7 @@ public:
virtual caStatus start()=0; // OS specific
inline void processDG();
void processDG();
private:
ELLLIST beaconAddrList;

View File

@@ -3,18 +3,10 @@
#define casIODILh
//
// casDGIntfIO::processDG()
// Problems with g++ -g 2.7.2 and inline functions
// caused all functions in this file to be moved to
// casDGIntfIO.cc
//
inline void casDGIntfIO::processDG()
{
assert(this->pAltOutIO);
//
// process the request DG and send a response DG
// if it is required
//
this->client.processDG(*this,*this->pAltOutIO);
}
#endif // casIODILh