Dead code removal

This commit is contained in:
shahramn 2024-03-09 19:55:22 +00:00
parent 9c5df40768
commit 9ce9b1f41c
3 changed files with 11 additions and 20 deletions

View File

@ -918,7 +918,6 @@ grib_handle* grib_fieldset_retrieve(grib_fieldset* set, int i, int* err);
/* grib_filepool.cc*/
void grib_file_pool_clean(void);
grib_file* grib_file_pool_get_files(void);
grib_file* grib_file_open(const char* filename, const char* mode, int* err);
void grib_file_pool_delete_file(grib_file* file);
void grib_file_close(const char* filename, int force, int* err);

View File

@ -132,10 +132,10 @@ void grib_file_pool_clean()
// return grib_write_file(fh, file->next);
// }
grib_file* grib_file_pool_get_files()
{
return file_pool.first;
}
// grib_file* grib_file_pool_get_files()
// {
// return file_pool.first;
// }
// int grib_file_pool_read(grib_context* c, FILE* fh)
// {

View File

@ -20,10 +20,9 @@ int main(int argc, char** argv)
codes_handle* h = NULL;
long* ivalues = NULL;
const char* sampleName = "BUFR3_local";
char* outfilename = NULL;
assert(argc == 2);
outfilename = argv[1];
char* outfilename = argv[1];
// Test non-existent sample file. Should fail
h = codes_bufr_handle_new_from_samples(NULL, "some rubbish");
@ -33,10 +32,8 @@ int main(int argc, char** argv)
assert(h);
ivalues = (long*)malloc(1 * sizeof(long));
if (!ivalues) {
fprintf(stderr, "Failed to allocate memory (ivalues).\n");
return 1;
}
assert(ivalues);
size = 1;
ivalues[0] = 1;
CODES_CHECK(codes_set_long_array(h, "inputDelayedDescriptorReplicationFactor", ivalues, size), 0);
@ -89,10 +86,8 @@ int main(int argc, char** argv)
free(ivalues);
ivalues = (long*)malloc(9 * sizeof(long));
if (!ivalues) {
fprintf(stderr, "Failed to allocate memory (ivalues).\n");
return 1;
}
assert(ivalues);
size = 4;
ivalues[0] = 309052;
ivalues[1] = 5001;
@ -104,11 +99,8 @@ int main(int argc, char** argv)
CODES_CHECK(codes_set_long(h, "pack", 1), 0);
fout = fopen(outfilename, "wb");
if (!fout) {
fprintf(stderr, "Failed to open (create) output file.\n");
free(ivalues);
return 1;
}
assert(fout);
CODES_CHECK(codes_get_message(h, &buffer, &size), 0);
CODES_CHECK(codes_check_message_header(buffer, size, PRODUCT_BUFR), 0);
CODES_CHECK(codes_check_message_footer(buffer, size, PRODUCT_BUFR), 0);