Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bunch of rename issues, including Charlie Zender's reported problem... #755

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
d5b37ad
cleaned up warnings
edhartnett Dec 19, 2017
dd7fd74
adding some more tests for fill values
edhartnett Dec 19, 2017
fec5696
more tests
edhartnett Dec 20, 2017
8f6e1bb
fixed cdf5 test
edhartnett Dec 20, 2017
cf7a465
more fill value tests
edhartnett Dec 20, 2017
1e4fedc
more tests for fill values
edhartnett Dec 20, 2017
f4e5353
more tests of fill values, strings, and unlimited dim
edhartnett Dec 20, 2017
8d4b900
fixed for classic
edhartnett Dec 20, 2017
2d644f8
fixed classic problem
edhartnett Dec 20, 2017
fea933f
fixed CDF5 test problem
edhartnett Dec 20, 2017
e712239
fixing test for CDF5
edhartnett Dec 20, 2017
6b2600b
fixed bug with fill value of NC_STRING
edhartnett Dec 21, 2017
153c9dc
more string fill value fixes
edhartnett Dec 21, 2017
d118957
fixed some problems with strings and fill values
edhartnett Dec 21, 2017
553d686
fixed test
edhartnett Dec 22, 2017
81858e4
more tests for NC_STRING and fill values
edhartnett Dec 22, 2017
ee6f897
fixed tests
edhartnett Dec 22, 2017
d29dbc5
Merge branch 'master' into ejh_more_tests
edhartnett Dec 22, 2017
e94e4a9
fixed tests
edhartnett Dec 22, 2017
dd8582c
merged changes from master
edhartnett Dec 22, 2017
093ce89
fixed v2 problem in test
edhartnett Dec 22, 2017
20124bf
removed useless check for negative size_t value
edhartnett Dec 22, 2017
c6b8506
documented relationship between contiguous and filters
edhartnett Dec 22, 2017
7e26052
moved two netcdf-4 tests to nc_test4
edhartnett Dec 22, 2017
a68d0d0
added assert, removed check that could never be true
edhartnett Dec 22, 2017
ec49d71
more testing
edhartnett Dec 22, 2017
7ae88f7
more tests
edhartnett Dec 22, 2017
d8c3180
check for read-only in nc_def_var_extra(), remove unneeded hdf4 checks
edhartnett Dec 23, 2017
4e67ac8
more fill value testing
edhartnett Dec 23, 2017
9fbab6a
more tests
edhartnett Dec 23, 2017
bb3977e
more tests for chunking
edhartnett Dec 23, 2017
e167482
more tests
edhartnett Dec 24, 2017
c3f1a6c
fixed test for parallel builds
edhartnett Dec 26, 2017
901ea8d
fixed NULL name segfault in nc_rename_var() and more testing
edhartnett Dec 26, 2017
cbae29f
more work on nc_rename_dim() and testing
edhartnett Dec 26, 2017
62f70b3
more work on nc_rename_dim() and testing
edhartnett Dec 26, 2017
39876fd
more cleanup, documentation
edhartnett Dec 26, 2017
e72ce01
removed unnecessary hdf4 check in nc_def_var()
edhartnett Dec 26, 2017
cc8710d
more tests for HDF4 and def_var
edhartnett Dec 26, 2017
6e4118a
more test development
edhartnett Dec 26, 2017
d3797a4
more test work on renames
edhartnett Dec 27, 2017
9d7dd5a
fixed test
edhartnett Dec 27, 2017
15ff618
added documentation
edhartnett Dec 27, 2017
51eec10
clean up
edhartnett Dec 27, 2017
dd98deb
clean up and documentation
edhartnett Dec 27, 2017
2f8f1d2
documentation fixes
edhartnett Dec 27, 2017
6d67aab
more documentation
edhartnett Dec 27, 2017
2f450ae
fixed problem with dimid attribute not being deleted
edhartnett Dec 27, 2017
f2a69bd
more development and testing of renames
edhartnett Dec 28, 2017
1e78214
now check return values from nc4_vararray_add()
edhartnett Dec 29, 2017
c9c54ea
broke up some if statements to enable determination of test coverage …
edhartnett Dec 29, 2017
3c0f247
more code coverage
edhartnett Dec 29, 2017
1f38b0f
more code coverage
edhartnett Dec 29, 2017
589a938
more work on renames
edhartnett Dec 31, 2017
5deddda
finally fixed a rename problem with dims
edhartnett Dec 31, 2017
660f559
fixed Charlie Zenders reported rename problem
edhartnett Jan 1, 2018
93fcb74
turned off debugging macro
edhartnett Jan 1, 2018
94ab2a5
merged warning fixes from ejh_more_tests
edhartnett Jan 1, 2018
bb89f51
readded DLL stuff
edhartnett Jan 1, 2018
625a920
added header guard to rnd.h
edhartnett Jan 1, 2018
e3605f0
attempt to fix missing par functions in DLL to allow fortran dll to work
edhartnett Jan 1, 2018
2bfdeb3
fixed alert in ncdump.c
edhartnett Jan 1, 2018
fcf2026
fixed alert for nciter.h
edhartnett Jan 1, 2018
86d376a
added some header guards to header files that needed them
edhartnett Jan 1, 2018
832e6ec
undid attempted windows fix
edhartnett Jan 2, 2018
4a887c5
Merge branch 'master' into ejh_fill_values
edhartnett Jan 3, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ check_nc_config:

