From 72afc35a0e4df47609533ce70b1df8a8e8a0acc5 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 19 Oct 2023 18:25:17 +0100 Subject: [PATCH] Cleanup --- src/action_class_if.cc | 2 +- src/action_class_section.cc | 7 ++----- src/eccodes_prototypes.h | 1 - src/grib_buffer.cc | 12 +----------- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/action_class_if.cc b/src/action_class_if.cc index a4da2f4be..4c94549af 100644 --- a/src/action_class_if.cc +++ b/src/action_class_if.cc @@ -272,7 +272,7 @@ static grib_action* reparse(grib_action* a, grib_accessor* acc, int* doit) if ((ret = grib_expression_evaluate_long(grib_handle_of_accessor(acc), self->expression, &lres)) != GRIB_SUCCESS) grib_context_log(acc->context, - GRIB_LOG_ERROR, "if reparse grib_expression_evaluate_long %s", + GRIB_LOG_ERROR, "action_class_if::reparse: grib_expression_evaluate_long failed: %s", grib_get_error_message(ret)); if (lres) diff --git a/src/action_class_section.cc b/src/action_class_section.cc index fc64351df..6f9cd5836 100644 --- a/src/action_class_section.cc +++ b/src/action_class_section.cc @@ -10,7 +10,6 @@ /*************************************************************************** * Jean Baptiste Filippi - 01.11.2005 * - * Enrico Fucile * ***************************************************************************/ #include "grib_api_internal.h" @@ -235,10 +234,8 @@ static int notify_change(grib_action* act, grib_accessor* notified, static grib_action* reparse(grib_action* a, grib_accessor* acc, int* doit) { - /* Should be inherited */ - printf("reparse should be inherited: %s\n", a->name); - - Assert(1 == 0); + fprintf(stderr, "action_class_section::reparse should be inherited: %s\n", a->name); + Assert(0); return 0; } diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index 3b405a05a..cf0985e86 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -792,7 +792,6 @@ void grib_buffer_free(const grib_context* c, void* p); void* grib_buffer_realloc(const grib_context* c, void* p, size_t s); /* grib_buffer.cc*/ -void grib_get_buffer_ownership(const grib_context* c, grib_buffer* b); grib_buffer* grib_create_growable_buffer(const grib_context* c); grib_buffer* grib_new_buffer(const grib_context* c, const unsigned char* data, size_t buflen); void grib_buffer_delete(const grib_context* c, grib_buffer* b); diff --git a/src/grib_buffer.cc b/src/grib_buffer.cc index 370cafc13..548c546cc 100644 --- a/src/grib_buffer.cc +++ b/src/grib_buffer.cc @@ -13,7 +13,7 @@ ***************************************************************************/ #include "grib_api_internal.h" -void grib_get_buffer_ownership(const grib_context* c, grib_buffer* b) +static void grib_get_buffer_ownership(const grib_context* c, grib_buffer* b) { unsigned char* newdata; if (b->property == CODES_MY_BUFFER) @@ -137,23 +137,19 @@ static void update_offsets_after(grib_accessor* a, long len) } } -// /* new GCC compiler v4.5.0 complains function is defined but not used*/ // void grib_recompute_sections_lengths(grib_section* s) // { // if(s) // { // long plen = 0; // size_t len = 1; - // grib_accessor* a = s->block->first; - // while(a) // { // /* grib_recompute_sections_lengths(grib_get_sub_section(a)); */ // grib_recompute_sections_lengths(a->sub_section); // a = a->next; // } - // if(s->aclength) // { // int ret; @@ -161,10 +157,8 @@ static void update_offsets_after(grib_accessor* a, long len) // plen = grib_get_next_position_offset(s->block->last) - s->owner->offset; // else // plen = grib_get_next_position_offset(s->block->last); - // if((ret = grib_pack_long(s->aclength, &plen, &len)) != GRIB_SUCCESS) // ; - // // if(s->h->context->debug) // printf("SECTION updating length %ld .. %s\n",plen,s->owner->name); @@ -177,7 +171,6 @@ static void update_offsets_after(grib_accessor* a, long len) // { // long plen = 0; // size_t len = 1; - // if(!s) return; // if(s->aclength) // { @@ -186,14 +179,11 @@ static void update_offsets_after(grib_accessor* a, long len) // plen = grib_get_next_position_offset(s->block->last) - s->owner->offset; // else // plen = grib_get_next_position_offset(s->block->last); - // /* if(s->owner) */ // /* s->owner->length = plen; */ - // /* if(s->aclength) */ // if((ret = grib_pack_long(s->aclength, &plen, &len)) != GRIB_SUCCESS) // ; - // if(s->h->context->debug) // { // printf("SECTION updating length %ld .. %s\n",plen,s->owner->name);