Dead code removal

This commit is contained in:
Shahram Najm 2023-06-25 16:01:22 +01:00
parent 91eee4e164
commit 76e97ca76f
8 changed files with 65 additions and 139 deletions

View File

@ -1154,14 +1154,6 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option
} */
}
#if 0
{
long of1,of2; /* Debugging: print offset of each handle */
grib_get_long(h1, "offset", &of1); grib_get_long(h2, "offset", &of2);
printf("of1=%lu of2=%lu\n",of1,of2);
}
#endif
if (headerMode) {
const void *msg1 = NULL, *msg2 = NULL;
size_t size1 = 0, size2 = 0;

View File

@ -481,27 +481,25 @@ void usage_doxygen(void)
exit(1);
}
#if 0
void usage_doxygen(void) {
int i=0;
printf("/*! \\page %s %s\n",tool_name,tool_name);
printf("\\section DESCRIPTION \n%s\n\n",tool_description);
printf("\\section USAGE \n%s \n%s\n\n",tool_name,tool_usage);
printf("\\section OPTIONS\n");
printf("<table frame=void border=0>\n");
for (i=0;i<grib_options_count;i++) {
if (grib_options[i].command_line) {
printf("<tr>\n");
printf("<td colspan=2>-%c %s</td>\n",
grib_options[i].id[0],
grib_options_get_args(grib_options[i].id));
printf("</tr><tr>\n");
printf("<td width=20></td><td>%s</td>",
grib_options_get_help(grib_options[i].id));
printf("</tr><tr><td></td></tr>\n");
}
}
printf("</table>\n");
exit(1);
}
#endif
// void usage_doxygen(void) {
// int i=0;
// printf("/*! \\page %s %s\n",tool_name,tool_name);
// printf("\\section DESCRIPTION \n%s\n\n",tool_description);
// printf("\\section USAGE \n%s \n%s\n\n",tool_name,tool_usage);
// printf("\\section OPTIONS\n");
// printf("<table frame=void border=0>\n");
// for (i=0;i<grib_options_count;i++) {
// if (grib_options[i].command_line) {
// printf("<tr>\n");
// printf("<td colspan=2>-%c %s</td>\n",
// grib_options[i].id[0],
// grib_options_get_args(grib_options[i].id));
// printf("</tr><tr>\n");
// printf("<td width=20></td><td>%s</td>",
// grib_options_get_help(grib_options[i].id));
// printf("</tr><tr><td></td></tr>\n");
// }
// }
// printf("</table>\n");
// exit(1);
// }

View File

@ -80,15 +80,13 @@ int grib_tool_init(grib_runtime_options* options)
exit(1);
}
#if 0
if (options->outfile && options->outfile->name) {
options->outfile->file = fopen(options->outfile->name,"w");
if(!options->outfile->file) {
perror(options->outfile->name);
exit(1);
}
}
#endif
// if (options->outfile && options->outfile->name) {
// options->outfile->file = fopen(options->outfile->name,"w");
// if(!options->outfile->file) {
// perror(options->outfile->name);
// exit(1);
// }
// }
return 0;
}

View File

