remove checking against UINT32_MAX

This commit is contained in:
Wei-keng Liao 2017-09-11 19:13:13 -05:00
parent 752f31a3d3
commit 49226bb76b
2 changed files with 13 additions and 15 deletions

View File

@ -313,16 +313,19 @@ fprintf(stderr, " REC %d %s: %ld\n", ii, (*vpp)->name->cp, (long)index);
last = (*vpp);
}
/*
* for special case of
*/
if(last != NULL) {
if(ncp->recsize == last->len) { /* exactly one record variable, pack value */
ncp->recsize = *last->dsizes * last->xsz;
} else if(last->len == UINT32_MAX) { /* huge last record variable */
ncp->recsize += *last->dsizes * last->xsz;
}
}
/*
* for special case (Check CDF-1 and CDF-2 file format specifications.)
* "A special case: Where there is exactly one record variable, we drop the
* requirement that each record be four-byte aligned, so in this case there
* is no record padding."
*/
if (last != NULL) {
if (ncp->recsize == last->len) {
/* exactly one record variable, pack value */
ncp->recsize = *last->dsizes * last->xsz;
}
}
if(NC_IsNew(ncp))
NC_set_numrecs(ncp, 0);
return NC_NOERR;

View File

@ -1230,11 +1230,6 @@ NC_computeshapes(NC3_INFO* ncp)
{
if(first_rec == NULL)
first_rec = *vpp;
if((*vpp)->len == UINT32_MAX &&
(fIsSet(ncp->flags, NC_64BIT_OFFSET) ||
fIsSet(ncp->flags, NC_64BIT_DATA))) /* Flag for large last record */
ncp->recsize += (*vpp)->dsizes[0] * (*vpp)->xsz;
else
ncp->recsize += (*vpp)->len;
}
else