From e7a613e60aa4d880b701a1fc3a625c4261de5ed0 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 7 Jan 2003 15:57:31 +0000 Subject: [PATCH] reinterpret cast not required when casting a void * pointer to another pointer type --- src/cas/generic/casDGClient.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cas/generic/casDGClient.cc b/src/cas/generic/casDGClient.cc index 451b4422e..9a30d1d2d 100644 --- a/src/cas/generic/casDGClient.cc +++ b/src/cas/generic/casDGClient.cc @@ -369,7 +369,7 @@ outBufClient::flushCondition casDGClient::xSend ( char *pBufIn, // X aCC 361 bufSizeT totalBytes = 0; while ( totalBytes < nBytesNeedToBeSent ) { - cadg *pHdr = reinterpret_cast(&pBufIn[totalBytes]); + cadg *pHdr = reinterpret_cast < cadg * > ( & pBufIn[totalBytes] ); assert ( totalBytes <= bufSizeT_MAX-pHdr->cadg_nBytes ); assert ( totalBytes + pHdr->cadg_nBytes <= nBytesAvailableToSend ); @@ -414,9 +414,9 @@ inBufClient::fillCondition casDGClient::xRecv (char *pBufIn, bufSizeT nBytesToRe cadg *pHdr; while (pAfter-pCurBuf >= static_cast(MAX_UDP_RECV+sizeof(cadg))) { - pHdr = reinterpret_cast(pCurBuf); - stat = this->osdRecv (reinterpret_cast(pHdr+1), MAX_UDP_RECV, parm, - nDGBytesRecv, pHdr->cadg_addr); + pHdr = reinterpret_cast < cadg * > ( pCurBuf ); + stat = this->osdRecv ( reinterpret_cast < char * > ( pHdr + 1 ), + MAX_UDP_RECV, parm, nDGBytesRecv, pHdr->cadg_addr); if (stat==casFillProgress) { pHdr->cadg_nBytes = nDGBytesRecv + sizeof(*pHdr); pCurBuf += pHdr->cadg_nBytes; @@ -468,7 +468,7 @@ caStatus casDGClient::asyncSearchResponse ( const caNetAddr & outAddr, return S_cas_sendBlocked; } - cadg * pRespHdr = reinterpret_cast ( pRaw ); + cadg * pRespHdr = static_cast < cadg * > ( pRaw ); // insert version header at the start of the reply message this->sendVersion (); @@ -502,7 +502,7 @@ caStatus casDGClient::processDG () status = S_cas_success; while ( ( bytesLeft = this->in.bytesPresent() ) ) { bufSizeT dgInBytesConsumed; - const cadg * pReqHdr = reinterpret_cast ( this->in.msgPtr () ); + const cadg * pReqHdr = reinterpret_cast < cadg * > ( this->in.msgPtr () ); if (bytesLeftin.removeMsg (bytesLeft); @@ -527,7 +527,7 @@ caStatus casDGClient::processDG () // insert version header at the start of the reply message this->sendVersion (); - cadg * pRespHdr = reinterpret_cast (pRaw); + cadg * pRespHdr = static_cast < cadg * > ( pRaw ); // // select the next DG in the input stream and start processing it @@ -593,7 +593,7 @@ caStatus casDGClient::processDG () { cadg *pReqHdrMove; cadg copy = *pReqHdr; - pReqHdrMove = reinterpret_cast ( this->in.msgPtr () ); + pReqHdrMove = reinterpret_cast < cadg * > ( this->in.msgPtr () ); pReqHdrMove->cadg_addr = copy.cadg_addr; pReqHdrMove->cadg_nBytes = copy.cadg_nBytes - dgInBytesConsumed; }