From 11180d0c9c234899d9fb952a7f014eab15fef450 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 2 Oct 2008 15:43:04 +0000 Subject: [PATCH] patch for DECXX compiler detected issues (found by Kazuro FURUKAWA) see --- src/ca/comBuf.h | 2 ++ src/ca/comQueSend.cpp | 7 ++----- src/ca/comQueSend.h | 3 +++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ca/comBuf.h b/src/ca/comBuf.h index dee58e542..2f6c6faa1 100644 --- a/src/ca/comBuf.h +++ b/src/ca/comBuf.h @@ -116,6 +116,8 @@ private: epicsUInt8 buf [ comBufSize ]; void * operator new ( size_t size ); void operator delete ( void * ); + template < class T > + bool push ( const T * ); // disabled }; inline void * comBuf::operator new ( size_t size, diff --git a/src/ca/comQueSend.cpp b/src/ca/comQueSend.cpp index 4a29b4db5..5ae150be2 100644 --- a/src/ca/comQueSend.cpp +++ b/src/ca/comQueSend.cpp @@ -106,10 +106,7 @@ void comQueSend::clear () void comQueSend::copy_dbr_string ( const void * pValue ) { - // this extra step is required by Borland BCC 5.5 - const dbr_string_t & str = - * static_cast ( pValue ); - this->push ( str ); + this->push ( static_cast < const char * > ( pValue ), MAX_STRING_SIZE ); } void comQueSend::copy_dbr_short ( const void * pValue ) @@ -186,7 +183,7 @@ const comQueSend::copyScalarFunc_t comQueSend::dbrCopyScalar [39] = { void comQueSend::copy_dbr_string ( const void *pValue, unsigned nElem ) { - this->push ( static_cast ( pValue ), nElem ); + this->push ( static_cast < const char * > ( pValue ), nElem * MAX_STRING_SIZE ); } void comQueSend::copy_dbr_short ( const void *pValue, unsigned nElem ) diff --git a/src/ca/comQueSend.h b/src/ca/comQueSend.h index 721a19b7f..c1be89440 100644 --- a/src/ca/comQueSend.h +++ b/src/ca/comQueSend.h @@ -149,6 +149,9 @@ private: this->pushComBuf ( *pComBuf ); } + template < class T > + inline void push ( const T * ); // disabled + comQueSend ( const comQueSend & ); comQueSend & operator = ( const comQueSend & ); };