From dac997c087fdcb44825706f1f4635dee82847553 Mon Sep 17 00:00:00 2001 From: Alexander Barth Date: Mon, 25 Apr 2022 11:23:35 +0200 Subject: [PATCH 1/2] Include getopt.h if HAVE_GETOPT_H is defined --- ncdump/ncvalidator.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ncdump/ncvalidator.c b/ncdump/ncvalidator.c index 5ac1ccd2ca..f591b989ee 100644 --- a/ncdump/ncvalidator.c +++ b/ncdump/ncvalidator.c @@ -60,6 +60,9 @@ THIS SOFTWARE. */ #include "config.h" +#ifdef HAVE_GETOPT_H +#include +#endif #include #include #include /* open() */ From bbe0b212a5d0ae0ef08b03ba34baa4c5cfde02ae Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Fri, 27 May 2022 15:45:34 -0600 Subject: [PATCH 2/2] Fix internal bz2 problems --- configure.ac | 1 + libnczarr/zfilter.c | 1 + plugins/NCZstdfilters.c | 6 ------ 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index cce149b3ec..94aaab9348 100644 --- a/configure.ac +++ b/configure.ac @@ -686,6 +686,7 @@ AC_MSG_RESULT([${have_bz2}]) if test "x$have_bz2" = "xno" ; then have_local_bz2=yes + AC_MSG_NOTICE([Defaulting to internal libbz2]) else have_local_bz2=no fi diff --git a/libnczarr/zfilter.c b/libnczarr/zfilter.c index b74e4132ba..72d0e139af 100644 --- a/libnczarr/zfilter.c +++ b/libnczarr/zfilter.c @@ -995,6 +995,7 @@ NCZ_filter_build(const NC_FILE_INFO_T* file, NC_VAR_INFO_T* var, const NCjson* j /* Find the plugin for this filter */ for(i=0;i<=loaded_plugins_max;i++) { if (!loaded_plugins[i]) continue; + if(!loaded_plugins[i] || !loaded_plugins[i]->codec.codec) continue; /* no plugin or no codec */ if(strcmp(NCJstring(jvalue), loaded_plugins[i]->codec.codec->codecid) == 0) {plugin = loaded_plugins[i]; break;} } diff --git a/plugins/NCZstdfilters.c b/plugins/NCZstdfilters.c index eda1865162..734541944b 100644 --- a/plugins/NCZstdfilters.c +++ b/plugins/NCZstdfilters.c @@ -38,10 +38,8 @@ Author: Dennis Heimbigner /* Forward */ -#ifdef HAVE_BZ2 static int NCZ_bzip2_codec_to_hdf5(const char* codec, size_t* nparamsp, unsigned** paramsp); static int NCZ_bzip2_hdf5_to_codec(size_t nparams, const unsigned* params, char** codecp); -#endif #ifdef HAVE_ZSTD static int NCZ_zstd_codec_to_hdf5(const char* codec, size_t* nparamsp, unsigned** paramsp); @@ -58,7 +56,6 @@ static void NCZ_blosc_codec_finalize(void); /**************************************************/ /* Provide the codec support for bzip2 filter */ -#ifdef HAVE_BZ2 static NCZ_codec_t NCZ_bzip2_codec = {/* NCZ_codec_t codec fields */ NCZ_CODEC_CLASS_VER, /* Struct version number */ NCZ_CODEC_HDF5, /* Struct sort */ @@ -139,7 +136,6 @@ NCZ_bzip2_hdf5_to_codec(size_t nparams, const unsigned* params, char** codecp) done: return stat; } -#endif /**************************************************/ /* Provide the codec support for zstandard filter */ @@ -438,9 +434,7 @@ NCZ_blosc_hdf5_to_codec(size_t nparams, const unsigned* params, char** codecp) /**************************************************/ NCZ_codec_t* NCZ_stdfilters_codecs[] = { -#ifdef HAVE_BZ2 &NCZ_bzip2_codec, -#endif #ifdef HAVE_ZSTD &NCZ_zstd_codec, #endif