merging branches into develop

This commit is contained in:
Ed Hartnett 2017-11-15 11:24:10 -07:00
commit 07de8e13f8
14 changed files with 21 additions and 21 deletions

View File

@ -261,7 +261,6 @@ fail:
int
nc__testurl(const char* path, char** basenamep)
{
int stat = NC_NOERR;
NCURI* uri;
int ok = 0;
if(ncuriparse(path,&uri) == NCU_OK) {

View File

@ -170,11 +170,13 @@ NC_check_file_type(const char *path, int flags, void *parameters,
int status = NC_NOERR;
int diskless = ((flags & NC_DISKLESS) == NC_DISKLESS);
#ifdef USE_PARALLEL
#ifdef USE_STDIO
int use_parallel = 0;
#else
int use_parallel = ((flags & NC_MPIIO) == NC_MPIIO);
#endif
#endif /* USE_PARALLEL */
int inmemory = (diskless && ((flags & NC_INMEMORY) == NC_INMEMORY));
struct MagicFile file;
@ -2056,7 +2058,7 @@ openmagic(struct MagicFile* file)
/* Get its length */
NC_MEM_INFO* meminfo = (NC_MEM_INFO*)file->parameters;
file->filelen = (long long)meminfo->size;
fprintf(stderr,"XXX: openmagic: memory=0x%llx size=%ld\n",meminfo->memory,meminfo->size);
fprintf(stderr,"XXX: openmagic: memory=0x%llx size=%ld\n",(long long unsigned int)meminfo->memory,meminfo->size);
goto done;
}
#ifdef USE_PARALLEL
@ -2122,7 +2124,7 @@ readmagic(struct MagicFile* file, long pos, char* magic)
if(file->inmemory) {
char* mempos;
NC_MEM_INFO* meminfo = (NC_MEM_INFO*)file->parameters;
fprintf(stderr,"XXX: readmagic: memory=0x%llx size=%ld\n",meminfo->memory,meminfo->size);
fprintf(stderr,"XXX: readmagic: memory=0x%llx size=%ld\n",(long long unsigned int)meminfo->memory,meminfo->size);
fprintf(stderr,"XXX: readmagic: pos=%ld filelen=%lld\n",pos,file->filelen);
if((pos + MAGIC_NUMBER_LEN) > meminfo->size)
{status = NC_EDISKLESS; goto done;}

View File

@ -223,7 +223,7 @@ rctrim(char* text)
static NClist*
rcorder(NClist* rc)
{
int i,j;
int i;
int len = nclistlength(rc);
NClist* newrc = nclistnew();
if(rc == NULL || len == 0) return newrc;

View File

@ -304,7 +304,7 @@ nc_inq_rec(
return status;
recsizes[varid] = rsize;
}
return NC_NOERR;
return NC_NOERR;
}
/** \ingroup v2_api

View File

@ -304,7 +304,6 @@ ncuriparse(const char* uri0, NCURI** durip)
/* Check for leading user:pwd@ */
char* newhost = strchr(tmp.host,'@');
if(newhost != NULL) {
size_t rem;
if(newhost == tmp.host)
{THROW(NCU_EUSRPWD);} /* we have proto://@ */
terminate(newhost); /* overwrite '@' */
@ -781,7 +780,6 @@ ncuriencodeonly(char* s, char* allowable)
*outptr++ = '+';
} else {
/* search allowable */
int c2;
char* p = strchr(allowable,c);
if(p != NULL) {
*outptr++ = (char)c;

View File

@ -39,7 +39,6 @@ main(int argc, char** argv)
int failcount = 0;
for(test=PATHTESTS;test->path;test++) {
int ret = 0;
char* cvt = NCpathcvt(test->path);
if(cvt == NULL) {
fprintf(stderr,"TEST returned NULL: %s\n",test->path);

View File

@ -132,7 +132,6 @@ NC_finddim(const NC_dimarray *ncap, const char *uname, NC_dim **dimpp)
{
int dimid;
NC_dim ** loc;
char *name;
assert(ncap != NULL);
@ -143,7 +142,6 @@ NC_finddim(const NC_dimarray *ncap, const char *uname, NC_dim **dimpp)
{
int stat;
dimid = 0;
loc = (NC_dim **) ncap->value;
/* normalized version of uname */
stat = nc_utf8_normalize((const unsigned char *)uname,(unsigned char **)&name);

View File

@ -385,7 +385,7 @@ NC_hashmap_verify(NC_hashmap* hash, NC_dim** dims)
for(i=0;i<hash->size;i++) {
hEntry* e = &hash->table[i];
if(e->flags == ACTIVE) {
fprintf(stderr,"[%d] key=%lu data=%ld",i,e->key,e->data-1);
fprintf(stderr,"[%d] key=%lu data=%ld",(int)i,e->key,e->data-1);
if(dims != NULL) {
fprintf(stderr," name=%s",dims[e->data-1]->name->cp);
}

View File

@ -2667,7 +2667,9 @@ NC4_open(const char *path, int mode, int basepe, size_t *chunksizehintp,
{
int res;
int is_hdf5_file = 0;
#ifdef USE_HDF4
int is_hdf4_file = 0;
#endif /* USE_HDF4 */
#ifdef USE_PARALLEL4
NC_MPI_INFO mpidfalt = {MPI_COMM_WORLD, MPI_INFO_NULL};
#endif
@ -2711,8 +2713,10 @@ NC4_open(const char *path, int mode, int basepe, size_t *chunksizehintp,
/* Figure out if this is a hdf4 or hdf5 file. */
if(nc_file->model == NC_FORMATX_NC4)
is_hdf5_file = 1;
#ifdef USE_HDF4
else if(nc_file->model == NC_FORMATX_NC_HDF4)
is_hdf4_file = 1;
#endif /* USE_HDF4 */
/* Depending on the type of file, open it. */
nc_file->int_ncid = nc_file->ext_ncid;
if (is_hdf5_file)

View File

@ -63,7 +63,7 @@ main(int argc, char **argv)
/* Check file can be opened and read correctly */
{
int format;
int ndims, nvars, ngatts, xdimid, nunlim;
int ndims, nvars, ngatts, xdimid;
nc_type lat_type, h_type;
int lat_rank, lat_natts, h_rank, h_natts;
if (nc_open(FILENAME, NC_NOWRITE, &ncid)) ERR;

View File

@ -1,3 +1,8 @@
/*
This is part of the netCDF package. Copyright 2017 University
Corporation for Atmospheric Research/Unidata. See COPYRIGHT file for
conditions of use. See www.unidata.ucar.edu for more info.
*/
#include <nc_tests.h>
#include "err_macros.h"
#include <stdio.h>
@ -83,7 +88,7 @@ main(int argc, char **argv)
int format, ndims, nvars, ngatts, xdimid, ndims_grp, dimids_grp[3],
unlimids[1], d_grp, nunlim, nvars_grp, varids_grp[3], v_grp,
varid, varndims, vardims[3], varnatts, vartype, dimids[3], is_recvar,
vdims[3], id, ntypes, numgrps;
id, ntypes, numgrps;
size_t dimsize, len;
char dimname[20], varname[20];
if ( nc_inq_format(ncid, &format)) ERR;
@ -139,7 +144,6 @@ main(int argc, char **argv)
}
for (id = 0; id < varndims; id++) {
if( nc_inq_dimlen(ncid, vardims[id], &len) ) ERR;
vdims[id] = len;
}
if (varid == 0) {
/* read Time variable */

View File

@ -103,7 +103,6 @@ main()
hid_t dcplid;
hid_t scalar_spaceid;
hid_t vlstr_typeid, fixstr_typeid;
hid_t attid;
/* Create scalar dataspace */
if ((scalar_spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
@ -183,7 +182,6 @@ main()
printf("*** Revise file through netCDF-4 API...");
{
int ncid, varid;
int ret;
char *vlstr;
if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;

View File

@ -533,7 +533,6 @@ vardata(
int id;
size_t nels;
size_t ncols;
size_t nrows;
int vrank = vp->ndims;
int level = 0;
@ -576,7 +575,6 @@ vardata(
if (vrank > 1)
add[vrank-2] = 1;
}
nrows = nels/ncols; /* number of "rows" */
vals = emalloc(ncols * vp->tinfo->size);
NC_CHECK(print_rows(level, ncid, varid, vp, vdims, cor, edg, vals, marks_pending));

View File

@ -509,9 +509,9 @@ case CASE(NC_OPAQUE,NC_CHAR):
tmp.charv = *(char*)bytes;
break;
case CASE(NC_OPAQUE,NC_BYTE):
if(bytes)
tmp.uint8v = *(unsigned char*)bytes;
break;
if(bytes)
tmp.uint8v = *(unsigned char*)bytes;
break;
case CASE(NC_OPAQUE,NC_UBYTE):
if(bytes)
tmp.uint8v = *(unsigned char*)bytes;