From cf92670687e8bbcf90d2010fe9bf552cb0e46d2e Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Wed, 17 Jan 2018 09:20:20 -0700 Subject: [PATCH] added guards for header files that needed them --- include/rnd.h | 6 +++--- ncdap_test/t_dap3a.c | 1 - ncdump/indent.h | 6 +++++- ncdump/isnan.h | 6 +++++- ncdump/ncdump.c | 2 +- ncdump/nctime0.h | 7 ++++++- ncdump/utils.h | 5 +++++ ncdump/vardata.h | 6 +++++- ncgen/nc_iter.h | 6 +++--- 9 files changed, 33 insertions(+), 12 deletions(-) diff --git a/include/rnd.h b/include/rnd.h index b26de52c1..90da7d2a1 100644 --- a/include/rnd.h +++ b/include/rnd.h @@ -7,8 +7,8 @@ * Glenn Davis, 1996 */ -#ifndef _RND_ -#define _RND_ +#ifndef _RND_H +#define _RND_H /* useful for aligning memory */ #define _RNDUP(x, unit) ((((x) + (unit) - 1) / (unit)) \ @@ -19,4 +19,4 @@ #define M_RNDUP(x) _RNDUP(x, M_RND_UNIT) #define M_RNDDOWN(x) __RNDDOWN(x, M_RND_UNIT) -#endif /* _RND_ */ +#endif /* _RND_H */ diff --git a/ncdap_test/t_dap3a.c b/ncdap_test/t_dap3a.c index 518358f49..535579ace 100644 --- a/ncdap_test/t_dap3a.c +++ b/ncdap_test/t_dap3a.c @@ -113,7 +113,6 @@ int main() int ncstat = NC_NOERR; char url[8102]; const char* topsrcdir; - size_t len; #ifndef USE_NETCDF4 int i,j; #endif diff --git a/ncdump/indent.h b/ncdump/indent.h index d69c3ad77..15b8981f0 100644 --- a/ncdump/indent.h +++ b/ncdump/indent.h @@ -1,8 +1,10 @@ /********************************************************************* * Copyright 2007, UCAR/Unidata * See netcdf/COPYRIGHT file for copying and redistribution conditions. - * $Header: /upc/share/CVS/netcdf-3/ncdump/indent.h,v 1.1 2007/05/20 20:42:30 russ Exp $ + * Russ Rew *********************************************************************/ +#ifndef _INDENT_H +#define _INDENT_H #ifdef __cplusplus extern "C" { @@ -18,3 +20,5 @@ extern int indent_get(); /* return current indent */ #ifdef __cplusplus } #endif + +#endif /* _INDENT_H */ diff --git a/ncdump/isnan.h b/ncdump/isnan.h index 3d7f50e2e..c62f801fe 100644 --- a/ncdump/isnan.h +++ b/ncdump/isnan.h @@ -1,8 +1,10 @@ /********************************************************************* * Copyright 2008, University Corporation for Atmospheric Research * See netcdf/README file for copying and redistribution conditions. - * $Id: isnan.h,v 1.3 2008/04/23 22:05:00 russ Exp $ + * Russ Rew *********************************************************************/ +#ifndef _ISNAN_H +#define _ISNAN_H #include "config.h" @@ -20,3 +22,5 @@ #if ! (defined(isfinite) || HAVE_DECL_ISFINITE) #define isfinite(x) (!(isinf(x)||isnan(x))) #endif /* !HAVE_DECL_ISFINITE */ + +#endif /* _ISNAN_H */ diff --git a/ncdump/ncdump.c b/ncdump/ncdump.c index 5bd2f2d7b..492cf6cfa 100644 --- a/ncdump/ncdump.c +++ b/ncdump/ncdump.c @@ -273,7 +273,7 @@ kind_string(int kind) case NC_FORMAT_NETCDF4_CLASSIC: return "netCDF-4 classic model"; default: - error("unrecognized file format: %d"); + error("unrecognized file format: %d", kind); return "unrecognized"; } } diff --git a/ncdump/nctime0.h b/ncdump/nctime0.h index a59b92175..c3558e284 100644 --- a/ncdump/nctime0.h +++ b/ncdump/nctime0.h @@ -1,8 +1,10 @@ /********************************************************************* * Copyright 2008, University Corporation for Atmospheric Research * See netcdf/COPYRIGHT file for copying and redistribution conditions. - * $Id: nctime.h,v 1.6 2010/03/18 19:24:26 russ Exp $ + * Russ Rew *********************************************************************/ +#ifndef _NCTIME0_H +#define _NCTIME0_H #include "nctime.h" @@ -12,3 +14,6 @@ extern int is_valid_time_unit(const char *units); extern int is_bounds_att(ncatt_t *attp); extern void get_timeinfo(int ncid, int varid, ncvar_t *vp); extern void print_att_times(int ncid, int varid, const ncatt_t *att); + +#endif /* _NCTIME0_H */ + diff --git a/ncdump/utils.h b/ncdump/utils.h index 6d06ed7b7..237647adf 100644 --- a/ncdump/utils.h +++ b/ncdump/utils.h @@ -5,6 +5,8 @@ * Stuff that's common to both ncdump and nccopy * *********************************************************************/ +#ifndef _UTILS_H +#define _UTILS_H #include "config.h" @@ -157,3 +159,6 @@ extern int getrootid(int grpid); #ifdef __cplusplus } #endif + +#endif /* _UTILS_H */ + diff --git a/ncdump/vardata.h b/ncdump/vardata.h index 287bb7981..a70520720 100644 --- a/ncdump/vardata.h +++ b/ncdump/vardata.h @@ -1,8 +1,10 @@ /********************************************************************* * Copyright 1993, University Corporation for Atmospheric Research * See netcdf/COPYRIGHT file for copying and redistribution conditions. - * $Header: /upc/share/CVS/netcdf-3/ncdump/vardata.h,v 1.7 2007/10/08 02:47:57 russ Exp $ + * Russ Rew *********************************************************************/ +#ifndef _VARDATA_H +#define _VARDATA_H extern char *progname; /* for error messages */ @@ -43,3 +45,5 @@ extern void pr_any_att_vals( const ncatt_t *attp, const void *vals ); #ifdef __cplusplus } #endif + +#endif /* _VARDATA_H */ diff --git a/ncgen/nc_iter.h b/ncgen/nc_iter.h index ef2e88f1a..8c9f70ae4 100644 --- a/ncgen/nc_iter.h +++ b/ncgen/nc_iter.h @@ -4,8 +4,8 @@ * "$Id $" *********************************************************************/ -#ifndef _NC_ITER_ -#define _NC_ITER_ +#ifndef _NC_ITER_H +#define _NC_ITER_H #include @@ -49,4 +49,4 @@ nc_next_iter(nciter_t *iterp, size_t *start, size_t *count); } #endif -#endif /* _NC_ITER_ */ +#endif /* _NC_ITER_H */