fix value count
CLASS = accessor
SUPER = grib_accessor_class_gen
IMPLEMENTS = get_native_type;init
- IMPLEMENTS = unpack_string;value_count
+ IMPLEMENTS = unpack_string
MEMBERS = const char* grid_type
END_CLASS_DEF
@@ -34,7 +34,6 @@ or edit "accessor.class" and rerun ./make_class.pl
static int get_native_type(grib_accessor*);
static int unpack_string(grib_accessor*, char*, size_t* len);
-static int value_count(grib_accessor*, long*);
static void init(grib_accessor*, const long, grib_arguments*);
static void init_class(grib_accessor_class*);
@@ -60,7 +59,7 @@ static grib_accessor_class _grib_accessor_class_proj_string = {
0, /* describes himself */
0, /* get length of section */
0, /* get length of string */
- &value_count, /* get number of values */
+ 0, /* get number of values */
0, /* get number of bytes */
0, /* get offset to bytes */
&get_native_type, /* get native type */
@@ -100,6 +99,7 @@ static void init_class(grib_accessor_class* c)
c->dump = (*(c->super))->dump;
c->next_offset = (*(c->super))->next_offset;
c->string_length = (*(c->super))->string_length;
+ c->value_count = (*(c->super))->value_count;
c->byte_count = (*(c->super))->byte_count;
c->byte_offset = (*(c->super))->byte_offset;
c->sub_section = (*(c->super))->sub_section;
@@ -161,7 +161,8 @@ static int unpack_string(grib_accessor* a, char* v, size_t* len)
if (grib_is_earth_oblate(h)) {
if ((err = grib_get_double_internal(h, "earthMinorAxisInMetres", &earthMinorAxisInMetres)) != GRIB_SUCCESS) return err;
if ((err = grib_get_double_internal(h, "earthMajorAxisInMetres", &earthMajorAxisInMetres)) != GRIB_SUCCESS) return err;
- } else {
+ }
+ else {
if ((err = grib_get_double_internal(h, "radius", &radius)) != GRIB_SUCCESS) return err;
earthMinorAxisInMetres = earthMajorAxisInMetres = radius;
}
@@ -196,9 +197,3 @@ static int unpack_string(grib_accessor* a, char* v, size_t* len)
*len = strlen(v) + 1;
return err;
}
-
-static int value_count(grib_accessor* a, long* count)
-{
- *count = 16;
- return 0;
-}
