From b8c7f8f8b67aba69c099420604bc56029abef159 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 3 May 2000 00:47:16 +0000 Subject: [PATCH] fixes for various sun pro compiler warnings --- src/ca/access.cpp | 12 ++--- src/ca/cacChannel.cpp | 4 +- src/ca/cadef.h | 3 +- src/ca/getCallback.cpp | 3 +- src/ca/inetAddrID_IL.h | 1 + src/ca/iocinf.h | 16 +++--- src/ca/nciu.cpp | 98 +++++++++++++++++++------------------ src/ca/netReadCopyIO.cpp | 19 ++++--- src/ca/netSubscription.cpp | 44 ++++++++++------- src/ca/netWriteNotifyIO.cpp | 4 +- src/ca/oldAccess.h | 1 + src/ca/oldSubscription.cpp | 3 +- src/ca/putCallback.cpp | 3 +- src/ca/syncGroupNotify.cpp | 12 ++++- src/ca/tcpiiu.cpp | 50 +++++++++---------- src/ca/udpiiu.cpp | 14 ++++-- 16 files changed, 162 insertions(+), 125 deletions(-) diff --git a/src/ca/access.cpp b/src/ca/access.cpp index a8bae7626..c5552a152 100644 --- a/src/ca/access.cpp +++ b/src/ca/access.cpp @@ -87,7 +87,7 @@ extern "C" void ca_default_exception_handler (struct exception_handler_args args } } -void caClientExitHandler () +extern "C" void caClientExitHandler () { if ( caClientContextId ) { threadPrivateDelete ( caClientContextId ); @@ -335,8 +335,9 @@ int epicsShareAPI ca_add_exception_event (caExceptionHandler *pfunc, void *arg) * ca_add_masked_array_event */ int epicsShareAPI ca_add_masked_array_event (chtype type, unsigned long count, chid pChan, - caEventCallBackFunc *pCallBack, void *pCallBackArg, ca_real p_delta, - ca_real n_delta, ca_real timeout, evid *monixptr, long mask) + caEventCallBackFunc *pCallBack, void *pCallBackArg, + ca_real, ca_real, ca_real, + evid *monixptr, long mask) { static const long maskMask = USHRT_MAX; oldSubscription *pSubsr; @@ -385,7 +386,6 @@ int epicsShareAPI ca_add_masked_array_event (chtype type, unsigned long count, c return status; } - /* * * ca_clear_event () @@ -831,7 +831,7 @@ unsigned epicsShareAPI ca_get_ioc_connection_count () return pcac->connectionCount (); } -void netiiu::show (unsigned /* level */) +void netiiu::show (unsigned /* level */) const { nciu *pChan; @@ -1211,4 +1211,4 @@ extern epicsShareDef const char *dbr_text[LAST_BUFFER_TYPE+1] = { extern epicsShareDef const char *dbr_text_invalid = "DBR_invalid"; extern epicsShareDef const short dbr_text_dim = (sizeof dbr_text) / (sizeof (char *)) + 1; -} \ No newline at end of file +} diff --git a/src/ca/cacChannel.cpp b/src/ca/cacChannel.cpp index c2422d1d7..7e773f57b 100644 --- a/src/ca/cacChannel.cpp +++ b/src/ca/cacChannel.cpp @@ -238,12 +238,12 @@ void cacChannel::connectTimeoutNotify () { } -void cacChannel::lock () const +void cacChannel::lock () { this->defaultMutex.lock(); } -void cacChannel::unlock () const +void cacChannel::unlock () { this->defaultMutex.unlock(); } diff --git a/src/ca/cadef.h b/src/ca/cadef.h index 98c85d33e..cb41f4c75 100644 --- a/src/ca/cadef.h +++ b/src/ca/cadef.h @@ -723,7 +723,8 @@ epicsShareFunc void epicsShareAPI ca_signal_formated (long ca_status, const char */ epicsShareFunc const char * epicsShareAPI ca_host_name (chid channel); /* thread safe version */ -epicsShareFunc void epicsShareAPI ca_get_host_name ( chid pChan, char *pBuf, unsigned bufLength ); +epicsShareFunc void epicsShareAPI ca_get_host_name ( chid pChan, + char *pBuf, unsigned bufLength ); /* * CA_ADD_FD_REGISTRATION diff --git a/src/ca/getCallback.cpp b/src/ca/getCallback.cpp index 6e6e38c4d..0f47e48a5 100644 --- a/src/ca/getCallback.cpp +++ b/src/ca/getCallback.cpp @@ -46,7 +46,8 @@ void getCallback::completionNotify ( unsigned type, unsigned long count, const v (*this->pFunc) (args); } -void getCallback::exceptionNotify (int status, const char *pContext) +void getCallback::exceptionNotify (int status, + const char * /* pContext */) { struct event_handler_args args; args.usr = this->pPrivate; diff --git a/src/ca/inetAddrID_IL.h b/src/ca/inetAddrID_IL.h index b3b4692cf..70a1ec661 100644 --- a/src/ca/inetAddrID_IL.h +++ b/src/ca/inetAddrID_IL.h @@ -42,3 +42,4 @@ inline unsigned inetAddrID::minIndexBitWidth () { return 8u; } + diff --git a/src/ca/iocinf.h b/src/ca/iocinf.h index 3f98b34d3..7ef98dd35 100644 --- a/src/ca/iocinf.h +++ b/src/ca/iocinf.h @@ -147,8 +147,8 @@ public: protected: class cacChannelIO *pChannelIO; - virtual void lock () const; - virtual void unlock () const; + virtual void lock (); + virtual void unlock (); private: virtual void ioAttachNotify (); @@ -392,7 +392,7 @@ class netiiu : public baseIIU { public: netiiu (class cac *pcac); ~netiiu (); - void show (unsigned level); + void show (unsigned level) const; virtual bool compareIfTCP (nciu &chan, const sockaddr_in &) const = 0; virtual void hostName (char *pBuf, unsigned bufLength) const = 0; @@ -582,7 +582,7 @@ public: bool pushPending; bool beaconAnomaly; - virtual void show (unsigned level) const; + virtual void show (unsigned level) const; private: @@ -670,8 +670,8 @@ private: void completionNotify ( unsigned type, unsigned long count, const void *pData ); void exceptionNotify ( int status, const char *pContext ); void exceptionNotify ( int status, const char *pContext, unsigned type, unsigned long count ); - void lock () const; - void unlock () const; + void lock (); + void unlock (); ~syncGroupNotify (); // allocate only from pool struct CASG &sg; @@ -739,8 +739,8 @@ public: unsigned readSequence () const; int pend (double timeout, int early); bool ioComplete () const; - void lock () const; - void unlock () const; + void lock (); + void unlock (); void exceptionNotify (int status, const char *pContext, const char *pFileName, unsigned lineNo); void exceptionNotify (int status, const char *pContext, diff --git a/src/ca/nciu.cpp b/src/ca/nciu.cpp index a2e17add2..de8894d17 100644 --- a/src/ca/nciu.cpp +++ b/src/ca/nciu.cpp @@ -109,7 +109,7 @@ nciu::~nciu () UNLOCK ( piiuCopy->pcas ); // remove clears this->piiu } -int nciu::read ( unsigned type, unsigned long count, cacNotify ¬ify ) +int nciu::read ( unsigned type, unsigned long countIn, cacNotify ¬ify ) { int status; caHdr hdr; @@ -129,11 +129,11 @@ int nciu::read ( unsigned type, unsigned long count, cacNotify ¬ify ) if ( ! this->ar.read_access ) { return ECA_NORDACCESS; } - if ( count > this->count || count > 0xffff ) { + if ( countIn > this->count || countIn > 0xffff ) { return ECA_BADCOUNT; } - if ( count == 0 ) { - count = this->count; + if ( countIn == 0 ) { + countIn = this->count; } /* @@ -141,7 +141,7 @@ int nciu::read ( unsigned type, unsigned long count, cacNotify ¬ify ) * them down to a smaller size */ type_u16 = (ca_uint16_t) type; - count_u16 = (ca_uint16_t) count; + count_u16 = (ca_uint16_t) countIn; LOCK (this->piiu->pcas); { @@ -172,7 +172,7 @@ int nciu::read ( unsigned type, unsigned long count, cacNotify ¬ify ) return status; } -int nciu::read ( unsigned type, unsigned long count, void *pValue ) +int nciu::read ( unsigned type, unsigned long countIn, void *pValue ) { int status; caHdr hdr; @@ -192,11 +192,11 @@ int nciu::read ( unsigned type, unsigned long count, void *pValue ) if ( ! this->ar.read_access ) { return ECA_NORDACCESS; } - if ( count > this->count || count > 0xffff ) { + if ( countIn > this->count || countIn > 0xffff ) { return ECA_BADCOUNT; } - if ( count == 0 ) { - count = this->count; + if ( countIn == 0 ) { + countIn = this->count; } /* @@ -204,11 +204,12 @@ int nciu::read ( unsigned type, unsigned long count, void *pValue ) * them down to a smaller size */ type_u16 = ( ca_uint16_t ) type; - count_u16 = ( ca_uint16_t ) count; + count_u16 = ( ca_uint16_t ) countIn; LOCK ( this->piiu->pcas ); { - netReadCopyIO *monix = new netReadCopyIO ( *this, type, count, pValue, this->readSequence () ); + netReadCopyIO *monix = new netReadCopyIO ( *this, + type, countIn, pValue, this->readSequence () ); if ( ! monix ) { UNLOCK ( this->piiu->pcas ); return ECA_ALLOCMEM; @@ -314,8 +315,8 @@ LOCAL void *malloc_put_convert (cac *pcac, unsigned long size) /* * nciu::issuePut () */ -int nciu::issuePut (ca_uint16_t cmd, unsigned id, chtype type, - unsigned long count, const void *pvalue) +int nciu::issuePut ( ca_uint16_t cmd, unsigned idIn, chtype type, + unsigned long countIn, const void *pvalue ) { int status; caHdr hdr; @@ -344,17 +345,17 @@ int nciu::issuePut (ca_uint16_t cmd, unsigned id, chtype type, if ( ! this->ar.write_access ) { return ECA_NOWTACCESS; } - if ( count > this->count || count > 0xffff || count == 0 ) { + if ( countIn > this->count || countIn > 0xffff || countIn == 0 ) { return ECA_BADCOUNT; } if (type==DBR_STRING) { - status = check_a_dbr_string ( (char *) pvalue, count ); + status = check_a_dbr_string ( (char *) pvalue, countIn ); if (status != ECA_NORMAL) { return status; } } - postcnt = dbr_size_n (type,count); - if (postcnt>0xffff) { + postcnt = dbr_size_n ( type, countIn ); + if ( postcnt > 0xffff ) { return ECA_TOLARGE; } @@ -363,9 +364,9 @@ int nciu::issuePut (ca_uint16_t cmd, unsigned id, chtype type, * them down to a smaller size */ type_u16 = (ca_uint16_t) type; - count_u16 = (ca_uint16_t) count; + count_u16 = (ca_uint16_t) countIn; - if (type == DBR_STRING && count == 1) { + if (type == DBR_STRING && countIn == 1) { char *pstr = (char *)pvalue; postcnt = strlen(pstr)+1; @@ -432,7 +433,7 @@ int nciu::issuePut (ca_uint16_t cmd, unsigned id, chtype type, return ECA_BADTYPE; } - if (++i>=count) { + if ( ++i >= countIn ) { break; } @@ -448,7 +449,7 @@ int nciu::issuePut (ca_uint16_t cmd, unsigned id, chtype type, hdr.m_dataType = htons (type_u16); hdr.m_count = htons (count_u16); hdr.m_cid = this->sid; - hdr.m_available = id; + hdr.m_available = idIn; hdr.m_postsize = (ca_uint16_t) postcnt; status = this->piiu->pushStreamMsg (&hdr, pvalue, true); @@ -460,15 +461,15 @@ int nciu::issuePut (ca_uint16_t cmd, unsigned id, chtype type, return status; } -int nciu::write (unsigned type, unsigned long count, const void *pValue) +int nciu::write (unsigned type, unsigned long countIn, const void *pValue) { - return this->issuePut (CA_PROTO_WRITE, ~0U, type, count, pValue); + return this->issuePut (CA_PROTO_WRITE, ~0U, type, countIn, pValue); } -int nciu::write (unsigned type, unsigned long count, const void *pValue, cacNotify ¬ify) +int nciu::write (unsigned type, unsigned long countIn, const void *pValue, cacNotify ¬ify) { netWriteNotifyIO *monix; - unsigned id; + unsigned newId; int status; if ( ! this->f_connected ) { @@ -492,29 +493,30 @@ int nciu::write (unsigned type, unsigned long count, const void *pValue, cacNoti return ECA_ALLOCMEM; } - id = monix->getId (); + newId = monix->getId (); UNLOCK (this->piiu->pcas); - status = this->issuePut (CA_PROTO_WRITE_NOTIFY, id, type, count, pValue); + status = this->issuePut (CA_PROTO_WRITE_NOTIFY, id, + type, countIn, pValue); if ( status != ECA_NORMAL ) { /* * we need to be careful about touching the monix * pointer after the lock has been released */ - this->piiu->pcas->safeDestroyNMIU (id); + this->piiu->pcas->safeDestroyNMIU ( newId ); } return status; } -int nciu::subscribe (unsigned type, unsigned long count, +int nciu::subscribe (unsigned type, unsigned long countIn, unsigned mask, cacNotify ¬ify) { netSubscription *pNetMon; LOCK (this->piiu->pcas); - pNetMon = new netSubscription (*this, type, count, + pNetMon = new netSubscription (*this, type, countIn, static_cast (mask), notify); if ( ! pNetMon ) { UNLOCK (this->piiu->pcas); @@ -591,21 +593,22 @@ unsigned nciu::searchAttempts () const return this->retry; } -void nciu::connect (tcpiiu &iiu, unsigned nativeType, unsigned long nativeCount, unsigned sid) +void nciu::connect ( tcpiiu &iiu, unsigned nativeType, + unsigned long nativeCount, unsigned sidIn ) { LOCK ( iiu.pcas ); if ( this->connected () ) { ca_printf ( "CAC: Ignored conn resp to conn chan CID=%u SID=%u?\n", - this->getId (), this->sid ); + this->getId (), sidIn ); UNLOCK ( iiu.pcas ); return; } this->typeCode = nativeType; this->count = nativeCount; - this->sid = sid; + this->sid = sidIn; this->f_connected = true; this->previousConn = true; @@ -670,11 +673,11 @@ void nciu::disconnect () */ int nciu::searchMsg () { - udpiiu *piiu = this->piiu->pcas->pudpiiu; + udpiiu *pudpiiu = this->piiu->pcas->pudpiiu; int status; caHdr msg; - if ( this->piiu != static_cast (piiu) ) { + if ( this->piiu != static_cast (pudpiiu) ) { return ECA_INTERNAL; } @@ -712,17 +715,18 @@ int nciu::searchMsg () return ECA_NORMAL; } -void nciu::searchReplySetUp (unsigned sid, unsigned typeCode, unsigned long count) +void nciu::searchReplySetUp ( unsigned sidIn, + unsigned typeIn, unsigned long countIn ) { - this->typeCode = typeCode; - this->count = count; - this->sid = sid; + this->typeCode = typeIn; + this->count = countIn; + this->sid = sidIn; } /* * nciu::claimMsg () */ -bool nciu::claimMsg (tcpiiu *piiu) +bool nciu::claimMsg ( tcpiiu *piiuIn ) { caHdr hdr; unsigned size; @@ -743,7 +747,7 @@ bool nciu::claimMsg (tcpiiu *piiu) hdr = cacnullmsg; hdr.m_cmmd = htons (CA_PROTO_CLAIM_CIU); - if ( CA_V44 (CA_PROTOCOL_VERSION, piiu->minor_version_number) ) { + if ( CA_V44 (CA_PROTOCOL_VERSION, piiuIn->minor_version_number) ) { hdr.m_cid = this->getId (); pStr = this->pNameStr; size = this->nameLength; @@ -769,22 +773,22 @@ bool nciu::claimMsg (tcpiiu *piiu) * of a push pull deadlock (since this is sent when * parsing the UDP input buffer). */ - status = piiu->pushStreamMsg (&hdr, pStr, false); + status = piiuIn->pushStreamMsg (&hdr, pStr, false); if ( status == ECA_NORMAL ) { /* * move to the end of the list once the claim has been sent */ this->claimPending = FALSE; - piiu->chidList.remove (*this); - piiu->chidList.add (*this); + piiuIn->chidList.remove (*this); + piiuIn->chidList.add (*this); - if ( ! CA_V42 (CA_PROTOCOL_VERSION, piiu->minor_version_number) ) { - this->connect (*piiu, this->typeCode, this->count, this->sid); + if ( ! CA_V42 (CA_PROTOCOL_VERSION, piiuIn->minor_version_number) ) { + this->connect (*piiuIn, this->typeCode, this->count, this->sid); } } else { - piiu->claimRequestsPending = true; + piiuIn->claimRequestsPending = true; } UNLOCK (this->piiu->pcas); diff --git a/src/ca/netReadCopyIO.cpp b/src/ca/netReadCopyIO.cpp index 53c16785e..e52b11c63 100644 --- a/src/ca/netReadCopyIO.cpp +++ b/src/ca/netReadCopyIO.cpp @@ -37,13 +37,16 @@ void netReadCopyIO::completionNotify () this->exceptionNotify ( ECA_INTERNAL, "get completion callback with no data?" ); } -void netReadCopyIO::completionNotify ( unsigned type, unsigned long count, const void *pData ) +void netReadCopyIO::completionNotify ( unsigned typeIn, + unsigned long countIn, const void *pDataIn ) { - if ( type <= (unsigned) LAST_BUFFER_TYPE ) { + if ( typeIn <= (unsigned) LAST_BUFFER_TYPE ) { # ifdef CONVERSION_REQUIRED - (*cac_dbr_cvrt[type]) ( pData, this->pValue, FALSE, count ); + (*cac_dbr_cvrt[type]) ( pDataIn, this->pValue, + FALSE, countIn ); # else - memcpy ( this->pValue, pData, dbr_size_n ( type, count ) ); + memcpy ( this->pValue, pDataIn, + dbr_size_n ( typeIn, countIn ) ); # endif chan.decrementOutstandingIO (this->seqNumber); } @@ -57,10 +60,12 @@ void netReadCopyIO::exceptionNotify ( int status, const char *pContext ) ca_signal (status, pContext); } -void netReadCopyIO::exceptionNotify ( int status, const char *pContext, unsigned type, unsigned long count ) +void netReadCopyIO::exceptionNotify ( int status, + const char *pContextIn, unsigned typeIn, unsigned long countIn ) { - ca_signal_formated (status, __FILE__, __LINE__, "%s type=%d count=%ld\n", - pContext, type, count); + ca_signal_formated (status, __FILE__, __LINE__, + "%s type=%d count=%ld\n", + pContextIn, typeIn, countIn); } void * netReadCopyIO::operator new ( size_t size ) diff --git a/src/ca/netSubscription.cpp b/src/ca/netSubscription.cpp index 4c8e70392..fd3823b80 100644 --- a/src/ca/netSubscription.cpp +++ b/src/ca/netSubscription.cpp @@ -25,20 +25,20 @@ netSubscription::~netSubscription () { if ( this->chan.connected () ) { caHdr hdr; - ca_uint16_t type, count; + ca_uint16_t type_16, count_16; - type = (ca_uint16_t) this->chan.nativeType (); + type_16 = (ca_uint16_t) this->chan.nativeType (); if ( this->chan.nativeElementCount () > 0xffff ) { - count = 0xffff; + count_16 = 0xffff; } else { - count = (ca_uint16_t) this->chan.nativeElementCount (); + count_16 = (ca_uint16_t) this->chan.nativeElementCount (); } hdr.m_cmmd = htons (CA_PROTO_EVENT_CANCEL); hdr.m_available = this->id; - hdr.m_dataType = htons (type); - hdr.m_count = htons (count); + hdr.m_dataType = htons ( type_16 ); + hdr.m_count = htons ( count_16 ); hdr.m_cid = this->chan.sid; hdr.m_postsize = 0; @@ -53,7 +53,7 @@ void netSubscription::destroy() int netSubscription::subscriptionMsg () { - unsigned long count; + unsigned long tmpCount; struct monops msg; ca_float32_t p_delta; ca_float32_t n_delta; @@ -64,26 +64,28 @@ int netSubscription::subscriptionMsg () * specify zero */ if ( this->count > this->chan.nativeElementCount () ){ - count = this->chan.nativeElementCount (); + tmpCount = this->chan.nativeElementCount (); } else { - count = this->count; + tmpCount = this->count; } /* * dont allow overflow when converting to ca_uint16_t */ - if ( count > 0xffff ) { - count = 0xffff; + if ( tmpCount > 0xffff ) { + tmpCount = 0xffff; } /* msg header */ msg.m_header.m_cmmd = htons (CA_PROTO_EVENT_ADD); msg.m_header.m_available = this->id; - msg.m_header.m_dataType = htons ( static_cast (this->type) ); - msg.m_header.m_count = htons ( static_cast (count) ); + msg.m_header.m_dataType = + htons ( static_cast (this->type) ); + msg.m_header.m_count = + htons ( static_cast ( tmpCount ) ); msg.m_header.m_cid = this->chan.sid; - msg.m_header.m_postsize = sizeof (msg.m_info); + msg.m_header.m_postsize = sizeof ( msg.m_info ); /* msg body */ p_delta = 0.0; @@ -98,7 +100,7 @@ int netSubscription::subscriptionMsg () return this->chan.piiu->pushStreamMsg (&msg.m_header, &msg.m_info, true); } -void netSubscription::disconnect ( const char *pHostName ) +void netSubscription::disconnect ( const char * /* pHostName */ ) { } @@ -107,9 +109,10 @@ void netSubscription::completionNotify () this->cacNotifyIO::completionNotify (); } -void netSubscription::completionNotify ( unsigned type, unsigned long count, const void *pData ) +void netSubscription::completionNotify ( unsigned typeIn, + unsigned long countIn, const void *pDataIn ) { - this->cacNotifyIO::completionNotify ( type, count, pData ); + this->cacNotifyIO::completionNotify ( typeIn, countIn, pDataIn ); } void netSubscription::exceptionNotify ( int status, const char *pContext ) @@ -117,7 +120,10 @@ void netSubscription::exceptionNotify ( int status, const char *pContext ) this->cacNotifyIO::exceptionNotify ( status, pContext ); } -void netSubscription::exceptionNotify ( int status, const char *pContext, unsigned type, unsigned long count ) +void netSubscription::exceptionNotify ( int statusIn, + const char *pContextIn, unsigned typeIn, unsigned long countIn ) { - this->cacNotifyIO::exceptionNotify ( status, pContext, type, count ); + this->cacNotifyIO::exceptionNotify ( statusIn, + pContextIn, typeIn, countIn ); } + diff --git a/src/ca/netWriteNotifyIO.cpp b/src/ca/netWriteNotifyIO.cpp index b9424b7f4..af3535295 100644 --- a/src/ca/netWriteNotifyIO.cpp +++ b/src/ca/netWriteNotifyIO.cpp @@ -39,7 +39,9 @@ void netWriteNotifyIO::completionNotify () this->cacNotifyIO::completionNotify (); } -void netWriteNotifyIO::completionNotify ( unsigned type, unsigned long count, const void *pData ) +void netWriteNotifyIO::completionNotify ( + unsigned /* type */, unsigned long /* count */, + const void * /* pData */ ) { this->cacNotifyIO::completionNotify (); } diff --git a/src/ca/oldAccess.h b/src/ca/oldAccess.h index 5e79735a4..e7ef7134c 100644 --- a/src/ca/oldAccess.h +++ b/src/ca/oldAccess.h @@ -99,3 +99,4 @@ private: ~oldSubscription (); // must allocate from pool static tsFreeList < struct oldSubscription, 1024 > freeList; }; + diff --git a/src/ca/oldSubscription.cpp b/src/ca/oldSubscription.cpp index c77cc86d7..bec8af7b1 100644 --- a/src/ca/oldSubscription.cpp +++ b/src/ca/oldSubscription.cpp @@ -37,7 +37,8 @@ void oldSubscription::completionNotify (unsigned type, unsigned long count, cons (*this->pFunc) (args); } -void oldSubscription::exceptionNotify (int status, const char *pContext) +void oldSubscription::exceptionNotify (int status, + const char * /* pContext */ ) { struct event_handler_args args; diff --git a/src/ca/putCallback.cpp b/src/ca/putCallback.cpp index 3167e1513..9bf24dca8 100644 --- a/src/ca/putCallback.cpp +++ b/src/ca/putCallback.cpp @@ -47,7 +47,8 @@ void putCallback::completionNotify () (*this->pFunc) (args); } -void putCallback::exceptionNotify (int status, const char *pContext) +void putCallback::exceptionNotify (int status, + const char * /* pContext */ ) { struct event_handler_args args; diff --git a/src/ca/syncGroupNotify.cpp b/src/ca/syncGroupNotify.cpp index 7decdf7cc..54de670fa 100644 --- a/src/ca/syncGroupNotify.cpp +++ b/src/ca/syncGroupNotify.cpp @@ -98,7 +98,7 @@ void syncGroupNotify::completionNotify ( unsigned type, unsigned long count, con } } -void syncGroupNotify::show (unsigned level) const +void syncGroupNotify::show ( unsigned /* level */ ) const { printf ( "pending sg op: pVal=%p, magic=%u seqNo=%lu sg=%p\n", this->pValue, this->magic, this->seqNo, &this->sg); @@ -117,6 +117,16 @@ void syncGroupNotify::exceptionNotify ( int status, const char *pContext, unsign type, count, pContext); } +void syncGroupNotify::lock () +{ + this->sg.mutex.lock (); +} + +void syncGroupNotify::unlock () +{ + this->sg.mutex.unlock (); +} + void * syncGroupNotify::operator new (size_t size) { return syncGroupNotify::freeList.allocate ( size ); diff --git a/src/ca/tcpiiu.cpp b/src/ca/tcpiiu.cpp index eccaf033c..9b7b00f91 100644 --- a/src/ca/tcpiiu.cpp +++ b/src/ca/tcpiiu.cpp @@ -354,12 +354,12 @@ tcpiiu::tcpiiu (cac *pcac, const struct sockaddr_in &ina, unsigned minorVersion, netiiu (pcac), bhe (bheIn) { - SOCKET sock; + SOCKET newSocket; int status; int flag; - sock = socket ( AF_INET, SOCK_STREAM, IPPROTO_TCP ); - if (sock == INVALID_SOCKET) { + newSocket = socket ( AF_INET, SOCK_STREAM, IPPROTO_TCP ); + if ( newSocket == INVALID_SOCKET ) { ca_printf ("CAC: unable to create virtual circuit because \"%s\"\n", SOCKERRSTR (SOCKERRNO)); this->fc = false; @@ -371,7 +371,7 @@ tcpiiu::tcpiiu (cac *pcac, const struct sockaddr_in &ina, unsigned minorVersion, // #if 0 flag = TRUE; - status = setsockopt ( sock, IPPROTO_TCP, TCP_NODELAY, + status = setsockopt ( newSocket, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(flag) ); if (status < 0) { ca_printf ("CAC: problems setting socket option TCP_NODELAY = \"%s\"\n", @@ -379,7 +379,7 @@ tcpiiu::tcpiiu (cac *pcac, const struct sockaddr_in &ina, unsigned minorVersion, } #endif flag = TRUE; - status = setsockopt ( sock, SOL_SOCKET, SO_KEEPALIVE, + status = setsockopt ( newSocket , SOL_SOCKET, SO_KEEPALIVE, (char *)&flag, sizeof (flag) ); if (status < 0) { ca_printf ("CAC: problems setting socket option SO_KEEPALIVE = \"%s\"\n", @@ -395,14 +395,14 @@ tcpiiu::tcpiiu (cac *pcac, const struct sockaddr_in &ina, unsigned minorVersion, * if this change is made joh 11-10-98 */ i = MAX_MSG_SIZE; - status = setsockopt ( piiu->sock, SOL_SOCKET, SO_SNDBUF, + status = setsockopt ( newSocket, SOL_SOCKET, SO_SNDBUF, (char *)&i, sizeof (i) ); if (status < 0) { ca_printf ("CAC: problems setting socket option SO_SNDBUF = \"%s\"\n", SOCKERRSTR (SOCKERRNO)); } i = MAX_MSG_SIZE; - status = setsockopt (piiu->sock, SOL_SOCKET, SO_RCVBUF, + status = setsockopt (newSocket, SOL_SOCKET, SO_RCVBUF, (char *)&i, sizeof (i) ); if (status < 0) { ca_printf ("CAC: problems setting socket option SO_RCVBUF = \"%s\"\n", @@ -411,7 +411,7 @@ tcpiiu::tcpiiu (cac *pcac, const struct sockaddr_in &ina, unsigned minorVersion, } #endif - this->sock = sock; + this->sock = newSocket; this->minor_version_number = minorVersion; this->dest.ia = ina; this->contiguous_msg_count = 0u; @@ -430,7 +430,7 @@ tcpiiu::tcpiiu (cac *pcac, const struct sockaddr_in &ina, unsigned minorVersion, status = cacRingBufferConstruct (&this->recv); if (status) { ca_printf ("CA: unable to create recv ring buffer\n"); - socket_close (sock); + socket_close ( newSocket ); this->fc = false; return; } @@ -439,7 +439,7 @@ tcpiiu::tcpiiu (cac *pcac, const struct sockaddr_in &ina, unsigned minorVersion, if (status) { ca_printf ("CA: unable to create send ring buffer\n"); cacRingBufferDestroy (&this->recv); - socket_close (sock); + socket_close ( newSocket ); this->fc = false; return; } @@ -461,7 +461,7 @@ tcpiiu::tcpiiu (cac *pcac, const struct sockaddr_in &ina, unsigned minorVersion, ca_printf ("CA: unable to create CA client send thread exit semaphore\n"); cacRingBufferDestroy (&this->recv); cacRingBufferDestroy (&this->send); - socket_close (sock); + socket_close ( newSocket ); this->fc = false; return; } @@ -472,7 +472,7 @@ tcpiiu::tcpiiu (cac *pcac, const struct sockaddr_in &ina, unsigned minorVersion, semBinaryDestroy (this->sendThreadExitSignal); cacRingBufferDestroy (&this->recv); cacRingBufferDestroy (&this->send); - socket_close (sock); + socket_close ( newSocket ); this->fc = false; return; } @@ -497,7 +497,7 @@ tcpiiu::tcpiiu (cac *pcac, const struct sockaddr_in &ina, unsigned minorVersion, semBinaryDestroy (this->sendThreadExitSignal); cacRingBufferDestroy (&this->recv); cacRingBufferDestroy (&this->send); - socket_close (sock); + socket_close ( newSocket ); this->fc = false; return; } @@ -514,15 +514,15 @@ tcpiiu::tcpiiu (cac *pcac, const struct sockaddr_in &ina, unsigned minorVersion, */ void tcpiiu::shutdown () { - LOCK (this->pcas); - if (this->state != iiu_disconnected) { + LOCK ( this->pcas ); + if ( this->state != iiu_disconnected ) { this->state = iiu_disconnected; - ::shutdown (this->sock, SD_BOTH); - cacRingBufferShutDown (&this->send); - cacRingBufferShutDown (&this->recv); - this->pcas->signalRecvActivityIIU (*this); + ::shutdown ( this->sock, SD_BOTH ); + cacRingBufferShutDown ( &this->send ); + cacRingBufferShutDown ( &this->recv ); + this->pcas->signalRecvActivityIIU ( *this ); } - UNLOCK (this->pcas); + UNLOCK ( this->pcas ); } // @@ -613,7 +613,7 @@ void tcpiiu::flush () } } -void tcpiiu::show ( unsigned level ) const +void tcpiiu::show ( unsigned /* level */ ) const { } @@ -1262,7 +1262,7 @@ int tcpiiu::post_msg (char *pInBuf, unsigned long blockSize) * make sure we have a large enough message body cache */ if ( this->curMsg.m_postsize > this->curDataMax ) { - void *pCurData; + void *pData; size_t cacheSize; /* @@ -1273,14 +1273,14 @@ int tcpiiu::post_msg (char *pInBuf, unsigned long blockSize) * bytes (instead of the actual string size). */ cacheSize = max ( this->curMsg.m_postsize, MAX_STRING_SIZE ); - pCurData = (void *) calloc (1u, cacheSize); - if (!pCurData) { + pData = (void *) calloc (1u, cacheSize); + if (!pData) { return ECA_ALLOCMEM; } if (this->pCurData) { free (this->pCurData); } - this->pCurData = pCurData; + this->pCurData = pData; this->curDataMax = this->curMsg.m_postsize; } diff --git a/src/ca/udpiiu.cpp b/src/ca/udpiiu.cpp index 9ef9f578b..9f0405fa6 100644 --- a/src/ca/udpiiu.cpp +++ b/src/ca/udpiiu.cpp @@ -588,7 +588,8 @@ void udpiiu::shutdown () /* * bad_udp_resp_action () */ -LOCAL void bad_udp_resp_action (udpiiu *piiu, caHdr *pMsg, const struct sockaddr_in *pnet_addr) +LOCAL void bad_udp_resp_action (udpiiu * /* piiu */, + caHdr *pMsg, const struct sockaddr_in *pnet_addr) { char buf[256]; ipAddrToA ( pnet_addr, buf, sizeof (buf) ); @@ -740,7 +741,8 @@ LOCAL void search_resp_action (udpiiu *piiu, caHdr *pMsg, const struct sockaddr_ /* * beacon_action () */ -LOCAL void beacon_action (udpiiu *piiu, caHdr *pMsg, const struct sockaddr_in *pnet_addr) +LOCAL void beacon_action ( udpiiu * piiu, + caHdr *pMsg, const struct sockaddr_in *pnet_addr) { struct sockaddr_in ina; @@ -787,7 +789,8 @@ LOCAL void beacon_action (udpiiu *piiu, caHdr *pMsg, const struct sockaddr_in *p /* * repeater_ack_action () */ -LOCAL void repeater_ack_action (udpiiu *piiu, caHdr *pMsg, const struct sockaddr_in * /* pnet_addr */) +LOCAL void repeater_ack_action (udpiiu * piiu, + caHdr * /* pMsg */, const struct sockaddr_in * /* pnet_addr */) { piiu->repeaterContacted = 1u; # ifdef DEBUG @@ -972,7 +975,7 @@ void udpiiu::removeFromChanList (nciu *chan) UNLOCK (this->pcas); } -void udpiiu::disconnect (nciu *chan) +void udpiiu::disconnect ( nciu * /* chan */ ) { // NOOP } @@ -1015,7 +1018,8 @@ int udpiiu::pushDatagramMsg (const caHdr *pMsg, const void *pExt, ca_uint16_t ex return ECA_NORMAL; } -int udpiiu::pushStreamMsg ( const caHdr *pmsg, const void *pext, bool blockingOk ) +int udpiiu::pushStreamMsg ( const caHdr * /* pmsg */, + const void * /* pext */, bool /* blockingOk */ ) { ca_printf ("in pushStreamMsg () for a udp iiu?\n"); return ECA_DISCONNCHID;