Skip to content

Commit fc4bfc6

Browse files
committed
Merge branch 'dispatchversion.dmh' of https://github.com/DennisHeimbigner/netcdf-c into 4.8.0-wellspring-prs.wif
2 parents ffa8a70 + f75c1c4 commit fc4bfc6

15 files changed

+46
-46
lines changed

CMakeLists.txt

+9-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ SET(PACKAGE_VERSION ${VERSION})
3737

3838
# Version of the dispatch table. This must match the value in
3939
# configure.ac.
40-
SET(NC_DISPATCH_VERSION 2)
40+
SET(NC_DISPATCH_VERSION 3)
4141

4242
# Get system configuration, Use it to determine osname, os release, cpu. These
4343
# will be used when committing to CDash.
@@ -163,8 +163,6 @@ SET(EXTRA_DEPS "")
163163
# Set CTest Properties
164164
################################
165165

166-
167-
168166
ENABLE_TESTING()
169167
INCLUDE(CTest)
170168

@@ -262,6 +260,7 @@ ENDIF()
262260
#####
263261
# System inspection checks
264262
#####
263+
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include)
265264
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
266265
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/oc2)
267266
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/libsrc)
@@ -2205,6 +2204,13 @@ configure_file(
22052204
${netCDF_SOURCE_DIR}/include/netcdf_meta.h.in
22062205
${netCDF_BINARY_DIR}/include/netcdf_meta.h @ONLY)
22072206

2207+
#####
2208+
# Create 'netcdf_dispatch.h' include file.
2209+
#####
2210+
configure_file(
2211+
${netCDF_SOURCE_DIR}/include/netcdf_dispatch.h.in
2212+
${netCDF_BINARY_DIR}/include/netcdf_dispatch.h @ONLY NEWLINE_STYLE LF)
2213+
22082214
#####
22092215
# Build test_common.sh
22102216
#####

RELEASE_NOTES.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This file contains a high-level description of this package's evolution. Release
77

88
## 4.8.0 - TBD
99

