mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-18 15:55:12 +08:00
changed var atts_not_read to atts_read
This commit is contained in:
parent
59ee728b93
commit
243cef8fa5
@ -153,7 +153,7 @@ typedef struct NC_VAR_INFO
|
||||
nc_bool_t created; /* Variable has already been created (_not_ that it was just created) */
|
||||
nc_bool_t written_to; /* True if variable has data written to it */
|
||||
struct NC_TYPE_INFO *type_info;
|
||||
int atts_not_read; /* If true, the atts have not yet been read. */
|
||||
int atts_read; /* If true, the atts have been read. */
|
||||
nc_bool_t meta_read; /* True if this vars metadata has been completely read. */
|
||||
nc_bool_t coords_read; /* True if this var has hidden coordinates att, and it has been read. */
|
||||
NCindex *att; /* NCindex<NC_ATT_INFO_T*> */
|
||||
|
@ -27,9 +27,10 @@ static int
|
||||
getattlist(NC_GRP_INFO_T *grp, int varid, NC_VAR_INFO_T **varp,
|
||||
NCindex **attlist)
|
||||
{
|
||||
NC_VAR_INFO_T* var;
|
||||
int retval;
|
||||
|
||||
assert(grp && attlist);
|
||||
|
||||
if (varid == NC_GLOBAL)
|
||||
{
|
||||
/* Do we need to read the atts? */
|
||||
@ -43,12 +44,14 @@ getattlist(NC_GRP_INFO_T *grp, int varid, NC_VAR_INFO_T **varp,
|
||||
}
|
||||
else
|
||||
{
|
||||
NC_VAR_INFO_T *var;
|
||||
|
||||
if (!(var = (NC_VAR_INFO_T *)ncindexith(grp->vars, varid)))
|
||||
return NC_ENOTVAR;
|
||||
assert(var->hdr.id == varid);
|
||||
|
||||
/* Do we need to read the atts? */
|
||||
if (var->atts_not_read)
|
||||
if (!var->atts_read)
|
||||
if ((retval = nc4_read_atts(grp, var)))
|
||||
return retval;
|
||||
|
||||
|
@ -849,7 +849,7 @@ nc4_hdf5_find_grp_var_att(int ncid, int varid, const char *name, int attnum,
|
||||
return NC_ENOTVAR;
|
||||
|
||||
/* Do we need to read the var attributes? */
|
||||
if (my_var->atts_not_read)
|
||||
if (!my_var->atts_read)
|
||||
if ((retval = nc4_read_atts(my_grp, my_var)))
|
||||
return retval;
|
||||
|
||||
|
@ -1308,7 +1308,7 @@ read_var(NC_GRP_INFO_T *grp, hid_t datasetid, const char *obj_name,
|
||||
H5Iinc_ref(hdf5_var->hdf_datasetid); /* Increment number of objects using ID */
|
||||
incr_id_rc++; /* Indicate that we've incremented the ref. count (for errors) */
|
||||
var->created = NC_TRUE;
|
||||
var->atts_not_read = 1; /* Don't read var atts until user asks for one. */
|
||||
var->atts_read = 0;
|
||||
|
||||
/* Try and read the dimids from the COORDINATES attribute. If it's
|
||||
* not present, we will have to do dimsscale matching to locate the
|
||||
@ -2112,7 +2112,7 @@ nc4_read_atts(NC_GRP_INFO_T *grp, NC_VAR_INFO_T *var)
|
||||
|
||||
/* Remember that we have read the atts for this var or group. */
|
||||
if (var)
|
||||
var->atts_not_read = 0;
|
||||
var->atts_read = 1;
|
||||
else
|
||||
grp->atts_not_read = 0;
|
||||
|
||||
|
@ -410,6 +410,7 @@ NC4_def_var(int ncid, const char *name, nc_type xtype,
|
||||
|
||||
var->is_new_var = NC_TRUE;
|
||||
var->meta_read = NC_TRUE;
|
||||
var->atts_read = NC_TRUE;
|
||||
|
||||
/* Point to the type, and increment its ref. count */
|
||||
var->type_info = type;
|
||||
|
Loading…
Reference in New Issue
Block a user