mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-02-05 16:20:10 +08:00
Merge branch 'master' into travis-update
This commit is contained in:
commit
89dab75455
12
configure.ac
12
configure.ac
@ -48,6 +48,18 @@ AC_CANONICAL_TARGET
|
||||
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
##
|
||||
# Some files need to exist in build directories
|
||||
# that do not correspond to their source directory, or
|
||||
# the test program makes an assumption about where files
|
||||
# live. AC_CONFIG_LINKS provides a mechanism to link/copy files
|
||||
# if an out-of-source build is happening.
|
||||
##
|
||||
|
||||
AC_CONFIG_LINKS([nc_test4/ref_hdf5_compat1.nc:nc_test4/ref_hdf5_compat1.nc])
|
||||
AC_CONFIG_LINKS([nc_test4/ref_hdf5_compat2.nc:nc_test4/ref_hdf5_compat2.nc])
|
||||
AC_CONFIG_LINKS([nc_test4/ref_hdf5_compat3.nc:nc_test4/ref_hdf5_compat3.nc])
|
||||
|
||||
# This call is required by automake.
|
||||
AM_INIT_AUTOMAKE([foreign dist-zip subdir-objects])
|
||||
|
||||
|
@ -650,20 +650,24 @@ ncuridecodeparams(NCURI* ncuri)
|
||||
int
|
||||
ncurilookup(NCURI* uri, const char* key, const char** resultp)
|
||||
{
|
||||
int i;
|
||||
char* value = NULL;
|
||||
if(uri == NULL || key == NULL || uri->params == NULL) return 0;
|
||||
if(uri->paramlist == NULL) {
|
||||
int i;
|
||||
char* value = NULL;
|
||||
if(uri == NULL || key == NULL || uri->params == NULL) return 0;
|
||||
if(uri->paramlist == NULL) {
|
||||
i = ncuridecodeparams(uri);
|
||||
if(!i) return 0;
|
||||
}
|
||||
/* Coverity[FORWARD_NULL] */
|
||||
i = ncfind(uri->paramlist,key);
|
||||
if(i < 0)
|
||||
}
|
||||
/* Coverity[FORWARD_NULL] */
|
||||
i = ncfind(uri->paramlist,key);
|
||||
if(i < 0)
|
||||
return 0;
|
||||
|
||||
if(uri->paramlist) {
|
||||
value = uri->paramlist[(2*i)+1];
|
||||
if(resultp) *resultp = value;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -47,7 +47,7 @@ EXTRA_DIST = attr.m4 ncx.m4 putget.m4 $(man_MANS) CMakeLists.txt XGetopt.c
|
||||
|
||||
# This tells make how to turn .m4 files into .c files.
|
||||
.m4.c:
|
||||
m4 $(AM_M4FLAGS) $(M4FLAGS) -s $< >$@
|
||||
m4 $(AM_M4FLAGS) $(M4FLAGS) -s $< >${srcdir}/$@
|
||||
|
||||
# The C API man page.
|
||||
man_MANS = netcdf.3
|
||||
|
@ -11,6 +11,8 @@
|
||||
|
||||
#define ACTIVE 1
|
||||
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
extern uint32_t hash_fast(const void *key, size_t length);
|
||||
|
||||
/* NOTE: 'data' is the dimid or varid which is non-negative.
|
||||
@ -144,7 +146,7 @@ void NC_hashmapAddDim(const NC_dimarray* ncap, long data, const char *name)
|
||||
{
|
||||
unsigned long key = hash_fast(name, strlen(name));
|
||||
NC_hashmap* hash = ncap->hashmap;
|
||||
|
||||
|
||||
if (hash->size*3/4 <= hash->count) {
|
||||
rehashDim(ncap);
|
||||
}
|
||||
@ -153,7 +155,7 @@ void NC_hashmapAddDim(const NC_dimarray* ncap, long data, const char *name)
|
||||
{
|
||||
unsigned long i;
|
||||
unsigned long index = key % hash->size;
|
||||
unsigned long step = (key % (hash->size-2)) + 1;
|
||||
unsigned long step = (key % MAX(1,(hash->size-2))) + 1;
|
||||
|
||||
for (i = 0; i < hash->size; i++)
|
||||
{
|
||||
@ -191,7 +193,7 @@ void NC_hashmapAddVar(const NC_vararray* ncap, long data, const char *name)
|
||||
{
|
||||
unsigned long key = hash_fast(name, strlen(name));
|
||||
NC_hashmap* hash = ncap->hashmap;
|
||||
|
||||
|
||||
if (hash->size*3/4 <= hash->count) {
|
||||
rehashVar(ncap);
|
||||
}
|
||||
@ -200,7 +202,7 @@ void NC_hashmapAddVar(const NC_vararray* ncap, long data, const char *name)
|
||||
{
|
||||
unsigned long i;
|
||||
unsigned long index = key % hash->size;
|
||||
unsigned long step = (key % (hash->size-2)) + 1;
|
||||
unsigned long step = (key % MAX(1,(hash->size-2))) + 1;
|
||||
|
||||
for (i = 0; i < hash->size; i++)
|
||||
{
|
||||
|
@ -93,14 +93,14 @@ EXTRA_DIST = test_get.m4 test_put.m4 run_valgrind_tests.sh \
|
||||
run_diskless.sh run_diskless2.sh run_mmap.sh run_pnetcdf_test.sh
|
||||
|
||||
# ref_tst_diskless2.cdl is for diff comparison and to produce tst_diskless2.c
|
||||
EXTRA_DIST += ref_tst_diskless2.cdl CMakeLists.txt tst_types.c
|
||||
EXTRA_DIST += ref_tst_diskless2.cdl CMakeLists.txt
|
||||
|
||||
# Only clean these on mainatiner-clean, because they require m4 to
|
||||
# regenerate.
|
||||
#MAINTAINERCLEANFILES = test_get.c test_put.c
|
||||
|
||||
all:
|
||||
cp $(top_builddir)/libsrc/ncx.c .
|
||||
cp $(top_srcdir)/libsrc/ncx.c .
|
||||
|
||||
CLEANFILES += ncx.c
|
||||
|
||||
|
@ -80,7 +80,7 @@ int main() {
|
||||
}
|
||||
|
||||
printf("\t* Puting data in secondary variable:\tnc_put_vara().\n");
|
||||
if (nc_put_vara(ncid,varid2,&startp2,&countp2,data2)) ERR;
|
||||
if (nc_put_vara(ncid,varid2,startp2,countp2,data2)) ERR;
|
||||
|
||||
/***********/
|
||||
/* Actually unnecessary to recreate the issue. */
|
||||
@ -172,7 +172,7 @@ int main() {
|
||||
}
|
||||
|
||||
printf("\t* Puting data in secondary variable:\tnc_put_vara().\n");
|
||||
if (nc_put_vara(ncid,varid2,&startp2,&countp2,data2)) ERR;
|
||||
if (nc_put_vara(ncid,varid2,startp2,countp2,data2)) ERR;
|
||||
|
||||
/***********/
|
||||
/* Actually unnecessary to recreate the issue. */
|
||||
|
Loading…
Reference in New Issue
Block a user