From 26536a647ea472469252d45c6a5968de993c8d7c Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Fri, 23 Feb 2001 00:46:00 +0000 Subject: [PATCH] use C++ style late declarations --- src/ca/nciu.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/ca/nciu.cpp b/src/ca/nciu.cpp index 2ab36660e..2d7711056 100644 --- a/src/ca/nciu.cpp +++ b/src/ca/nciu.cpp @@ -150,9 +150,7 @@ int nciu::read ( unsigned type, unsigned long countIn, void *pValue ) */ LOCAL int check_a_dbr_string ( const char *pStr, const unsigned count ) { - unsigned i; - - for ( i = 0; i < count; i++ ) { + for ( unsigned i = 0; i < count; i++ ) { unsigned int strsize = 0; while ( pStr[strsize++] != '\0' ) { if ( strsize >= MAX_STRING_SIZE ) { @@ -167,8 +165,6 @@ LOCAL int check_a_dbr_string ( const char *pStr, const unsigned count ) int nciu::write ( unsigned type, unsigned long countIn, const void *pValue ) { - int status; - // check this first so thet get a decent diagnostic if ( ! this->f_connected ) { return ECA_DISCONNCHID; @@ -183,7 +179,7 @@ int nciu::write ( unsigned type, unsigned long countIn, const void *pValue ) } if ( type == DBR_STRING ) { - status = check_a_dbr_string ( (char *) pValue, countIn ); + int status = check_a_dbr_string ( (char *) pValue, countIn ); if ( status != ECA_NORMAL ) { return status; } @@ -194,8 +190,6 @@ int nciu::write ( unsigned type, unsigned long countIn, const void *pValue ) int nciu::write ( unsigned type, unsigned long countIn, const void *pValue, cacNotify ¬ify ) { - int status; - // check this first so thet get a decent diagnostic if ( ! this->f_connected ) { return ECA_DISCONNCHID; @@ -210,7 +204,7 @@ int nciu::write ( unsigned type, unsigned long countIn, const void *pValue, cacN } if ( type == DBR_STRING ) { - status = check_a_dbr_string ( (char *) pValue, countIn ); + int status = check_a_dbr_string ( (char *) pValue, countIn ); if ( status != ECA_NORMAL ) { return status; }