Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions libdap2/getvara.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,8 +884,6 @@ slicestring(OClink conn, char* stringmem, DCEslice* slice, struct NCMEMORY* memo
{
size_t stringlen;
NCerror ncstat = NC_NOERR;
char* lastchar;
size_t charcount; /* number of characters inserted into memory */

/* libnc-dap chooses to convert string escapes to the corresponding
character; so we do likewise.
Expand All @@ -901,18 +899,12 @@ slice->first,slice->stride,slice->last,slice->declsize);
#endif

/* Stride across string; if we go past end of string, then pad*/
charcount = 0;
for(size_t i=slice->first;i<slice->length;i+=slice->stride) {
if(i < stringlen)
*memory->next = stringmem[i];
else /* i >= stringlen*/
*memory->next = NC_FILL_CHAR;
memory->next++;
charcount++;
}
lastchar = (memory->next);
if(charcount > 0) {
lastchar--;
}

return THROW(ncstat);
Expand Down
4 changes: 1 addition & 3 deletions nc_test/test_read.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,7 @@ TestFunc(get_varm)(VarArgs)
int nslabs;
PTRDType nstarts; /* number of different starts */
int nok = 0; /* total count of valid comparisons */
IntType j, m, nels;
IntType j, m;
IntType start[MAX_RANK];
IntType edge[MAX_RANK];
IntType index[MAX_RANK];
Expand Down Expand Up @@ -1708,11 +1708,9 @@ ifdef(`PNETCDF',`dnl
} else {
err = toMixedBase(m, var_rank[i], sstride, index);
IF (err != 0) error("error in toMixedBase");
nels = 1;
for (j = 0; j < var_rank[i] && j < MAX_RANK; j++) {
count[j] = 1 + (edge[j] - index[j] - 1) / ( (IntType)stride[j] == 0 ? 1 : (IntType)stride[j]);
index[j] += start[j];
nels *= count[j];
}
/* Random choice of forward or backward */
/* TODO
Expand Down
7 changes: 1 addition & 6 deletions ncdump/ncvalidator.c
Original file line number Diff line number Diff line change
Expand Up @@ -2051,7 +2051,7 @@ val_NC_check_vlens(NC *ncp)
static int
val_NC_check_voff(NC *ncp)
{
int nerrs=0, status=NC_NOERR;
int status=NC_NOERR;
NC_var *varp;
long long i, prev, prev_off;

Expand All @@ -2072,7 +2072,6 @@ val_NC_check_voff(NC *ncp)
else
printf("\tvar \"%s\" begin offset (%lld) is less than previous variable \"%s\" end offset (%lld)\n", varp->name, varp->begin, ncp->vars.value[prev]->name, prev_off);
}
nerrs++;
DEBUG_ASSIGN_ERROR(status, NC_ENOTNC)
}
prev_off = varp->begin + varp->len;
Expand All @@ -2082,7 +2081,6 @@ val_NC_check_voff(NC *ncp)
if (ncp->begin_rec < prev_off) {
if (verbose) printf("Error:\n");
if (verbose) printf("\tRecord variable section begin offset (%lld) is less than fixed-size variable section end offset (%lld)\n", varp->begin, prev_off);
nerrs++;
DEBUG_ASSIGN_ERROR(status, NC_ENOTNC)
}

Expand All @@ -2101,15 +2099,12 @@ val_NC_check_voff(NC *ncp)
else
printf("Variable \"%s\" begin offset (%lld) is less than previous variable \"%s\" end offset (%lld)\n", varp->name, varp->begin, ncp->vars.value[prev]->name, prev_off);
}
nerrs++;
DEBUG_ASSIGN_ERROR(status, NC_ENOTNC)
}
prev_off = varp->begin + varp->len;
prev = i;
}

(void)nerrs;

return status;
}

Expand Down
Loading