From 2c657392867966b095f684ee354a7b21605bf17d Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 4 May 2017 12:31:17 -0500 Subject: [PATCH] Change indfield settings in new dbInitEntryFrom*() Can get indfield value from dbAddr->pflddes->indRecordType. Make FromRecord set indfield=0 like dbFindRecord() does. Adjust dbStaticTest to match. --- src/ioc/db/dbAccess.c | 3 +-- src/ioc/db/test/dbStaticTest.c | 10 ++-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/ioc/db/dbAccess.c b/src/ioc/db/dbAccess.c index 2b04280c0..7180259f5 100644 --- a/src/ioc/db/dbAccess.c +++ b/src/ioc/db/dbAccess.c @@ -694,7 +694,7 @@ void dbInitEntryFromAddr(struct dbAddr *paddr, DBENTRY *pdbentry) pdbentry->precnode = ppvt->recnode; pdbentry->pflddes = paddr->pfldDes; pdbentry->pfield = paddr->pfield; - pdbentry->indfield = -1; /* invalid */ + pdbentry->indfield = paddr->pfldDes->indRecordType; } void dbInitEntryFromRecord(struct dbCommon *prec, DBENTRY *pdbentry) @@ -706,7 +706,6 @@ void dbInitEntryFromRecord(struct dbCommon *prec, DBENTRY *pdbentry) pdbentry->pdbbase = pdbbase; pdbentry->precordType = prec->rdes; pdbentry->precnode = ppvt->recnode; - pdbentry->indfield = -1; /* invalid */ } long dbValueSize(short dbr_type) diff --git a/src/ioc/db/test/dbStaticTest.c b/src/ioc/db/test/dbStaticTest.c index 5f5367722..589134d50 100644 --- a/src/ioc/db/test/dbStaticTest.c +++ b/src/ioc/db/test/dbStaticTest.c @@ -63,13 +63,10 @@ static void testAddr2Entry(const char *pv) testOk1(entry.pflddes==entry2.pflddes); testOk1(entry.precnode==entry2.precnode); testOk1(entry.pfield==entry2.pfield); - testOk1(entry2.indfield==-1); + testOk1(entry.indfield==entry2.indfield); testOk1(!entry2.pinfonode); testOk1(!entry2.message); - /* no way to look this up, so not set */ - entry.indfield = -1; - testOk1(memcmp(&entry, &entry2, sizeof(entry))==0); dbFinishEntry(&entry); @@ -103,13 +100,10 @@ static void testRec2Entry(const char *recname) testOk1(entry.pflddes==entry2.pflddes); testOk1(entry.precnode==entry2.precnode); testOk1(entry.pfield==entry2.pfield); - testOk1(entry2.indfield==-1); + testOk1(entry.indfield==entry2.indfield); testOk1(!entry2.pinfonode); testOk1(!entry2.message); - /* no way to look this up, so not set */ - entry.indfield = -1; - testOk1(memcmp(&entry, &entry2, sizeof(entry))==0); dbFinishEntry(&entry);