fixed some header files, checked some return values

This commit is contained in:
Ed Hartnett 2018-01-17 08:25:15 -07:00
parent 2281f3e133
commit 09ee32b205
4 changed files with 23 additions and 12 deletions

View File

@ -1,9 +1,14 @@
/*
* Copyright 1996, University Corporation for Atmospheric Research
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
/* Copyright 1996-2018, University Corporation for Atmospheric
* Research See netcdf/COPYRIGHT file for copying and redistribution
* conditions.
*
* This header file contains some macros for rounding numbers.
*
* Glenn Davis, 1996
*/
/* $Id: rnd.h,v 2.13 1996/12/11 05:46:54 davis Exp $ */
#ifndef _RNDUP
#ifndef _RND_
#define _RND_
/* useful for aligning memory */
#define _RNDUP(x, unit) ((((x) + (unit) - 1) / (unit)) \
@ -14,4 +19,4 @@
#define M_RNDUP(x) _RNDUP(x, M_RND_UNIT)
#define M_RNDDOWN(x) __RNDDOWN(x, M_RND_UNIT)
#endif
#endif /* _RND_ */

View File

@ -2028,7 +2028,9 @@ read_var(NC_GRP_INFO_T *grp, hid_t datasetid, const char *obj_name,
att_read_var_callbk, &att_info)) < 0)
BAIL(NC_EATTMETA);
nc4_vararray_add(grp, var);
/* Add a var to the variable array, growing it as needed. */
if ((retval = nc4_vararray_add(grp, var)))
BAIL(retval);
/* Is this a deflated variable with a chunksize greater than the
* current cache size? */
@ -2866,7 +2868,9 @@ nc4_open_hdf4_file(const char *path, int mode, NC *nc)
var->created = NC_TRUE;
var->written_to = NC_TRUE;
nc4_vararray_add(grp, var);
/* Add a var to the variable array, growing it as needed. */
if ((retval = nc4_vararray_add(grp, var)))
BAIL(retval);
/* Open this dataset in HDF4 file. */
if ((var->sdsid = SDselect(h5->sdid, v)) == FAIL)

View File

@ -610,7 +610,9 @@ NC4_def_var(int ncid, const char *name, nc_type xtype,
var->ndims = ndims;
var->is_new_var = NC_TRUE;
nc4_vararray_add(grp, var);
/* Add a var to the variable array, growing it as needed. */
if ((retval = nc4_vararray_add(grp, var)))
BAIL(retval);
/* Point to the type, and increment its ref. count */
var->type_info = type_info;

View File

@ -4,8 +4,8 @@
* "$Id $"
*********************************************************************/
#ifndef _NCITER_
#define _NCITER_
#ifndef _NC_ITER_
#define _NC_ITER_
#include <netcdf.h>
@ -49,4 +49,4 @@ nc_next_iter(nciter_t *iterp, size_t *start, size_t *count);
}
#endif
#endif /* _NCITER_ */
#endif /* _NC_ITER_ */