fixed GNU and SUN PRO warnings

This commit is contained in:
Jeff Hill
2000-08-25 17:55:18 +00:00
parent b1d85b357c
commit 18b885af33
21 changed files with 76 additions and 74 deletions

View File

@@ -33,7 +33,7 @@ threadPrivateId cacRecursionLock;
static threadOnceId caClientContextIdOnce = OSITHREAD_ONCE_INIT;
void ca_client_exit_handler ()
static void ca_client_exit_handler ()
{
if ( caClientContextId ) {
threadPrivateDelete ( caClientContextId );
@@ -42,7 +42,7 @@ void ca_client_exit_handler ()
}
// runs once only for each process
static void ca_init_client_context ( void * dummy )
static void ca_init_client_context ( void * )
{
caClientContextId = threadPrivateCreate ();
if ( caClientContextId ) {
@@ -693,11 +693,11 @@ int ca_vPrintf ( const char *pformat, va_list args )
return pcac->vPrintf ( pformat, args );
}
else {
return ( *errlogVprintf ) ( pformat, args );
return errlogVprintf ( pformat, args );
}
}
else {
return ( *errlogVprintf ) ( pformat, args );
return errlogVprintf ( pformat, args );
}
}
@@ -846,9 +846,7 @@ epicsShareFunc int epicsShareAPI ca_attach_context (caClientCtx context)
return ECA_NORMAL;
}
extern "C" {
extern epicsShareDef const int epicsTypeToDBR_XXXX [lastEpicsType+1] = {
extern "C" epicsShareDef const int epicsTypeToDBR_XXXX [lastEpicsType+1] = {
DBR_SHORT, /* forces conversion fronm uint8 to int16 */
DBR_CHAR,
DBR_SHORT,
@@ -862,7 +860,7 @@ extern epicsShareDef const int epicsTypeToDBR_XXXX [lastEpicsType+1] = {
DBR_STRING
};
extern epicsShareDef const epicsType DBR_XXXXToEpicsType [LAST_BUFFER_TYPE+1] = {
extern "C" epicsShareDef const epicsType DBR_XXXXToEpicsType [LAST_BUFFER_TYPE+1] = {
epicsOldStringT,
epicsInt16T,
epicsFloat32T,
@@ -909,7 +907,7 @@ extern epicsShareDef const epicsType DBR_XXXXToEpicsType [LAST_BUFFER_TYPE+1] =
epicsOldStringT
};
extern epicsShareDef const unsigned short dbr_size[LAST_BUFFER_TYPE+1] = {
extern "C" epicsShareDef const unsigned short dbr_size[LAST_BUFFER_TYPE+1] = {
sizeof(dbr_string_t), /* string max size */
sizeof(dbr_short_t), /* short */
sizeof(dbr_float_t), /* IEEE Float */
@@ -951,7 +949,7 @@ extern epicsShareDef const unsigned short dbr_size[LAST_BUFFER_TYPE+1] = {
sizeof(dbr_string_t), /* string max size */
};
extern epicsShareDef const unsigned short dbr_value_size[LAST_BUFFER_TYPE+1] = {
extern "C" epicsShareDef const unsigned short dbr_value_size[LAST_BUFFER_TYPE+1] = {
sizeof(dbr_string_t), /* string max size */
sizeof(dbr_short_t), /* short */
sizeof(dbr_float_t), /* IEEE Float */
@@ -993,7 +991,7 @@ extern epicsShareDef const unsigned short dbr_value_size[LAST_BUFFER_TYPE+1] = {
sizeof(dbr_string_t), /* string max size */
};
extern epicsShareDef const enum dbr_value_class dbr_value_class[LAST_BUFFER_TYPE+1] = {
extern "C" epicsShareDef const enum dbr_value_class dbr_value_class[LAST_BUFFER_TYPE+1] = {
dbr_class_string, /* string max size */
dbr_class_int, /* short */
dbr_class_float, /* IEEE Float */
@@ -1039,7 +1037,7 @@ extern epicsShareDef const enum dbr_value_class dbr_value_class[LAST_BUFFER_TYPE
dbr_class_string, /* string max size */
};
extern epicsShareDef const unsigned short dbr_value_offset[LAST_BUFFER_TYPE+1] = {
extern "C" epicsShareDef const unsigned short dbr_value_offset[LAST_BUFFER_TYPE+1] = {
0, /* string */
0, /* short */
0, /* IEEE Float */
@@ -1081,7 +1079,7 @@ extern epicsShareDef const unsigned short dbr_value_offset[LAST_BUFFER_TYPE+1] =
0, /* string */
};
extern epicsShareDef const char *db_field_text[] = {
extern "C" epicsShareDef const char *db_field_text[] = {
"DBF_STRING",
"DBF_SHORT",
"DBF_FLOAT",
@@ -1091,11 +1089,11 @@ extern epicsShareDef const char *db_field_text[] = {
"DBF_DOUBLE"
};
extern epicsShareDef const char *dbf_text_invalid = "DBF_invalid";
extern "C" epicsShareDef const char *dbf_text_invalid = "DBF_invalid";
extern epicsShareDef const short dbf_text_dim = (sizeof dbf_text)/(sizeof (char *));
extern "C" epicsShareDef const short dbf_text_dim = (sizeof dbf_text)/(sizeof (char *));
extern epicsShareDef const char *dbr_text[LAST_BUFFER_TYPE+1] = {
extern "C" epicsShareDef const char *dbr_text[LAST_BUFFER_TYPE+1] = {
"DBR_STRING",
"DBR_SHORT",
"DBR_FLOAT",
@@ -1137,7 +1135,5 @@ extern epicsShareDef const char *dbr_text[LAST_BUFFER_TYPE+1] = {
"DBR_CLASS_NAME"
};
extern epicsShareDef const char *dbr_text_invalid = "DBR_invalid";
extern epicsShareDef const short dbr_text_dim = (sizeof dbr_text) / (sizeof (char *)) + 1;
}
extern "C" epicsShareDef const char *dbr_text_invalid = "DBR_invalid";
extern "C" epicsShareDef const short dbr_text_dim = (sizeof dbr_text) / (sizeof (char *)) + 1;

View File

@@ -1244,7 +1244,7 @@ void pend_event_delay_test(dbr_double_t request)
assert (fabs(accuracy) < 10.0);
}
caTaskExistTest ()
void caTaskExistTest ()
{
int status;

View File

@@ -19,7 +19,7 @@
#include "tcpiiu_IL.h"
#include "nciu_IL.h"
extern "C" void cacRecursionLockExitHandler ()
static void cacRecursionLockExitHandler ()
{
if ( cacRecursionLock ) {
threadPrivateDelete ( cacRecursionLock );
@@ -27,7 +27,7 @@ extern "C" void cacRecursionLockExitHandler ()
}
}
static void cacInitRecursionLock ( void * dummy )
static void cacInitRecursionLock ( void * )
{
cacRecursionLock = threadPrivateCreate ();
if ( cacRecursionLock ) {
@@ -58,7 +58,7 @@ cac::cac ( bool enablePreemptiveCallbackIn ) :
threadOnce ( &once, cacInitRecursionLock, 0 );
if ( cacInitRecursionLock == 0 ) {
if ( cacRecursionLock == 0 ) {
throwWithLocation ( caErrorCode (ECA_ALLOCMEM) );
}

View File

@@ -40,6 +40,7 @@ void cacPrivate::destroyAllIO ()
done = false;
}
else {
id = UINT_MAX;
done = true;
}
}
@@ -77,4 +78,4 @@ void cacPrivate::disconnectAllIO ( const char *pHostName )
iter = next;
}
this->cacCtx.defaultMutex.unlock ();
}
}

View File

@@ -17,7 +17,7 @@
#ifndef comBuf_ILh
#define comBuf_ILh
#include <assert.h>
#include <epicsAssert.h>
#include "epicsTypes.h"
#include "osiWireFormat.h"
@@ -122,8 +122,6 @@ inline unsigned comBuf::maxBytes ()
inline bool comBuf::flushToWire ( class comQueSend &que )
{
unsigned occupied = this->occupiedBytes ();
unsigned nSent = 0u;
while ( occupied ) {
unsigned nBytes = que.sendBytes ( &this->buf[this->nextReadIndex], occupied );
if ( nBytes == 0u ) {

View File

@@ -72,7 +72,7 @@ static const char nillBytes[] =
inline bufferReservoir::~bufferReservoir ()
{
comBuf *pBuf;
while ( pBuf = this->reservedBufs.get () ) {
while ( ( pBuf = this->reservedBufs.get () ) ) {
pBuf->destroy ();
}
}
@@ -322,7 +322,7 @@ unsigned comQueSend::occupiedBytes () const
bool comQueSend::flushToWire ()
{
bool success;
bool success = false;
// the recv thread is not permitted to flush as this
// can result in a push / pull deadlock on the TCP pipe,
@@ -345,17 +345,14 @@ bool comQueSend::flushToWire ()
success = true;
break;
}
bool success = pBuf->flushToWire ( *this );
success = pBuf->flushToWire ( *this );
pBuf->destroy ();
if ( ! success ) {
comBuf *pBuf;
this->mutex.lock ();
while ( ( pBuf = this->bufs.get () ) ) {
pBuf->destroy ();
}
this->mutex.unlock ();
break;
}
}
@@ -811,4 +808,4 @@ int tcpiiu::pushStreamMsg ( const caHdr &hdr )
return ECA_ALLOCMEM;
}
}
#endif
#endif

View File

@@ -25,7 +25,7 @@ inline bool inetAddrID::operator == (const inetAddrID &rhs)
return false;
}
inline resTableIndex inetAddrID::hash (unsigned nBitsHashIndex) const
inline resTableIndex inetAddrID::hash ( unsigned ) const
{
unsigned index;
index = this->addr.sin_addr.s_addr;

View File

@@ -852,9 +852,9 @@ private:
class inetAddrID {
public:
inetAddrID (const struct sockaddr_in &addrIn);
bool operator == (const inetAddrID &);
resTableIndex hash (unsigned nBitsHashIndex) const;
inetAddrID ( const struct sockaddr_in &addrIn );
bool operator == ( const inetAddrID & );
resTableIndex hash ( unsigned nBitsHashIndex ) const;
static unsigned maxIndexBitWidth ();
static unsigned minIndexBitWidth ();
private:

View File

@@ -30,8 +30,8 @@
tsFreeList < class nciu, 1024 > nciu::freeList;
nciu::nciu ( cac &cacIn, cacChannel &chan, const char *pNameIn ) :
cacChannelIO ( chan ), cacPrivate ( cacIn )
nciu::nciu ( cac &cacIn, cacChannel &chanIn, const char *pNameIn ) :
cacChannelIO ( chanIn ), cacPrivate ( cacIn )
{
static const caar defaultAccessRights = { false, false };
size_t strcnt;
@@ -67,7 +67,7 @@ nciu::nciu ( cac &cacIn, cacChannel &chan, const char *pNameIn ) :
this->cacCtx.installDisconnectedChannel ( *this );
chan.attachIO ( *this );
chanIn.attachIO ( *this );
}
void nciu::destroy ()
@@ -105,7 +105,7 @@ nciu::~nciu ()
int nciu::read ( unsigned type, unsigned long countIn, cacNotify &notify )
{
int status;
unsigned id;
unsigned idCopy;
//
// fail out if their arguments are invalid
@@ -123,14 +123,14 @@ int nciu::read ( unsigned type, unsigned long countIn, cacNotify &notify )
countIn = this->count;
}
bool success = netReadNotifyIO::factory ( *this, notify, id );
bool success = netReadNotifyIO::factory ( *this, notify, idCopy );
if ( ! success ) {
return ECA_ALLOCMEM;
}
this->lockPIIU ();
if ( this->piiu ) {
status = this->piiu->readNotifyRequest ( id, this->sid, type, countIn );
status = this->piiu->readNotifyRequest ( idCopy, this->sid, type, countIn );
}
else {
status = ECA_DISCONNCHID;
@@ -146,7 +146,7 @@ int nciu::read ( unsigned type, unsigned long countIn, cacNotify &notify )
int nciu::read ( unsigned type, unsigned long countIn, void *pValue )
{
unsigned id;
unsigned idCopy;
bool success;
int status;
@@ -171,14 +171,14 @@ int nciu::read ( unsigned type, unsigned long countIn, void *pValue )
}
success = netReadCopyIO::factory ( *this, type, countIn, pValue,
this->readSequence (), id );
this->readSequence (), idCopy );
if ( ! success ) {
return ECA_ALLOCMEM;
}
this->lockPIIU ();
if ( this->piiu ) {
status = this->piiu->readCopyRequest ( id, this->sid, type, countIn );
status = this->piiu->readCopyRequest ( idCopy, this->sid, type, countIn );
}
else {
status = ECA_DISCONNCHID;
@@ -785,9 +785,9 @@ unsigned nciu::searchAttempts () const
int nciu::subscribe ( unsigned type, unsigned long countIn,
unsigned mask, cacNotify &notify )
{
unsigned id;
unsigned idCopy;
bool success = netSubscription::factory ( *this, type, countIn,
static_cast <unsigned short> (mask), notify, id );
static_cast <unsigned short> (mask), notify, idCopy );
if ( success ) {
return ECA_NORMAL;
}

View File

@@ -57,7 +57,7 @@ inline void nciu::resetRetryCount ()
inline void nciu::accessRightsStateChange ( const caar &arIn )
{
this->ar = ar;
this->ar = arIn;
this->accessRightsNotify ( this->ar );
}
@@ -158,8 +158,8 @@ inline void nciu::ioInstall ( class baseNMIU &nmiu )
this->cacCtx.ioInstall ( *this, nmiu );
}
inline void nciu::ioDestroy ( unsigned id )
inline void nciu::ioDestroy ( unsigned idIn )
{
this->cacCtx.ioDestroy ( id );
this->cacCtx.ioDestroy ( idIn );
}

View File

@@ -198,7 +198,7 @@ bool netiiu::pushDatagramMsg ( const caHdr &, const void *, ca_uint16_t )
return false;
}
bool netiiu::connectionInProgress ( const char *pChannelName, const osiSockAddr &addr ) const
bool netiiu::connectionInProgress ( const char *, const osiSockAddr & ) const
{
return false;
}
@@ -212,37 +212,37 @@ int netiiu::writeRequest ( unsigned, unsigned, unsigned, const void * )
return ECA_DISCONNCHID;
}
int netiiu::writeNotifyRequest ( unsigned ioId, unsigned serverId, unsigned type, unsigned nElem, const void *pValue )
int netiiu::writeNotifyRequest ( unsigned, unsigned, unsigned, unsigned, const void * )
{
return ECA_DISCONNCHID;
}
int netiiu::readCopyRequest ( unsigned ioId, unsigned serverId, unsigned type, unsigned nElem )
int netiiu::readCopyRequest ( unsigned, unsigned, unsigned, unsigned )
{
return ECA_DISCONNCHID;
}
int netiiu::readNotifyRequest ( unsigned ioId, unsigned serverId, unsigned type, unsigned nElem )
int netiiu::readNotifyRequest ( unsigned, unsigned, unsigned, unsigned )
{
return ECA_DISCONNCHID;
}
int netiiu::createChannelRequest ( unsigned clientId, const char *pName, unsigned nameLength )
int netiiu::createChannelRequest ( unsigned, const char *, unsigned )
{
return ECA_DISCONNCHID;
}
int netiiu::clearChannelRequest ( unsigned clientId, unsigned serverId )
int netiiu::clearChannelRequest ( unsigned, unsigned )
{
return ECA_DISCONNCHID;
}
int netiiu::subscriptionRequest ( unsigned ioId, unsigned serverId, unsigned type, unsigned nElem, unsigned mask )
int netiiu::subscriptionRequest ( unsigned, unsigned, unsigned, unsigned, unsigned )
{
return ECA_DISCONNCHID;
}
int netiiu::subscriptionCancelRequest ( unsigned ioId, unsigned serverId, unsigned type, unsigned nElem )
int netiiu::subscriptionCancelRequest ( unsigned, unsigned, unsigned, unsigned )
{
return ECA_DISCONNCHID;
}

View File

@@ -27,7 +27,7 @@ tsFreeList < struct oldChannel, 1024 > oldChannel::freeList;
* out so that we will not decrement the pending
* recv count in the future.
*/
extern "C" void cacAlreadyConnHandler (struct connection_handler_args)
static void cacAlreadyConnHandler (struct connection_handler_args)
{
}

View File

@@ -219,7 +219,7 @@ bool repeaterClient::sendMessage ( const void *pBuf, unsigned bufSize )
status = send ( this->sock, (char *) pBuf, bufSize, 0 );
if ( status >= 0 ) {
assert ( status == bufSize );
assert ( static_cast <unsigned> ( status ) == bufSize );
debugPrintf ( ("Sent to %u\n", ntohs ( this->from.ia.sin_port ) ) );
return true;
}
@@ -263,11 +263,11 @@ inline unsigned repeaterClient::port () const
return ntohs ( this->from.ia.sin_port );
}
inline bool repeaterClient::identicalAddress ( const osiSockAddr &from )
inline bool repeaterClient::identicalAddress ( const osiSockAddr &fromIn )
{
if ( from.sa.sa_family == this->from.sa.sa_family ) {
if ( from.ia.sin_port == this->from.ia.sin_port) {
if ( from.ia.sin_addr.s_addr == this->from.ia.sin_addr.s_addr ) {
if ( fromIn.sa.sa_family == this->from.sa.sa_family ) {
if ( fromIn.ia.sin_port == this->from.ia.sin_port) {
if ( fromIn.ia.sin_addr.s_addr == this->from.ia.sin_addr.s_addr ) {
return true;
}
}
@@ -316,7 +316,7 @@ LOCAL void verifyClients()
static tsDLList < repeaterClient > theClients;
repeaterClient *pclient;
while ( pclient = client_list.get () ) {
while ( ( pclient = client_list.get () ) ) {
if ( pclient->verify () ) {
theClients.add ( *pclient );
}
@@ -335,7 +335,7 @@ LOCAL void fanOut ( const osiSockAddr &from, const void *pMsg, unsigned msgSize
static tsDLList < repeaterClient > theClients;
repeaterClient *pclient;
while ( pclient = client_list.get () ) {
while ( ( pclient = client_list.get () ) ) {
theClients.add ( *pclient );
/* Dont reflect back to sender */
if ( pclient->identicalAddress ( from ) ) {

View File

@@ -60,4 +60,4 @@ const char *repeaterSubscribeTimer::name () const
void repeaterSubscribeTimer::confirmNotify ()
{
this->registered = true;
}
}

View File

@@ -105,19 +105,19 @@ void searchTimer::setRetryInterval (unsigned retryNo)
// at least one response. However, dont reset this delay if we
// get a delayed response to an old search request.
//
void searchTimer::notifySearchResponse ( unsigned short retrySeqNo )
void searchTimer::notifySearchResponse ( unsigned short retrySeqNoIn )
{
bool reschedualNeeded;
this->lock ();
if ( this->retrySeqAtPassBegin <= retrySeqNo ) {
if ( this->retrySeqAtPassBegin <= retrySeqNoIn ) {
if ( this->searchResponsesWithinThisPass < UINT_MAX ) {
this->searchResponsesWithinThisPass++;
}
}
reschedualNeeded = ( retrySeqNo == this->retrySeqNo );
reschedualNeeded = ( retrySeqNoIn == this->retrySeqNo );
this->unlock ();

View File

@@ -341,10 +341,10 @@ tcpiiu::tcpiiu ( cac &cac, const osiSockAddr &addrIn,
unsigned minorVersion, class bhe &bheIn,
double connectionTimeout, osiTimerQueue &timerQueue,
ipAddrToAsciiEngine &engineIn ) :
ipToA ( addrIn, engineIn ),
tcpRecvWatchdog ( connectionTimeout, timerQueue, CA_V43 (CA_PROTOCOL_VERSION, minorVersion ) ),
tcpSendWatchdog ( connectionTimeout, timerQueue ),
netiiu ( cac ),
ipToA ( addrIn, engineIn ),
bhe ( bheIn ),
contigRecvMsgCount ( 0u ),
busyStateDetected ( false ),

View File

@@ -50,7 +50,9 @@
#include <limits.h>
#include <string.h>
#include <math.h>
#ifndef assert // allow use of epicsAssert.h
#include <assert.h>
#endif
#include "tsSLList.h"
#include "shareLib.h"

View File

@@ -1,5 +1,7 @@
#ifndef assert // allow use of epicsAssert.h
#include <assert.h>
#endif
#include "locationException.h"
//

View File

@@ -33,7 +33,9 @@
#ifndef tsSLListh
#define tsSLListh
#ifndef assert // allow use of epicsAssert.h
#include <assert.h>
#endif
#include <locationException.h>

View File

@@ -1,5 +1,7 @@
#ifndef assert // allow use of epicsAssert.h
#include <assert.h>
#endif
#include <windows.h>

View File

@@ -28,7 +28,9 @@
*
*/
#ifndef assert // allow use of epicsAssert.h
#include <assert.h>
#endif
#include <stdio.h>
#include <float.h>