From 376f37eb1e09a45793652085f078d5b5e27a070f Mon Sep 17 00:00:00 2001 From: Jim Kowalkowski Date: Tue, 23 Jul 1996 17:13:34 +0000 Subject: [PATCH] various fixes - dbmapper incorrectly worked with enum types --- src/gdd/Makefile.Unix | 13 +++++-- src/gdd/dbMapper.cc | 87 ++++++++++++++++--------------------------- src/gdd/gdd.cc | 11 +++++- src/gdd/gdd.h | 33 ++++++++-------- src/gdd/gddAppDefs.cc | 8 ++-- 5 files changed, 75 insertions(+), 77 deletions(-) diff --git a/src/gdd/Makefile.Unix b/src/gdd/Makefile.Unix index 5be81dc79..2c7db8cda 100644 --- a/src/gdd/Makefile.Unix +++ b/src/gdd/Makefile.Unix @@ -5,6 +5,9 @@ # $Id$ # # $Log$ +# Revision 1.9 1996/07/10 23:48:03 jhill +# added install for gddAppFuncTable.h +# # Revision 1.8 1996/07/09 22:58:55 jhill # added installation of the include files # @@ -46,6 +49,8 @@ TOP= ../../.. include $(TOP)/config/CONFIG_BASE +OPTIM_YES=-g + INC += gdd.h INC += gddNewDel.h INC += gddUtils.h @@ -67,8 +72,10 @@ SRCS.cc = ../aitGen.c ../aitTypes.c ../aitHelpers.cc \ ../gdd.cc ../gddAppDefs.cc ../gddAppTable.cc ../gddNewDel.cc \ ../gddTest.cc ../genApps.cc ../dbMapper.cc -LIBOBJS = gdd.o gddTest.o gddAppTable.o gddNewDel.o gddAppDefs.o \ - aitTypes.o aitConvert.o aitHelpers.o dbMapper.o +MY_OBJS = gdd.o gddTest.o gddAppTable.o gddNewDel.o gddAppDefs.o \ + aitTypes.o aitConvert.o aitHelpers.o + +LIBOBJS = $(MY_OBJS) dbMapper.o LIBNAME = libgdd.a @@ -95,7 +102,7 @@ dbMapper.o: ../dbMapper.cc gdd.h gddAppTable.h dbMapper.h gddApps.h aitTypes.h gddApps.h: genApps ./genApps $@ -genApps: genApps.o $(LIBOBJS) +genApps: genApps.o $(MY_OBJS) $(LINK.cc) -o $@ $^ $(LDLIBS) clean:: diff --git a/src/gdd/dbMapper.cc b/src/gdd/dbMapper.cc index b5fc2b1f7..c979df2d7 100644 --- a/src/gdd/dbMapper.cc +++ b/src/gdd/dbMapper.cc @@ -4,6 +4,9 @@ // $Id$ // // $Log$ +// Revision 1.5 1996/07/01 19:59:12 jhill +// fixed case where gdd was mapped to a string without cvrt +// // Revision 1.4 1996/06/26 21:00:06 jbk // Fixed up code in aitHelpers, removed unused variables in others // Fixed potential problem in gddAppTable.cc with the map functions @@ -66,7 +69,7 @@ gddDbrToAitTable gddDbrToAit[] = { { aitEnumFixedString, 0, "value" }, { aitEnumInt16, 0, "value" }, { aitEnumFloat32, 0, "value" }, - { aitEnumEnum16, 0, "enums" }, + { aitEnumEnum16, 0, "value" }, { aitEnumInt8, 0, "value" }, { aitEnumInt32, 0, "value" }, { aitEnumFloat64, 0, "value" }, @@ -74,7 +77,7 @@ gddDbrToAitTable gddDbrToAit[] = { { aitEnumFixedString, 0, "value" }, { aitEnumInt16, 0, "value" }, { aitEnumFloat32, 0, "value" }, - { aitEnumEnum16, 0, "enums" }, + { aitEnumEnum16, 0, "value" }, { aitEnumInt8, 0, "value" }, { aitEnumInt32, 0, "value" }, { aitEnumFloat64, 0, "value" }, @@ -82,7 +85,7 @@ gddDbrToAitTable gddDbrToAit[] = { { aitEnumFixedString, 0, "value" }, { aitEnumInt16, 0, "value" }, { aitEnumFloat32, 0, "value" }, - { aitEnumEnum16, 0, "enums" }, + { aitEnumEnum16, 0, "value" }, { aitEnumInt8, 0, "value" }, { aitEnumInt32, 0, "value" }, { aitEnumFloat64, 0, "value" }, @@ -605,8 +608,7 @@ static gdd* mapGraphicShortToGdd(void* v, aitIndex count) gdd* dd = type_table->getDD(gddDbrToAit[DBR_GR_SHORT].app); gdd& vdd = dd[gddAppTypeIndex_dbr_gr_short_value]; - aitString str = db->units; - dd[gddAppTypeIndex_dbr_gr_short_units].put(str); + dd[gddAppTypeIndex_dbr_gr_short_units].put(db->units); dd[gddAppTypeIndex_dbr_gr_short_graphicLow]=db->lower_disp_limit; dd[gddAppTypeIndex_dbr_gr_short_graphicHigh]=db->upper_disp_limit; dd[gddAppTypeIndex_dbr_gr_short_alarmLow]=db->lower_alarm_limit; @@ -635,8 +637,7 @@ static gdd* mapControlShortToGdd(void* v, aitIndex count) gdd* dd = type_table->getDD(gddDbrToAit[DBR_CTRL_SHORT].app); gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_short_value]; - aitString str = db->units; - dd[gddAppTypeIndex_dbr_ctrl_short_units].put(str); + dd[gddAppTypeIndex_dbr_ctrl_short_units].put(db->units); dd[gddAppTypeIndex_dbr_ctrl_short_graphicLow]=db->lower_disp_limit; dd[gddAppTypeIndex_dbr_ctrl_short_graphicHigh]=db->upper_disp_limit; dd[gddAppTypeIndex_dbr_ctrl_short_controlLow]=db->lower_ctrl_limit; @@ -666,9 +667,7 @@ static int mapGraphicGddToShort(void* v, gdd* dd) int sz=1; gdd& vdd = dd[gddAppTypeIndex_dbr_gr_short_value]; - aitString str; - dd[gddAppTypeIndex_dbr_gr_short_units].get(str); - strcpy(db->units,str.string()); + dd[gddAppTypeIndex_dbr_gr_short_units].get(db->units); db->lower_disp_limit=dd[gddAppTypeIndex_dbr_gr_short_graphicLow]; db->upper_disp_limit=dd[gddAppTypeIndex_dbr_gr_short_graphicHigh]; db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_gr_short_alarmLow]; @@ -693,9 +692,7 @@ static int mapControlGddToShort(void* v, gdd* dd) int sz=1; gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_short_value]; - aitString str; - dd[gddAppTypeIndex_dbr_ctrl_short_units].get(str); - strcpy(db->units,str.string()); + dd[gddAppTypeIndex_dbr_ctrl_short_units].get(db->units); db->lower_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_short_graphicLow]; db->upper_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_short_graphicHigh]; db->lower_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_short_controlLow]; @@ -724,8 +721,7 @@ static gdd* mapGraphicFloatToGdd(void* v, aitIndex count) gdd* dd = type_table->getDD(gddDbrToAit[DBR_GR_FLOAT].app); gdd& vdd = dd[gddAppTypeIndex_dbr_gr_float_value]; - aitString str = db->units; - dd[gddAppTypeIndex_dbr_gr_float_units].put(str); + dd[gddAppTypeIndex_dbr_gr_float_units].put(db->units); dd[gddAppTypeIndex_dbr_gr_float_precision]=db->precision; dd[gddAppTypeIndex_dbr_gr_float_graphicLow]=db->lower_disp_limit; dd[gddAppTypeIndex_dbr_gr_float_graphicHigh]=db->upper_disp_limit; @@ -755,8 +751,7 @@ static gdd* mapControlFloatToGdd(void* v, aitIndex count) gdd* dd = type_table->getDD(gddDbrToAit[DBR_CTRL_FLOAT].app); gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_float_value]; - aitString str = db->units; - dd[gddAppTypeIndex_dbr_ctrl_float_units].put(str); + dd[gddAppTypeIndex_dbr_ctrl_float_units].put(db->units); dd[gddAppTypeIndex_dbr_ctrl_float_precision]=db->precision; dd[gddAppTypeIndex_dbr_ctrl_float_graphicLow]=db->lower_disp_limit; dd[gddAppTypeIndex_dbr_ctrl_float_graphicHigh]=db->upper_disp_limit; @@ -787,9 +782,7 @@ static int mapGraphicGddToFloat(void* v, gdd* dd) int sz=1; gdd& vdd = dd[gddAppTypeIndex_dbr_gr_float_value]; - aitString str; - dd[gddAppTypeIndex_dbr_gr_float_units].get(str); - strcpy(db->units,str.string()); + dd[gddAppTypeIndex_dbr_gr_float_units].get(db->units); db->precision=dd[gddAppTypeIndex_dbr_gr_float_precision]; db->lower_disp_limit=dd[gddAppTypeIndex_dbr_gr_float_graphicLow]; db->upper_disp_limit=dd[gddAppTypeIndex_dbr_gr_float_graphicHigh]; @@ -815,9 +808,7 @@ static int mapControlGddToFloat(void* v, gdd* dd) int sz=1; gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_float_value]; - aitString str; - dd[gddAppTypeIndex_dbr_ctrl_float_units].get(str); - strcpy(db->units,str.string()); + dd[gddAppTypeIndex_dbr_ctrl_float_units].get(db->units); db->precision=dd[gddAppTypeIndex_dbr_ctrl_float_precision]; db->lower_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_float_graphicLow]; db->upper_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_float_graphicHigh]; @@ -889,7 +880,9 @@ static int mapGraphicGddToEnum(void* v, gdd* dd) vdd.getStatSevr(db->status,db->severity); db->no_str=menu.getDataSizeElements(); - for(i=0;ino_str;i++) strcpy(&(db->strs[i][0]),str[i]); + for(i=0;ino_str;i++) + if(&(db->strs[i][0]) && str[i].string()) + strcpy(&(db->strs[i][0]),str[i].string()); db->value=vdd; // always scaler return 1; @@ -906,7 +899,9 @@ static int mapControlGddToEnum(void* v, gdd* dd) vdd.getStatSevr(db->status,db->severity); db->no_str=menu.getDataSizeElements(); - for(i=0;ino_str;i++) strcpy(&(db->strs[i][0]),str[i]); + for(i=0;ino_str;i++) + if(&(db->strs[i][0]) && str[i].string()) + strcpy(&(db->strs[i][0]),str[i].string()); db->value=vdd; // always scaler return 1; @@ -920,8 +915,7 @@ static gdd* mapGraphicCharToGdd(void* v, aitIndex count) gdd* dd = type_table->getDD(gddDbrToAit[DBR_GR_CHAR].app); gdd& vdd = dd[gddAppTypeIndex_dbr_gr_char_value]; - aitString str = db->units; - dd[gddAppTypeIndex_dbr_gr_char_units].put(str); + dd[gddAppTypeIndex_dbr_gr_char_units].put(db->units); dd[gddAppTypeIndex_dbr_gr_char_graphicLow]=db->lower_disp_limit; dd[gddAppTypeIndex_dbr_gr_char_graphicHigh]=db->upper_disp_limit; dd[gddAppTypeIndex_dbr_gr_char_alarmLow]=db->lower_alarm_limit; @@ -950,8 +944,7 @@ static gdd* mapControlCharToGdd(void* v, aitIndex count) gdd* dd = type_table->getDD(gddDbrToAit[DBR_CTRL_CHAR].app); gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_char_value]; - aitString str = db->units; - dd[gddAppTypeIndex_dbr_ctrl_char_units].put(str); + dd[gddAppTypeIndex_dbr_ctrl_char_units].put(db->units); dd[gddAppTypeIndex_dbr_ctrl_char_graphicLow]=db->lower_disp_limit; dd[gddAppTypeIndex_dbr_ctrl_char_graphicHigh]=db->upper_disp_limit; dd[gddAppTypeIndex_dbr_ctrl_char_controlLow]=db->lower_ctrl_limit; @@ -981,9 +974,7 @@ static int mapGraphicGddToChar(void* v, gdd* dd) gdd& vdd = dd[gddAppTypeIndex_dbr_gr_char_value]; int sz=1; - aitString str; - dd[gddAppTypeIndex_dbr_gr_char_units].get(str); - strcpy(db->units,str.string()); + dd[gddAppTypeIndex_dbr_gr_char_units].get(db->units); db->lower_disp_limit=dd[gddAppTypeIndex_dbr_gr_char_graphicLow]; db->upper_disp_limit=dd[gddAppTypeIndex_dbr_gr_char_graphicHigh]; db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_gr_char_alarmLow]; @@ -1008,9 +999,7 @@ static int mapControlGddToChar(void* v, gdd* dd) gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_char_value]; int sz=1; - aitString str; - dd[gddAppTypeIndex_dbr_ctrl_char_units].get(str); - strcpy(db->units,str.string()); + dd[gddAppTypeIndex_dbr_ctrl_char_units].get(db->units); db->lower_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_char_graphicLow]; db->upper_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_char_graphicHigh]; db->lower_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_char_controlLow]; @@ -1039,8 +1028,7 @@ static gdd* mapGraphicLongToGdd(void* v, aitIndex count) gdd* dd = type_table->getDD(gddDbrToAit[DBR_GR_LONG].app); gdd& vdd = dd[gddAppTypeIndex_dbr_gr_long_value]; - aitString str = db->units; - dd[gddAppTypeIndex_dbr_gr_long_units].put(str); + dd[gddAppTypeIndex_dbr_gr_long_units].put(db->units); dd[gddAppTypeIndex_dbr_gr_long_graphicLow]=db->lower_disp_limit; dd[gddAppTypeIndex_dbr_gr_long_graphicHigh]=db->upper_disp_limit; dd[gddAppTypeIndex_dbr_gr_long_alarmLow]=db->lower_alarm_limit; @@ -1069,8 +1057,7 @@ static gdd* mapControlLongToGdd(void* v, aitIndex count) gdd* dd = type_table->getDD(gddDbrToAit[DBR_CTRL_LONG].app); gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_long_value]; - aitString str = db->units; - dd[gddAppTypeIndex_dbr_ctrl_long_units].put(str); + dd[gddAppTypeIndex_dbr_ctrl_long_units].put(db->units); dd[gddAppTypeIndex_dbr_ctrl_long_graphicLow]=db->lower_disp_limit; dd[gddAppTypeIndex_dbr_ctrl_long_graphicHigh]=db->upper_disp_limit; dd[gddAppTypeIndex_dbr_ctrl_long_controlLow]=db->lower_ctrl_limit; @@ -1100,9 +1087,7 @@ static int mapGraphicGddToLong(void* v, gdd* dd) gdd& vdd = dd[gddAppTypeIndex_dbr_gr_long_value]; int sz=1; - aitString str; - dd[gddAppTypeIndex_dbr_gr_long_units].get(str); - strcpy(db->units,str.string()); + dd[gddAppTypeIndex_dbr_gr_long_units].get(db->units); db->lower_disp_limit=dd[gddAppTypeIndex_dbr_gr_long_graphicLow]; db->upper_disp_limit=dd[gddAppTypeIndex_dbr_gr_long_graphicHigh]; db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_gr_long_alarmLow]; @@ -1127,9 +1112,7 @@ static int mapControlGddToLong(void* v, gdd* dd) gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_long_value]; int sz=1; - aitString str; - dd[gddAppTypeIndex_dbr_ctrl_long_units].get(str); - strcpy(db->units,str.string()); + dd[gddAppTypeIndex_dbr_ctrl_long_units].get(db->units); db->lower_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_long_graphicLow]; db->upper_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_long_graphicHigh]; db->lower_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_long_controlLow]; @@ -1158,8 +1141,7 @@ static gdd* mapGraphicDoubleToGdd(void* v, aitIndex count) gdd* dd = type_table->getDD(gddDbrToAit[DBR_GR_DOUBLE].app); gdd& vdd = dd[gddAppTypeIndex_dbr_gr_double_value]; - aitString str = db->units; - dd[gddAppTypeIndex_dbr_gr_double_units].put(str); + dd[gddAppTypeIndex_dbr_gr_double_units].put(db->units); dd[gddAppTypeIndex_dbr_gr_double_precision]=db->precision; dd[gddAppTypeIndex_dbr_gr_double_graphicLow]=db->lower_disp_limit; dd[gddAppTypeIndex_dbr_gr_double_graphicHigh]=db->upper_disp_limit; @@ -1189,8 +1171,7 @@ static gdd* mapControlDoubleToGdd(void* v, aitIndex count) gdd* dd = type_table->getDD(gddDbrToAit[DBR_CTRL_DOUBLE].app); gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_double_value]; - aitString str = db->units; - dd[gddAppTypeIndex_dbr_ctrl_double_units].put(str); + dd[gddAppTypeIndex_dbr_ctrl_double_units].put(db->units); dd[gddAppTypeIndex_dbr_ctrl_double_precision]=db->precision; dd[gddAppTypeIndex_dbr_ctrl_double_graphicLow]=db->lower_disp_limit; dd[gddAppTypeIndex_dbr_ctrl_double_graphicHigh]=db->upper_disp_limit; @@ -1221,9 +1202,7 @@ static int mapGraphicGddToDouble(void* v, gdd* dd) gdd& vdd = dd[gddAppTypeIndex_dbr_gr_double_value]; int sz=1; - aitString str; - dd[gddAppTypeIndex_dbr_gr_double_units].get(str); - strcpy(db->units,str.string()); + dd[gddAppTypeIndex_dbr_gr_double_units].get(db->units); db->precision=dd[gddAppTypeIndex_dbr_gr_double_precision]; db->lower_disp_limit=dd[gddAppTypeIndex_dbr_gr_double_graphicLow]; db->upper_disp_limit=dd[gddAppTypeIndex_dbr_gr_double_graphicHigh]; @@ -1249,9 +1228,7 @@ static int mapControlGddToDouble(void* v, gdd* dd) gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_double_value]; int sz=1; - aitString str; - dd[gddAppTypeIndex_dbr_ctrl_double_units].get(str); - strcpy(db->units,str.string()); + dd[gddAppTypeIndex_dbr_ctrl_double_units].get(db->units); db->precision=dd[gddAppTypeIndex_dbr_ctrl_double_precision]; db->lower_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_double_graphicLow]; db->upper_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_double_graphicHigh]; diff --git a/src/gdd/gdd.cc b/src/gdd/gdd.cc index ffcada435..863fbf75d 100644 --- a/src/gdd/gdd.cc +++ b/src/gdd/gdd.cc @@ -4,6 +4,10 @@ // $Id$ // // $Log$ +// Revision 1.3 1996/06/26 21:00:07 jbk +// Fixed up code in aitHelpers, removed unused variables in others +// Fixed potential problem in gddAppTable.cc with the map functions +// // Revision 1.2 1996/06/26 02:42:06 jbk // more correction to the aitString processing - testing menus // @@ -953,7 +957,7 @@ gddStatus gdd::put(const gdd* dd) if(isContainer() || dd->isContainer()) rc=gddErrorNotSupported; - if(isScaler() && dd->isScaler()) + else if(isScaler() && dd->isScaler()) { // this is the simple case - just make this scaler look like the other // not protected against screwing up the string type @@ -1039,6 +1043,11 @@ gddStatus gdd::put(const gdd* dd) dd->primitiveType(),dd->dataAddress(),1); } + aitTimeStamp ts; + setStatSevr(dd->getStat(),dd->getSevr()); + dd->getTimeStamp(&ts); + setTimeStamp(&ts); + return rc; } diff --git a/src/gdd/gdd.h b/src/gdd/gdd.h index cbd2484e4..fc083e983 100644 --- a/src/gdd/gdd.h +++ b/src/gdd/gdd.h @@ -8,6 +8,9 @@ * $Id$ * * $Log$ + * Revision 1.2 1996/06/26 00:19:40 jhill + * added CHAR_BIT to max bound calc for the "ref_cnt" member of class gdd + * * Revision 1.1 1996/06/25 19:11:38 jbk * new in EPICS base * @@ -297,10 +300,10 @@ public: void* dataPointer(void) const; void* dataPointer(aitIndex element_offset) const; - void getTimeStamp(struct timespec* ts); - void getTimeStamp(aitTimeStamp* ts); - void setTimeStamp(struct timespec* ts); - void setTimeStamp(aitTimeStamp* ts); + void getTimeStamp(struct timespec* const ts) const; + void getTimeStamp(aitTimeStamp* const ts) const; + void setTimeStamp(const struct timespec* const ts); + void setTimeStamp(const aitTimeStamp* const ts); void setStatus(aitUint32); void setStatus(aitUint16 high, aitUint16 low); void getStatus(aitUint32&); @@ -308,8 +311,8 @@ public: void setStat(aitUint16); void setSevr(aitUint16); - aitUint16 getStat(void); - aitUint16 getSevr(void); + aitUint16 getStat(void) const; + aitUint16 getSevr(void) const; void setStatSevr(aitInt16 stat, aitInt16 sevr); void getStatSevr(aitInt16& stat, aitInt16& sevr); @@ -608,13 +611,14 @@ inline void gdd::markFlat(void) { flags|=GDD_FLAT_MASK; } inline void gdd::markManaged(void) { flags|=GDD_MANAGED_MASK; } inline void gdd::markUnmanaged(void) { flags&=~GDD_MANAGED_MASK; } -inline void gdd::getTimeStamp(struct timespec* ts) +inline void gdd::getTimeStamp(struct timespec* const ts) const { ts->tv_sec=time_stamp.tv_sec; ts->tv_nsec=time_stamp.tv_nsec; } -inline void gdd::setTimeStamp(struct timespec* ts) { +inline void gdd::setTimeStamp(const struct timespec* const ts) { time_stamp.tv_sec=(aitUint32)ts->tv_sec; time_stamp.tv_nsec=(aitUint32)ts->tv_nsec; } -inline void gdd::getTimeStamp(aitTimeStamp* ts) { *ts=time_stamp; } -inline void gdd::setTimeStamp(aitTimeStamp* ts) { time_stamp=*ts; } +inline void gdd::getTimeStamp(aitTimeStamp* const ts) const { *ts=time_stamp; } +inline void gdd::setTimeStamp(const aitTimeStamp* const ts) { time_stamp=*ts; } + inline void gdd::setStatus(aitUint32 s) { status=s; } inline void gdd::getStatus(aitUint32& s) { s=status; } inline void gdd::setStatus(aitUint16 high, aitUint16 low) @@ -626,9 +630,9 @@ inline void gdd::setStat(aitUint16 s) { aitUint16* x = (aitUint16*)&status; x[0]=s; } inline void gdd::setSevr(aitUint16 s) { aitUint16* x = (aitUint16*)&status; x[1]=s; } -inline aitUint16 gdd::getStat(void) +inline aitUint16 gdd::getStat(void) const { aitUint16* x = (aitUint16*)&status; return x[0]; } -inline aitUint16 gdd::getSevr(void) +inline aitUint16 gdd::getSevr(void) const { aitUint16* x = (aitUint16*)&status; return x[1]; } inline void gdd::getStatSevr(aitInt16& st, aitInt16& se) { st=getStat(); se=getSevr(); } @@ -672,10 +676,9 @@ inline gddStatus gdd::unreference(void) if(ref_cnt==0u) { fprintf(stderr,"gdd reference count underflow!!\n"); - return gddErrorUnderflow; + rc=gddErrorUnderflow; } - - if(--ref_cnt<=0u) + else if(--ref_cnt<=0u) { if(isManaged()) { diff --git a/src/gdd/gddAppDefs.cc b/src/gdd/gddAppDefs.cc index 0ad6e5216..74615a575 100644 --- a/src/gdd/gddAppDefs.cc +++ b/src/gdd/gddAppDefs.cc @@ -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:34 jbk @@ -28,13 +31,12 @@ gddApplicationTypeTable* gddGenerateApplicationTypeTable(long x/*=(1<<13)*/) void gddApplicationTypeTable::GenerateTypes(void) { - gddScaler* add_units = new gddScaler(0); + gddAtomic* add_units = new gddAtomic(0,aitEnumInt8,1,8); gddAtomic* add_enum = new gddAtomic(0,aitEnumString,1,16); aitString add_enum_buf[16]; - aitString add_units_buf = thing; - add_units->put(add_units_buf); + add_units->putRef(thing); add_enum->putRef(add_enum_buf); // ----------------------------------------------------------------