Fixed up code in aitHelpers, removed unused variables in others

Fixed potential problem in gddAppTable.cc with the map functions
This commit is contained in:
Jim Kowalkowski
1996-06-26 21:00:08 +00:00
parent aa8cceb119
commit 91347ff65f
5 changed files with 45 additions and 18 deletions

View File

@@ -5,6 +5,9 @@
# $Id$
#
# $Log$
# Revision 1.1 1996/06/25 19:11:27 jbk
# new in EPICS base
#
# Revision 1.4 1996/06/25 18:58:57 jbk
# more fixes for the aitString management functions and mapping menus
#
@@ -118,6 +121,16 @@ If only array of 5 aitString is placed into a pre-made array of 16,
then the last 11 should be initialized to NULLs or something, same for
fixed string - especially the fixed string
************** 6/26/96 ************
aitString:copy() still has troubles. Need to correct the
aitConvertStringFloat64() and others. How are they supposed to work?
Should they be calling aitString::installString() instead of copy()? Yes,
that is the answer. In the convert functions, the temp variable
used to hold a value (character value) is always a stack variable and
needs to be copied. Maybe the temp char variable should be copied over
the existing string if it will fit. No.
Jim

View File

@@ -8,6 +8,9 @@
* $Id$
*
* $Log$
* Revision 1.1 1996/06/25 19:11:31 jbk
* new in EPICS base
*
*
*/
@@ -109,15 +112,14 @@ inline aitTimeStamp operator- (const aitTimeStamp &lhs, const aitTimeStamp &rhs)
inline int operator>= (const aitTimeStamp &lhs, const aitTimeStamp &rhs)
{
if (lhs.tv_sec>rhs.tv_sec) {
return 1;
}
else if (lhs.tv_sec==rhs.tv_sec) {
if (lhs.tv_nsec>=rhs.tv_nsec) {
return 1;
}
}
return 0;
int rc=0;
if (lhs.tv_sec>rhs.tv_sec)
rc=1;
else if(lhs.tv_sec==rhs.tv_sec)
if(lhs.tv_nsec>=rhs.tv_nsec)
rc=1;
return rc;
}
@@ -132,6 +134,7 @@ private:
int set(const char* p)
{
int rc=0;
if(p)
{
len=strlen(p);
@@ -149,7 +152,7 @@ private:
len = 0u;
type = aitStrConst;
printf("aitString: no pool => continuing with nill str\n");
return -1;
rc=-1;
}
}
else
@@ -158,7 +161,7 @@ private:
len=0u;
type=aitStrConst;
}
return 0;
return rc;
}
void cset(const char* p)

View File

@@ -4,6 +4,9 @@
// $Id$
//
// $Log$
// Revision 1.3 1996/06/26 02:42:05 jbk
// more correction to the aitString processing - testing menus
//
// Revision 1.2 1996/06/25 19:18:12 jbk
// moved from extensions to base - fixed trouble in dbMapper.cc
//
@@ -833,14 +836,13 @@ static int mapControlGddToFloat(void* v, gdd* dd)
}
// -------------map the enum structures----------------
static gdd* mapGraphicEnumToGdd(void* v, aitIndex count)
static gdd* mapGraphicEnumToGdd(void* v, aitIndex /*count*/)
{
dbr_gr_enum* db = (dbr_gr_enum*)v;
gdd* dd = type_table->getDD(gddDbrToAit[DBR_GR_ENUM].app);
gdd& vdd = dd[gddAppTypeIndex_dbr_gr_enum_value];
gdd& menu = dd[gddAppTypeIndex_dbr_gr_enum_enums];
aitString* str = menu;
aitIndex l;
int i;
for(i=0;i<db->no_str;i++) str[i]=((const char*)&(db->strs[i][0]));
@@ -853,14 +855,13 @@ static gdd* mapGraphicEnumToGdd(void* v, aitIndex count)
return dd;
}
static gdd* mapControlEnumToGdd(void* v, aitIndex count)
static gdd* mapControlEnumToGdd(void* v, aitIndex /*count*/)
{
dbr_ctrl_enum* db = (dbr_ctrl_enum*)v;
gdd* dd = type_table->getDD(gddDbrToAit[DBR_CTRL_ENUM].app);
gdd& menu = dd[gddAppTypeIndex_dbr_ctrl_enum_enums];
gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_enum_value];
aitString* str = menu;
aitIndex l;
int i;
for(i=0;i<db->no_str;i++) str[i]=((const char*)&(db->strs[i][0]));

View File

@@ -4,6 +4,9 @@
// $Id$
//
// $Log$
// Revision 1.2 1996/06/26 02:42:06 jbk
// more correction to the aitString processing - testing menus
//
// Revision 1.1 1996/06/25 19:11:37 jbk
// new in EPICS base
//
@@ -394,7 +397,7 @@ size_t gdd::DescribedDataSizeBytes(void) const
size_t gdd::getTotalSizeBytes(void) const
{
size_t sz;
unsigned long tmp,tsize;
unsigned long tsize;
gdd* pdd;
// add up size of bounds + size of this DD

View File

@@ -4,6 +4,9 @@
// $Id$
//
// $Log$
// Revision 1.1 1996/06/25 19:11:41 jbk
// new in EPICS base
//
// *Revision 1.3 1996/06/24 03:15:35 jbk
// *name changes and fixes for aitString and fixed string functions
@@ -264,7 +267,8 @@ gddStatus gddApplicationTypeTable::registerApplicationTypeWithProto(
aitUint8* blk;
size_t sz;
aitIndex tot;
int i;
aitUint16 x;
aitUint16 i;
gddStatus rc;
if(rc=registerApplicationType(name,new_app)) return rc;
@@ -302,7 +306,10 @@ gddStatus gddApplicationTypeTable::registerApplicationTypeWithProto(
attr_table[group][app].map_size=total_registered;
for(i=0;i<total_registered;i++) attr_table[group][app].map[i]=0;
for(i=0;i<tot;i++)
attr_table[group][app].map[attr_table[group][app].proto[i].applicationType()]=i;
{
x=attr_table[group][app].proto[i].applicationType();
if(x<total_registered) attr_table[group][app].map[x]=i;
}
return 0;
}