From 626aee752d82df41563bc6d064501d63205056e8 Mon Sep 17 00:00:00 2001 From: shahramn Date: Fri, 8 Mar 2024 12:08:39 +0000 Subject: [PATCH] Refactoring: removal of duplicated code (dump) --- src/grib_accessor_class_unexpanded_descriptors.cc | 10 ++-------- src/grib_accessor_class_unsigned_bits.cc | 10 ++-------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/grib_accessor_class_unexpanded_descriptors.cc b/src/grib_accessor_class_unexpanded_descriptors.cc index b583ce5cd..a026388f2 100644 --- a/src/grib_accessor_class_unexpanded_descriptors.cc +++ b/src/grib_accessor_class_unexpanded_descriptors.cc @@ -16,7 +16,7 @@ CLASS = accessor SUPER = grib_accessor_class_long IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init;dump + IMPLEMENTS = init IMPLEMENTS = next_offset IMPLEMENTS = value_count IMPLEMENTS = byte_offset @@ -43,7 +43,6 @@ static int unpack_long(grib_accessor*, long* val, size_t* len); static long byte_offset(grib_accessor*); 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 void update_size(grib_accessor*, size_t); @@ -68,7 +67,7 @@ static grib_accessor_class _grib_accessor_class_unexpanded_descriptors = { &init, /* init */ 0, /* post_init */ 0, /* destroy */ - &dump, /* dump */ + 0, /* dump */ &next_offset, /* next_offset */ 0, /* get length of string */ &value_count, /* get number of values */ @@ -122,11 +121,6 @@ static void init(grib_accessor* a, const long len, grib_arguments* args) a->length = 0; } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_unexpanded_descriptors* self = (grib_accessor_unexpanded_descriptors*)a; diff --git a/src/grib_accessor_class_unsigned_bits.cc b/src/grib_accessor_class_unsigned_bits.cc index 026d4ff67..53824a994 100644 --- a/src/grib_accessor_class_unsigned_bits.cc +++ b/src/grib_accessor_class_unsigned_bits.cc @@ -16,7 +16,7 @@ CLASS = accessor SUPER = grib_accessor_class_long IMPLEMENTS = unpack_long;pack_long - IMPLEMENTS = init;dump + IMPLEMENTS = init IMPLEMENTS = next_offset IMPLEMENTS = byte_count IMPLEMENTS = value_count @@ -45,7 +45,6 @@ static long byte_count(grib_accessor*); static long byte_offset(grib_accessor*); 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 void update_size(grib_accessor*, size_t); @@ -70,7 +69,7 @@ static grib_accessor_class _grib_accessor_class_unsigned_bits = { &init, /* init */ 0, /* post_init */ 0, /* destroy */ - &dump, /* dump */ + 0, /* dump */ &next_offset, /* next_offset */ 0, /* get length of string */ &value_count, /* get number of values */ @@ -149,11 +148,6 @@ static void init(grib_accessor* a, const long len, grib_arguments* args) a->length = compute_byte_count(a); } -static void dump(grib_accessor* a, grib_dumper* dumper) -{ - grib_dump_long(dumper, a, NULL); -} - static int unpack_long(grib_accessor* a, long* val, size_t* len) { grib_accessor_unsigned_bits* self = (grib_accessor_unsigned_bits*)a;