diff --git a/src/accessor/grib_accessor_class_count_total.h b/src/accessor/grib_accessor_class_count_total.h index 6f4e9020c..2f6dcaad9 100644 --- a/src/accessor/grib_accessor_class_count_total.h +++ b/src/accessor/grib_accessor_class_count_total.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc b/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc index 7a98e6725..55bf9ea8a 100644 --- a/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc +++ b/src/accessor/grib_accessor_class_data_jpeg2000_packing.cc @@ -94,6 +94,8 @@ int grib_accessor_data_jpeg2000_packing_t::unpack_float(float* val, size_t* len) int grib_accessor_data_jpeg2000_packing_t::unpack_double(double* val, size_t* len) { int err = GRIB_SUCCESS; + grib_handle* hand = grib_handle_of_accessor(this); + size_t i = 0; size_t buflen = byte_count(); double bscale = 0; @@ -116,18 +118,18 @@ int grib_accessor_data_jpeg2000_packing_t::unpack_double(double* val, size_t* le return err; if (units_factor_) - grib_get_double_internal(grib_handle_of_accessor(this), units_factor_, &units_factor); + grib_get_double_internal(hand, units_factor_, &units_factor); if (units_bias_) - grib_get_double_internal(grib_handle_of_accessor(this), units_bias_, &units_bias); + grib_get_double_internal(hand, units_bias_, &units_bias); - if ((err = grib_get_long_internal(grib_handle_of_accessor(this), bits_per_value_, &bits_per_value)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(hand, bits_per_value_, &bits_per_value)) != GRIB_SUCCESS) return err; - if ((err = grib_get_double_internal(grib_handle_of_accessor(this), reference_value_, &reference_value)) != GRIB_SUCCESS) + if ((err = grib_get_double_internal(hand, reference_value_, &reference_value)) != GRIB_SUCCESS) return err; - if ((err = grib_get_long_internal(grib_handle_of_accessor(this), binary_scale_factor_, &binary_scale_factor)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(hand, binary_scale_factor_, &binary_scale_factor)) != GRIB_SUCCESS) return err; - if ((err = grib_get_long_internal(grib_handle_of_accessor(this), decimal_scale_factor_, &decimal_scale_factor)) != GRIB_SUCCESS) + if ((err = grib_get_long_internal(hand, decimal_scale_factor_, &decimal_scale_factor)) != GRIB_SUCCESS) return err; dirty_ = 0; @@ -194,7 +196,6 @@ int grib_accessor_data_jpeg2000_packing_t::pack_double(const double* cval, size_ { size_t n_vals = *len; int err = 0; - int i; double reference_value = 0; long binary_scale_factor = 0; long bits_per_value = 0; @@ -237,14 +238,14 @@ int grib_accessor_data_jpeg2000_packing_t::pack_double(const double* cval, size_ if (units_factor != 1.0) { if (units_bias != 0.0) - for (i = 0; i < n_vals; i++) + for (size_t i = 0; i < n_vals; i++) val[i] = val[i] * units_factor + units_bias; else - for (i = 0; i < n_vals; i++) + for (size_t i = 0; i < n_vals; i++) val[i] *= units_factor; } else if (units_bias != 0.0) - for (i = 0; i < n_vals; i++) + for (size_t i = 0; i < n_vals; i++) val[i] += units_bias; ret = grib_accessor_data_simple_packing_t::pack_double(val, len); diff --git a/src/accessor/grib_accessor_class_evaluate.cc b/src/accessor/grib_accessor_class_evaluate.cc index a8158ee96..9cca2b034 100644 --- a/src/accessor/grib_accessor_class_evaluate.cc +++ b/src/accessor/grib_accessor_class_evaluate.cc @@ -16,15 +16,16 @@ grib_accessor* grib_accessor_evaluate = &_grib_accessor_evaluate; void grib_accessor_evaluate_t::init(const long l, grib_arguments* c) { grib_accessor_long_t::init(l, c); - arg_ = c; + arg_ = c; // the expression to be evaluated flags_ |= GRIB_ACCESSOR_FLAG_READ_ONLY; } int grib_accessor_evaluate_t::unpack_long(long* val, size_t* len) { - grib_expression* e = grib_arguments_get_expression(grib_handle_of_accessor(this), arg_, 0); + grib_handle* h = grib_handle_of_accessor(this); + grib_expression* e = grib_arguments_get_expression(h, arg_, 0); - int ret = grib_expression_evaluate_long(grib_handle_of_accessor(this), e, val); + int ret = grib_expression_evaluate_long(h, e, val); *len = 1; return ret; diff --git a/src/accessor/grib_accessor_class_evaluate.h b/src/accessor/grib_accessor_class_evaluate.h index 53f5420ae..aa76049bf 100644 --- a/src/accessor/grib_accessor_class_evaluate.h +++ b/src/accessor/grib_accessor_class_evaluate.h @@ -22,5 +22,5 @@ public: void init(const long, grib_arguments*) override; protected: - grib_arguments* arg_; + grib_arguments* arg_; // expression to be evaluated }; diff --git a/src/accessor/grib_accessor_class_g1fcperiod.h b/src/accessor/grib_accessor_class_g1fcperiod.h index e609853b9..8943966dc 100644 --- a/src/accessor/grib_accessor_class_g1fcperiod.h +++ b/src/accessor/grib_accessor_class_g1fcperiod.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_g1forecastmonth.h b/src/accessor/grib_accessor_class_g1forecastmonth.h index 9737eb16a..1d3f8569b 100644 --- a/src/accessor/grib_accessor_class_g1forecastmonth.h +++ b/src/accessor/grib_accessor_class_g1forecastmonth.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_g1monthlydate.h b/src/accessor/grib_accessor_class_g1monthlydate.h index 8c904c524..a46aa000a 100644 --- a/src/accessor/grib_accessor_class_g1monthlydate.h +++ b/src/accessor/grib_accessor_class_g1monthlydate.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h index f14604d8f..757358d5a 100644 --- a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h +++ b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_complex.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h index 0619a72dd..1f7c15a2a 100644 --- a/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h +++ b/src/accessor/grib_accessor_class_g1number_of_coded_values_sh_simple.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_g1step_range.h b/src/accessor/grib_accessor_class_g1step_range.h index 29858ce1a..a76bd520c 100644 --- a/src/accessor/grib_accessor_class_g1step_range.h +++ b/src/accessor/grib_accessor_class_g1step_range.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_g1verificationdate.h b/src/accessor/grib_accessor_class_g1verificationdate.h index 5e1f0ac24..0b1abf641 100644 --- a/src/accessor/grib_accessor_class_g1verificationdate.h +++ b/src/accessor/grib_accessor_class_g1verificationdate.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_g2_aerosol.h b/src/accessor/grib_accessor_class_g2_aerosol.h index f50542862..3f02da7a5 100644 --- a/src/accessor/grib_accessor_class_g2_aerosol.h +++ b/src/accessor/grib_accessor_class_g2_aerosol.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_g2_chemical.h b/src/accessor/grib_accessor_class_g2_chemical.h index 68d7ece7c..7ceece9c5 100644 --- a/src/accessor/grib_accessor_class_g2_chemical.h +++ b/src/accessor/grib_accessor_class_g2_chemical.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_g2end_step.cc b/src/accessor/grib_accessor_class_g2end_step.cc index 002a07779..c175ebe88 100644 --- a/src/accessor/grib_accessor_class_g2end_step.cc +++ b/src/accessor/grib_accessor_class_g2end_step.cc @@ -403,8 +403,8 @@ int grib_accessor_g2end_step_t::unpack_double(double* val, size_t* len) int grib_accessor_g2end_step_t::pack_long_(const long end_step_value, const long end_step_unit) { - grib_handle* h = grib_handle_of_accessor(this); - int err = 0; + grib_handle* h = grib_handle_of_accessor(this); + int err = 0; long year; long month; @@ -527,13 +527,13 @@ int grib_accessor_g2end_step_t::pack_long_(const long end_step_value, const long time_range_opt = eccodes::Step{ time_range.value(eccodes::Unit{ force_step_units }), eccodes::Unit{ force_step_units } }; } - if ((err = grib_set_long_internal(grib_handle_of_accessor(this), time_range_value_, time_range_opt.value())) != GRIB_SUCCESS) + if ((err = grib_set_long_internal(h, time_range_value_, time_range_opt.value())) != GRIB_SUCCESS) return err; - if ((err = grib_set_long_internal(grib_handle_of_accessor(this), time_range_unit_, time_range_opt.unit().value())) != GRIB_SUCCESS) + if ((err = grib_set_long_internal(h, time_range_unit_, time_range_opt.unit().value())) != GRIB_SUCCESS) return err; - if ((err = grib_set_long_internal(grib_handle_of_accessor(this), forecast_time_value_key, forecast_time_opt.value())) != GRIB_SUCCESS) + if ((err = grib_set_long_internal(h, forecast_time_value_key, forecast_time_opt.value())) != GRIB_SUCCESS) return err; - if ((err = grib_set_long_internal(grib_handle_of_accessor(this), forecast_time_unit_key, forecast_time_opt.unit().value())) != GRIB_SUCCESS) + if ((err = grib_set_long_internal(h, forecast_time_unit_key, forecast_time_opt.unit().value())) != GRIB_SUCCESS) return err; return GRIB_SUCCESS; @@ -639,7 +639,7 @@ int grib_accessor_g2end_step_t::pack_string(const char* val, size_t* len) long grib_accessor_g2end_step_t::get_native_type() { - grib_handle* h = grib_handle_of_accessor(this); + grib_handle* h = grib_handle_of_accessor(this); const int show_units_for_hours = context_->grib_hourly_steps_with_units; if (!show_units_for_hours) { diff --git a/src/accessor/grib_accessor_class_g2end_step.h b/src/accessor/grib_accessor_class_g2end_step.h index d66a01d5e..18a9a78ee 100644 --- a/src/accessor/grib_accessor_class_g2end_step.h +++ b/src/accessor/grib_accessor_class_g2end_step.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_g2grid.h b/src/accessor/grib_accessor_class_g2grid.h index 07fc48fc0..8ec82e7a6 100644 --- a/src/accessor/grib_accessor_class_g2grid.h +++ b/src/accessor/grib_accessor_class_g2grid.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_g2latlon.h b/src/accessor/grib_accessor_class_g2latlon.h index 2bcd564b7..b7e5537c7 100644 --- a/src/accessor/grib_accessor_class_g2latlon.h +++ b/src/accessor/grib_accessor_class_g2latlon.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_g2level.h b/src/accessor/grib_accessor_class_g2level.h index e51fef38d..50fc6d0d1 100644 --- a/src/accessor/grib_accessor_class_g2level.h +++ b/src/accessor/grib_accessor_class_g2level.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_g2lon.h b/src/accessor/grib_accessor_class_g2lon.h index b78cab8dc..a781f666a 100644 --- a/src/accessor/grib_accessor_class_g2lon.h +++ b/src/accessor/grib_accessor_class_g2lon.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_global_gaussian.h b/src/accessor/grib_accessor_class_global_gaussian.h index ebb59b6b6..6a3517784 100644 --- a/src/accessor/grib_accessor_class_global_gaussian.h +++ b/src/accessor/grib_accessor_class_global_gaussian.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_group.h b/src/accessor/grib_accessor_class_group.h index dc6bb1822..ad6146c61 100644 --- a/src/accessor/grib_accessor_class_group.h +++ b/src/accessor/grib_accessor_class_group.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_gts_header.h b/src/accessor/grib_accessor_class_gts_header.h index 81a58ba4b..f1718fb36 100644 --- a/src/accessor/grib_accessor_class_gts_header.h +++ b/src/accessor/grib_accessor_class_gts_header.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_hash_array.h b/src/accessor/grib_accessor_class_hash_array.h index 9dabd2db8..69b4bedc8 100644 --- a/src/accessor/grib_accessor_class_hash_array.h +++ b/src/accessor/grib_accessor_class_hash_array.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_headers_only.h b/src/accessor/grib_accessor_class_headers_only.h index 3ca33f2a6..e0637317d 100644 --- a/src/accessor/grib_accessor_class_headers_only.h +++ b/src/accessor/grib_accessor_class_headers_only.h @@ -1,4 +1,3 @@ - /* * (C) Copyright 2005- ECMWF. * diff --git a/src/accessor/grib_accessor_class_julian_day.cc b/src/accessor/grib_accessor_class_julian_day.cc index 3183ef60a..7b22252a0 100644 --- a/src/accessor/grib_accessor_class_julian_day.cc +++ b/src/accessor/grib_accessor_class_julian_day.cc @@ -17,11 +17,12 @@ void grib_accessor_julian_day_t::init(const long l, grib_arguments* c) { grib_accessor_double_t::init(l, c); int n = 0; + grib_handle* h = grib_handle_of_accessor(this); - date_ = grib_arguments_get_name(grib_handle_of_accessor(this), c, n++); - hour_ = grib_arguments_get_name(grib_handle_of_accessor(this), c, n++); - minute_ = grib_arguments_get_name(grib_handle_of_accessor(this), c, n++); - second_ = grib_arguments_get_name(grib_handle_of_accessor(this), c, n++); + date_ = grib_arguments_get_name(h, c, n++); + hour_ = grib_arguments_get_name(h, c, n++); + minute_ = grib_arguments_get_name(h, c, n++); + second_ = grib_arguments_get_name(h, c, n++); length_ = 0; } @@ -39,29 +40,27 @@ int grib_accessor_julian_day_t::pack_long(const long* val, size_t* len) int grib_accessor_julian_day_t::pack_double(const double* val, size_t* len) { - int ret = 0; - long hour = 0; - long minute = 0; - long second = 0; - long date = 0; - long year, month, day; + int ret = GRIB_SUCCESS; + long hour = 0, minute = 0, second = 0; + long year = 0, month = 0, day = 0; + grib_handle* h = grib_handle_of_accessor(this); ret = grib_julian_to_datetime(*val, &year, &month, &day, &hour, &minute, &second); if (ret != 0) return ret; - date = year * 10000 + month * 100 + day; + long date = year * 10000 + month * 100 + day; - ret = grib_set_long_internal(grib_handle_of_accessor(this), date_, date); + ret = grib_set_long_internal(h, date_, date); if (ret != 0) return ret; - ret = grib_set_long_internal(grib_handle_of_accessor(this), hour_, hour); + ret = grib_set_long_internal(h, hour_, hour); if (ret != 0) return ret; - ret = grib_set_long_internal(grib_handle_of_accessor(this), minute_, minute); + ret = grib_set_long_internal(h, minute_, minute); if (ret != 0) return ret; - ret = grib_set_long_internal(grib_handle_of_accessor(this), second_, second); + ret = grib_set_long_internal(h, second_, second); return ret; } @@ -82,17 +81,18 @@ int grib_accessor_julian_day_t::unpack_double(double* val, size_t* len) int ret = 0; long date, hour, minute, second; long year, month, day; + grib_handle* h = grib_handle_of_accessor(this); - ret = grib_get_long_internal(grib_handle_of_accessor(this), date_, &date); + ret = grib_get_long_internal(h, date_, &date); if (ret != GRIB_SUCCESS) return ret; - ret = grib_get_long_internal(grib_handle_of_accessor(this), hour_, &hour); + ret = grib_get_long_internal(h, hour_, &hour); if (ret != GRIB_SUCCESS) return ret; - ret = grib_get_long_internal(grib_handle_of_accessor(this), minute_, &minute); + ret = grib_get_long_internal(h, minute_, &minute); if (ret != GRIB_SUCCESS) return ret; - ret = grib_get_long_internal(grib_handle_of_accessor(this), second_, &second); + ret = grib_get_long_internal(h, second_, &second); if (ret != GRIB_SUCCESS) return ret; diff --git a/src/accessor/grib_accessor_class_number_of_coded_values.cc b/src/accessor/grib_accessor_class_number_of_coded_values.cc index 36a699516..4ca9d4c2b 100644 --- a/src/accessor/grib_accessor_class_number_of_coded_values.cc +++ b/src/accessor/grib_accessor_class_number_of_coded_values.cc @@ -16,12 +16,14 @@ grib_accessor* grib_accessor_number_of_coded_values = &_grib_accessor_number_of_ void grib_accessor_number_of_coded_values_t::init(const long l, grib_arguments* c) { grib_accessor_long_t::init(l, c); + grib_handle* h = grib_handle_of_accessor(this); + int n = 0; - bitsPerValue_ = grib_arguments_get_name(grib_handle_of_accessor(this), c, n++); - offsetBeforeData_ = grib_arguments_get_name(grib_handle_of_accessor(this), c, n++); - offsetAfterData_ = grib_arguments_get_name(grib_handle_of_accessor(this), c, n++); - unusedBits_ = grib_arguments_get_name(grib_handle_of_accessor(this), c, n++); - numberOfValues_ = grib_arguments_get_name(grib_handle_of_accessor(this), c, n++); + bitsPerValue_ = grib_arguments_get_name(h, c, n++); + offsetBeforeData_ = grib_arguments_get_name(h, c, n++); + offsetAfterData_ = grib_arguments_get_name(h, c, n++); + unusedBits_ = grib_arguments_get_name(h, c, n++); + numberOfValues_ = grib_arguments_get_name(h, c, n++); flags_ |= GRIB_ACCESSOR_FLAG_READ_ONLY; flags_ |= GRIB_ACCESSOR_FLAG_FUNCTION; length_ = 0; @@ -29,30 +31,31 @@ void grib_accessor_number_of_coded_values_t::init(const long l, grib_arguments* int grib_accessor_number_of_coded_values_t::unpack_long(long* val, size_t* len) { - int ret = GRIB_SUCCESS; - long bpv = 0; - long offsetBeforeData = 0, offsetAfterData = 0, unusedBits = 0, numberOfValues; + int ret = GRIB_SUCCESS; + long bpv = 0, offsetBeforeData = 0, offsetAfterData = 0, unusedBits = 0, numberOfValues; + grib_handle* h = grib_handle_of_accessor(this); - if ((ret = grib_get_long_internal(grib_handle_of_accessor(this), bitsPerValue_, &bpv)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, bitsPerValue_, &bpv)) != GRIB_SUCCESS) return ret; - if ((ret = grib_get_long_internal(grib_handle_of_accessor(this), offsetBeforeData_, &offsetBeforeData)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, offsetBeforeData_, &offsetBeforeData)) != GRIB_SUCCESS) return ret; - if ((ret = grib_get_long_internal(grib_handle_of_accessor(this), offsetAfterData_, &offsetAfterData)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, offsetAfterData_, &offsetAfterData)) != GRIB_SUCCESS) return ret; - if ((ret = grib_get_long_internal(grib_handle_of_accessor(this), unusedBits_, &unusedBits)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, unusedBits_, &unusedBits)) != GRIB_SUCCESS) return ret; if (bpv != 0) { - grib_context_log(context_, GRIB_LOG_DEBUG, "grib_accessor_number_of_coded_values_t: offsetAfterData=%ld offsetBeforeData=%ld unusedBits=%ld bpv=%ld\n", - offsetAfterData, offsetBeforeData, unusedBits, bpv); + grib_context_log(context_, GRIB_LOG_DEBUG, + "grib_accessor_number_of_coded_values_t: offsetAfterData=%ld offsetBeforeData=%ld unusedBits=%ld bpv=%ld", + offsetAfterData, offsetBeforeData, unusedBits, bpv); DEBUG_ASSERT(offsetAfterData > offsetBeforeData); *val = ((offsetAfterData - offsetBeforeData) * 8 - unusedBits) / bpv; } else { - if ((ret = grib_get_long_internal(grib_handle_of_accessor(this), numberOfValues_, &numberOfValues)) != GRIB_SUCCESS) + if ((ret = grib_get_long_internal(h, numberOfValues_, &numberOfValues)) != GRIB_SUCCESS) return ret; *val = numberOfValues; diff --git a/src/accessor/grib_accessor_class_statistics_spectral.cc b/src/accessor/grib_accessor_class_statistics_spectral.cc index 033dfb692..5a092e25b 100644 --- a/src/accessor/grib_accessor_class_statistics_spectral.cc +++ b/src/accessor/grib_accessor_class_statistics_spectral.cc @@ -17,12 +17,13 @@ void grib_accessor_statistics_spectral_t::init(const long l, grib_arguments* c) { grib_accessor_abstract_vector_t::init(l, c); int n = 0; + grib_handle* h = grib_handle_of_accessor(this); - values_ = grib_arguments_get_name(grib_handle_of_accessor(this), c, n++); - J_ = grib_arguments_get_name(grib_handle_of_accessor(this), c, n++); - K_ = grib_arguments_get_name(grib_handle_of_accessor(this), c, n++); - M_ = grib_arguments_get_name(grib_handle_of_accessor(this), c, n++); - JS_ = grib_arguments_get_name(grib_handle_of_accessor(this), c, n++); + values_ = grib_arguments_get_name(h, c, n++); + J_ = grib_arguments_get_name(h, c, n++); + K_ = grib_arguments_get_name(h, c, n++); + M_ = grib_arguments_get_name(h, c, n++); + JS_ = grib_arguments_get_name(h, c, n++); flags_ |= GRIB_ACCESSOR_FLAG_READ_ONLY; flags_ |= GRIB_ACCESSOR_FLAG_FUNCTION; @@ -53,13 +54,13 @@ int grib_accessor_statistics_spectral_t::unpack_double(double* val, size_t* len) if ((ret = grib_get_size(h, values_, &size)) != GRIB_SUCCESS) return ret; - if ((ret = grib_get_long(grib_handle_of_accessor(this), J_, &J)) != GRIB_SUCCESS) + if ((ret = grib_get_long(h, J_, &J)) != GRIB_SUCCESS) return ret; - if ((ret = grib_get_long(grib_handle_of_accessor(this), K_, &K)) != GRIB_SUCCESS) + if ((ret = grib_get_long(h, K_, &K)) != GRIB_SUCCESS) return ret; - if ((ret = grib_get_long(grib_handle_of_accessor(this), M_, &M)) != GRIB_SUCCESS) + if ((ret = grib_get_long(h, M_, &M)) != GRIB_SUCCESS) return ret; if (J != M || M != K) @@ -114,7 +115,7 @@ int grib_accessor_statistics_spectral_t::unpack_double(double* val, size_t* len) int grib_accessor_statistics_spectral_t::value_count(long* count) { *count = number_of_elements_; - return 0; + return GRIB_SUCCESS; } void grib_accessor_statistics_spectral_t::destroy(grib_context* c)