Make dbLinkIs{Constant|Volatile}() return only true/false
This commit is contained in:
@@ -190,20 +190,14 @@ int dbLinkIsConstant(const struct link *plink)
|
||||
{
|
||||
lset *plset = plink->lset;
|
||||
|
||||
if (plset)
|
||||
return plset->isConstant;
|
||||
|
||||
return -1;
|
||||
return !plset || plset->isConstant;
|
||||
}
|
||||
|
||||
int dbLinkIsVolatile(const struct link *plink)
|
||||
{
|
||||
lset *plset = plink->lset;
|
||||
|
||||
if (plset)
|
||||
return plset->isVolatile;
|
||||
|
||||
return -1;
|
||||
return plset && plset->isVolatile;
|
||||
}
|
||||
|
||||
long dbLoadLink(struct link *plink, short dbrType, void *pbuffer)
|
||||
|
||||
@@ -89,8 +89,8 @@ epicsShareFunc void dbLinkOpen(struct link *plink);
|
||||
epicsShareFunc void dbRemoveLink(struct dbLocker *locker, struct link *plink);
|
||||
|
||||
epicsShareFunc int dbLinkIsDefined(const struct link *plink); /* 0 or 1 */
|
||||
epicsShareFunc int dbLinkIsConstant(const struct link *plink); /* -1, 0 or 1 */
|
||||
epicsShareFunc int dbLinkIsVolatile(const struct link *plink); /* -1, 0 or 1 */
|
||||
epicsShareFunc int dbLinkIsConstant(const struct link *plink); /* 0 or 1 */
|
||||
epicsShareFunc int dbLinkIsVolatile(const struct link *plink); /* 0 or 1 */
|
||||
|
||||
epicsShareFunc long dbLoadLink(struct link *plink, short dbrType,
|
||||
void *pbuffer);
|
||||
@@ -98,7 +98,7 @@ epicsShareFunc long dbLoadLinkArray(struct link *, short dbrType, void *pbuffer,
|
||||
long *pnRequest);
|
||||
|
||||
epicsShareFunc long dbGetNelements(const struct link *plink, long *nelements);
|
||||
epicsShareFunc int dbIsLinkConnected(const struct link *plink);
|
||||
epicsShareFunc int dbIsLinkConnected(const struct link *plink); /* 0 or 1 */
|
||||
epicsShareFunc int dbGetLinkDBFtype(const struct link *plink);
|
||||
epicsShareFunc long dbGetLink(struct link *, short dbrType, void *pbuffer,
|
||||
long *options, long *nRequest);
|
||||
|
||||
@@ -466,7 +466,7 @@ static int lnkCalc_isConn(const struct link *plink)
|
||||
for (i = 0; i < clink->nArgs; i++) {
|
||||
struct link *child = &clink->inp[i];
|
||||
|
||||
if (dbLinkIsVolatile(child) > 0 &&
|
||||
if (dbLinkIsVolatile(child) &&
|
||||
!dbIsLinkConnected(child))
|
||||
connected = 0;
|
||||
}
|
||||
|
||||
@@ -172,10 +172,10 @@ static long init_record(struct dbCommon *pcommon, int pass)
|
||||
recGblInitConstantLink(plink, DBF_DOUBLE, pvalue);
|
||||
}
|
||||
|
||||
if (dbLinkIsConstant(plink) > 0) {
|
||||
if (dbLinkIsConstant(plink)) {
|
||||
*plinkValid = calcoutINAV_CON;
|
||||
}
|
||||
else if (dbLinkIsVolatile(plink) > 0) {
|
||||
else if (dbLinkIsVolatile(plink)) {
|
||||
int conn = dbIsLinkConnected(plink);
|
||||
|
||||
if (conn)
|
||||
@@ -366,10 +366,11 @@ static long special(DBADDR *paddr, int after)
|
||||
|
||||
if (fieldIndex != calcoutRecordOUT)
|
||||
recGblInitConstantLink(plink, DBF_DOUBLE, pvalue);
|
||||
if (dbLinkIsConstant(plink) > 0) {
|
||||
|
||||
if (dbLinkIsConstant(plink)) {
|
||||
db_post_events(prec, pvalue, DBE_VALUE);
|
||||
*plinkValid = calcoutINAV_CON;
|
||||
} else if (dbLinkIsVolatile(plink) > 0) {
|
||||
} else if (dbLinkIsVolatile(plink)) {
|
||||
int conn = dbIsLinkConnected(plink);
|
||||
|
||||
if (conn)
|
||||
@@ -734,7 +735,7 @@ static void checkLinks(calcoutRecord *prec)
|
||||
plinkValid = &prec->inav;
|
||||
|
||||
for (i = 0; i<CALCPERFORM_NARGS+1; i++, plink++, plinkValid++) {
|
||||
if (dbLinkIsVolatile(plink) == 1) {
|
||||
if (dbLinkIsVolatile(plink)) {
|
||||
caLink = 1;
|
||||
stat = dbIsLinkConnected(plink);
|
||||
if (!stat && (*plinkValid == calcoutINAV_EXT_NC)) {
|
||||
|
||||
Reference in New Issue
Block a user