Fixed various clang Wunused-but-set-variable warnings

Mostly, this was dead code.

In some cases, the variable looked useful in debug, so I kept it but mark it unused by casting it to void.
This commit is contained in:
Sean McBride 2024-11-15 23:55:07 -05:00
parent f907cd3b57
commit 5a4040b8e2
3 changed files with 2 additions and 8 deletions

View File

@ -2107,6 +2107,8 @@ val_NC_check_voff(NC *ncp)
prev_off = varp->begin + varp->len;
prev = i;
}
(void)nerrs;
return status;
}

View File

@ -544,7 +544,6 @@ vardata(
void *vals;
int id;
size_t nels;
size_t ncols;
int vrank = vp->ndims;
@ -555,7 +554,6 @@ vardata(
edg = (size_t *) emalloc((size_t)(1 + vrank) * sizeof(size_t));
add = (size_t *) emalloc((size_t)(1 + vrank) * sizeof(size_t));
nels = 1;
if(vrank == 0) { /*scalar*/
cor[0] = 0;
edg[0] = 1;
@ -563,7 +561,6 @@ vardata(
for (id = 0; id < vrank; id++) {
cor[id] = 0;
edg[id] = 1;
nels *= vdims[id]; /* total number of values for variable */
}
}
printf("\n");

View File

@ -420,12 +420,7 @@ genbin_writevar(Generator* generator, Symbol* vsym, Bytebuffer* memory,
int rank, size_t* start, size_t* count)
{
int stat = NC_NOERR;
int i;
char* data = bbContents(memory);
size_t nelems;
/* Compute total number of elements */
for(nelems=1,i=0;i<rank;i++) nelems *= count[i];
#ifdef GENDEBUG
{