From 2077729abca4eeb7daf4ae619cb51ce0dae95dc6 Mon Sep 17 00:00:00 2001 From: edwardhartnett Date: Thu, 15 Aug 2019 06:51:06 -0600 Subject: [PATCH] removed base_pe functions from dispatch table --- include/netcdf_dispatch.h | 4 ++-- libdap2/ncd2dispatch.c | 2 -- libdap4/ncd4dispatch.c | 8 -------- libdispatch/dfile.c | 11 +++++++---- libhdf4/hdf4dispatch.c | 2 -- libhdf5/hdf5dispatch.c | 2 -- libsrc/nc3dispatch.c | 2 -- nc_test/tst_formats.c | 10 ++-------- nc_test4/tst_udf.c | 2 -- 9 files changed, 11 insertions(+), 32 deletions(-) diff --git a/include/netcdf_dispatch.h b/include/netcdf_dispatch.h index a4e4ca188..5ebc3102b 100644 --- a/include/netcdf_dispatch.h +++ b/include/netcdf_dispatch.h @@ -35,8 +35,8 @@ struct NC_Dispatch int (*abort)(int); int (*close)(int, void *); int (*set_fill)(int, int, int *); - int (*inq_base_pe)(int, int *); - int (*set_base_pe)(int, int); + /* int (*inq_base_pe)(int, int *); */ + /* int (*set_base_pe)(int, int); */ int (*inq_format)(int, int*); int (*inq_format_extended)(int, int *, int *); diff --git a/libdap2/ncd2dispatch.c b/libdap2/ncd2dispatch.c index 1299f9143..30772b8f2 100644 --- a/libdap2/ncd2dispatch.c +++ b/libdap2/ncd2dispatch.c @@ -101,8 +101,6 @@ NCD2_sync, NCD2_abort, NCD2_close, NCD2_set_fill, -NCD2_inq_base_pe, -NCD2_set_base_pe, NCD2_inq_format, NCD2_inq_format_extended, /*inq_format_extended*/ diff --git a/libdap4/ncd4dispatch.c b/libdap4/ncd4dispatch.c index a91b68934..8f944a733 100644 --- a/libdap4/ncd4dispatch.c +++ b/libdap4/ncd4dispatch.c @@ -117,12 +117,6 @@ NCD4_set_fill(int ncid, int fillmode, int* old_modep) return (NC_EPERM); } -static int -NCD4_set_base_pe(int ncid, int pe) -{ - return (NC_EPERM); -} - static int NCD4_def_dim(int ncid, const char* name, size_t len, int* idp) { @@ -806,8 +800,6 @@ NCD4_sync, NCD4_abort, NCD4_close, NCD4_set_fill, -NCD4_inq_base_pe, -NCD4_set_base_pe, NCD4_inq_format, NCD4_inq_format_extended, /*inq_format_extended*/ diff --git a/libdispatch/dfile.c b/libdispatch/dfile.c index f74c2dd24..36cc8d0d0 100644 --- a/libdispatch/dfile.c +++ b/libdispatch/dfile.c @@ -1454,8 +1454,8 @@ nc_set_fill(int ncid, int fillmode, int *old_modep) * @internal Learn base PE. * * @deprecated This function was used in the old days with the Cray at - * NCAR. The Cray is long gone, and this call is supported only for - * backward compatibility. + * NCAR. The Cray is long gone, and this call is now meaningless. The + * value returned for pe is always 0. * * @param ncid File and group ID. * @param pe Pointer for base PE. @@ -1470,7 +1470,9 @@ nc_inq_base_pe(int ncid, int *pe) NC* ncp; int stat = NC_check_id(ncid, &ncp); if(stat != NC_NOERR) return stat; - return ncp->dispatch->inq_base_pe(ncid,pe); + /* return ncp->dispatch->inq_base_pe(ncid,pe); */ + if (pe) *pe = 0; + return NC_NOERR; } /** @@ -1493,7 +1495,8 @@ nc_set_base_pe(int ncid, int pe) NC* ncp; int stat = NC_check_id(ncid, &ncp); if(stat != NC_NOERR) return stat; - return ncp->dispatch->set_base_pe(ncid,pe); + /* return ncp->dispatch->set_base_pe(ncid,pe); */ + return NC_NOERR; } /** \ingroup datasets diff --git a/libhdf4/hdf4dispatch.c b/libhdf4/hdf4dispatch.c index 4cb790bb2..d2b5437cd 100644 --- a/libhdf4/hdf4dispatch.c +++ b/libhdf4/hdf4dispatch.c @@ -28,8 +28,6 @@ static const NC_Dispatch HDF4_dispatcher = { NC_HDF4_abort, NC_HDF4_close, NC_RO_set_fill, - NC_NOTNC3_inq_base_pe, - NC_NOTNC3_set_base_pe, NC_HDF4_inq_format, NC_HDF4_inq_format_extended, diff --git a/libhdf5/hdf5dispatch.c b/libhdf5/hdf5dispatch.c index 06203a9a7..9e703b0cd 100644 --- a/libhdf5/hdf5dispatch.c +++ b/libhdf5/hdf5dispatch.c @@ -28,8 +28,6 @@ static const NC_Dispatch HDF5_dispatcher = { NC4_abort, NC4_close, NC4_set_fill, - NC_NOTNC3_inq_base_pe, - NC_NOTNC3_set_base_pe, NC4_inq_format, NC4_inq_format_extended, diff --git a/libsrc/nc3dispatch.c b/libsrc/nc3dispatch.c index 59a6643f3..165caff4d 100644 --- a/libsrc/nc3dispatch.c +++ b/libsrc/nc3dispatch.c @@ -91,8 +91,6 @@ NC3_sync, NC3_abort, NC3_close, NC3_set_fill, -NC3_inq_base_pe, -NC3_set_base_pe, NC3_inq_format, NC3_inq_format_extended, diff --git a/nc_test/tst_formats.c b/nc_test/tst_formats.c index 6f9e8b0a9..251026d27 100644 --- a/nc_test/tst_formats.c +++ b/nc_test/tst_formats.c @@ -87,14 +87,8 @@ check_inq_format(int ncid, int expected_format, int expected_extended_format, in /* Nothing to do with inq_format, but let's check the base_pe * functions. */ - if (expected_format == NC_FORMAT_CLASSIC || expected_format == NC_FORMAT_64BIT_OFFSET || - expected_format == NC_FORMAT_CDF5) { - if (nc_set_base_pe(ncid, 0)) ERR; - if (nc_inq_base_pe(ncid, NULL)) ERR; - } else { - if (nc_set_base_pe(ncid, 0) != NC_ENOTNC3) ERR; - if (nc_inq_base_pe(ncid, NULL) != NC_ENOTNC3) ERR; - } + if (nc_set_base_pe(ncid, 0)) ERR; + if (nc_inq_base_pe(ncid, NULL)) ERR; return 0; } diff --git a/nc_test4/tst_udf.c b/nc_test4/tst_udf.c index 534d3be42..25f85f2d1 100644 --- a/nc_test4/tst_udf.c +++ b/nc_test4/tst_udf.c @@ -77,8 +77,6 @@ NC_RO_sync, tst_abort, tst_close, NC_RO_set_fill, -NC_NOTNC3_inq_base_pe, -NC_NOTNC3_set_base_pe, tst_inq_format, tst_inq_format_extended,