subArray: Bugfix, allow array puts to VAL

Fixed a bug reported by Michael Abbott, NORD goes -ve.
Modified soft channel support so when INP="" it extracts the relevent
sub-array of the existing VAL field; use an external put to set the
array. This lets the other records pull a series of values from the
record in sequence.
This commit is contained in:
Andrew Johnson
2010-11-12 16:09:09 -06:00
parent 99e7e7727a
commit 18594e1a34
3 changed files with 22 additions and 6 deletions

View File

@@ -13,6 +13,14 @@
<h2 align="center">Changes between 3.14.11 and 3.14.12</h2>
<!-- Insert new items immediately below here ... -->
<h4>Enable array puts to subArray records</h4>
<p>It is now possible to put an array into the VAL field of a soft channel
subArray record whose INP field is empty. Processing the record then causes the
sub-array extraction process to be done on the current VAL array. This can be
used to feed a sequence of values into some other record (set INDX=1 and
NELM=MALM and read one element out of the VAL field each time).</p>
<h4>Added windows-x64 target</h4>
<p>64-bit binaries for Microsoft Windows platforms can now be built using the

View File

@@ -72,15 +72,24 @@ static long read_sa(subArrayRecord *prec)
if (nRequest > prec->malm)
nRequest = prec->malm;
dbGetLink(&prec->inp, prec->ftvl, prec->bptr, 0, &nRequest);
prec->nord = ecount = nRequest - prec->indx;
if (prec->inp.type == CONSTANT)
nRequest = prec->nord;
else
dbGetLink(&prec->inp, prec->ftvl, prec->bptr, 0, &nRequest);
ecount = nRequest - prec->indx;
if (ecount > 0) {
int esize = dbValueSize(prec->ftvl);
if (ecount > prec->nelm)
ecount = prec->nelm;
memmove(prec->bptr, (char *)prec->bptr + prec->indx * esize,
ecount * esize);
}
} else
ecount = 0;
prec->nord = ecount;
if (nRequest > 0 &&
prec->tsel.type == CONSTANT &&

View File

@@ -194,9 +194,8 @@ static long put_array_info(DBADDR *paddr, long nNew)
subArrayRecord *prec = (subArrayRecord *) paddr->precord;
if (nNew > prec->malm)
prec->nord = prec->malm;
else
prec->nord = nNew;
nNew = prec->malm;
prec->nord = nNew;
return 0;
}