From 162072dbd4088fe1b36a3ce30e07dc06cc9ab321 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Mon, 24 Feb 2003 17:19:07 +0000 Subject: [PATCH] fixed gnu warning --- src/ca/comQueRecv.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/ca/comQueRecv.h b/src/ca/comQueRecv.h index c2f0ebf59..5c55ad3ea 100644 --- a/src/ca/comQueRecv.h +++ b/src/ca/comQueRecv.h @@ -127,24 +127,24 @@ inline epicsUInt8 comQueRecv::popUInt8 () inline epicsUInt16 comQueRecv::popUInt16 () { comBuf * pComBuf = this->bufs.first (); - if ( pComBuf ) { - // try first for all in one buffer efficent version - // (double check here avoids slow C++ exception) - // (hopefully optimizer removes inside check) - unsigned bytesAvailable = pComBuf->occupiedBytes(); - if ( bytesAvailable > sizeof ( epicsUInt16 ) ) { - this->nBytesPending -= sizeof ( epicsUInt16 ); - return pComBuf->popUInt16 (); - } - else if ( bytesAvailable == sizeof ( epicsUInt16 ) ) { - this->nBytesPending -= sizeof ( epicsUInt16 ); - epicsUInt16 tmp = pComBuf->popUInt16 (); - this->removeAndDestroyBuf ( *pComBuf ); - return tmp; - } - return this->multiBufferPopUInt16 (); + if ( ! pComBuf ) { + comBuf::throwInsufficentBytesException (); } - comBuf::throwInsufficentBytesException (); + // try first for all in one buffer efficent version + // (double check here avoids slow C++ exception) + // (hopefully optimizer removes inside check) + unsigned bytesAvailable = pComBuf->occupiedBytes (); + if ( bytesAvailable > sizeof ( epicsUInt16 ) ) { + this->nBytesPending -= sizeof ( epicsUInt16 ); + return pComBuf->popUInt16 (); + } + else if ( bytesAvailable == sizeof ( epicsUInt16 ) ) { + this->nBytesPending -= sizeof ( epicsUInt16 ); + epicsUInt16 tmp = pComBuf->popUInt16 (); + this->removeAndDestroyBuf ( *pComBuf ); + return tmp; + } + return this->multiBufferPopUInt16 (); } // optimization here complicates this function somewhat