From 98f48951664f4d0a6c6993d9f87ed6e7bf360501 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 4 Feb 2015 18:10:08 +0000 Subject: [PATCH] Revert my previous change. value_count should be 1 NOT the bit count --- src/grib_accessor_class_bits.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/grib_accessor_class_bits.c b/src/grib_accessor_class_bits.c index 18bc1af75..5e736b85f 100644 --- a/src/grib_accessor_class_bits.c +++ b/src/grib_accessor_class_bits.c @@ -27,7 +27,6 @@ IMPLEMENTS = unpack_double; pack_double IMPLEMENTS = unpack_string IMPLEMENTS = init - IMPLEMENTS = value_count MEMBERS=const char* argument MEMBERS=long start MEMBERS=long len @@ -53,7 +52,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 int value_count(grib_accessor*,long*); static int unpack_string (grib_accessor*, char*, size_t *len); static void init(grib_accessor*,const long, grib_arguments* ); static void init_class(grib_accessor_class*); @@ -84,7 +82,7 @@ static grib_accessor_class _grib_accessor_class_bits = { 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 */ @@ -123,6 +121,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; @@ -322,11 +321,3 @@ static int unpack_string(grib_accessor*a , char* v, size_t *len){ } return ret; } - -static int value_count(grib_accessor* a,long* numBits) -{ - grib_accessor_bits* self = (grib_accessor_bits*)a; - *numBits=self->len; - - return GRIB_SUCCESS; -}