From 95aa40fc234679d4d5066d9ea5d5e012f4489e74 Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 7 Mar 2024 13:34:33 +0000 Subject: [PATCH 1/5] Examples: Use binary write mode for fopen --- examples/C/grib_multi_write.c | 2 +- examples/C/grib_multi_write.sh | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/C/grib_multi_write.c b/examples/C/grib_multi_write.c index b68df1517..d0f275c58 100644 --- a/examples/C/grib_multi_write.c +++ b/examples/C/grib_multi_write.c @@ -72,7 +72,7 @@ int main(int argc, char** argv) } /* open output file */ - of = fopen(ofilename, "w"); + of = fopen(ofilename, "wb"); if (!of) { fprintf(stderr, "ERROR: unable to open output file %s\n", ofilename); exit(1); diff --git a/examples/C/grib_multi_write.sh b/examples/C/grib_multi_write.sh index a6a621a59..73942c663 100755 --- a/examples/C/grib_multi_write.sh +++ b/examples/C/grib_multi_write.sh @@ -9,20 +9,20 @@ . ./include.ctest.sh -#if [ ! -f "${data_dir}/sample.grib2" ] -#then -# echo SKIP: $0 -# exit -#fi +label="grib_multi_write_c" +tempGrib=temp.$label.grib +tempText=temp.$label.txt -${examples_dir}/c_grib_multi_write ${data_dir}/sample.grib2 ${data_dir}/multi_sample.grib2 > /dev/null +${examples_dir}/c_grib_multi_write ${data_dir}/sample.grib2 $tempGrib > /dev/null -${tools_dir}/grib_get -p step ${data_dir}/multi_sample.grib2 > ${data_dir}/multi_step.test +${tools_dir}/grib_get -p step $tempGrib > $tempText -diff ${data_dir}/multi_step.test ${data_dir}/multi_step.txt - -step=`${tools_dir}/grib_get -M -p step ${data_dir}/multi_sample.grib2` +reference=${data_dir}/multi_step.txt +diff $reference $tempText +# -M = Turn multi-field support off +step=`${tools_dir}/grib_get -M -p step $tempGrib` [ $step -eq 12 ] -rm -f ${data_dir}/multi_sample.grib2 ${data_dir}/multi_step.test +# Clean up +rm -f $tempGrib $tempText From 5521445e568146105d35cea13cb7e9bb2aeb134f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 7 Mar 2024 16:00:50 +0000 Subject: [PATCH 2/5] Tools: Check overflow/underflow --- src/grib_accessor_class_variable.cc | 7 ++++++- src/grib_util.cc | 7 +++++++ tests/grib_set_fail.sh | 13 +++++++++---- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/grib_accessor_class_variable.cc b/src/grib_accessor_class_variable.cc index 13b31706b..1eb04f897 100644 --- a/src/grib_accessor_class_variable.cc +++ b/src/grib_accessor_class_variable.cc @@ -208,11 +208,16 @@ static int pack_double(grib_accessor* a, const double* val, size_t* len) const double dval = *val; if (*len != 1) { - grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s it contains %d values", a->name, 1); + grib_context_log(a->context, GRIB_LOG_ERROR, "Wrong size for %s, it contains %d values", a->name, 1); *len = 1; return GRIB_ARRAY_TOO_SMALL; } + //if (std::isnan(dval)) { + // grib_context_log(a->context, GRIB_LOG_ERROR, "%s: Invalid number for %s: %g", __func__, a->name, dval); + // return GRIB_INVALID_ARGUMENT; + //} + self->dval = dval; if (dval < (double)LONG_MIN || dval > (double)LONG_MAX) self->type = GRIB_TYPE_DOUBLE; diff --git a/src/grib_util.cc b/src/grib_util.cc index 670dbd8aa..d2c1af775 100644 --- a/src/grib_util.cc +++ b/src/grib_util.cc @@ -1748,6 +1748,13 @@ static void set_value(grib_values* value, char* str, int equal) case GRIB_TYPE_UNDEFINED: value->long_value = strtol(buf, &p, 10); if (*p == 0) { + // check the conversion from string to long + if ((errno == ERANGE && (value->long_value == LONG_MAX || value->long_value == LONG_MIN)) || + (errno != 0 && value->long_value == 0)) { + fprintf(stderr, "ECCODES WARNING : Setting %s=%s causes overflow/underflow\n", value->name, buf); + fprintf(stderr, "ECCODES WARNING : Value adjusted to %ld\n", value->long_value); + //perror("strtol"); + } value->type = GRIB_TYPE_LONG; value->has_value = 1; } diff --git a/tests/grib_set_fail.sh b/tests/grib_set_fail.sh index 1a44b5a3b..e3fd7acd9 100755 --- a/tests/grib_set_fail.sh +++ b/tests/grib_set_fail.sh @@ -19,7 +19,7 @@ temp=${data_dir}/temp.$label.out infile=${data_dir}/regular_gaussian_surface.grib2 -# Set without -s. Expected to fail +# Set without -s # ---------------------------------------------------- set +e ${tools_dir}/grib_set -p levtype $infile $outfile > $temp 2>&1 @@ -28,7 +28,7 @@ set -e [ $status -ne 0 ] grep -q "provide some keys to set" $temp -# Set with empty -s. Expected to fail +# Set with empty -s # ---------------------------------------------------- set +e ${tools_dir}/grib_set -s '' $infile $outfile > $temp 2>&1 @@ -37,7 +37,7 @@ set -e [ $status -ne 0 ] grep -q "provide some keys to set" $temp -# Out-of-bounds value. Expected to fail +# Out-of-bounds value # ---------------------------------------------------- input=${data_dir}/reduced_gaussian_sub_area.grib2 set +e @@ -47,7 +47,7 @@ set -e [ $status -ne 0 ] grep -q "Trying to encode value of 1000 but the maximum allowable value is 255 (number of bits=8)" $temp -# Negative value for an unsigned key. Expected to fail +# Negative value for an unsigned key # ---------------------------------------------------- input=${data_dir}/reduced_gaussian_sub_area.grib2 set +e @@ -181,6 +181,11 @@ set -e [ $status -ne 0 ] grep -q "centre: No such code table entry.*Did you mean.*ecmf" $temp +# Overflow/Underflow +# ------------------------ +input=$ECCODES_SAMPLES_PATH/GRIB2.tmpl +${tools_dir}/grib_set -s missingValue=9223372036854776666 $input $outfile > $temp 2>&1 +grep -q "ECCODES WARNING : Setting .* causes overflow/underflow" $temp # ------------------------ # Unreadable message From 84f23bf5020134ec9bf3fe43cf5c1eb8efe7fc73 Mon Sep 17 00:00:00 2001 From: shahramn Date: Thu, 7 Mar 2024 16:58:23 +0000 Subject: [PATCH 3/5] ECC-1782: Repacking sample GRIB2.tmpl fails when ECCODES_GRIB_DATA_QUALITY_CHECKS=1 --- samples/GRIB2.tmpl | Bin 179 -> 179 bytes tests/codes_ecc-1698.sh | 4 ++-- tests/grib_data_quality_checks.sh | 17 ++++++++++++++--- tests/grib_decimalPrecision.sh | 8 +++++--- tests/grib_ecc-1271.sh | 2 +- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/samples/GRIB2.tmpl b/samples/GRIB2.tmpl index 5c7b111ce7bff3a14a194351d67418d3aa6342ce..e2f890a57d52dea5ea01d64c3285a1babd51bab1 100644 GIT binary patch delta 32 gcmdnYxS4UnEJ^2%28ISM1_)qd`wwKWvYP_|0EIXPbN~PV delta 32 gcmdnYxS4UnEJ^zY28ISM1_)qd`wwKWvYP_|0C $tempDir/param_limits.def < 4 -${tools_dir}/grib_set -s paramId=260509,step=12,scaleValuesBy=1000 $sample_g2 $tempGrib2 +# The GRIB2 sample has max values of 273. We need to use 1 for this test +${tools_dir}/grib_set -s paramId=260509,step=12,values=1,scaleValuesBy=1000 $sample_g2 $tempGrib2 # Step of 0 doesn't satisfy the condition so will use 400 +# The GRIB2 sample has max values of 273. We need to use 1 for this test set +e -${tools_dir}/grib_set -s paramId=260509,scaleValuesBy=1000 $sample_g2 $tempGrib2 +${tools_dir}/grib_set -s paramId=260509,values=1,scaleValuesBy=1000 $sample_g2 $tempGrib2 status=$? set -e [ $status -ne 0 ] diff --git a/tests/grib_decimalPrecision.sh b/tests/grib_decimalPrecision.sh index 66a4c6253..afe13ad74 100755 --- a/tests/grib_decimalPrecision.sh +++ b/tests/grib_decimalPrecision.sh @@ -10,6 +10,9 @@ . ./include.ctest.sh +label="grib_decimalPrecision_test" + +temp=temp.$label.grib REDIRECT=/dev/null files="regular_latlon_surface.grib2 \ @@ -29,7 +32,6 @@ for file in $files; do done # ECC-458: spectral_complex packing -temp=temp.grib_decimalPrecision.grib infile=${data_dir}/spectral_complex.grib1 # Catch errors re negative values export ECCODES_FAIL_IF_LOG_MESSAGE=1 @@ -42,7 +44,7 @@ sample2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl ${tools_dir}/grib_set -s decimalScaleFactor=3 $sample1 $temp grib_check_key_equals $temp min,max,const,decimalScaleFactor,referenceValue '47485.4 47485.4 1 3 47485.4' ${tools_dir}/grib_set -s decimalScaleFactor=3 $sample2 $temp -grib_check_key_equals $temp min,max,const,decimalScaleFactor,referenceValue '1 1 1 3 1' - +grib_check_key_equals $temp min,max,const,decimalScaleFactor,referenceValue '273 273 1 3 273' +# Clean up rm -f $temp diff --git a/tests/grib_ecc-1271.sh b/tests/grib_ecc-1271.sh index 04a25d828..8e9f7ed13 100755 --- a/tests/grib_ecc-1271.sh +++ b/tests/grib_ecc-1271.sh @@ -23,6 +23,6 @@ $sample_grib2 $temp grib_check_key_equals $temp Ni,Nj "16 31" grib_check_key_equals $temp centreLatitudeInDegrees,centreLongitudeInDegrees "0 30" -grib_check_key_equals $temp minimum,maximum "1 1" +grib_check_key_equals $temp minimum,maximum "273 273" rm -f $temp From 017794f8e1c8a9a40e6390c50d684401866fb9f9 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 7 Mar 2024 21:10:30 +0000 Subject: [PATCH 4/5] Refactoring: removal of duplicated code (dump) --- src/grib_accessor_class_bit.cc | 9 ++------- src/grib_accessor_class_bufrdc_expanded_descriptors.cc | 10 ++-------- src/grib_accessor_class_expanded_descriptors.cc | 10 ++-------- src/grib_accessor_class_g1date.cc | 10 ++-------- src/grib_accessor_class_g1monthlydate.cc | 10 ++-------- src/grib_accessor_class_g1verificationdate.cc | 10 ++-------- src/grib_accessor_class_g2date.cc | 10 ++-------- src/grib_accessor_class_g2level.cc | 10 ++-------- src/grib_accessor_class_rdbtime_guess_date.cc | 10 ++-------- src/grib_accessor_class_signed_bits.cc | 10 ++-------- src/grib_accessor_class_spd.cc | 10 ++-------- src/grib_accessor_class_time.cc | 10 ++-------- src/grib_accessor_class_validity_date.cc | 10 ++-------- src/grib_accessor_class_validity_time.cc | 10 ++-------- 14 files changed, 28 insertions(+), 111 deletions(-) diff --git a/src/grib_accessor_class_bit.cc b/src/grib_accessor_class_bit.cc index 17c1d3c8c..e3099d259 100644 --- a/src/grib_accessor_class_bit.cc +++ b/src/grib_accessor_class_bit.cc @@ -17,7 +17,7 @@ CLASS = accessor SUPER = grib_accessor_class_long IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init;dump + IMPLEMENTS = init MEMBERS = const char* owner MEMBERS = int bit_index END_CLASS_DEF @@ -36,7 +36,6 @@ or edit "accessor.class" and rerun ./make_class.pl static int pack_long(grib_accessor*, const long* val, size_t* len); static int unpack_long(grib_accessor*, long* val, size_t* len); -static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); typedef struct grib_accessor_bit @@ -60,7 +59,7 @@ static grib_accessor_class _grib_accessor_class_bit = { &init, /* init */ 0, /* post_init */ 0, /* destroy */ - &dump, /* dump */ + 0, /* dump */ 0, /* next_offset */ 0, /* get length of string */ 0, /* get number of values */ @@ -112,10 +111,6 @@ static void init(grib_accessor* a, const long len, grib_arguments* arg) self->bit_index = grib_arguments_get_long(grib_handle_of_accessor(a), arg, 1); } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} static int unpack_long(grib_accessor* a, long* val, size_t* len) { diff --git a/src/grib_accessor_class_bufrdc_expanded_descriptors.cc b/src/grib_accessor_class_bufrdc_expanded_descriptors.cc index 8476f4708..929e21724 100644 --- a/src/grib_accessor_class_bufrdc_expanded_descriptors.cc +++ b/src/grib_accessor_class_bufrdc_expanded_descriptors.cc @@ -24,7 +24,7 @@ CLASS = accessor SUPER = grib_accessor_class_long IMPLEMENTS = unpack_long IMPLEMENTS = unpack_string_array -IMPLEMENTS = init;dump;destroy +IMPLEMENTS = init;destroy IMPLEMENTS = value_count MEMBERS = const char* expandedDescriptors MEMBERS = grib_accessor* expandedDescriptorsAccessor @@ -47,7 +47,6 @@ static int unpack_long(grib_accessor*, long* val, size_t* len); static int unpack_string_array(grib_accessor*, char**, size_t* len); static int value_count(grib_accessor*, long*); static void destroy(grib_context*, grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); typedef struct grib_accessor_bufrdc_expanded_descriptors @@ -71,7 +70,7 @@ static grib_accessor_class _grib_accessor_class_bufrdc_expanded_descriptors = { &init, /* init */ 0, /* post_init */ &destroy, /* destroy */ - &dump, /* dump */ + 0, /* dump */ 0, /* next_offset */ 0, /* get length of string */ &value_count, /* get number of values */ @@ -125,11 +124,6 @@ static void init(grib_accessor* a, const long len, grib_arguments* args) a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - static grib_accessor* get_accessor(grib_accessor* a) { grib_accessor_bufrdc_expanded_descriptors* self = (grib_accessor_bufrdc_expanded_descriptors*)a; diff --git a/src/grib_accessor_class_expanded_descriptors.cc b/src/grib_accessor_class_expanded_descriptors.cc index d515e4dcb..b4cb0ece7 100644 --- a/src/grib_accessor_class_expanded_descriptors.cc +++ b/src/grib_accessor_class_expanded_descriptors.cc @@ -26,7 +26,7 @@ SUPER = grib_accessor_class_long IMPLEMENTS = unpack_long;pack_long IMPLEMENTS = unpack_double IMPLEMENTS = unpack_string_array -IMPLEMENTS = init;dump;destroy +IMPLEMENTS = init;destroy IMPLEMENTS = value_count; get_native_type MEMBERS = const char* unexpandedDescriptors MEMBERS = const char* sequence @@ -59,7 +59,6 @@ static int unpack_long(grib_accessor*, long* val, size_t* len); static int unpack_string_array(grib_accessor*, char**, size_t* len); static int value_count(grib_accessor*, long*); static void destroy(grib_context*, grib_accessor*); -static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); typedef struct grib_accessor_expanded_descriptors @@ -90,7 +89,7 @@ static grib_accessor_class _grib_accessor_class_expanded_descriptors = { &init, /* init */ 0, /* post_init */ &destroy, /* destroy */ - &dump, /* dump */ + 0, /* dump */ 0, /* next_offset */ 0, /* get length of string */ &value_count, /* get number of values */ @@ -180,11 +179,6 @@ static void init(grib_accessor* a, const long len, grib_arguments* args) a->length = 0; } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - static bufr_descriptors_array* do_expand(grib_accessor* a, bufr_descriptors_array* unexpanded, change_coding_params* ccp, int* err); #define BUFR_DESCRIPTORS_ARRAY_USED_SIZE(v) ((v)->n) diff --git a/src/grib_accessor_class_g1date.cc b/src/grib_accessor_class_g1date.cc index 10294a935..c53b3768a 100644 --- a/src/grib_accessor_class_g1date.cc +++ b/src/grib_accessor_class_g1date.cc @@ -17,7 +17,7 @@ CLASS = accessor SUPER = grib_accessor_class_long IMPLEMENTS = unpack_long;pack_long;unpack_string - IMPLEMENTS = init;dump;value_count + IMPLEMENTS = init;value_count MEMBERS=const char* century MEMBERS=const char* year MEMBERS=const char* month @@ -40,7 +40,6 @@ static int pack_long(grib_accessor*, const long* val, size_t* len); static int unpack_long(grib_accessor*, long* val, size_t* len); static int unpack_string(grib_accessor*, char*, size_t* len); static int value_count(grib_accessor*, long*); -static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); typedef struct grib_accessor_g1date @@ -66,7 +65,7 @@ static grib_accessor_class _grib_accessor_class_g1date = { &init, /* init */ 0, /* post_init */ 0, /* destroy */ - &dump, /* dump */ + 0, /* dump */ 0, /* next_offset */ 0, /* get length of string */ &value_count, /* get number of values */ @@ -122,11 +121,6 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) self->day = grib_arguments_get_name(hand, c, n++); } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_g1date* self = (grib_accessor_g1date*)a; diff --git a/src/grib_accessor_class_g1monthlydate.cc b/src/grib_accessor_class_g1monthlydate.cc index 503d0daa4..57c3ea729 100644 --- a/src/grib_accessor_class_g1monthlydate.cc +++ b/src/grib_accessor_class_g1monthlydate.cc @@ -22,7 +22,7 @@ CLASS = accessor SUPER = grib_accessor_class_long IMPLEMENTS = unpack_long - IMPLEMENTS = init;dump + IMPLEMENTS = init MEMBERS=const char* date END_CLASS_DEF @@ -39,7 +39,6 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int unpack_long(grib_accessor*, long* val, size_t* len); -static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); typedef struct grib_accessor_g1monthlydate @@ -62,7 +61,7 @@ static grib_accessor_class _grib_accessor_class_g1monthlydate = { &init, /* init */ 0, /* post_init */ 0, /* destroy */ - &dump, /* dump */ + 0, /* dump */ 0, /* next_offset */ 0, /* get length of string */ 0, /* get number of values */ @@ -115,11 +114,6 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_g1monthlydate* self = (grib_accessor_g1monthlydate*)a; diff --git a/src/grib_accessor_class_g1verificationdate.cc b/src/grib_accessor_class_g1verificationdate.cc index a3272acc2..03c871617 100644 --- a/src/grib_accessor_class_g1verificationdate.cc +++ b/src/grib_accessor_class_g1verificationdate.cc @@ -17,7 +17,7 @@ CLASS = accessor SUPER = grib_accessor_class_long IMPLEMENTS = unpack_long - IMPLEMENTS = init;dump + IMPLEMENTS = init MEMBERS=const char* date MEMBERS=const char* time MEMBERS=const char* step @@ -36,7 +36,6 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int unpack_long(grib_accessor*, long* val, size_t* len); -static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); typedef struct grib_accessor_g1verificationdate @@ -61,7 +60,7 @@ static grib_accessor_class _grib_accessor_class_g1verificationdate = { &init, /* init */ 0, /* post_init */ 0, /* destroy */ - &dump, /* dump */ + 0, /* dump */ 0, /* next_offset */ 0, /* get length of string */ 0, /* get number of values */ @@ -117,11 +116,6 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_g1verificationdate* self = (grib_accessor_g1verificationdate*)a; diff --git a/src/grib_accessor_class_g2date.cc b/src/grib_accessor_class_g2date.cc index c85e86b9e..698cd4a26 100644 --- a/src/grib_accessor_class_g2date.cc +++ b/src/grib_accessor_class_g2date.cc @@ -16,7 +16,7 @@ START_CLASS_DEF CLASS = accessor SUPER = grib_accessor_class_long - IMPLEMENTS = unpack_long;pack_long;init;dump + IMPLEMENTS = unpack_long;pack_long;init MEMBERS=const char* century MEMBERS=const char* year MEMBERS=const char* month @@ -37,7 +37,6 @@ or edit "accessor.class" and rerun ./make_class.pl static int pack_long(grib_accessor*, const long* val, size_t* len); static int unpack_long(grib_accessor*, long* val, size_t* len); -static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); typedef struct grib_accessor_g2date @@ -63,7 +62,7 @@ static grib_accessor_class _grib_accessor_class_g2date = { &init, /* init */ 0, /* post_init */ 0, /* destroy */ - &dump, /* dump */ + 0, /* dump */ 0, /* next_offset */ 0, /* get length of string */ 0, /* get number of values */ @@ -116,11 +115,6 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) self->day = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++); } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - static int unpack_long(grib_accessor* a, long* val, size_t* len) { const grib_accessor_g2date* self = (grib_accessor_g2date*)a; diff --git a/src/grib_accessor_class_g2level.cc b/src/grib_accessor_class_g2level.cc index e1d8aaa38..39bd79033 100644 --- a/src/grib_accessor_class_g2level.cc +++ b/src/grib_accessor_class_g2level.cc @@ -17,7 +17,7 @@ CLASS = accessor SUPER = grib_accessor_class_long IMPLEMENTS = unpack_double;pack_double - IMPLEMENTS = unpack_long;pack_long;init;dump;is_missing + IMPLEMENTS = unpack_long;pack_long;init;is_missing MEMBERS=const char* type_first MEMBERS=const char* scale_first MEMBERS=const char* value_first @@ -41,7 +41,6 @@ static int pack_double(grib_accessor*, const double* val, size_t* len); static int pack_long(grib_accessor*, const long* val, size_t* len); static int unpack_double(grib_accessor*, double* val, size_t* len); static int unpack_long(grib_accessor*, long* val, size_t* len); -static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); typedef struct grib_accessor_g2level @@ -67,7 +66,7 @@ static grib_accessor_class _grib_accessor_class_g2level = { &init, /* init */ 0, /* post_init */ 0, /* destroy */ - &dump, /* dump */ + 0, /* dump */ 0, /* next_offset */ 0, /* get length of string */ 0, /* get number of values */ @@ -126,11 +125,6 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) a->flags |= GRIB_ACCESSOR_FLAG_COPY_IF_CHANGING_EDITION; } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - static bool is_tigge(grib_handle* h) { long productionStatus = 0; diff --git a/src/grib_accessor_class_rdbtime_guess_date.cc b/src/grib_accessor_class_rdbtime_guess_date.cc index 7bd8a3c4a..8a3bfa2a1 100644 --- a/src/grib_accessor_class_rdbtime_guess_date.cc +++ b/src/grib_accessor_class_rdbtime_guess_date.cc @@ -17,7 +17,7 @@ CLASS = accessor SUPER = grib_accessor_class_long IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init;dump + IMPLEMENTS = init MEMBERS=const char* typicalYear MEMBERS=const char* typicalMonth MEMBERS=const char* typicalDay @@ -39,7 +39,6 @@ or edit "accessor.class" and rerun ./make_class.pl static int pack_long(grib_accessor*, const long* val, size_t* len); static int unpack_long(grib_accessor*, long* val, size_t* len); -static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); typedef struct grib_accessor_rdbtime_guess_date @@ -66,7 +65,7 @@ static grib_accessor_class _grib_accessor_class_rdbtime_guess_date = { &init, /* init */ 0, /* post_init */ 0, /* destroy */ - &dump, /* dump */ + 0, /* dump */ 0, /* next_offset */ 0, /* get length of string */ 0, /* get number of values */ @@ -124,11 +123,6 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) /* a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; */ } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_rdbtime_guess_date* self = (grib_accessor_rdbtime_guess_date*)a; diff --git a/src/grib_accessor_class_signed_bits.cc b/src/grib_accessor_class_signed_bits.cc index 1750af3eb..dc8ccf488 100644 --- a/src/grib_accessor_class_signed_bits.cc +++ b/src/grib_accessor_class_signed_bits.cc @@ -16,7 +16,7 @@ CLASS = accessor SUPER = grib_accessor_class_long IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init;dump + IMPLEMENTS = init IMPLEMENTS = next_offset IMPLEMENTS = byte_count IMPLEMENTS = value_count @@ -45,7 +45,6 @@ static long byte_count(grib_accessor*); static long byte_offset(grib_accessor*); static long next_offset(grib_accessor*); static int value_count(grib_accessor*, long*); -static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); static void update_size(grib_accessor*, size_t); @@ -70,7 +69,7 @@ static grib_accessor_class _grib_accessor_class_signed_bits = { &init, /* init */ 0, /* post_init */ 0, /* destroy */ - &dump, /* dump */ + 0, /* dump */ &next_offset, /* next_offset */ 0, /* get length of string */ &value_count, /* get number of values */ @@ -152,11 +151,6 @@ static void init(grib_accessor* a, const long len, grib_arguments* args) a->length = compute_byte_count(a); } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - static int unpack_long(grib_accessor* a, long* val, size_t* len) { return GRIB_NOT_IMPLEMENTED; diff --git a/src/grib_accessor_class_spd.cc b/src/grib_accessor_class_spd.cc index 22fa03dc5..734c0bc89 100644 --- a/src/grib_accessor_class_spd.cc +++ b/src/grib_accessor_class_spd.cc @@ -16,7 +16,7 @@ CLASS = accessor SUPER = grib_accessor_class_long IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init;dump + IMPLEMENTS = init IMPLEMENTS = next_offset IMPLEMENTS = byte_count IMPLEMENTS = value_count @@ -45,7 +45,6 @@ static long byte_count(grib_accessor*); static long byte_offset(grib_accessor*); static long next_offset(grib_accessor*); static int value_count(grib_accessor*, long*); -static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); static void update_size(grib_accessor*, size_t); @@ -70,7 +69,7 @@ static grib_accessor_class _grib_accessor_class_spd = { &init, /* init */ 0, /* post_init */ 0, /* destroy */ - &dump, /* dump */ + 0, /* dump */ &next_offset, /* next_offset */ 0, /* get length of string */ &value_count, /* get number of values */ @@ -153,11 +152,6 @@ static void init(grib_accessor* a, const long len, grib_arguments* args) a->length = compute_byte_count(a); } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_spd* self = (grib_accessor_spd*)a; diff --git a/src/grib_accessor_class_time.cc b/src/grib_accessor_class_time.cc index 36aa290c9..3251fdd33 100644 --- a/src/grib_accessor_class_time.cc +++ b/src/grib_accessor_class_time.cc @@ -18,7 +18,7 @@ SUPER = grib_accessor_class_long IMPLEMENTS = unpack_long;pack_long IMPLEMENTS = unpack_string - IMPLEMENTS = init;dump + IMPLEMENTS = init MEMBERS=const char* hour MEMBERS=const char* minute MEMBERS=const char* second @@ -39,7 +39,6 @@ or edit "accessor.class" and rerun ./make_class.pl static int pack_long(grib_accessor*, const long* val, size_t* len); static int unpack_long(grib_accessor*, long* val, size_t* len); static int unpack_string(grib_accessor*, char*, size_t* len); -static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); typedef struct grib_accessor_time @@ -64,7 +63,7 @@ static grib_accessor_class _grib_accessor_class_time = { &init, /* init */ 0, /* post_init */ 0, /* destroy */ - &dump, /* dump */ + 0, /* dump */ 0, /* next_offset */ 0, /* get length of string */ 0, /* get number of values */ @@ -119,11 +118,6 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) self->second = grib_arguments_get_name(hand, c, n++); } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - static int unpack_long(grib_accessor* a, long* val, size_t* len) { const grib_accessor_time* self = (grib_accessor_time*)a; diff --git a/src/grib_accessor_class_validity_date.cc b/src/grib_accessor_class_validity_date.cc index 8182228ae..760b7bccd 100644 --- a/src/grib_accessor_class_validity_date.cc +++ b/src/grib_accessor_class_validity_date.cc @@ -17,7 +17,7 @@ CLASS = accessor SUPER = grib_accessor_class_long IMPLEMENTS = unpack_long - IMPLEMENTS = init;dump + IMPLEMENTS = init MEMBERS=const char* date MEMBERS=const char* time MEMBERS=const char* step @@ -40,7 +40,6 @@ or edit "accessor.class" and rerun ./make_class.pl */ static int unpack_long(grib_accessor*, long* val, size_t* len); -static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); typedef struct grib_accessor_validity_date @@ -69,7 +68,7 @@ static grib_accessor_class _grib_accessor_class_validity_date = { &init, /* init */ 0, /* post_init */ 0, /* destroy */ - &dump, /* dump */ + 0, /* dump */ 0, /* next_offset */ 0, /* get length of string */ 0, /* get number of values */ @@ -165,11 +164,6 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_validity_date* self = (grib_accessor_validity_date*)a; diff --git a/src/grib_accessor_class_validity_time.cc b/src/grib_accessor_class_validity_time.cc index 0b2c9697f..34eb78128 100644 --- a/src/grib_accessor_class_validity_time.cc +++ b/src/grib_accessor_class_validity_time.cc @@ -18,7 +18,7 @@ SUPER = grib_accessor_class_long IMPLEMENTS = unpack_long IMPLEMENTS = unpack_string - IMPLEMENTS = init;dump + IMPLEMENTS = init MEMBERS=const char* date MEMBERS=const char* time MEMBERS=const char* step @@ -41,7 +41,6 @@ or edit "accessor.class" and rerun ./make_class.pl static int unpack_long(grib_accessor*, long* val, size_t* len); static int unpack_string(grib_accessor*, char*, size_t* len); -static void dump(grib_accessor*, grib_dumper*); static void init(grib_accessor*, const long, grib_arguments*); typedef struct grib_accessor_validity_time @@ -69,7 +68,7 @@ static grib_accessor_class _grib_accessor_class_validity_time = { &init, /* init */ 0, /* post_init */ 0, /* destroy */ - &dump, /* dump */ + 0, /* dump */ 0, /* next_offset */ 0, /* get length of string */ 0, /* get number of values */ @@ -164,11 +163,6 @@ static void init(grib_accessor* a, const long l, grib_arguments* c) a->flags |= GRIB_ACCESSOR_FLAG_READ_ONLY; } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_validity_time* self = (grib_accessor_validity_time*)a; From 13e38aae9222a8b102e5653cb568d06982203708 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 7 Mar 2024 21:11:32 +0000 Subject: [PATCH 5/5] Deprecated travis yaml --- .travis.yml => deprecated/.travis.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .travis.yml => deprecated/.travis.yml (100%) diff --git a/.travis.yml b/deprecated/.travis.yml similarity index 100% rename from .travis.yml rename to deprecated/.travis.yml