fixed borland warning
This commit is contained in:
@@ -50,6 +50,7 @@ LIBSRCS += syncGroupNotify.cpp
|
||||
LIBSRCS += localHostName.cpp
|
||||
LIBSRCS += comQueRecv.cpp
|
||||
LIBSRCS += comQueSend.cpp
|
||||
LIBSRCS += comBuf.cpp
|
||||
LIBSRCS += tcpiiuPrivateListOfIO.cpp
|
||||
LIBSRCS += hostNameCache.cpp
|
||||
LIBSRCS += ioCounter.cpp
|
||||
|
||||
34
src/ca/comBuf.cpp
Normal file
34
src/ca/comBuf.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
/*
|
||||
* $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
|
||||
*/
|
||||
|
||||
#include "iocinf.h"
|
||||
#include "comBuf_IL.h"
|
||||
|
||||
bool comBuf::flushToWire ( wireSendAdapter &wire )
|
||||
{
|
||||
unsigned occupied = this->occupiedBytes ();
|
||||
while ( occupied ) {
|
||||
unsigned nBytes = wire.sendBytes ( &this->buf[this->nextReadIndex],
|
||||
occupied );
|
||||
if ( nBytes == 0u ) {
|
||||
this->nextReadIndex = this->nextWriteIndex;
|
||||
return false;
|
||||
}
|
||||
this->nextReadIndex += nBytes;
|
||||
occupied = this->occupiedBytes ();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -131,22 +131,6 @@ inline void comBuf::compress ()
|
||||
}
|
||||
}
|
||||
|
||||
inline bool comBuf::flushToWire ( wireSendAdapter &wire )
|
||||
{
|
||||
unsigned occupied = this->occupiedBytes ();
|
||||
while ( occupied ) {
|
||||
unsigned nBytes = wire.sendBytes ( &this->buf[this->nextReadIndex],
|
||||
occupied );
|
||||
if ( nBytes == 0u ) {
|
||||
this->nextReadIndex = this->nextWriteIndex;
|
||||
return false;
|
||||
}
|
||||
this->nextReadIndex += nBytes;
|
||||
occupied = this->occupiedBytes ();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
inline unsigned comBuf::fillFromWire ( wireRecvAdapter &wire )
|
||||
{
|
||||
unsigned nNewBytes = wire.recvBytes ( &this->buf[this->nextWriteIndex],
|
||||
|
||||
@@ -82,20 +82,29 @@ inline void comQueSend_copyIn ( unsigned &nBytesPending,
|
||||
tsDLList < comBuf > &comBufList, bufferReservoir &reservoir,
|
||||
const T *pVal, unsigned nElem )
|
||||
{
|
||||
unsigned nCopied;
|
||||
|
||||
nBytesPending += sizeof ( T ) * nElem;
|
||||
|
||||
comBuf *pComBuf = comBufList.last ();
|
||||
if ( pComBuf ) {
|
||||
nCopied = pComBuf->copyIn ( pVal, nElem );
|
||||
unsigned nCopied = pComBuf->copyIn ( pVal, nElem );
|
||||
if ( nElem > nCopied ) {
|
||||
comQueSend_copyInWithReservour ( comBufList, reservoir, &pVal[nCopied],
|
||||
nElem - nCopied );
|
||||
}
|
||||
}
|
||||
else {
|
||||
nCopied = 0u;
|
||||
comQueSend_copyInWithReservour ( comBufList, reservoir, pVal, nElem );
|
||||
}
|
||||
}
|
||||
|
||||
template < class T >
|
||||
void comQueSend_copyInWithReservour (
|
||||
tsDLList < comBuf > &comBufList, bufferReservoir &reservoir,
|
||||
const T *pVal, unsigned nElem )
|
||||
{
|
||||
unsigned nCopied = 0u;
|
||||
while ( nElem > nCopied ) {
|
||||
pComBuf = reservoir.fetchOneBuffer ();
|
||||
comBuf *pComBuf = reservoir.fetchOneBuffer ();
|
||||
//
|
||||
// This fails only if space was not preallocated.
|
||||
// See comments at the top of this program on
|
||||
|
||||
@@ -893,7 +893,7 @@ private:
|
||||
double averagePeriod;
|
||||
|
||||
static tsFreeList < class bhe, 1024 > freeList;
|
||||
~bhe (); // force allocation from freeList
|
||||
epicsShareFunc ~bhe (); // force allocation from freeList
|
||||
};
|
||||
|
||||
class caErrorCode {
|
||||
|
||||
@@ -135,9 +135,8 @@ int epicsShareAPI ca_sg_stat ( const CA_SYNC_GID gid )
|
||||
{
|
||||
CASG *pcasg;
|
||||
cac *pcac;
|
||||
int caStatus;
|
||||
|
||||
caStatus = fetchClientContext (&pcac);
|
||||
int caStatus = fetchClientContext (&pcac);
|
||||
if ( caStatus != ECA_NORMAL ) {
|
||||
return caStatus;
|
||||
}
|
||||
@@ -145,7 +144,7 @@ int epicsShareAPI ca_sg_stat ( const CA_SYNC_GID gid )
|
||||
pcasg = pcac->lookupCASG ( gid );
|
||||
if ( ! pcasg ) {
|
||||
printf("Bad Sync Group Id\n");
|
||||
caStatus = ECA_BADSYNCGRP;
|
||||
return ECA_BADSYNCGRP;
|
||||
}
|
||||
|
||||
pcasg->show (1000u);
|
||||
|
||||
Reference in New Issue
Block a user