Dead code removal

This commit is contained in:
Shahram Najm 2023-12-26 18:45:00 +00:00
parent 5cbc79fd36
commit 84d8265b9a
1 changed files with 1 additions and 43 deletions

View File

@ -22,7 +22,6 @@
IMPLEMENTS = value_count
IMPLEMENTS = next_offset
IMPLEMENTS = get_native_type
IMPLEMENTS = compare
END_CLASS_DEF
*/
@ -46,7 +45,6 @@ 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 int compare(grib_accessor*, grib_accessor*);
typedef struct grib_accessor_non_alpha
{
@ -95,7 +93,7 @@ static grib_accessor_class _grib_accessor_class_non_alpha = {
0, /* resize */
0, /* nearest_smaller_value */
0, /* next accessor */
&compare, /* compare vs. another 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) */
@ -213,46 +211,6 @@ static int unpack_double(grib_accessor* a, double* v, size_t* len)
return GRIB_NOT_IMPLEMENTED;
}
static int compare(grib_accessor* a, grib_accessor* b)
{
int retval = 0;
char* aval = 0;
char* bval = 0;
int err = 0;
size_t alen = 0;
size_t blen = 0;
long count = 0;
err = grib_value_count(a, &count);
if (err)
return err;
alen = count;
err = grib_value_count(b, &count);
if (err)
return err;
blen = count;
if (alen != blen)
return GRIB_COUNT_MISMATCH;
aval = (char*)grib_context_malloc(a->context, alen * sizeof(char));
bval = (char*)grib_context_malloc(b->context, blen * sizeof(char));
grib_unpack_string(a, aval, &alen);
grib_unpack_string(b, bval, &blen);
retval = GRIB_SUCCESS;
if (strcmp(aval, bval))
retval = GRIB_STRING_VALUE_MISMATCH;
grib_context_free(a->context, aval);
grib_context_free(b->context, bval);
return retval;
}
static long next_offset(grib_accessor* a)
{
return a->offset + a->length;