From 8b38402d4bacc4dde98d0f6a8c1d2360cf53ac6e Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 7 Mar 2001 17:13:19 +0000 Subject: [PATCH] fixed gnu warnings --- src/ca/CASG.cpp | 2 +- src/ca/access.cpp | 7 ++++++- src/ca/cac.cpp | 1 - src/ca/getCopy.cpp | 2 +- src/ca/nciu.cpp | 7 ++++--- src/ca/oldAccess.h | 4 ++-- src/ca/recvProcessThread.cpp | 2 +- 7 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/ca/CASG.cpp b/src/ca/CASG.cpp index 003102a3a..875c3897f 100644 --- a/src/ca/CASG.cpp +++ b/src/ca/CASG.cpp @@ -34,7 +34,7 @@ tsFreeList < struct CASG, 128 > CASG::freeList; epicsMutex CASG::freeListMutex; CASG::CASG (cac &cacIn) : - client (cacIn), magic (CASG_MAGIC), opPendCount (0u), seqNo (0u) + client (cacIn), opPendCount (0u), magic (CASG_MAGIC), seqNo (0u) { client.installCASG ( *this ); } diff --git a/src/ca/access.cpp b/src/ca/access.cpp index 1b6e60832..c681bad45 100644 --- a/src/ca/access.cpp +++ b/src/ca/access.cpp @@ -268,7 +268,12 @@ extern "C" int epicsShareAPI ca_array_get ( chtype type, return caStatus; } - getCopy *pNotify = new getCopy ( *pcac, type, count, pValue ); + if ( type < 0 ) { + return ECA_BADTYPE; + } + unsigned tmpType = static_cast < unsigned > ( type ); + + getCopy *pNotify = new getCopy ( *pcac, tmpType, count, pValue ); if ( ! pNotify ) { return ECA_ALLOCMEM; } diff --git a/src/ca/cac.cpp b/src/ca/cac.cpp index b7beafcee..bb3a5b147 100644 --- a/src/ca/cac.cpp +++ b/src/ca/cac.cpp @@ -40,7 +40,6 @@ cac::cac ( bool enablePreemptiveCallbackIn ) : enablePreemptiveCallback ( enablePreemptiveCallbackIn ) { long status; - static epicsThreadOnceId once = EPICS_THREAD_ONCE_INIT; unsigned abovePriority; if ( ! osiSockAttach () ) { diff --git a/src/ca/getCopy.cpp b/src/ca/getCopy.cpp index d5b4c1cd8..b767c79be 100644 --- a/src/ca/getCopy.cpp +++ b/src/ca/getCopy.cpp @@ -22,7 +22,7 @@ tsFreeList < class getCopy, 1024 > getCopy::freeList; epicsMutex getCopy::freeListMutex; -getCopy::getCopy ( cac &cacCtxIn, chtype typeIn, +getCopy::getCopy ( cac &cacCtxIn, unsigned typeIn, unsigned long countIn, void *pValueIn ) : count ( countIn ), cacCtx ( cacCtxIn ), pValue ( pValueIn ), readSeq ( cacCtxIn.sequenceNumberOfOutstandingIO () ), type ( typeIn ) diff --git a/src/ca/nciu.cpp b/src/ca/nciu.cpp index 8efed0ce9..b291b216f 100644 --- a/src/ca/nciu.cpp +++ b/src/ca/nciu.cpp @@ -489,8 +489,9 @@ void nciu::show ( unsigned level ) const printf ( "Channel \"%s\", connected to server %s", this->pNameStr, hostNameTmp ); if ( level > 1u ) { + int tmpTypeCode = static_cast < int > ( this->typeCode ); printf ( ", native type %s, native element count %u", - dbf_type_to_text ( this->typeCode ), this->count ); + dbf_type_to_text ( tmpTypeCode ), this->count ); printf ( ", %sread access, %swrite access", this->accessRightState.read_access ? "" : "no ", this->accessRightState.write_access ? "" : "no "); @@ -505,8 +506,8 @@ void nciu::show ( unsigned level ) const } if ( level > 2u ) { - printf ( "\tnetwork IO pointer=%p\n", - this->piiu ); + printf ( "\tnetwork IO pointer = %p\n", + static_cast ( this->piiu ) ); printf ( "\tserver identifier %u\n", this->sid ); printf ( "\tsearch retry number=%u, search retry sequence number=%u\n", this->retry, this->retrySeqNo ); diff --git a/src/ca/oldAccess.h b/src/ca/oldAccess.h index d01525b4e..ca311f21d 100644 --- a/src/ca/oldAccess.h +++ b/src/ca/oldAccess.h @@ -44,7 +44,7 @@ private: class getCopy : public cacNotify { public: - getCopy ( cac &cacCtx, chtype type, + getCopy ( cac &cacCtx, unsigned type, unsigned long count, void *pValue ); void release (); void * operator new ( size_t size ); @@ -57,7 +57,7 @@ private: cac &cacCtx; void *pValue; unsigned readSeq; - chtype type; + unsigned type; void completionNotify ( cacChannelIO & ); void completionNotify ( cacChannelIO &, unsigned type, unsigned long count, const void *pData); diff --git a/src/ca/recvProcessThread.cpp b/src/ca/recvProcessThread.cpp index e67fd8583..7375103fe 100644 --- a/src/ca/recvProcessThread.cpp +++ b/src/ca/recvProcessThread.cpp @@ -142,7 +142,7 @@ void recvProcessThread::show ( unsigned level ) const printf ( "blocking for completion count %u\n", this->blockingForCompletion ); } if ( level > 1u ) { - printf ( "\tCA client at %p\n", this->pcac ); + printf ( "\tCA client at %p\n", static_cast < void * > ( this->pcac ) ); printf ( "\tshutdown command boolean %u\n", this->shutDown ); } if ( level > 2u ) {