Accessors: Do not assert on error

This commit is contained in:
Shahram Najm 2024-02-19 13:34:02 +00:00
parent 1e24c813f5
commit d9dacdd3d7
8 changed files with 226 additions and 92 deletions

View File

@ -14,6 +14,6 @@ meta secondWavelength from_scale_factor_scaled_value(scaleFactorOfSecondWaveleng
alias firstWavelengthInMetres = firstWavelength;
alias secondWavelengthInMetres = secondWavelength;
constant oneBillionth = 1.0 / 1000000000 : hidden;
meta firstWavelengthInNanometres divdouble(firstWavelength, oneBillionth);
meta secondWavelengthInNanometres divdouble(secondWavelength, oneBillionth);
constant billion = 1000000000 : hidden;
meta firstWavelengthInNanometres multdouble(firstWavelength, billion);
meta secondWavelengthInNanometres multdouble(secondWavelength, billion);

View File

@ -80,6 +80,7 @@ list( APPEND eccodes_src_files
grib_accessor_class_hash_array.cc
grib_accessor_class_decimal_precision.cc
grib_accessor_class_divdouble.cc
grib_accessor_class_multdouble.cc
grib_accessor_class_budgdate.cc
grib_accessor_class_validity_date.cc
grib_accessor_class_validity_time.cc

View File

@ -131,6 +131,7 @@ extern grib_accessor_class* grib_accessor_class_mars_step;
extern grib_accessor_class* grib_accessor_class_md5;
extern grib_accessor_class* grib_accessor_class_message;
extern grib_accessor_class* grib_accessor_class_message_copy;
extern grib_accessor_class* grib_accessor_class_multdouble;
extern grib_accessor_class* grib_accessor_class_nearest;
extern grib_accessor_class* grib_accessor_class_non_alpha;
extern grib_accessor_class* grib_accessor_class_number_of_coded_values;

View File

@ -7,11 +7,6 @@
* In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
* virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
*/
/*****************************************
* Enrico Fucile
****************************************/
#include "grib_api_internal.h"
/*
This is used by make_class.pl
@ -108,7 +103,7 @@ grib_accessor_class* grib_accessor_class_divdouble = &_grib_accessor_class_divdo
static void init(grib_accessor* a, const long l, grib_arguments* c)
{
grib_accessor_divdouble* self = (grib_accessor_divdouble*)a;
int n = 0;
int n = 0;
self->val = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++);
self->divisor = grib_arguments_get_double(grib_handle_of_accessor(a), c, n++);
@ -116,9 +111,9 @@ static void init(grib_accessor* a, const long l, grib_arguments* c)
static int unpack_double(grib_accessor* a, double* val, size_t* len)
{
grib_accessor_divdouble* self = (grib_accessor_divdouble*)a;
int ret = GRIB_SUCCESS;
double value = 0;
const grib_accessor_divdouble* self = (grib_accessor_divdouble*)a;
int ret = GRIB_SUCCESS;
double value = 0;
if (*len < 1) {
*len = 1;
@ -130,8 +125,9 @@ static int unpack_double(grib_accessor* a, double* val, size_t* len)
if (ret != GRIB_SUCCESS)
return ret;
/* fprintf(stdout,"\nname %s %s %g/%g\n",a->name ,self->val,value,divisor);*/
Assert(self->divisor != 0);
if (self->divisor == 0) {
return GRIB_INVALID_ARGUMENT;
}
*val = value / self->divisor;
*len = 1;

View File

@ -0,0 +1,133 @@
/*
* (C) Copyright 2005- ECMWF.
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
*
* In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
* virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
*/
#include "grib_api_internal.h"
/*
This is used by make_class.pl
START_CLASS_DEF
CLASS = accessor
SUPER = grib_accessor_class_double
IMPLEMENTS = unpack_double
IMPLEMENTS = init
MEMBERS = const char* val
MEMBERS = double multiplier
END_CLASS_DEF
*/
/* START_CLASS_IMP */
/*
Don't edit anything between START_CLASS_IMP and END_CLASS_IMP
Instead edit values between START_CLASS_DEF and END_CLASS_DEF
or edit "accessor.class" and rerun ./make_class.pl
*/
static int unpack_double(grib_accessor*, double* val, size_t* len);
static void init(grib_accessor*, const long, grib_arguments*);
typedef struct grib_accessor_multdouble
{
grib_accessor att;
/* Members defined in gen */
/* Members defined in double */
/* Members defined in multdouble */
const char* val;
double multiplier;
} grib_accessor_multdouble;
extern grib_accessor_class* grib_accessor_class_double;
static grib_accessor_class _grib_accessor_class_multdouble = {
&grib_accessor_class_double, /* super */
"multdouble", /* name */
sizeof(grib_accessor_multdouble), /* size */
0, /* inited */
0, /* init_class */
&init, /* init */
0, /* post_init */
0, /* destroy */
0, /* dump */
0, /* next_offset */
0, /* get length of string */
0, /* get number of values */
0, /* get number of bytes */
0, /* get offset to bytes */
0, /* get native type */
0, /* get sub_section */
0, /* pack_missing */
0, /* is_missing */
0, /* pack_long */
0, /* unpack_long */
0, /* pack_double */
0, /* pack_float */
&unpack_double, /* unpack_double */
0, /* unpack_float */
0, /* pack_string */
0, /* unpack_string */
0, /* pack_string_array */
0, /* unpack_string_array */
0, /* pack_bytes */
0, /* unpack_bytes */
0, /* pack_expression */
0, /* notify_change */
0, /* update_size */
0, /* preferred_size */
0, /* resize */
0, /* nearest_smaller_value */
0, /* next accessor */
0, /* compare vs. another accessor */
0, /* unpack only ith value (double) */
0, /* unpack only ith value (float) */
0, /* unpack a given set of elements (double) */
0, /* unpack a given set of elements (float) */
0, /* unpack a subarray */
0, /* clear */
0, /* clone accessor */
};
grib_accessor_class* grib_accessor_class_multdouble = &_grib_accessor_class_multdouble;
/* END_CLASS_IMP */
static void init(grib_accessor* a, const long l, grib_arguments* c)
{
grib_accessor_multdouble* self = (grib_accessor_multdouble*)a;
int n = 0;
self->val = grib_arguments_get_name(grib_handle_of_accessor(a), c, n++);
self->multiplier = grib_arguments_get_double(grib_handle_of_accessor(a), c, n++);
}
static int unpack_double(grib_accessor* a, double* val, size_t* len)
{
grib_accessor_multdouble* self = (grib_accessor_multdouble*)a;
int ret = GRIB_SUCCESS;
double value = 0;
if (*len < 1) {
*len = 1;
return GRIB_ARRAY_TOO_SMALL;
}
ret = grib_get_double_internal(grib_handle_of_accessor(a), self->val, &value);
if (ret != GRIB_SUCCESS)
return ret;
*val = value * self->multiplier;
*len = 1;
return GRIB_SUCCESS;
}

View File

@ -37,7 +37,7 @@
#line 6 "accessor_class_list.gperf"
struct accessor_class_hash { char *name; grib_accessor_class **cclass;};
#define TOTAL_KEYWORDS 204
#define TOTAL_KEYWORDS 205
#define MIN_WORD_LENGTH 1
#define MAX_WORD_LENGTH 44
#define MIN_HASH_VALUE 1
@ -117,21 +117,21 @@ static const struct accessor_class_hash classes[] =
#line 9 "accessor_class_list.gperf"
{" "},
{""}, {""}, {""}, {""},
#line 178 "accessor_class_list.gperf"
#line 179 "accessor_class_list.gperf"
{"size", &grib_accessor_class_size},
#line 12 "accessor_class_list.gperf"
{"ascii", &grib_accessor_class_ascii},
#line 175 "accessor_class_list.gperf"
#line 176 "accessor_class_list.gperf"
{"signed", &grib_accessor_class_signed},
#line 155 "accessor_class_list.gperf"
#line 156 "accessor_class_list.gperf"
{"pad", &grib_accessor_class_pad},
#line 181 "accessor_class_list.gperf"
#line 182 "accessor_class_list.gperf"
{"spd", &grib_accessor_class_spd},
{""},
#line 75 "accessor_class_list.gperf"
{"dirty", &grib_accessor_class_dirty},
{""},
#line 176 "accessor_class_list.gperf"
#line 177 "accessor_class_list.gperf"
{"signed_bits", &grib_accessor_class_signed_bits},
{""},
#line 66 "accessor_class_list.gperf"
@ -141,7 +141,7 @@ static const struct accessor_class_hash classes[] =
{"data_simple_packing", &grib_accessor_class_data_simple_packing},
#line 68 "accessor_class_list.gperf"
{"data_secondary_bitmap", &grib_accessor_class_data_secondary_bitmap},
#line 169 "accessor_class_list.gperf"
#line 170 "accessor_class_list.gperf"
{"section", &grib_accessor_class_section},
#line 43 "accessor_class_list.gperf"
{"data_apply_bitmap", &grib_accessor_class_data_apply_bitmap},
@ -155,36 +155,36 @@ static const struct accessor_class_hash classes[] =
{"data_jpeg2000_packing", &grib_accessor_class_data_jpeg2000_packing},
#line 65 "accessor_class_list.gperf"
{"data_png_packing", &grib_accessor_class_data_png_packing},
#line 171 "accessor_class_list.gperf"
{"section_padding", &grib_accessor_class_section_padding},
#line 172 "accessor_class_list.gperf"
{"section_padding", &grib_accessor_class_section_padding},
#line 173 "accessor_class_list.gperf"
{"section_pointer", &grib_accessor_class_section_pointer},
#line 44 "accessor_class_list.gperf"
{"data_apply_boustrophedonic", &grib_accessor_class_data_apply_boustrophedonic},
{""}, {""}, {""}, {""},
#line 80 "accessor_class_list.gperf"
{"expanded_descriptors", &grib_accessor_class_expanded_descriptors},
#line 156 "accessor_class_list.gperf"
#line 157 "accessor_class_list.gperf"
{"padding", &grib_accessor_class_padding},
#line 45 "accessor_class_list.gperf"
{"data_apply_boustrophedonic_bitmap", &grib_accessor_class_data_apply_boustrophedonic_bitmap},
#line 110 "accessor_class_list.gperf"
{"gds_is_present", &grib_accessor_class_gds_is_present},
#line 168 "accessor_class_list.gperf"
#line 169 "accessor_class_list.gperf"
{"second_order_bits_per_value", &grib_accessor_class_second_order_bits_per_value},
#line 170 "accessor_class_list.gperf"
#line 171 "accessor_class_list.gperf"
{"section_length", &grib_accessor_class_section_length},
#line 113 "accessor_class_list.gperf"
{"getenv", &grib_accessor_class_getenv},
#line 57 "accessor_class_list.gperf"
{"data_g22order_packing", &grib_accessor_class_data_g22order_packing},
#line 190 "accessor_class_list.gperf"
#line 191 "accessor_class_list.gperf"
{"time", &grib_accessor_class_time},
{""},
#line 61 "accessor_class_list.gperf"
{"data_g2shsimple_packing", &grib_accessor_class_data_g2shsimple_packing},
{""},
#line 154 "accessor_class_list.gperf"
#line 155 "accessor_class_list.gperf"
{"packing_type", &grib_accessor_class_packing_type},
#line 62 "accessor_class_list.gperf"
{"data_g2simple_packing", &grib_accessor_class_data_g2simple_packing},
@ -198,28 +198,28 @@ static const struct accessor_class_hash classes[] =
{"g2end_step", &grib_accessor_class_g2end_step},
#line 98 "accessor_class_list.gperf"
{"g2_eps", &grib_accessor_class_g2_eps},
#line 141 "accessor_class_list.gperf"
#line 142 "accessor_class_list.gperf"
{"nearest", &grib_accessor_class_nearest},
{""},
#line 157 "accessor_class_list.gperf"
#line 158 "accessor_class_list.gperf"
{"padto", &grib_accessor_class_padto},
#line 188 "accessor_class_list.gperf"
#line 189 "accessor_class_list.gperf"
{"sum", &grib_accessor_class_sum},
{""},
#line 107 "accessor_class_list.gperf"
{"g2lon", &grib_accessor_class_g2lon},
#line 202 "accessor_class_list.gperf"
#line 203 "accessor_class_list.gperf"
{"uint8", &grib_accessor_class_uint8},
{""},
#line 187 "accessor_class_list.gperf"
#line 188 "accessor_class_list.gperf"
{"step_in_units", &grib_accessor_class_step_in_units},
#line 63 "accessor_class_list.gperf"
{"data_g2simple_packing_with_preprocessing", &grib_accessor_class_data_g2simple_packing_with_preprocessing},
#line 200 "accessor_class_list.gperf"
#line 201 "accessor_class_list.gperf"
{"uint64", &grib_accessor_class_uint64},
#line 47 "accessor_class_list.gperf"
{"data_complex_packing", &grib_accessor_class_data_complex_packing},
#line 198 "accessor_class_list.gperf"
#line 199 "accessor_class_list.gperf"
{"uint32", &grib_accessor_class_uint32},
#line 13 "accessor_class_list.gperf"
{"bit", &grib_accessor_class_bit},
@ -233,7 +233,7 @@ static const struct accessor_class_hash classes[] =
{"julian_day", &grib_accessor_class_julian_day},
#line 123 "accessor_class_list.gperf"
{"julian_date", &grib_accessor_class_julian_date},
#line 142 "accessor_class_list.gperf"
#line 143 "accessor_class_list.gperf"
{"non_alpha", &grib_accessor_class_non_alpha},
{""},
#line 29 "accessor_class_list.gperf"
@ -245,14 +245,14 @@ static const struct accessor_class_hash classes[] =
#line 16 "accessor_class_list.gperf"
{"bits_per_value", &grib_accessor_class_bits_per_value},
{""}, {""}, {""}, {""}, {""},
#line 166 "accessor_class_list.gperf"
#line 167 "accessor_class_list.gperf"
{"scale", &grib_accessor_class_scale},
{""},
#line 184 "accessor_class_list.gperf"
#line 185 "accessor_class_list.gperf"
{"statistics", &grib_accessor_class_statistics},
#line 102 "accessor_class_list.gperf"
{"g2date", &grib_accessor_class_g2date},
#line 144 "accessor_class_list.gperf"
#line 145 "accessor_class_list.gperf"
{"number_of_points", &grib_accessor_class_number_of_points},
#line 100 "accessor_class_list.gperf"
{"g2bitmap", &grib_accessor_class_g2bitmap},
@ -265,13 +265,13 @@ static const struct accessor_class_hash classes[] =
{"gds_not_present_bitmap", &grib_accessor_class_gds_not_present_bitmap},
#line 122 "accessor_class_list.gperf"
{"iterator", &grib_accessor_class_iterator},
#line 185 "accessor_class_list.gperf"
#line 186 "accessor_class_list.gperf"
{"statistics_spectral", &grib_accessor_class_statistics_spectral},
#line 46 "accessor_class_list.gperf"
{"data_ccsds_packing", &grib_accessor_class_data_ccsds_packing},
#line 145 "accessor_class_list.gperf"
#line 146 "accessor_class_list.gperf"
{"number_of_points_gaussian", &grib_accessor_class_number_of_points_gaussian},
#line 205 "accessor_class_list.gperf"
#line 206 "accessor_class_list.gperf"
{"unsigned", &grib_accessor_class_unsigned},
#line 138 "accessor_class_list.gperf"
{"md5", &grib_accessor_class_md5},
@ -280,30 +280,30 @@ static const struct accessor_class_hash classes[] =
{"g2_aerosol", &grib_accessor_class_g2_aerosol},
#line 139 "accessor_class_list.gperf"
{"message", &grib_accessor_class_message},
#line 206 "accessor_class_list.gperf"
#line 207 "accessor_class_list.gperf"
{"unsigned_bits", &grib_accessor_class_unsigned_bits},
#line 173 "accessor_class_list.gperf"
#line 174 "accessor_class_list.gperf"
{"select_step_template", &grib_accessor_class_select_step_template},
#line 136 "accessor_class_list.gperf"
{"mars_param", &grib_accessor_class_mars_param},
#line 203 "accessor_class_list.gperf"
#line 204 "accessor_class_list.gperf"
{"unexpanded_descriptors", &grib_accessor_class_unexpanded_descriptors},
#line 192 "accessor_class_list.gperf"
#line 193 "accessor_class_list.gperf"
{"to_integer", &grib_accessor_class_to_integer},
{""}, {""}, {""},
#line 177 "accessor_class_list.gperf"
#line 178 "accessor_class_list.gperf"
{"simple_packing_error", &grib_accessor_class_simple_packing_error},
#line 186 "accessor_class_list.gperf"
#line 187 "accessor_class_list.gperf"
{"step_human_readable", &grib_accessor_class_step_human_readable},
#line 140 "accessor_class_list.gperf"
{"message_copy", &grib_accessor_class_message_copy},
#line 162 "accessor_class_list.gperf"
#line 163 "accessor_class_list.gperf"
{"raw", &grib_accessor_class_raw},
{""}, {""},
#line 201 "accessor_class_list.gperf"
#line 202 "accessor_class_list.gperf"
{"uint64_little_endian", &grib_accessor_class_uint64_little_endian},
{""},
#line 199 "accessor_class_list.gperf"
#line 200 "accessor_class_list.gperf"
{"uint32_little_endian", &grib_accessor_class_uint32_little_endian},
#line 114 "accessor_class_list.gperf"
{"global_gaussian", &grib_accessor_class_global_gaussian},
@ -311,20 +311,20 @@ static const struct accessor_class_hash classes[] =
#line 76 "accessor_class_list.gperf"
{"divdouble", &grib_accessor_class_divdouble},
{""},
#line 174 "accessor_class_list.gperf"
#line 175 "accessor_class_list.gperf"
{"sexagesimal2decimal", &grib_accessor_class_sexagesimal2decimal},
#line 99 "accessor_class_list.gperf"
{"g2_mars_labeling", &grib_accessor_class_g2_mars_labeling},
#line 78 "accessor_class_list.gperf"
{"element", &grib_accessor_class_element},
#line 159 "accessor_class_list.gperf"
#line 160 "accessor_class_list.gperf"
{"padtomultiple", &grib_accessor_class_padtomultiple},
#line 127 "accessor_class_list.gperf"
{"latitudes", &grib_accessor_class_latitudes},
#line 163 "accessor_class_list.gperf"
#line 164 "accessor_class_list.gperf"
{"rdbtime_guess_date", &grib_accessor_class_rdbtime_guess_date},
{""}, {""}, {""},
#line 193 "accessor_class_list.gperf"
#line 194 "accessor_class_list.gperf"
{"to_string", &grib_accessor_class_to_string},
#line 132 "accessor_class_list.gperf"
{"long", &grib_accessor_class_long},
@ -348,20 +348,20 @@ static const struct accessor_class_hash classes[] =
{""},
#line 28 "accessor_class_list.gperf"
{"bufrdc_expanded_descriptors", &grib_accessor_class_bufrdc_expanded_descriptors},
#line 160 "accessor_class_list.gperf"
#line 161 "accessor_class_list.gperf"
{"position", &grib_accessor_class_position},
{""}, {""}, {""},
#line 17 "accessor_class_list.gperf"
{"blob", &grib_accessor_class_blob},
#line 109 "accessor_class_list.gperf"
{"gaussian_grid_name", &grib_accessor_class_gaussian_grid_name},
#line 196 "accessor_class_list.gperf"
#line 197 "accessor_class_list.gperf"
{"trim", &grib_accessor_class_trim},
{""}, {""},
#line 119 "accessor_class_list.gperf"
{"ibmfloat", &grib_accessor_class_ibmfloat},
{""}, {""},
#line 194 "accessor_class_list.gperf"
#line 195 "accessor_class_list.gperf"
{"transient", &grib_accessor_class_transient},
#line 55 "accessor_class_list.gperf"
{"data_g1shsimple_packing", &grib_accessor_class_data_g1shsimple_packing},
@ -370,15 +370,15 @@ static const struct accessor_class_hash classes[] =
{"data_g1simple_packing", &grib_accessor_class_data_g1simple_packing},
#line 49 "accessor_class_list.gperf"
{"data_g1complex_packing", &grib_accessor_class_data_g1complex_packing},
#line 165 "accessor_class_list.gperf"
#line 166 "accessor_class_list.gperf"
{"round", &grib_accessor_class_round},
#line 195 "accessor_class_list.gperf"
#line 196 "accessor_class_list.gperf"
{"transient_darray", &grib_accessor_class_transient_darray},
#line 18 "accessor_class_list.gperf"
{"budgdate", &grib_accessor_class_budgdate},
#line 209 "accessor_class_list.gperf"
#line 210 "accessor_class_list.gperf"
{"values", &grib_accessor_class_values},
#line 143 "accessor_class_list.gperf"
#line 144 "accessor_class_list.gperf"
{"number_of_coded_values", &grib_accessor_class_number_of_coded_values},
#line 126 "accessor_class_list.gperf"
{"label", &grib_accessor_class_label},
@ -386,30 +386,30 @@ static const struct accessor_class_hash classes[] =
#line 38 "accessor_class_list.gperf"
{"concept", &grib_accessor_class_concept},
{""},
#line 182 "accessor_class_list.gperf"
#line 183 "accessor_class_list.gperf"
{"spectral_truncation", &grib_accessor_class_spectral_truncation},
{""}, {""},
#line 83 "accessor_class_list.gperf"
{"g1_message_length", &grib_accessor_class_g1_message_length},
#line 183 "accessor_class_list.gperf"
#line 184 "accessor_class_list.gperf"
{"sprintf", &grib_accessor_class_sprintf},
#line 189 "accessor_class_list.gperf"
#line 190 "accessor_class_list.gperf"
{"suppressed", &grib_accessor_class_suppressed},
{""},
#line 212 "accessor_class_list.gperf"
#line 213 "accessor_class_list.gperf"
{"when", &grib_accessor_class_when},
{""}, {""},
#line 179 "accessor_class_list.gperf"
#line 180 "accessor_class_list.gperf"
{"smart_table", &grib_accessor_class_smart_table},
{""},
#line 39 "accessor_class_list.gperf"
{"constant", &grib_accessor_class_constant},
{""}, {""},
#line 161 "accessor_class_list.gperf"
#line 162 "accessor_class_list.gperf"
{"proj_string", &grib_accessor_class_proj_string},
#line 149 "accessor_class_list.gperf"
#line 150 "accessor_class_list.gperf"
{"octet_number", &grib_accessor_class_octet_number},
#line 180 "accessor_class_list.gperf"
#line 181 "accessor_class_list.gperf"
{"smart_table_column", &grib_accessor_class_smart_table_column},
{""},
#line 135 "accessor_class_list.gperf"
@ -426,7 +426,7 @@ static const struct accessor_class_hash classes[] =
{"data_sh_unpacked", &grib_accessor_class_data_sh_unpacked},
#line 27 "accessor_class_list.gperf"
{"bufr_string_values", &grib_accessor_class_bufr_string_values},
#line 197 "accessor_class_list.gperf"
#line 198 "accessor_class_list.gperf"
{"uint16", &grib_accessor_class_uint16},
{""}, {""},
#line 71 "accessor_class_list.gperf"
@ -439,26 +439,27 @@ static const struct accessor_class_hash classes[] =
{""},
#line 54 "accessor_class_list.gperf"
{"data_g1secondary_bitmap", &grib_accessor_class_data_g1secondary_bitmap},
#line 191 "accessor_class_list.gperf"
#line 192 "accessor_class_list.gperf"
{"to_double", &grib_accessor_class_to_double},
#line 101 "accessor_class_list.gperf"
{"g2bitmap_present", &grib_accessor_class_g2bitmap_present},
#line 120 "accessor_class_list.gperf"
{"ieeefloat", &grib_accessor_class_ieeefloat},
#line 150 "accessor_class_list.gperf"
#line 151 "accessor_class_list.gperf"
{"offset_file", &grib_accessor_class_offset_file},
#line 207 "accessor_class_list.gperf"
{"validity_date", &grib_accessor_class_validity_date},
#line 208 "accessor_class_list.gperf"
{"validity_date", &grib_accessor_class_validity_date},
#line 209 "accessor_class_list.gperf"
{"validity_time", &grib_accessor_class_validity_time},
{""},
#line 130 "accessor_class_list.gperf"
{"library_version", &grib_accessor_class_library_version},
#line 211 "accessor_class_list.gperf"
#line 212 "accessor_class_list.gperf"
{"vector", &grib_accessor_class_vector},
#line 84 "accessor_class_list.gperf"
{"g1_section4_length", &grib_accessor_class_g1_section4_length},
{""},
#line 141 "accessor_class_list.gperf"
{"multdouble", &grib_accessor_class_multdouble},
#line 52 "accessor_class_list.gperf"
{"data_g1second_order_general_packing", &grib_accessor_class_data_g1second_order_general_packing},
{""}, {""},
@ -467,7 +468,7 @@ static const struct accessor_class_hash classes[] =
{""},
#line 24 "accessor_class_list.gperf"
{"bufr_extract_subsets", &grib_accessor_class_bufr_extract_subsets},
#line 158 "accessor_class_list.gperf"
#line 159 "accessor_class_list.gperf"
{"padtoeven", &grib_accessor_class_padtoeven},
#line 50 "accessor_class_list.gperf"
{"data_g1second_order_constant_width_packing", &grib_accessor_class_data_g1second_order_constant_width_packing},
@ -483,7 +484,7 @@ static const struct accessor_class_hash classes[] =
#line 21 "accessor_class_list.gperf"
{"bufr_elements_table", &grib_accessor_class_bufr_elements_table},
{""}, {""}, {""}, {""},
#line 153 "accessor_class_list.gperf"
#line 154 "accessor_class_list.gperf"
{"pack_bufr_values", &grib_accessor_class_pack_bufr_values},
#line 35 "accessor_class_list.gperf"
{"codetable", &grib_accessor_class_codetable},
@ -495,7 +496,7 @@ static const struct accessor_class_hash classes[] =
{""},
#line 88 "accessor_class_list.gperf"
{"g1end_of_interval_monthly", &grib_accessor_class_g1end_of_interval_monthly},
#line 146 "accessor_class_list.gperf"
#line 147 "accessor_class_list.gperf"
{"number_of_values", &grib_accessor_class_number_of_values},
{""},
#line 116 "accessor_class_list.gperf"
@ -503,26 +504,26 @@ static const struct accessor_class_hash classes[] =
{""},
#line 33 "accessor_class_list.gperf"
{"closest_date", &grib_accessor_class_closest_date},
#line 152 "accessor_class_list.gperf"
#line 153 "accessor_class_list.gperf"
{"optimal_step_units", &grib_accessor_class_optimal_step_units},
{""},
#line 210 "accessor_class_list.gperf"
#line 211 "accessor_class_list.gperf"
{"variable", &grib_accessor_class_variable},
#line 133 "accessor_class_list.gperf"
{"long_vector", &grib_accessor_class_long_vector},
#line 167 "accessor_class_list.gperf"
#line 168 "accessor_class_list.gperf"
{"scale_values", &grib_accessor_class_scale_values},
{""}, {""}, {""},
#line 128 "accessor_class_list.gperf"
{"latlon_increment", &grib_accessor_class_latlon_increment},
{""}, {""}, {""},
#line 147 "accessor_class_list.gperf"
#line 148 "accessor_class_list.gperf"
{"number_of_values_data_raw_packing", &grib_accessor_class_number_of_values_data_raw_packing},
{""},
#line 79 "accessor_class_list.gperf"
{"evaluate", &grib_accessor_class_evaluate},
{""}, {""}, {""}, {""}, {""},
#line 151 "accessor_class_list.gperf"
#line 152 "accessor_class_list.gperf"
{"offset_values", &grib_accessor_class_offset_values},
#line 69 "accessor_class_list.gperf"
{"data_sh_packed", &grib_accessor_class_data_sh_packed},
@ -535,7 +536,7 @@ static const struct accessor_class_hash classes[] =
{""}, {""},
#line 41 "accessor_class_list.gperf"
{"count_missing", &grib_accessor_class_count_missing},
#line 204 "accessor_class_list.gperf"
#line 205 "accessor_class_list.gperf"
{"unpack_bufr_values", &grib_accessor_class_unpack_bufr_values},
{""}, {""},
#line 121 "accessor_class_list.gperf"
@ -569,7 +570,7 @@ static const struct accessor_class_hash classes[] =
#line 31 "accessor_class_list.gperf"
{"change_scanning_direction", &grib_accessor_class_change_scanning_direction},
{""}, {""}, {""}, {""}, {""}, {""}, {""},
#line 148 "accessor_class_list.gperf"
#line 149 "accessor_class_list.gperf"
{"octahedral_gaussian", &grib_accessor_class_octahedral_gaussian},
#line 10 "accessor_class_list.gperf"
{"abstract_long_vector", &grib_accessor_class_abstract_long_vector},
@ -600,7 +601,7 @@ static const struct accessor_class_hash classes[] =
#line 87 "accessor_class_list.gperf"
{"g1day_of_the_year_date", &grib_accessor_class_g1day_of_the_year_date},
{""}, {""}, {""}, {""}, {""},
#line 164 "accessor_class_list.gperf"
#line 165 "accessor_class_list.gperf"
{"reference_value_error", &grib_accessor_class_reference_value_error},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
@ -621,11 +622,11 @@ static const struct accessor_class_hash classes[] =
};
static const struct accessor_class_hash* grib_accessor_classes_hash(const char *str, size_t len)
{
unsigned int key = grib_accessor_classes_get_id (str, len);
{
unsigned int key = grib_accessor_classes_get_id (str, len);
#ifdef DEBUG
{
{
const char *s;
Assert( len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH );
Assert( key <= MAX_HASH_VALUE );
@ -634,5 +635,5 @@ static const struct accessor_class_hash* grib_accessor_classes_hash(const char *
}
#endif
return &classes[key];
return &classes[key];
}

View File

@ -130,6 +130,7 @@
{ "md5", &grib_accessor_class_md5, },
{ "message", &grib_accessor_class_message, },
{ "message_copy", &grib_accessor_class_message_copy, },
{ "multdouble", &grib_accessor_class_multdouble, },
{ "nearest", &grib_accessor_class_nearest, },
{ "non_alpha", &grib_accessor_class_non_alpha, },
{ "number_of_coded_values", &grib_accessor_class_number_of_coded_values, },

View File

@ -131,6 +131,7 @@ mars_step, &grib_accessor_class_mars_step
md5, &grib_accessor_class_md5
message, &grib_accessor_class_message
message_copy, &grib_accessor_class_message_copy
multdouble, &grib_accessor_class_multdouble
nearest, &grib_accessor_class_nearest
non_alpha, &grib_accessor_class_non_alpha
number_of_coded_values, &grib_accessor_class_number_of_coded_values