mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-18 15:55:12 +08:00
Merge branch 'master' into ejh_ncdump_again
This commit is contained in:
commit
3d4548a0e4
@ -166,8 +166,10 @@ NC_parsefilterspec(const char* spec, unsigned int* idp, size_t* nparamsp, unsign
|
||||
/* Now return results */
|
||||
if(idp) *idp = id;
|
||||
if(nparamsp) *nparamsp = nparams;
|
||||
if(paramsp) *paramsp = ulist;
|
||||
ulist = NULL; /* avoid duplicate free */
|
||||
if(paramsp) {
|
||||
*paramsp = ulist;
|
||||
ulist = NULL; /* avoid duplicate free */
|
||||
}
|
||||
if(sdata) free(sdata);
|
||||
if(ulist) free(ulist);
|
||||
return 1;
|
||||
|
@ -1071,6 +1071,10 @@ nc4_var_del(NC_VAR_INFO_T *var)
|
||||
if (var->dimscale_attached)
|
||||
free(var->dimscale_attached);
|
||||
|
||||
/* Release parameter information. */
|
||||
if (var->params)
|
||||
free(var->params);
|
||||
|
||||
/* Delete the var. */
|
||||
free(var);
|
||||
|
||||
|
@ -59,7 +59,9 @@ static int nerrs = 0;
|
||||
static int parsefilterspec(const char* spec, unsigned int* idp, size_t* nparamsp, unsigned int** paramsp);
|
||||
#endif
|
||||
|
||||
#ifdef WORD_BIGENDIAN
|
||||
static void byteswap8(unsigned char* mem);
|
||||
#endif
|
||||
|
||||
static void
|
||||
report(const char* which)
|
||||
@ -72,7 +74,7 @@ report(const char* which)
|
||||
static void
|
||||
mismatch(size_t i, unsigned int baseline, unsigned int params)
|
||||
{
|
||||
fprintf(stderr,"mismatch: [%d] baseline=%ud spec=%ud\n",i,baseline,params);
|
||||
fprintf(stderr,"mismatch: [%d] baseline=%ud spec=%ud\n",(int)i,baseline,params);
|
||||
fflush(stderr);
|
||||
nerrs++;
|
||||
}
|
||||
@ -86,6 +88,8 @@ main(int argc, char **argv)
|
||||
size_t i,nparams = 0;
|
||||
unsigned int* params = NULL;
|
||||
|
||||
printf("\nTesting filter parser.\n");
|
||||
|
||||
#ifdef USE_INTERNAL
|
||||
stat = parsefilterspec(spec,&id,&nparams,¶ms);
|
||||
#else
|
||||
@ -125,9 +129,16 @@ main(int argc, char **argv)
|
||||
if(ul.ull != 18446744073709551615ULL)
|
||||
report("ul.ull");
|
||||
|
||||
if (params)
|
||||
free(params);
|
||||
|
||||
if (!nerrs)
|
||||
printf("SUCCESS!!\n");
|
||||
|
||||
return (nerrs > 0 ? 1 : 0);
|
||||
}
|
||||
|
||||
#ifdef WORD_BIGENDIAN
|
||||
/* Byte swap an 8-byte integer in place */
|
||||
static void
|
||||
byteswap8(unsigned char* mem)
|
||||
@ -146,6 +157,7 @@ byteswap8(unsigned char* mem)
|
||||
mem[3] = mem[4];
|
||||
mem[4] = c;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_INTERNAL
|
||||
static int
|
||||
|
Loading…
Reference in New Issue
Block a user