@ -1744,15 +1744,12 @@ static hypercube* new_hypercube_from_mars_request(const request* r)
struct stuff_1 s;
#if 0
const request *lang = mars_language_from_request(r);
int count = 0;
count = init_axis(lang);
grib_context_log(ctx,GRIB_LOG_DEBUG,"cube %s",r->kind);
/* print_all_requests(mars_language_from_request(r)); */
grib_context_log(ctx,GRIB_LOG_INFO,"NUMBER(axis): %d, number axisnew: %d",NUMBER(axis),count);
#endif
// const request *lang = mars_language_from_request(r);
// int count = 0;
// count = init_axis(lang);
// grib_context_log(ctx,GRIB_LOG_DEBUG,"cube %s",r->kind);
// /* print_all_requests(mars_language_from_request(r)); */
// grib_context_log(ctx,GRIB_LOG_INFO,"NUMBER(axis): %d, number axisnew: %d",NUMBER(axis),count);
s.c = new_hypercube(r);
s.r = clone_one_request(r);
@ -2817,9 +2814,7 @@ static int put_data(hypercube* h, int ncid, const char* name, dataset_t* subset)
return e;
}
#if 0
bool missing = (g->ksec4[0] < 0); /* If negative number of values, field is missing */
#endif
// bool missing = (g->ksec4[0] < 0); /* If negative number of values, field is missing */
r = field_to_request(g);
if (!missing) {
@ -3119,14 +3114,12 @@ static int define_netcdf_dimensions(hypercube* h, fieldset* fs, int ncid, datase
check_err("nc_put_att_text", stat, __LINE__);
}
#if 0
if(subsets[i].att.other)
{
const char *txt = subsets[i].att.long_name;
stat = nc_put_att_text(ncid, var_id, "other",strlen(txt),txt);
check_err("nc_put_att_text", stat,__LINE__,__FILE__);
}
#endif
// if(subsets[i].att.other)
// {
// const char *txt = subsets[i].att.long_name;
// stat = nc_put_att_text(ncid, var_id, "other",strlen(txt),txt);
// check_err("nc_put_att_text", stat,__LINE__,__FILE__);
// }
if (subsets[i].att.metadata) {
parameter* p = subsets[i].att.metadata->params;
@ -3200,13 +3193,10 @@ static int define_netcdf_dimensions(hypercube* h, fieldset* fs, int ncid, datase
stat = nc_put_att_text(ncid, NC_GLOBAL, "history", strlen(history), history);
check_err("nc_put_att_text", stat, __LINE__);
#if 0
stat = nc_put_att_text(ncid, NC_GLOBAL, "source",strlen(setup.source),setup.source);
check_err(stat,__LINE__,__FILE__);
stat = nc_put_att_text(ncid, NC_GLOBAL, "institution",strlen(institution),institution);
check_err(stat,__LINE__,__FILE__);
#endif
//stat = nc_put_att_text(ncid, NC_GLOBAL, "source",strlen(setup.source),setup.source);
//check_err(stat,__LINE__,__FILE__);
//stat = nc_put_att_text(ncid, NC_GLOBAL, "institution",strlen(institution),institution);
//check_err(stat,__LINE__,__FILE__);
if (setup.title) {
stat = nc_put_att_text(ncid, NC_GLOBAL, "title", strlen(setup.title), setup.title);

View File

@ -900,28 +900,26 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option
if (size1 == size2 && !(memcmp_ret = memcmp(msg1, msg2, size1))) {
return 0;
}
#if 0
else {
int lcount=count,ii;
if (options->current_infile) lcount=options->current_infile->filter_handle_count;
if (size1 != size2) {
printf("#%d different size: %d!=%d\n",lcount,(int)size1,(int)size2);
}
if (memcmp_ret) {
unsigned char *m1=(unsigned char*)msg1;
unsigned char *m2=(unsigned char*)msg2;
printf("=== list of different bytes for message %d\n",lcount);
for (ii=0;ii<size1;ii++) {
if (memcmp(m1,m2,1)) {
printf(" %d 0x%.2X != 0x%.2X\n",ii,*m1,*m2);
}
m1++; m2++;
}
}
return err;
}
#endif
// else {
// int lcount=count,ii;
// if (options->current_infile) lcount=options->current_infile->filter_handle_count;
// if (size1 != size2) {
// printf("#%d different size: %d!=%d\n",lcount,(int)size1,(int)size2);
// }
// if (memcmp_ret) {
// unsigned char *m1=(unsigned char*)msg1;
// unsigned char *m2=(unsigned char*)msg2;
// printf("=== list of different bytes for message %d\n",lcount);
// for (ii=0;ii<size1;ii++) {
// if (memcmp(m1,m2,1)) {
// printf(" %d 0x%.2X != 0x%.2X\n",ii,*m1,*m2);
// }
// m1++; m2++;
// }
// }
// return err;
// }
if (listFromCommandLine) {
for (i = 0; i < options->compare_count; i++) {

View File

@ -57,15 +57,6 @@ int grib_tool_before_getopt(grib_runtime_options* options)
int grib_tool_init(grib_runtime_options* options)
{
#if 0
if (options->outfile && options->outfile->name) {
options->outfile->file = fopen(options->outfile->name,"w");
if(!options->outfile->file) {
perror(options->outfile->name);
exit(1);
}
}
#endif
return 0;
}
@ -107,11 +98,6 @@ void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h)
int grib_tool_finalise_action(grib_runtime_options* options)
{
/*
if (options->outfile->file) {
fclose(options->outfile->file);
}
*/
return 0;
}

View File

@ -1122,28 +1122,6 @@ static int compare_handles(grib_handle* h1, grib_handle* h2, grib_runtime_option
if (size1 == size2 && !(memcmp_ret = memcmp(msg1, msg2, size1))) {
return 0;
}
#if 0
else {
int lcount=count,ii;
if (options->current_infile) lcount=options->current_infile->filter_handle_count;
if (size1 != size2) {
printf("#%d different size: %d!=%d\n",lcount,(int)size1,(int)size2);
}
if (memcmp_ret) {
unsigned char *m1=(unsigned char*)msg1;
unsigned char *m2=(unsigned char*)msg2;
printf("=== list of different bytes for message %d\n",lcount);
for (ii=0;ii<size1;ii++) {
if (memcmp(m1,m2,1)) {
printf(" %d 0x%.2X != 0x%.2X\n",ii,*m1,*m2);
}
m1++; m2++;
}
}
return err;
}
#endif
if (listFromCommandLine) {
for (i = 0; i < options->compare_count; i++) {

View File

@ -57,15 +57,6 @@ int grib_tool_before_getopt(grib_runtime_options* options)
int grib_tool_init(grib_runtime_options* options)
{
#if 0
if (options->outfile && options->outfile->name) {
options->outfile->file = fopen(options->outfile->name,"w");
if(!options->outfile->file) {
perror(options->outfile->name);
exit(1);
}
}
#endif
return 0;
}
@ -107,11 +98,6 @@ void grib_tool_print_key_values(grib_runtime_options* options, grib_handle* h)
int grib_tool_finalise_action(grib_runtime_options* options)
{
/*
if (options->outfile->file) {
fclose(options->outfile->file);
}
*/
return 0;
}