Dead code removal

This commit is contained in:
shahramn 2024-08-18 12:50:08 +01:00
parent 11ea6745c3
commit 1b532e9260
4 changed files with 21 additions and 23 deletions

View File

@ -122,26 +122,26 @@ static grib_trie* load_dictionary(grib_accessor* a, int* err)
fclose(f); fclose(f);
if (localFilename != 0) { if (localFilename != 0) {
f = codes_fopen(localFilename, "r"); *err = GRIB_NOT_IMPLEMENTED;
if (!f) { return NULL;
*err = GRIB_IO_PROBLEM; // f = codes_fopen(localFilename, "r");
return NULL; // if (!f) {
} // *err = GRIB_IO_PROBLEM;
// return NULL;
// }
while (fgets(line, sizeof(line) - 1, f)) { // while (fgets(line, sizeof(line) - 1, f)) {
i = 0; // i = 0;
while (line[i] != '|' && line[i] != 0) { // while (line[i] != '|' && line[i] != 0) {
key[i] = line[i]; // key[i] = line[i];
i++; // i++;
} // }
key[i] = 0; // key[i] = 0;
list = (char*)grib_context_malloc_clear(c, strlen(line) + 1); // list = (char*)grib_context_malloc_clear(c, strlen(line) + 1);
memcpy(list, line, strlen(line)); // memcpy(list, line, strlen(line));
grib_trie_insert(dictionary, key, list); // grib_trie_insert(dictionary, key, list);
} //}
//fclose(f);
fclose(f);
} }
grib_trie_insert(c->lists, filename, dictionary); grib_trie_insert(c->lists, filename, dictionary);
return dictionary; return dictionary;

View File

@ -19,7 +19,7 @@ class grib_accessor_class_long_t : public grib_accessor_class_gen_t
{ {
public: public:
grib_accessor_class_long_t(const char* name) : grib_accessor_class_gen_t(name) {} grib_accessor_class_long_t(const char* name) : grib_accessor_class_gen_t(name) {}
grib_accessor* create_empty_accessor() override { return new grib_accessor_long_t{}; } // grib_accessor* create_empty_accessor() override { return new grib_accessor_long_t{}; }
void init(grib_accessor* a, const long len, grib_arguments* arg) override; void init(grib_accessor* a, const long len, grib_arguments* arg) override;
int get_native_type(grib_accessor* a) override; int get_native_type(grib_accessor* a) override;
int pack_missing(grib_accessor* a) override; int pack_missing(grib_accessor* a) override;

View File

@ -26,7 +26,7 @@ class grib_accessor_class_values_t : public grib_accessor_class_gen_t
{ {
public: public:
grib_accessor_class_values_t(const char* name) : grib_accessor_class_gen_t(name) {} grib_accessor_class_values_t(const char* name) : grib_accessor_class_gen_t(name) {}
grib_accessor* create_empty_accessor() override { return new grib_accessor_values_t{}; } // grib_accessor* create_empty_accessor() override { return new grib_accessor_values_t{}; }
int get_native_type(grib_accessor*) override; int get_native_type(grib_accessor*) override;
int pack_long(grib_accessor*, const long* val, size_t* len) override; int pack_long(grib_accessor*, const long* val, size_t* len) override;
long byte_count(grib_accessor*) override; long byte_count(grib_accessor*) override;

View File

@ -85,7 +85,6 @@ static int evaluate_long(grib_expression* g, grib_handle* h, long* lres)
long v2 = 0; long v2 = 0;
grib_expression_binop* e = (grib_expression_binop*)g; grib_expression_binop* e = (grib_expression_binop*)g;
// #if DEBUGGING
// { // {
// int typeLeft, typeRight; // int typeLeft, typeRight;
// const char* nameLeft; // const char* nameLeft;
@ -117,7 +116,6 @@ static int evaluate_double(grib_expression* g, grib_handle* h, double* dres)
double v2 = 0.0; double v2 = 0.0;
grib_expression_binop* e = (grib_expression_binop*)g; grib_expression_binop* e = (grib_expression_binop*)g;
// #if DEBUGGING
// { // {
// int typeLeft, typeRight; // int typeLeft, typeRight;
// const char* nameLeft; // const char* nameLeft;