Changes for HP-UX 11 - first semi-stable version

This commit is contained in:
Ralph Lange
2002-02-04 16:05:49 +00:00
parent a2479de9b5
commit 4bd3e02954
28 changed files with 136 additions and 127 deletions

View File

@@ -666,7 +666,7 @@ chid epicsShareAPI ca_evid_to_chid ( evid pMon )
}
// extern "C"
int epicsShareAPI ca_pend ( ca_real timeout, int early )
int epicsShareAPI ca_pend ( ca_real timeout, int early ) // X aCC 361
{
if ( early ) {
return ca_pend_io ( timeout );
@@ -750,7 +750,7 @@ int epicsShareAPI ca_flush_io ()
* CA_TEST_IO ()
*/
// extern "C"
int epicsShareAPI ca_test_io ()
int epicsShareAPI ca_test_io () // X aCC 361
{
oldCAC *pcac;
int caStatus = fetchClientContext ( &pcac );
@@ -934,7 +934,7 @@ arrayElementCount epicsShareAPI ca_element_count ( chid pChan )
* ca_state ()
*/
// extern "C"
enum channel_state epicsShareAPI ca_state ( chid pChan )
enum channel_state epicsShareAPI ca_state ( chid pChan ) // X aCC 361
{
if ( pChan->connected() ) {
return cs_conn;

View File

@@ -81,8 +81,10 @@
* "EPICS_CA_SERVER_PORT"
*/
#define CA_PORT_BASE IPPORT_USERRESERVED + 56U
#define CA_SERVER_PORT (CA_PORT_BASE+CA_MAJOR_PROTOCOL_REVISION*2u)
#define CA_REPEATER_PORT (CA_PORT_BASE+CA_MAJOR_PROTOCOL_REVISION*2u+1u)
#define CA_SERVER_PORT static_cast <unsigned short> \
(CA_PORT_BASE+CA_MAJOR_PROTOCOL_REVISION*2u)
#define CA_REPEATER_PORT static_cast <unsigned short> \
(CA_PORT_BASE+CA_MAJOR_PROTOCOL_REVISION*2u+1u)
/*
* 1500 (max of ethernet and 802.{2,3} MTU) - 20(IP) - 8(UDP)
* (the MTU of Ethernet is currently independent of its speed varient)

View File

@@ -19,7 +19,7 @@
class caServerID {
public:
caServerID ( const struct sockaddr_in & addrIn, unsigned priority );
caServerID ( const struct sockaddr_in & addrIn, unsigned char priority );
bool operator == ( const caServerID & ) const;
resTableIndex hash () const;
static unsigned maxIndexBitWidth ();
@@ -38,7 +38,7 @@ static const unsigned caServerMinIndexBitWidth = 2u;
static const unsigned caServerMaxIndexBitWidth = 32u;
inline caServerID::caServerID (
const struct sockaddr_in & addrIn, unsigned priorityIn ) :
const struct sockaddr_in & addrIn, unsigned char priorityIn ) :
addr ( addrIn ), pri ( priorityIn )
{
assert ( priorityIn <= 0xff );

View File

@@ -1,5 +1,5 @@
/* $Id$
/*
* $Id$
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -749,7 +749,7 @@ bool cac::lookupChannelAndTransferToTCP ( unsigned cid, unsigned sid,
const epicsTime & currentTime )
{
tcpiiu * pnewiiu = 0;
unsigned retrySeqNumber;
unsigned short retrySeqNumber;
if ( addr.sa.sa_family != AF_INET ) {
return false;
@@ -980,8 +980,9 @@ void cac::writeRequest ( nciu &chan, unsigned type, unsigned nElem, const void *
chan.getPIIU()->writeRequest ( chan, type, nElem, pValue );
}
cacChannel::ioid cac::writeNotifyRequest ( nciu &chan, unsigned type, unsigned nElem,
const void *pValue, cacWriteNotify &notifyIn )
cacChannel::ioid
cac::writeNotifyRequest ( nciu &chan, unsigned type, unsigned nElem, // X aCC 361
const void *pValue, cacWriteNotify &notifyIn )
{
epicsAutoMutex autoMutex ( this->mutex );
autoPtrRecycle < netWriteNotifyIO > pIO ( this->ioTable, chan.cacPrivateListOfIO::eventq,
@@ -999,11 +1000,13 @@ cacChannel::ioid cac::writeNotifyRequest ( nciu &chan, unsigned type, unsigned n
}
}
cacChannel::ioid cac::readNotifyRequest ( nciu &chan, unsigned type,
unsigned nElem, cacReadNotify &notifyIn )
cacChannel::ioid
cac::readNotifyRequest ( nciu &chan, unsigned type, // X aCC 361
unsigned nElem, cacReadNotify &notifyIn )
{
epicsAutoMutex autoMutex ( this->mutex );
autoPtrRecycle < netReadNotifyIO > pIO ( this->ioTable, chan.cacPrivateListOfIO::eventq, *this,
autoPtrRecycle < netReadNotifyIO > pIO ( this->ioTable,
chan.cacPrivateListOfIO::eventq, *this,
netReadNotifyIO::factory ( this->freeListReadNotifyIO, chan, notifyIn ) );
if ( pIO.get() ) {
this->ioTable.add ( *pIO );
@@ -1293,12 +1296,16 @@ void cac::recycleSubscription ( netSubscription &io )
this->freeListSubscription.release ( &io, sizeof ( io ) );
}
cacChannel::ioid cac::subscriptionRequest ( nciu &chan, unsigned type,
arrayElementCount nElem, unsigned mask, cacStateNotify &notifyIn )
cacChannel::ioid
cac::subscriptionRequest ( nciu &chan, unsigned type, // X aCC 361
arrayElementCount nElem, unsigned mask,
cacStateNotify &notifyIn )
{
epicsAutoMutex autoMutex ( this->mutex );
autoPtrRecycle < netSubscription > pIO ( this->ioTable, chan.cacPrivateListOfIO::eventq, *this,
netSubscription::factory ( this->freeListSubscription, chan, type, nElem, mask, notifyIn ) );
autoPtrRecycle < netSubscription > pIO ( this->ioTable,
chan.cacPrivateListOfIO::eventq, *this,
netSubscription::factory ( this->freeListSubscription,
chan, type, nElem, mask, notifyIn ) );
if ( pIO.get() ) {
this->ioTable.add ( *pIO );
chan.cacPrivateListOfIO::eventq.add ( *pIO );

View File

@@ -38,7 +38,7 @@ class netSubscription;
// used to control access to cac's recycle routines which
// should only be indirectly invoked by CAC when its lock
// is applied
class cacRecycle {
class cacRecycle { // X aCC 655
public:
virtual void recycleReadNotifyIO ( netReadNotifyIO &io ) = 0;
virtual void recycleWriteNotifyIO ( netWriteNotifyIO &io ) = 0;

View File

@@ -49,7 +49,7 @@ typedef unsigned long arrayElementCount;
// 1) this should not be passing caerr.h status to the exception callback
// 2) needless-to-say the data should be passed here using the new data access API
class epicsShareClass cacWriteNotify {
class epicsShareClass cacWriteNotify { // X aCC 655
public:
virtual ~cacWriteNotify () = 0;
virtual void completion () = 0;
@@ -59,7 +59,7 @@ public:
// 1) this should not be passing caerr.h status to the exception callback
// 2) needless-to-say the data should be passed here using the new data access API
class epicsShareClass cacReadNotify {
class epicsShareClass cacReadNotify { // X aCC 655
public:
virtual ~cacReadNotify () = 0;
virtual void completion ( unsigned type,
@@ -70,7 +70,7 @@ public:
// 1) this should not be passing caerr.h status to the exception callback
// 2) needless-to-say the data should be passed here using the new data access API
class epicsShareClass cacStateNotify {
class epicsShareClass cacStateNotify { // X aCC 655
public:
virtual ~cacStateNotify () = 0;
virtual void current ( unsigned type,
@@ -119,12 +119,12 @@ public:
// Notes
// 1) This interface assumes that when a channel is deleted then all
// attached IO is deleted. This is left over from the old interface,
// but perhaps is a bad practce that should be eliminated? If so,
// but perhaps is a bad practice that should be eliminated? If so,
// then the IO should not store or use a pointer to the channel.
//
class epicsShareClass cacChannel {
public:
typedef unsigned priLev;
typedef unsigned char priLev;
static const priLev priorityMax;
static const priLev priorityMin;
static const priLev priorityDefault;
@@ -159,7 +159,8 @@ public:
virtual bool ca_v42_ok () const; // defaults to true
virtual bool connected () const; // defaults to true
virtual bool previouslyConnected () const; // defaults to true
virtual void hostName ( char *pBuf, unsigned bufLength ) const; // defaults to local host name
virtual void hostName (
char *pBuf, unsigned bufLength ) const; // defaults to local host name
virtual const char * pHostName () const;
virtual void notifyStateChangeFirstConnectInCountOfOutstandingIO ();
@@ -181,7 +182,7 @@ private:
cacChannelNotify & callback;
};
class cacNotify {
class cacNotify { // X aCC 655
public:
virtual ~cacNotify () = 0;
virtual void exception ( int status, const char *pContext,
@@ -195,7 +196,7 @@ public:
virtual void attachToClientCtx () = 0;
};
struct cacService : public tsDLNode < cacService > {
class cacService : public tsDLNode < cacService > { // X aCC 655
public:
virtual cacChannel * createChannel (
const char *pName, cacChannelNotify &,

View File

@@ -1,15 +1,14 @@
/*
* $Id$
*
*
*
*
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
*
*
* Copyright, 1986, The Regents of the University of California.
*
*
*
*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
@@ -56,4 +55,3 @@ void cacServiceList::show ( unsigned level ) const
iter++;
}
}

View File

@@ -242,7 +242,7 @@ epicsShareFunc int epicsShareAPI ca_search_and_connect
/* End of anachronistic entry points */
/************************************************************************/
typedef unsigned capri;
typedef unsigned char capri;
#define CA_PRIORITY_MAX 99
#define CA_PRIORITY_MIN 0
#define CA_PRIORITY_DEFAULT CA_PRIORITY_MIN

View File

@@ -62,7 +62,7 @@ int main ( int, char ** )
}
osiSockIoctl_t yes = true;
status = socket_ioctl ( sock, FIONBIO, &yes );
status = socket_ioctl ( sock, FIONBIO, &yes ); // X aCC 392
if ( status < 0 ) {
socket_close ( sock );
errlogPrintf ("casw: unable to set socket to nonblocking state because \"%s\"\n",
@@ -93,7 +93,7 @@ int main ( int, char ** )
}
osiSockIoctl_t no = false;
status = socket_ioctl ( sock, FIONBIO, &no );
status = socket_ioctl ( sock, FIONBIO, &no ); // X aCC 392
if ( status < 0 ) {
socket_close ( sock );
errlogPrintf ("casw: unable to set socket to blocking state because \"%s\"\n",

View File

@@ -29,13 +29,13 @@
static const unsigned comBufSize = 0x4000;
class wireSendAdapter {
class wireSendAdapter { // X aCC 655
public:
virtual unsigned sendBytes ( const void *pBuf,
unsigned nBytesInBuf ) = 0;
};
class wireRecvAdapter {
class wireRecvAdapter { // X aCC 655
public:
virtual unsigned recvBytes ( void *pBuf,
unsigned nBytesInBuf ) = 0;
@@ -347,8 +347,8 @@ inline comBuf::statusPopUInt16 comBuf::popUInt16 ()
{
statusPopUInt16 tmp;
if ( this->occupiedBytes () >= 2u ) {
tmp.val = static_cast < epicsUInt16 > ( this->buf[ this->nextReadIndex++ ] << 8u );
tmp.val |= static_cast < epicsUInt16 > ( this->buf[ this->nextReadIndex++ ] << 0u );
tmp.val = static_cast < epicsUInt16 > ( this->buf[ this->nextReadIndex++ ] << 8u
| this->buf[ this->nextReadIndex++ ] << 0u );
tmp.success = true;
}
else {

View File

@@ -115,6 +115,7 @@ epicsUInt8 comQueRecv::popUInt8 ()
return tmp;
}
throw insufficentBytesAvailable ();
return 0; // make compiler happy
}
// optimization here complicates this function somewhat
@@ -135,12 +136,13 @@ epicsUInt16 comQueRecv::popUInt16 ()
}
else {
// split between buffers runs slower
tmp = this->popUInt8() << 8u;
tmp |= this->popUInt8() << 0u;
tmp = this->popUInt8() << 8u; // X aCC 818
tmp |= this->popUInt8() << 0u; // X aCC 818
}
return tmp;
}
throw insufficentBytesAvailable ();
return 0; // make compiler happy
}
// optimization here complicates this function somewhat
@@ -169,4 +171,5 @@ epicsUInt32 comQueRecv::popUInt32 ()
return tmp;
}
throw insufficentBytesAvailable ();
return 0; // make compiler happy
}

View File

@@ -54,16 +54,14 @@ inline epicsInt8 comQueRecv::popInt8 ()
inline epicsInt16 comQueRecv::popInt16 ()
{
epicsInt16 tmp;
tmp = static_cast < epicsInt16 > ( this->popInt8() << 8u );
tmp |= static_cast < epicsInt16 > ( this->popInt8() << 0u );
return tmp;
return static_cast < epicsInt16 > ( this->popInt8() << 8u
| this->popInt8() << 0u );
}
inline epicsInt32 comQueRecv::popInt32 ()
{
epicsInt32 tmp ;
tmp |= this->popInt8() << 24u;
tmp = this->popInt8() << 24u;
tmp |= this->popInt8() << 16u;
tmp |= this->popInt8() << 8u;
tmp |= this->popInt8() << 0u;

View File

@@ -51,12 +51,8 @@ static char *getToken ( const char **ppString, char *pBuf, unsigned bufSIze )
*ppString = &pToken[i];
if(*pToken){
return pBuf;
}
else{
return NULL;
}
if ( *pToken ) return pBuf;
return NULL;
}
/*
@@ -118,7 +114,7 @@ extern "C" void epicsShareAPI removeDuplicatesAddresses
if ( pNode->addr.sa.sa_family == AF_INET ) {
pTmpNode = (osiSockAddrNode *) ellFirst (pDestList);
pTmpNode = (osiSockAddrNode *) ellFirst (pDestList); // X aCC 749
while ( pTmpNode ) {
if (pTmpNode->addr.sa.sa_family == AF_INET) {
unsigned netMask = pNode->netMask.ia.sin_addr.s_addr |
@@ -134,7 +130,7 @@ extern "C" void epicsShareAPI removeDuplicatesAddresses
break;
}
}
pTmpNode = (osiSockAddrNode *) ellNext (&pTmpNode->node);
pTmpNode = (osiSockAddrNode *) ellNext (&pTmpNode->node); // X aCC 749
}
if (pNode) {
ellAdd (pDestList, &pNode->node);
@@ -153,12 +149,12 @@ static void forcePort ( ELLLIST *pList, unsigned short port )
{
osiSockAddrNode *pNode;
pNode = ( osiSockAddrNode * ) ellFirst ( pList );
pNode = ( osiSockAddrNode * ) ellFirst ( pList ); // X aCC 749
while ( pNode ) {
if ( pNode->addr.sa.sa_family == AF_INET ) {
pNode->addr.ia.sin_port = htons (port);
}
pNode = ( osiSockAddrNode * ) ellNext ( &pNode->node );
pNode = ( osiSockAddrNode * ) ellNext ( &pNode->node ); // X aCC 749
}
}
@@ -177,9 +173,9 @@ extern "C" void epicsShareAPI configureChannelAccessAddressList
/*
* dont load the list twice
*/
assert ( ellCount (pList) == 0 );
assert ( ellCount (pList) == 0 ); // X aCC 392
ellInit ( &tmpList );
ellInit ( &tmpList ); // X aCC 392
/*
* Check to see if the user has disabled
@@ -203,7 +199,7 @@ extern "C" void epicsShareAPI configureChannelAccessAddressList
osiSockAddr addr;
addr.ia.sin_family = AF_UNSPEC;
osiSockDiscoverBroadcastAddresses ( &tmpList, sock, &addr );
if ( ellCount ( &tmpList ) == 0 ) {
if ( ellCount ( &tmpList ) == 0 ) { // X aCC 392
osiSockAddrNode *pNewNode;
pNewNode = (osiSockAddrNode *) calloc ( 1, sizeof (*pNewNode) );
if ( pNewNode ) {
@@ -239,11 +235,11 @@ extern "C" void epicsShareAPI printChannelAccessAddressList ( const ELLLIST *pLi
osiSockAddrNode *pNode;
::printf ( "Channel Access Address List\n" );
pNode = (osiSockAddrNode *) ellFirst ( pList );
pNode = (osiSockAddrNode *) ellFirst ( pList ); // X aCC 749
while (pNode) {
char buf[64];
ipAddrToA ( &pNode->addr.ia, buf, sizeof ( buf ) );
::printf ( "%s\n", buf );
pNode = (osiSockAddrNode *) ellNext ( &pNode->node );
pNode = (osiSockAddrNode *) ellNext ( &pNode->node ); // X aCC 749
}
}

View File

@@ -56,7 +56,7 @@ nciu::nciu ( cac & cacIn, netiiu & iiuIn, cacChannelNotify & chanIn,
count ( 0 ),
retry ( 0u ),
retrySeqNo ( 0u ),
nameLength ( strlen ( pNameIn ) + 1 ),
nameLength ( static_cast <ca_uint16_t> ( strlen ( pNameIn ) + 1 ) ),
typeCode ( USHRT_MAX ),
priority ( pri ),
f_connected ( false ),

View File

@@ -1,4 +1,3 @@
/*
* $Id$
*
@@ -57,7 +56,7 @@ public:
void * operator new ( size_t size );
void operator delete ( void *pCadaver, size_t size );
void resetRetryCount ();
unsigned getRetrySeqNo () const;
unsigned short getRetrySeqNo () const;
void accessRightsStateChange ( const caAccessRights & );
ca_uint32_t getSID () const;
ca_uint32_t getCID () const;
@@ -84,18 +83,18 @@ private:
cac & cacCtx;
char * pNameStr;
netiiu * piiu;
ca_uint32_t sid; // server id
ca_uint32_t sid; // server id
unsigned count;
unsigned retry; // search retry number
unsigned retry; // search retry number
ca_uint16_t retrySeqNo; // search retry seq number
ca_uint16_t nameLength; // channel name length
ca_uint16_t typeCode;
ca_uint8_t priority;
unsigned f_connected:1;
unsigned f_previousConn:1; // T if connected in the past
unsigned f_claimSent:1;
unsigned f_firstConnectDecrementsOutstandingIO:1;
unsigned f_connectTimeOutSeen:1;
bool f_connected:1;
bool f_previousConn:1; // T if connected in the past
bool f_claimSent:1;
bool f_firstConnectDecrementsOutstandingIO:1;
bool f_connectTimeOutSeen:1;
void initiateConnect ();
ioStatus read ( unsigned type, arrayElementCount count,
cacReadNotify &, ioid * );
@@ -156,7 +155,7 @@ inline ca_uint32_t nciu::getCID () const
return this->id;
}
inline unsigned nciu::getRetrySeqNo () const
inline unsigned short nciu::getRetrySeqNo () const
{
return this->retrySeqNo;
}

View File

@@ -174,7 +174,7 @@ inline netSubscription * netSubscription::factory (
count, mask, notify );
}
inline arrayElementCount netSubscription::getCount () const
inline arrayElementCount netSubscription::getCount () const // X aCC 361
{
arrayElementCount nativeCount = this->chan.nativeElementCount ();
if ( this->count == 0u || this->count > nativeCount ) {

View File

@@ -1,4 +1,3 @@
/*
* $Id$
*
@@ -68,7 +67,7 @@ private:
virtual void lastChannelDetachNotify ();
};
class limboiiu : public netiiu {
class limboiiu : public netiiu { // X aCC 655
public:
limboiiu ();
};

View File

@@ -79,7 +79,7 @@ int oldCAC::printf ( const char *pformat, ... ) const
return status;
}
int oldCAC::vPrintf ( const char *pformat, va_list args ) const
int oldCAC::vPrintf ( const char *pformat, va_list args ) const // X aCC 361
{
caPrintfFunc *pFunc;
{

View File

@@ -1,4 +1,3 @@
/*
* $Id$
*
@@ -44,7 +43,7 @@ extern "C" void cacNoopAccesRightsHandler ( struct access_rights_handler_args )
}
oldChannelNotify::oldChannelNotify ( oldCAC & cacIn, const char *pName,
caCh * pConnCallBackIn, void * pPrivateIn, capri priority ) :
caCh * pConnCallBackIn, void * pPrivateIn, capri priority ) :
io ( cacIn.createChannel ( pName, *this, priority ) ),
cacCtx ( cacIn ),
pConnCallBack ( pConnCallBackIn ? pConnCallBackIn : cacNoopConnHandler ),

View File

@@ -1,7 +1,7 @@
/*
* $Id$
*
* REPEATER.C
* REPEATER.cpp
*
* CA broadcast repeater
*
@@ -89,7 +89,7 @@ protected:
private:
osiSockAddr from;
SOCKET sock;
unsigned port () const;
unsigned short port () const;
static tsFreeList < class repeaterClient, 0x20 > freeList;
static epicsMutex freeListMutex;
};
@@ -150,7 +150,9 @@ LOCAL makeSocketReturn makeSocket ( unsigned short port, bool reuseAddr )
bd.sin_family = AF_INET;
bd.sin_addr.s_addr = htonl (INADDR_ANY);
bd.sin_port = htons (port);
status = bind (msr.sock, (struct sockaddr *)&bd, (int)sizeof(bd));
status = bind (msr.sock,
reinterpret_cast <struct sockaddr *> (&bd),
(int)sizeof(bd));
if ( status < 0 ) {
msr.errNumber = SOCKERRNO;
msr.pErrStr = SOCKERRSTR ( msr.errNumber );
@@ -207,7 +209,7 @@ bool repeaterClient::connect ()
return true;
}
bool repeaterClient::sendConfirm ()
bool repeaterClient::sendConfirm () // X aCC 361
{
int status;
@@ -231,7 +233,7 @@ bool repeaterClient::sendConfirm ()
}
}
bool repeaterClient::sendMessage ( const void *pBuf, unsigned bufSize )
bool repeaterClient::sendMessage ( const void *pBuf, unsigned bufSize ) // X aCC 361
{
int status;
@@ -278,7 +280,7 @@ inline void repeaterClient::destroy ()
delete this;
}
inline unsigned repeaterClient::port () const
inline unsigned short repeaterClient::port () const
{
return ntohs ( this->from.ia.sin_port );
}
@@ -305,7 +307,7 @@ inline bool repeaterClient::identicalPort ( const osiSockAddr &fromIn )
return false;
}
bool repeaterClient::verify ()
bool repeaterClient::verify () // X aCC 361
{
makeSocketReturn msr;
msr = makeSocket ( this->port (), false );

View File

@@ -1,4 +1,3 @@
/*
* $Id$
*
@@ -34,7 +33,7 @@ repeaterSubscribeTimer::~repeaterSubscribeTimer ()
}
epicsTimerNotify::expireStatus repeaterSubscribeTimer::
expire ( const epicsTime & /* currentTime */ )
expire ( const epicsTime & /* currentTime */ ) // X aCC 361
{
static const unsigned nTriesToMsg = 50;
if ( this->attempts > nTriesToMsg && ! this->once ) {

View File

@@ -1,5 +1,5 @@
/* * $Id$
/*
* $Id$
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -195,7 +195,7 @@ void searchTimer::notifySearchResponse ( unsigned short retrySeqNoIn,
//
// searchTimer::expire ()
//
epicsTimerNotify::expireStatus searchTimer::expire ( const epicsTime & currentTime )
epicsTimerNotify::expireStatus searchTimer::expire ( const epicsTime & currentTime ) // X aCC 361
{
epicsAutoMutex locker ( this->mutex );
unsigned nFrameSent = 0u;
@@ -218,7 +218,7 @@ epicsTimerNotify::expireStatus searchTimer::expire ( const epicsTime & currentTi
/*
* increment the retry sequence number
*/
this->retrySeqNo++; /* allowed to roll over */
this->retrySeqNo++; /* allowed to roll over */ // X aCC 818
this->timeAtLastRetry = currentTime;
/*
@@ -296,7 +296,7 @@ epicsTimerNotify::expireStatus searchTimer::expire ( const epicsTime & currentTi
this->searchAttempts = 0;
this->searchResponses = 0;
while ( 1 ) {
while ( true ) {
/*
* clear counter when we reach the end of the list
@@ -320,7 +320,7 @@ epicsTimerNotify::expireStatus searchTimer::expire ( const epicsTime & currentTi
* we are handling a response from an old
* search message)
*/
this->retrySeqNo++; /* allowed to roll over */
this->retrySeqNo++; /* allowed to roll over */ // X aCC 818
/*
* so that old search tries will not update the counters

View File

@@ -1,4 +1,3 @@
/*
* $Id$
*
@@ -33,7 +32,7 @@ static const unsigned CASG_MAGIC = 0xFAB4CAFE;
// used to control access to CASG's recycle routines which
// should only be indirectly invoked by CASG when its lock
// is applied
class casgRecycle {
class casgRecycle { // X aCC 655
public:
virtual void recycleSyncGroupWriteNotify ( class syncGroupWriteNotify & io ) = 0;
virtual void recycleSyncGroupReadNotify ( class syncGroupReadNotify & io ) = 0;

View File

@@ -38,7 +38,7 @@
/*
* ca_sg_create()
*/
extern "C" int epicsShareAPI ca_sg_create ( CA_SYNC_GID *pgid )
extern "C" int epicsShareAPI ca_sg_create ( CA_SYNC_GID *pgid ) // X aCC 361
{
oldCAC *pcac;
int caStatus;
@@ -161,7 +161,7 @@ extern "C" int epicsShareAPI ca_sg_stat ( const CA_SYNC_GID gid )
/*
* ca_sg_test
*/
extern "C" int epicsShareAPI ca_sg_test ( const CA_SYNC_GID gid )
extern "C" int epicsShareAPI ca_sg_test ( const CA_SYNC_GID gid ) // X aCC 361
{
oldCAC *pcac;
CASG *pcasg;

View File

@@ -1,5 +1,5 @@
/* * $Id$
/*
* $Id$
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -31,14 +31,16 @@ tcpRecvWatchdog::~tcpRecvWatchdog ()
this->timer.destroy ();
}
epicsTimerNotify::expireStatus tcpRecvWatchdog::expire ( const epicsTime & /* currentTime */ )
epicsTimerNotify::expireStatus
tcpRecvWatchdog::expire ( const epicsTime & /* currentTime */ ) // X aCC 361
{
if ( this->responsePending ) {
this->cancel ();
# ifdef DEBUG
char hostName[128];
this->iiu.hostName ( hostName, sizeof (hostName) );
debugPrintf ( ( "CA server \"%s\" unresponsive after %g inactive sec - disconnecting.\n",
debugPrintf ( ( "CA server \"%s\" unresponsive after %g inactive sec"
"- disconnecting.\n",
hostName, this->period ) );
# endif
this->iiu.forcedShutdown ();

View File

@@ -329,7 +329,8 @@ extern "C" void cacRecvThreadTCP ( void *pParam )
{
int status;
osiSockIoctl_t bytesPending = 0;
status = socket_ioctl ( piiu->sock, FIONREAD, & bytesPending );
status = socket_ioctl ( piiu->sock, // X aCC 392
FIONREAD, & bytesPending );
if ( status || bytesPending == 0u ) {
break;
}
@@ -757,7 +758,7 @@ void tcpiiu::show ( unsigned level ) const
}
}
bool tcpiiu::setEchoRequestPending ()
bool tcpiiu::setEchoRequestPending () // X aCC 361
{
{
epicsAutoMutex locker ( this->pCAC()->mutexRef() );
@@ -878,6 +879,7 @@ bool tcpiiu::processIncoming ()
this->msgHeaderAvailable = false;
this->curDataBytes = 0u;
}
return false; // to make compiler happy...
}
inline void insertRequestHeader (
@@ -962,7 +964,7 @@ void tcpiiu::userNameSetRequest ()
epicsAutoMutex locker ( this->pCAC()->mutexRef() );
this->sendQue.beginMsg ();
this->sendQue.pushUInt16 ( CA_PROTO_CLIENT_NAME ); // cmd
this->sendQue.pushUInt16 ( postSize ); // postsize
this->sendQue.pushUInt16 ( static_cast <epicsUInt16> ( postSize ) ); // postsize
this->sendQue.pushUInt16 ( 0u ); // dataType
this->sendQue.pushUInt16 ( 0u ); // count
this->sendQue.pushUInt32 ( 0u ); // cid
@@ -1171,7 +1173,7 @@ void tcpiiu::createChannelRequest ( nciu &chan )
this->sendQue.beginMsg ();
this->sendQue.pushUInt16 ( CA_PROTO_CLAIM_CIU ); // cmd
this->sendQue.pushUInt16 ( postCnt ); // postsize
this->sendQue.pushUInt16 ( static_cast < epicsUInt16 > ( postCnt ) ); // postsize
this->sendQue.pushUInt16 ( 0u ); // dataType
this->sendQue.pushUInt16 ( 0u ); // count
this->sendQue.pushUInt32 ( identity ); // cid
@@ -1310,6 +1312,7 @@ bool tcpiiu::flush ()
return false;
}
}
return false; // to make compiler happy...
}
// ~tcpiiu() will not return while this->blockingForFlush is greater than zero

View File

@@ -1,5 +1,5 @@
/* $Id$
/*
* $Id$
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -105,7 +105,7 @@ udpiiu::udpiiu ( cac &cac ) :
memset ( (char *)&addr, 0 , sizeof (addr) );
addr.ia.sin_family = AF_INET;
addr.ia.sin_addr.s_addr = htonl (INADDR_ANY);
addr.ia.sin_port = htons (PORT_ANY);
addr.ia.sin_port = htons (PORT_ANY); // X aCC 818
status = bind (this->sock, &addr.sa, sizeof (addr) );
if ( status < 0 ) {
socket_close (this->sock);
@@ -143,9 +143,9 @@ udpiiu::udpiiu ( cac &cac ) :
* load user and auto configured
* broadcast address list
*/
ellInit ( &this->dest );
ellInit ( &this->dest ); // X aCC 392
configureChannelAccessAddressList ( &this->dest, this->sock, this->serverPort );
if ( ellCount ( &this->dest ) == 0 ) {
if ( ellCount ( &this->dest ) == 0 ) { // X aCC 392
// no need to lock callbacks here because
// 1) this is called while in a CA client function
// 2) no auxiliary threads are running at this point
@@ -336,20 +336,20 @@ void epicsShareAPI caRepeaterRegistrationMessage (
*/
saddr.ia.sin_family = AF_INET;
saddr.ia.sin_addr.s_addr = htonl ( INADDR_LOOPBACK );
saddr.ia.sin_port = htons ( repeaterPort );
saddr.ia.sin_port = static_cast <unsigned short> ( htons ( repeaterPort ) );
}
else {
saddr.ia.sin_port = htons ( repeaterPort );
saddr.ia.sin_port = static_cast <unsigned short> ( htons ( repeaterPort ) );
}
}
else {
saddr.ia.sin_family = AF_INET;
saddr.ia.sin_addr.s_addr = htonl ( INADDR_LOOPBACK );
saddr.ia.sin_port = htons ( repeaterPort );
saddr.ia.sin_port = static_cast <unsigned short> ( htons ( repeaterPort ) );
}
memset ( (char *) &msg, 0, sizeof (msg) );
msg.m_cmmd = htons ( REPEATER_REGISTER );
msg.m_cmmd = static_cast <unsigned short> ( htons ( REPEATER_REGISTER ) );
msg.m_available = saddr.ia.sin_addr.s_addr;
/*
@@ -365,8 +365,9 @@ void epicsShareAPI caRepeaterRegistrationMessage (
len = 0;
# endif
status = sendto ( sock, (char *) &msg, len,
0, (struct sockaddr *) &saddr, sizeof ( saddr ) );
status = sendto ( sock, (char *) &msg, len, 0,
reinterpret_cast <struct sockaddr*> (&saddr),
sizeof ( saddr ) );
if ( status < 0 ) {
int errnoCpy = SOCKERRNO;
/*
@@ -430,7 +431,9 @@ void epicsShareAPI caStartRepeaterIfNotInstalled ( unsigned repeaterPort )
bd.sin_family = AF_INET;
bd.sin_addr.s_addr = htonl ( INADDR_ANY );
bd.sin_port = htons ( port );
status = bind ( tmpSock, (struct sockaddr *) &bd, sizeof ( bd ) );
status = bind ( tmpSock,
reinterpret_cast <struct sockaddr *> (&bd),
sizeof ( bd ) );
if ( status < 0 ) {
if ( SOCKERRNO == SOCK_EADDRINUSE ) {
installed = true;
@@ -510,8 +513,8 @@ bool udpiiu::noopAction ( const caHdr &, const osiSockAddr &, const epicsTime &
return true;
}
bool udpiiu::searchRespAction ( const caHdr &msg,
const osiSockAddr &addr, const epicsTime &currentTime )
bool udpiiu::searchRespAction ( const caHdr &msg, // X aCC 361
const osiSockAddr &addr, const epicsTime &currentTime )
{
osiSockAddr serverAddr;
unsigned minorVersion;
@@ -734,7 +737,7 @@ bool udpiiu::pushDatagramMsg ( const caHdr &msg, const void *pExt, ca_uint16_t e
ca_uint16_t allignedExtSize;
caHdr *pbufmsg;
allignedExtSize = CA_MESSAGE_ALIGN ( extsize );
allignedExtSize = static_cast <ca_uint16_t> (CA_MESSAGE_ALIGN ( extsize ));
msgsize = sizeof ( caHdr ) + allignedExtSize;
@@ -768,7 +771,7 @@ void udpiiu::datagramFlush ()
return;
}
pNode = (osiSockAddrNode *) ellFirst ( &this->dest );
pNode = (osiSockAddrNode *) ellFirst ( &this->dest ); // X aCC 749
while ( pNode ) {
int status;
@@ -813,7 +816,7 @@ void udpiiu::datagramFlush ()
}
}
}
pNode = (osiSockAddrNode *) ellNext ( &pNode->node );
pNode = (osiSockAddrNode *) ellNext ( &pNode->node ); // X aCC 749
}
this->nBytesInXmitBuf = 0u;

View File

@@ -1,4 +1,3 @@
/*
* $Id$
*
@@ -162,7 +161,7 @@ inline bool tcpiiu::ca_v49_ok () const
return CA_V49 ( this->minorProtocolVersion );
}
inline bool tcpiiu::alive () const
inline bool tcpiiu::alive () const // X aCC 361
{
if ( this->state == iiu_connecting ||
this->state == iiu_connected ) {