From 15eeed49f15b525a23e084f4e9426a912c7539c0 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 24 Aug 2023 11:34:46 +0100 Subject: [PATCH] Dead code removal --- src/eccodes_prototypes.h | 1 - src/grib_value.cc | 35 ++++++++++++++++------------------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index 6cbe12193..2d53a28ab 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -1158,7 +1158,6 @@ int grib_set_string(grib_handle* h, const char* name, const char* val, size_t* l int grib_set_string_array(grib_handle* h, const char* name, const char** val, size_t length); int grib_set_bytes_internal(grib_handle* h, const char* name, const unsigned char* val, size_t* length); int grib_set_bytes(grib_handle* h, const char* name, const unsigned char* val, size_t* length); -int grib_clear(grib_handle* h, const char* name); int grib_set_missing(grib_handle* h, const char* name); int grib_is_missing_long(grib_accessor* a, long x); int grib_is_missing_double(grib_accessor* a, double x); diff --git a/src/grib_value.cc b/src/grib_value.cc index 6cfd76a3c..bd4421a13 100644 --- a/src/grib_value.cc +++ b/src/grib_value.cc @@ -537,25 +537,22 @@ int grib_set_bytes(grib_handle* h, const char* name, const unsigned char* val, s return GRIB_NOT_FOUND; } -int grib_clear(grib_handle* h, const char* name) -{ - int ret = 0; - grib_accessor* a = NULL; - - a = grib_find_accessor(h, name); - - if (a) { - if (a->length == 0) - return 0; - if ((ret = grib_pack_zero(a)) != GRIB_SUCCESS) - grib_context_log(h->context, GRIB_LOG_ERROR, "unable to clear %s (%s)", - name, grib_get_error_message(ret)); - return ret; - } - - /*grib_context_log(h->context,GRIB_LOG_ERROR,"unable to find accessor %s",name);*/ - return GRIB_NOT_FOUND; -} +// int grib_clear(grib_handle* h, const char* name) +// { +// int ret = 0; +// grib_accessor* a = NULL; +// a = grib_find_accessor(h, name); +// if (a) { +// if (a->length == 0) +// return 0; +// if ((ret = grib_pack_zero(a)) != GRIB_SUCCESS) +// grib_context_log(h->context, GRIB_LOG_ERROR, "unable to clear %s (%s)", +// name, grib_get_error_message(ret)); +// return ret; +// } +// /*grib_context_log(h->context,GRIB_LOG_ERROR,"unable to find accessor %s",name);*/ +// return GRIB_NOT_FOUND; +// } int grib_set_missing(grib_handle* h, const char* name) {