10+
* [Enhancement] Bump the NC_DISPATCH_VERSION from 2 to 3, and as a side effect, unify the definition of NC_DISPATCH_VERSION so it only needs to be defined in CMakeLists.txt and configure.ac. See [Github #1945](https://github.com/Unidata/netcdf-c/pull/1945) for more information.
1011
* [Enhancement] Provide better cross platform path name management. This converts paths for various platforms (e.g. Windows, MSYS, etc.) so that they are in the proper format for the executing platform. See [Github #1958](https://github.com/Unidata/netcdf-c/pull/1958) for more information.
1112
* [Bug Fixes] The nccopy program was treating -d0 as turning deflation on rather than interpreting it as "turn off deflation". See [Github #1944](https://github.com/Unidata/netcdf-c/pull/1944) for more information.
1213
* [Enhancement] Add support for storing NCZarr data in zip files. See [Github #1942](https://github.com/Unidata/netcdf-c/pull/1942) for more information.

config.h.cmake.in

+3
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,9 @@ with zip */
460460
/* Add extra properties to _NCProperties attribute */
461461
#cmakedefine NCPROPERTIES_EXTRA ${NCPROPERTIES_EXTRA}
462462

463+
/* Idspatch table version */
464+
#cmakedefine NC_DISPATCH_VERSION ${NC_DISPATCH_VERSION}
465+
463466
/* no IEEE float on this platform */
464467
#cmakedefine NO_IEEE_FLOAT 1
465468

configure.ac

+4-1
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,9 @@ AX_SET_META([NC_HAS_MULTIFILTERS],[$has_multifilters],[yes])
16891689
# applications like PIO can determine whether they have an appropriate
16901690
# dispatch table to submit. If this is changed, make sure the value in
16911691
# CMakeLists.txt also changes to match.
1692-
AC_SUBST([NC_DISPATCH_VERSION], [2])
1692+
1693+
AC_SUBST([NC_DISPATCH_VERSION], [3])
1694+
AC_DEFINE_UNQUOTED([NC_DISPATCH_VERSION], [${NC_DISPATCH_VERSION}], [Dispatch table version.])
16931695

16941696
#####
16951697
# End netcdf_meta.h definitions.
@@ -1723,6 +1725,7 @@ AC_CONFIG_FILES([Makefile
17231725
libnetcdf.settings
17241726
postinstall.sh
17251727
include/netcdf_meta.h
1728+
include/netcdf_dispatch.h
17261729
include/Makefile
17271730
h5_test/Makefile
17281731
hdf4_test/Makefile

include/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ INSTALL(FILES ${netCDF_SOURCE_DIR}/include/netcdf_filter.h
2828
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
2929
COMPONENT headers)
3030

31-
INSTALL(FILES ${netCDF_SOURCE_DIR}/include/netcdf_dispatch.h
31+
INSTALL(FILES ${netCDF_BINARY_DIR}/include/netcdf_dispatch.h
3232
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
3333
COMPONENT headers)
3434

include/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ if ENABLE_BYTERANGE
2929
noinst_HEADERS += nchttp.h
3030
endif
3131

32-
EXTRA_DIST = CMakeLists.txt XGetopt.h netcdf_meta.h.in
32+
EXTRA_DIST = CMakeLists.txt XGetopt.h netcdf_meta.h.in netcdf_dispatch.in

include/ncdispatch.h

-3
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@
8080
#define ATOMICTYPEMAX3 NC_DOUBLE
8181
#define ATOMICTYPEMAX5 NC_UINT64
8282

83-
/* Define an alias for int to indicate an error return */
84-
typedef int NCerror;
85-
8683
#if !defined HDF5_PARALLEL && !defined USE_PNETCDF
8784
typedef int MPI_Comm;
8885
typedef int MPI_Info;

include/nchttp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ typedef struct NC_HTTP_STATE {
2323
char errbuf[1024]; /* assert(CURL_ERROR_SIZE <= 1024) */
2424
} NC_HTTP_STATE;
2525

26-
extern int nc_http_open(const char* objecturl, NC_HTTP_STATE** state, size64_t* lenp);
26+
extern int nc_http_open(const char* objecturl, NC_HTTP_STATE** state, long long* lenp);
2727
extern int nc_http_size(NC_HTTP_STATE* state, const char* url, size64_t* sizep);
2828
extern int nc_http_read(NC_HTTP_STATE* state, const char* url, size64_t start, size64_t count, NCbytes* buf);
2929
extern int nc_http_close(NC_HTTP_STATE* state);

include/netcdf_dispatch.h include/netcdf_dispatch.h.in

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525

2626
/* This is the version of the dispatch table. It should be changed
2727
* when new functions are added to the dispatch table. */
28-
#define NC_DISPATCH_VERSION 3
28+
#ifndef NC_DISPATCH_VERSION
29+
#define NC_DISPATCH_VERSION @NC_DISPATCH_VERSION@
30+
#endif /*NC_DISPATCH_VERSION*/
2931

3032
/* This is the dispatch table, with a pointer to each netCDF
3133
* function. */

libdap2/dapincludes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "oc.h"
3333

3434
#include "ncdap.h"
35+
#include "nccommon.h"
3536
#include "dapdebug.h"
3637
#include "daputil.h"
3738

@@ -47,7 +48,6 @@ struct NCsegment;
4748

4849
/**************************************************/
4950

50-
#include "nccommon.h"
5151
#include "getvara.h"
5252
#include "constraints.h"
5353

libdap2/daputil.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ simplepathstring(NClist* names, char* separator)
435435
/* Define a number of location tests */
436436

437437
/* Is node contained (transitively) in a sequence ? */
438-
BOOL
438+
int
439439
dapinsequence(CDFnode* node)
440440
{
441441
if(node == NULL || node->container == NULL) return TRUE;
@@ -446,7 +446,7 @@ dapinsequence(CDFnode* node)
446446
}
447447

448448
/* Is node contained (transitively) in a structure array */
449-
BOOL
449+
int
450450
dapinstructarray(CDFnode* node)
451451
{
452452
if(node == NULL) return TRUE;
@@ -459,7 +459,7 @@ dapinstructarray(CDFnode* node)
459459
}
460460

461461
/* Is node a map field of a grid? */
462-
BOOL
462+
int
463463
dapgridmap(CDFnode* node)
464464
{
465465
if(node != NULL && node->container != NULL
@@ -471,7 +471,7 @@ dapgridmap(CDFnode* node)
471471
}
472472

473473
/* Is node an array field of a grid? */
474-
BOOL
474+
int
475475
dapgridarray(CDFnode* node)
476476
{
477477
if(node != NULL && node->container != NULL
@@ -482,31 +482,31 @@ dapgridarray(CDFnode* node)
482482
return FALSE;
483483
}
484484

485-
BOOL
485+
int
486486
dapgridelement(CDFnode* node)
487487
{
488488
return dapgridarray(node)
489489
|| dapgridmap(node);
490490
}
491491

492492
/* Is node a top-level grid node? */
493-
BOOL
493+
int
494494
daptopgrid(CDFnode* grid)
495495
{
496496
if(grid == NULL || grid->nctype != NC_Grid) return FALSE;
497497
return daptoplevel(grid);
498498
}
499499

500500
/* Is node a top-level sequence node? */
501-
BOOL
501+
int
502502
daptopseq(CDFnode* seq)
503503
{
504504
if(seq == NULL || seq->nctype != NC_Sequence) return FALSE;
505505
return daptoplevel(seq);
506506
}
507507

508508
/* Is node a top-level node? */
509-
BOOL
509+
int
510510
daptoplevel(CDFnode* node)
511511
{
512512
if(node->container == NULL

libdap2/nccommon.h

+11-11
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
#include "dapincludes.h"
1010

1111
/* Mnemonics */
12-
#ifndef BOOL
13-
#define BOOL int
14-
#endif
1512
#ifndef TRUE
1613
#define TRUE 1
1714
#define FALSE 0
1815
#endif
1916

17+
/* Define an alias for int to indicate an error return */
18+
typedef int NCerror;
19+
2020
#ifndef nullfree
2121
#define nullfree(m) {if((m)!=NULL) {free(m);} else {}}
2222
#endif
@@ -206,7 +206,7 @@ typedef struct NCD2alignment {
206206
} NCD2alignment;
207207

208208
typedef struct NCtypesize {
209-
BOOL aligned; /* have instance and field been defined? */
209+
int aligned; /* have instance and field been defined? */
210210
NCD2alignment instance; /* Alignment, etc for instance data */
211211
NCD2alignment field; /* Alignment, etc WRT to parent */
212212
} NCtypesize;
@@ -232,13 +232,13 @@ typedef struct CDFnode {
232232
int ncid; /* relevant NC id for this object*/
233233
unsigned long maxstringlength;
234234
unsigned long sequencelimit; /* 0=>unlimited */
235-
BOOL usesequence; /* If this sequence is usable */
236-
BOOL elided; /* 1 => node does not partipate in naming*/
235+
int usesequence; /* If this sequence is usable */
236+
int elided; /* 1 => node does not partipate in naming*/
237237
struct CDFnode* basenode; /* derived tree map to pattern tree */
238-
BOOL invisible; /* 1 => do not show to user */
239-
BOOL zerodim; /* 1 => node has a zero dimension */
238+
int invisible; /* 1 => do not show to user */
239+
int zerodim; /* 1 => node has a zero dimension */
240240
/* These two flags track the effects on grids of constraints */
241-
BOOL nc_virtual; /* node added by regrid */
241+
int nc_virtual; /* node added by regrid */
242242
struct CDFnode* attachment; /* DDS<->DATADDS cross link*/
243243
struct CDFnode* pattern; /* temporary field for regridding */
244244
/* Fields for use by libncdap4 */
@@ -249,8 +249,8 @@ typedef struct CDFnode {
249249
char* vlenname; /* for sequence types */
250250
int singleton; /* for singleton sequences */
251251
unsigned long estimatedsize; /* > 0 Only for var nodes */
252-
BOOL whole; /* projected as whole node */
253-
BOOL prefetchable; /* eligible to be prefetched (if whole) */
252+
int whole; /* projected as whole node */
253+
int prefetchable; /* eligible to be prefetched (if whole) */
254254
} CDFnode;
255255

256256
/**************************************************/

libdap4/ncd4.h

-12
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,6 @@ extern int dsp_close(ND4dsp* dsp);
7171
/* DSP API */
7272
extern int dsp_open(const char* path, ND4dsp** dspp);
7373

74-
/*
75-
extern NCerror dapbuildvaraprojection(CDFnode*,
76-
const size_t* startp, const size_t* countp, const ptrdiff_t* stridep,
77-
struct DCEprojection** projectionlist);
78-
79-
extern NCerror NCD4_getvarx(int ncid, int varid,
80-
const size_t *startp,
81-
const size_t *countp,
82-
const ptrdiff_t *stridep,
83-
void *data,
84-
nc_type dsttype0);
85-
*/
8674
#endif
8775

8876
/**************************************************/

libdispatch/dhttp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Trace(const char* fcn)
7171
*/
7272

7373
int
74-
nc_http_open(const char* objecturl, NC_HTTP_STATE** statep, size64_t* filelenp)
74+
nc_http_open(const char* objecturl, NC_HTTP_STATE** statep, long long* filelenp)
7575
{
7676
int stat = NC_NOERR;
7777
int i;

libdispatch/dinfermodel.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct MagicFile {
4444
struct NCURI* uri;
4545
int omode;
4646
NCmodel* model;
47-
fileoffset_t filelen;
47+
long long filelen;
4848
int use_parallel;
4949
void* parameters; /* !NULL if inmemory && !diskless */
5050
FILE* fp;
@@ -937,7 +937,7 @@ check_file_type(const char *path, int omode, int use_parallel,
937937
if((status = openmagic(&magicinfo))) goto done;
938938

939939
/* Verify we have a large enough file */
940-
if(magicinfo.filelen < MAGIC_NUMBER_LEN)
940+
if(magicinfo.filelen < (long long)MAGIC_NUMBER_LEN)
941941
{status = NC_ENOTNC; goto done;}
942942
if((status = readmagic(&magicinfo,0L,magic)) != NC_NOERR) {
943943
status = NC_ENOTNC;

0 commit comments

Comments
 (0)