mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-04-24 18:30:51 +08:00
cleanup whitespace issues
This commit is contained in:
parent
9d187c099a
commit
d1946e4b69
@ -36,35 +36,35 @@ main()
|
||||
hsize_t dimscale_dims[1] = {DIM1_LEN};
|
||||
|
||||
/* Open file and create group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
|
||||
/* Create our dimension scale. Use the built-in NAME attribute
|
||||
* on the dimscale. */
|
||||
if ((dimscale_spaceid = H5Screate_simple(1, dimscale_dims,
|
||||
dimscale_dims)) < 0) ERR;
|
||||
dimscale_dims)) < 0) ERR;
|
||||
if ((dimscaleid = H5Dcreate(grpid, DIMSCALE_NAME, H5T_NATIVE_INT,
|
||||
dimscale_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
dimscale_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSset_scale(dimscaleid, NAME_ATTRIBUTE) < 0) ERR;
|
||||
|
||||
/* Create a 1D variable which uses the dimscale. Attach a label
|
||||
* to this scale. */
|
||||
if ((var1_spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
if ((var1_datasetid = H5Dcreate(grpid, VAR1_NAME, H5T_NATIVE_INT,
|
||||
var1_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
var1_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSattach_scale(var1_datasetid, dimscaleid, 0) < 0) ERR;
|
||||
if (H5DSset_label(var1_datasetid, 0, FIFTIES_SONG) < 0) ERR;
|
||||
|
||||
/* Create a 1D variabls that doesn't use the dimension scale. */
|
||||
if ((var2_datasetid = H5Dcreate(grpid, VAR2_NAME, H5T_NATIVE_INT,
|
||||
var1_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
var1_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
/* Create a 2D dataset which uses the scale for one of its
|
||||
* dimensions. */
|
||||
if ((var3_spaceid = H5Screate_simple(2, dims, dims)) < 0) ERR;
|
||||
if ((var3_datasetid = H5Dcreate(grpid, VAR3_NAME, H5T_NATIVE_INT,
|
||||
var3_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
var3_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSattach_scale(var3_datasetid, dimscaleid, 0) < 0) ERR;
|
||||
|
||||
/* Detach the scale. */
|
||||
@ -72,16 +72,15 @@ main()
|
||||
|
||||
/* Close up the shop. */
|
||||
if (H5Dclose(dimscaleid) < 0 ||
|
||||
H5Dclose(var1_datasetid) < 0 ||
|
||||
H5Dclose(var2_datasetid) < 0 ||
|
||||
H5Dclose(var3_datasetid) < 0 ||
|
||||
H5Sclose(var1_spaceid) < 0 ||
|
||||
H5Sclose(var3_spaceid) < 0 ||
|
||||
H5Sclose(dimscale_spaceid) < 0) ERR;
|
||||
H5Dclose(var1_datasetid) < 0 ||
|
||||
H5Dclose(var2_datasetid) < 0 ||
|
||||
H5Dclose(var3_datasetid) < 0 ||
|
||||
H5Sclose(var1_spaceid) < 0 ||
|
||||
H5Sclose(var3_spaceid) < 0 ||
|
||||
H5Sclose(dimscale_spaceid) < 0) ERR;
|
||||
if (H5Gclose(grpid) < 0 ||
|
||||
H5Fclose(fileid) < 0) ERR;
|
||||
H5Fclose(fileid) < 0) ERR;
|
||||
}
|
||||
SUMMARIZE_ERR;
|
||||
FINAL_RESULTS;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user