install-data-hook:

if BUILD_DLL
cp liblib/netcdfdll.def $(DESTDIR)${prefix}/bin
endif # BUILD_DLL

@echo ''
@echo '+-------------------------------------------------------------+'
@echo '| Congratulations! You have successfully installed netCDF! |'
Expand Down
14 changes: 14 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,20 @@ AC_CONFIG_SRCDIR([include/netcdf.h])

AC_MSG_NOTICE([checking user options])

# If --enable-dll is specified the DLL will be built. This only works
# on mingw.
AC_MSG_CHECKING([whether a win32 DLL is desired])
AC_ARG_ENABLE([dll],
[AS_HELP_STRING([--enable-dll],
[build a win32 DLL (only works on mingw)])])
test "x$enable_dll" = xyes || enable_dll=no
AC_MSG_RESULT([$enable_dll])
if test "x$enable_dll" = xyes; then
AC_DEFINE(DLL_NETCDF, 1, [set this only when building a DLL under MinGW])
AC_DEFINE(DLL_EXPORT, 1, [set this only when building a DLL under MinGW])
fi
AM_CONDITIONAL(BUILD_DLL, [test x$enable_dll = xyes])

# Did the user specify a default minimum blocksize (NCIO_MINBLOCKSIZE) for posixio?
AC_MSG_CHECKING([whether a NCIO_MINBLOCKSIZE was specified])
AC_ARG_WITH([minblocksize],
Expand Down
9 changes: 8 additions & 1 deletion include/nc4internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ typedef enum {VAR, DIM, ATT} NC_OBJ_T;
* as the netCDF dimid. */
#define NC_DIMID_ATT_NAME "_Netcdf4Dimid"

/** This is the name of the class HDF5 dimension scale attribute. */
#define HDF5_DIMSCALE_CLASS_ATT_NAME "CLASS"

/** This is the name of the name HDF5 dimension scale attribute. */
#define HDF5_DIMSCALE_NAME_ATT_NAME "NAME"

/* Boolean type, to make the code easier to read */
typedef enum {NC_FALSE = 0, NC_TRUE = 1} nc_bool_t;

Expand All @@ -126,7 +132,7 @@ typedef struct NC_DIM_INFO
nc_bool_t unlimited; /* True if the dimension is unlimited */
nc_bool_t extended; /* True if the dimension needs to be extended */
nc_bool_t too_long; /* True if len is too big to fit in local size_t. */
hid_t hdf_dimscaleid;
hid_t hdf_dimscaleid; /* Non-zero if a DIM_WITHOUT_VARIABLE dataset is in use (no coord var). */
HDF5_OBJID_T hdf5_objid;
struct NC_VAR_INFO *coord_var; /* The coord var, if it exists. */
} NC_DIM_INFO_T;
Expand Down Expand Up @@ -344,6 +350,7 @@ int nc4_convert_type(const void *src, void *dest,
/* These functions do HDF5 things. */
int rec_detach_scales(NC_GRP_INFO_T *grp, int dimid, hid_t dimscaleid);
int rec_reattach_scales(NC_GRP_INFO_T *grp, int dimid, hid_t dimscaleid);
int delete_existing_dimscale_dataset(NC_GRP_INFO_T *grp, int dimid, NC_DIM_INFO_T *dim);
int nc4_open_var_grp2(NC_GRP_INFO_T *grp, int varid, hid_t *dataset);
int nc4_put_vara(NC *nc, int ncid, int varid, const size_t *startp,
const size_t *countp, nc_type xtype, int is_long, void *op);
Expand Down
3 changes: 2 additions & 1 deletion include/nc_tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ for conditions of use.
#include "netcdf.h"
//#include "err_macros.h"


#define NC_TESTS_MAX_DIMS 1024 /**< NC_MAX_DIMS for tests. Allows different NC_MAX_DIMS values without breaking this test with a heap or stack overflow. */
#define MAX_NUM_FORMATS 5 /**< Max number of available binary formats. */
#define NUM_CLASSIC_TYPES 6 /**< Number of classic types. */
#define NUM_ENHANCED_TYPES 12 /**< Number of types including enhanced types. */

/** Useful define for tests. */
/** \{ */
Expand Down
2 changes: 2 additions & 0 deletions include/netcdf_par.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ extern "C" {
/** Use with nc_var_par_access() to set parallel access to collective. */
#define NC_COLLECTIVE 1

#define EXTERNL MSC_EXTRA extern /**< Needed for DLL build. */

/* Create a file and enable parallel I/O. */
extern int
nc_create_par(const char *path, int cmode, MPI_Comm comm, MPI_Info info,
Expand Down
5 changes: 5 additions & 0 deletions include/rnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
*/
/* $Id: rnd.h,v 2.13 1996/12/11 05:46:54 davis Exp $ */
#ifndef _RND_H
#define _RND_H

#ifndef _RNDUP

/* useful for aligning memory */
Expand All @@ -15,3 +18,5 @@
#define M_RNDDOWN(x) __RNDDOWN(x, M_RND_UNIT)

#endif

#endif /* _RND_H */
2 changes: 1 addition & 1 deletion libdap4/d4chunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ NCD4_dechunk(NCD4meta* metadata)
metadata->localchecksumming = metadata->serial.remotechecksumming;

metadata->serial.remotelittleendian = ((hdr.flags & LITTLE_ENDIAN_CHUNK) ? 1 : 0);
metadata->serial.dmr = p;
metadata->serial.dmr = (char *)p;
metadata->serial.dmr[hdr.count-1] = '\0';
metadata->serial.dmr = strdup(metadata->serial.dmr);
if(metadata->serial.dmr == NULL)
Expand Down
5 changes: 5 additions & 0 deletions libdispatch/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ libdispatch_la_SOURCES += dgroup.c dvlen.c dcompound.c dtype.c denum.c \
dopaque.c dfilter.c ncaux.c
endif # USE_NETCDF4

# Turn on pre-processor flag when building a DLL for windows.
if BUILD_DLL
libdispatch_la_CPPFLAGS += -DDLL_EXPORT
endif # BUILD_DLL

# Add V2 API convenience library if needed.
if BUILD_V2
noinst_LTLIBRARIES += libnetcdf2.la
Expand Down
30 changes: 14 additions & 16 deletions libdispatch/dfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1653,20 +1653,20 @@ nc_inq_type(int ncid, nc_type xtype, char *name, size_t *size)
}

/**
Check the create mode parameter for sanity.

Some create flags cannot be used if corresponding library features are
enabled during the build. This function does a pre-check of the mode
flag before calling the dispatch layer nc_create functions.

\param cmode The creation mode flag.

\returns ::NC_NOERR No error.
\returns ::NC_ENOTBUILT Requested feature not built into library
\returns ::NC_NINVAL Invalid combination of modes.
\internal
\ingroup dispatch
\author Ed Hartnett
* @internal Check the create mode parameter for sanity.
*
* Some create flags cannot be used if corresponding library features are
* enabled during the build. This function does a pre-check of the mode
* flag before calling the dispatch layer nc_create functions.
*
* @param mode The creation mode flag.
*
* @return ::NC_NOERR No error.
* @return ::NC_ENOTBUILT Requested feature not built into library
* @return ::NC_EINVAL Invalid combination of modes.
*
* @ingroup dispatch
* @author Ed Hartnett
*/
static int
check_create_mode(int mode)
Expand Down Expand Up @@ -2175,7 +2175,6 @@ openmagic(struct MagicFile* file)
}
#ifdef USE_PARALLEL
if (file->use_parallel) {
MPI_Status mstatus;
int retval;
MPI_Offset size;
MPI_Comm comm = MPI_COMM_WORLD;
Expand Down Expand Up @@ -2293,7 +2292,6 @@ closemagic(struct MagicFile* file)
if(file->inmemory) goto done; /* noop*/
#ifdef USE_PARALLEL
if (file->use_parallel) {
MPI_Status mstatus;
int retval;
if((retval = MPI_File_close(&file->fh)) != MPI_SUCCESS)
{status = NC_EPARINIT; goto done;}
Expand Down
Loading