mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-18 15:55:12 +08:00
fixed def_var_chunking call bug
This commit is contained in:
parent
746b9e55e2
commit
f81628eeb1
@ -550,12 +550,14 @@ nc_def_var_fletcher32(int ncid, int varid, int fletcher32)
|
||||
}
|
||||
|
||||
int
|
||||
nc_def_var_chunking(int ncid, int varid, int storage, const size_t *chunksizesp)
|
||||
nc_def_var_chunking(int ncid, int varid, int storage,
|
||||
const size_t *chunksizesp)
|
||||
{
|
||||
NC* ncp;
|
||||
int stat = NC_check_id(ncid,&ncp);
|
||||
int stat = NC_check_id(ncid, &ncp);
|
||||
if(stat != NC_NOERR) return stat;
|
||||
return ncp->dispatch->def_var_chunking(ncid,varid,storage,chunksizesp);
|
||||
return ncp->dispatch->def_var_chunking(ncid, varid, storage,
|
||||
chunksizesp);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -38,7 +38,7 @@ get_mem_used1(int *mem_used)
|
||||
system(cmd);
|
||||
|
||||
/* Read the results and delete temp file. */
|
||||
if (!(fp = fopen(TMP_FILE_NAME, "r"))) ERR;
|
||||
if (!(fp = fopen(TMP_FILE_NAME, "r"))) exit;
|
||||
num_char = fread(blob, MAX_LEN, 1, fp);
|
||||
sscanf(blob, "%d", mem_used);
|
||||
fclose(fp);
|
||||
|
@ -58,7 +58,7 @@ main(int argc, char **argv)
|
||||
if (nc_def_dim(ncid, "d1", D1, &dimids[1])) ERR;
|
||||
if (nc_def_dim(ncid, "d2", D2, &dimids[2])) ERR;
|
||||
if (nc_def_var(ncid, LARGE_VAR_NAME, NC_FLOAT, NDIMS3, dimids, &varid)) ERR;
|
||||
if (nc_def_var_chunking(ncid, varid, NULL, chunk_sizes, NULL)) ERR;
|
||||
if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, chunk_sizes)) ERR;
|
||||
if (nc_enddef(ncid)) ERR;
|
||||
|
||||
/* Write the data one slice at a time. */
|
||||
|
@ -75,7 +75,7 @@ main(int argc, char **argv)
|
||||
if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
|
||||
|
||||
/* Get the string, check it, and free it. */
|
||||
strcpy(data_in, "");
|
||||
strcpy(data_in[0], "");
|
||||
if (nc_get_var_string(ncid, varid_in, data_in)) ERR;
|
||||
if (strcmp(data_in[0], data_out[0])) ERR;
|
||||
if (nc_free_string(1, data_in)) ERR;
|
||||
|
Loading…
Reference in New Issue
Block a user