rec: Fix precision where link not set
Don't just force the precision to 15 if an INPx link is not set, default to PREC field instead.
This commit is contained in:
@@ -360,22 +360,25 @@ static long get_precision(DBADDR *paddr, long *pprecision)
|
||||
aSubRecord *prec = (aSubRecord *)paddr->precord;
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
int linkNumber;
|
||||
short precision;
|
||||
|
||||
*pprecision = prec->prec;
|
||||
linkNumber = get_inlinkNumber(fieldIndex);
|
||||
if (linkNumber >= 0) {
|
||||
short precision;
|
||||
|
||||
if (dbGetPrecision(&prec->inpa + linkNumber, &precision) == 0)
|
||||
*pprecision = precision;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
linkNumber = get_outlinkNumber(fieldIndex);
|
||||
if (linkNumber >= 0) {
|
||||
short precision;
|
||||
|
||||
if (dbGetPrecision(&prec->outa + linkNumber, &precision) == 0)
|
||||
*pprecision = precision;
|
||||
return 0;
|
||||
}
|
||||
recGblGetPrec(paddr, pprecision);
|
||||
} else
|
||||
recGblGetPrec(paddr, pprecision);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -188,16 +188,15 @@ static long get_precision(DBADDR *paddr, long *pprecision)
|
||||
int linkNumber;
|
||||
|
||||
*pprecision = prec->prec;
|
||||
if (fieldIndex == indexof(VAL)) {
|
||||
if (fieldIndex == indexof(VAL))
|
||||
return 0;
|
||||
}
|
||||
|
||||
linkNumber = get_linkNumber(fieldIndex);
|
||||
if (linkNumber >= 0) {
|
||||
short precision;
|
||||
|
||||
if (dbGetPrecision(&prec->inpa + linkNumber, &precision) == 0)
|
||||
*pprecision = precision;
|
||||
else
|
||||
*pprecision = 15;
|
||||
} else
|
||||
recGblGetPrec(paddr, pprecision);
|
||||
return 0;
|
||||
|
||||
@@ -414,21 +414,21 @@ static long get_precision(DBADDR *paddr, long *pprecision)
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
int linkNumber;
|
||||
|
||||
if(fieldIndex == indexof(ODLY)) {
|
||||
if (fieldIndex == indexof(ODLY)) {
|
||||
*pprecision = calcoutODLYprecision;
|
||||
return 0;
|
||||
}
|
||||
|
||||
*pprecision = prec->prec;
|
||||
if (fieldIndex == indexof(VAL)) {
|
||||
if (fieldIndex == indexof(VAL))
|
||||
return 0;
|
||||
}
|
||||
|
||||
linkNumber = get_linkNumber(fieldIndex);
|
||||
if (linkNumber >= 0) {
|
||||
short precision;
|
||||
|
||||
if (dbGetPrecision(&prec->inpa + linkNumber, &precision) == 0)
|
||||
*pprecision = precision;
|
||||
else
|
||||
*pprecision = 15;
|
||||
} else
|
||||
recGblGetPrec(paddr, pprecision);
|
||||
return 0;
|
||||
|
||||
@@ -222,16 +222,15 @@ static long get_precision(DBADDR *paddr, long *pprecision)
|
||||
int linkNumber;
|
||||
|
||||
*pprecision = prec->prec;
|
||||
if (fieldIndex == indexof(VAL)) {
|
||||
return 0;
|
||||
}
|
||||
if (fieldIndex == indexof(VAL))
|
||||
return 0;
|
||||
|
||||
linkNumber = get_linkNumber(fieldIndex);
|
||||
if (linkNumber >= 0) {
|
||||
short precision;
|
||||
|
||||
if (dbGetPrecision(&prec->inpa + linkNumber, &precision) == 0)
|
||||
*pprecision = precision;
|
||||
else
|
||||
*pprecision = 15;
|
||||
} else
|
||||
recGblGetPrec(paddr, pprecision);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user