From a9c15d34e77a11216b10368568ec1496ecd705ae Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 17 Sep 2002 17:52:20 +0000 Subject: [PATCH] set the bounds when asking for the string table --- src/cas/generic/casPVI.cc | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/cas/generic/casPVI.cc b/src/cas/generic/casPVI.cc index 22f56d503..c45953348 100644 --- a/src/cas/generic/casPVI.cc +++ b/src/cas/generic/casPVI.cc @@ -16,6 +16,7 @@ */ #include "gddAppTable.h" // EPICS application type table +#include "gddApps.h" #include "dbMapper.h" // EPICS application type table #include "server.h" @@ -157,9 +158,6 @@ caStatus casPVI::attachToServer ( caServerI & cas ) // caStatus casPVI::updateEnumStringTable ( casCtx & ctx ) { - static const aitUint32 stringTableTypeStaticInit = 0xffffffff; - static aitUint32 stringTableType = stringTableTypeStaticInit; - // // keep trying to fill in the table if client disconnects // prevented previous asynchronous IO from finishing, but if @@ -169,18 +167,11 @@ caStatus casPVI::updateEnumStringTable ( casCtx & ctx ) return S_cas_success; } - // - // lazy init - // - if ( stringTableType == stringTableTypeStaticInit ) { - stringTableType = - gddApplicationTypeTable::app_table.registerApplicationType ("enums"); - } - // // create a gdd with the "enum string table" application type // - gdd *pTmp = new gddScalar ( stringTableType ); + // gddArray(int app, aitEnum prim, int dimen, ...); + gdd *pTmp = new gddScalar ( gddAppType_enums ); if ( pTmp == NULL ) { errMessage ( S_cas_noMemory, "unable to read application type \"enums\" string" @@ -188,6 +179,16 @@ caStatus casPVI::updateEnumStringTable ( casCtx & ctx ) return S_cas_noMemory; } + bool success = convertContainerMemberToAtomic ( *pTmp, + gddAppType_enums, MAX_ENUM_STATES ); + if ( ! success ) { + pTmp->unreference (); + errMessage ( S_cas_noMemory, + "unable to read application type \"enums\" string" + " conversion table for enumerated PV"); + return S_cas_noMemory; + } + // // read the enum string table // @@ -202,7 +203,7 @@ caStatus casPVI::updateEnumStringTable ( casCtx & ctx ) else if ( status ) { pTmp->unreference (); errMessage ( status, - "unable to read application type \"enums\" string" + "- unable to read application type \"enums\" string" " conversion table for enumerated PV"); return status; }