1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
|
Author: Alastair McKinstry <mckinstry@debian.org>ยง
Description: compile fix for shadowed function definitions
goto-cc compiler says multiple 'usage' functions shadow each other
due to including 'grib_options' when linking. Declare static.
Bug-Upstream: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=752732
Last-Updated: 2017-10-03
Forwarded: no
--- a/tools/grib_tools.h
+++ b/tools/grib_tools.h
@@ -192,7 +192,7 @@
const char* grib_options_get_help(const char* id);
const char* grib_options_get_args(const char* id);
int grib_options_command_line(const char* id);
-void usage(void);
+void grib_usage(void);
void usage_doxygen(void);
int grib_tool_before_getopt(grib_runtime_options* options);
int grib_tool_init(grib_runtime_options* options);
--- a/tools/grib_compare.c
+++ b/tools/grib_compare.c
@@ -330,7 +330,7 @@
options->tolerance_count = MAX_KEYS;
ret = parse_keyval_string(tool_name, sarg, 1, GRIB_TYPE_DOUBLE, options->tolerance, &(options->tolerance_count));
if (ret == GRIB_INVALID_ARGUMENT) {
- usage();
+ grib_usage();
exit(1);
}
}
--- a/tools/grib_options.c
+++ b/tools/grib_options.c
@@ -117,7 +117,7 @@
static int grib_options_help_count = sizeof(grib_options_help_list) / sizeof(grib_options_help);
-void usage(void)
+void grib_usage(void)
{
int i = 0;
printf("\nNAME \t%s\n\n", tool_name);
@@ -179,7 +179,7 @@
while ((c = getopt(argc, argv, optstr)) != -1) {
if (c == '?')
- usage();
+ grib_usage();
i = 0;
while (i < grib_options_count && grib_options[i].id[0] != c)
i++;
@@ -276,7 +276,7 @@
nfiles = argc - optind;
if (nfiles < (1 + has_output + has_input_extra) && !options->infile)
- usage();
+ grib_usage();
if (has_input_extra) {
options->infile_extra = (grib_tools_file*)calloc(1, sizeof(grib_tools_file));
@@ -338,7 +338,7 @@
ret = parse_keyval_string(tool_name, karg, 0, GRIB_TYPE_UNDEFINED,
options->requested_print_keys, &(options->requested_print_keys_count));
if (ret == GRIB_INVALID_ARGUMENT)
- usage();
+ grib_usage();
GRIB_CHECK_NOLINE(ret, 0);
options->strict = grib_options_on("S");
@@ -364,7 +364,7 @@
options->set_values_count = MAX_KEYS;
ret = parse_keyval_string(tool_name, sarg, 1, GRIB_TYPE_UNDEFINED, options->set_values, &(options->set_values_count));
if (ret == GRIB_INVALID_ARGUMENT)
- usage();
+ grib_usage();
}
if (grib_options_on("b:")) {
@@ -372,7 +372,7 @@
options->set_values_count = MAX_KEYS;
ret = parse_keyval_string(tool_name, barg, 0, GRIB_TYPE_STRING, options->set_values, &(options->set_values_count));
if (ret == GRIB_INVALID_ARGUMENT)
- usage();
+ grib_usage();
}
if (grib_options_on("c:")) {
@@ -381,7 +381,7 @@
ret = parse_keyval_string(tool_name, sarg, 0, GRIB_TYPE_UNDEFINED, options->compare,
&(options->compare_count));
if (ret == GRIB_INVALID_ARGUMENT)
- usage();
+ grib_usage();
}
if (grib_options_on("e")) {
for (i = 0; i < names_count; i++) {
@@ -397,7 +397,7 @@
ret = parse_keyval_string(tool_name, warg, 1, GRIB_TYPE_UNDEFINED,
options->constraints, &(options->constraints_count));
if (ret == GRIB_INVALID_ARGUMENT)
- usage();
+ grib_usage();
return GRIB_SUCCESS;
}
--- a/tools/grib_to_netcdf.c
+++ b/tools/grib_to_netcdf.c
@@ -4058,7 +4058,7 @@
}
if (kvalue->name == NULL) {
fprintf(stderr, "Invalid format: %s", kind_name);
- usage();
+ grib_usage();
exit(1);
}
}
@@ -4068,7 +4068,7 @@
char* theArg = grib_options_get_option("d:");
if (!is_number(theArg) || atol(theArg) < 0 || atol(theArg) > 9) {
fprintf(stderr, "Invalid deflate option: %s (must be 0 to 9)\n", theArg);
- usage();
+ grib_usage();
exit(1);
}
set_value(user_r, "deflate", theArg);
@@ -4076,7 +4076,7 @@
}
else {
fprintf(stderr, "Invalid deflate option for non netCDF-4 output formats\n");
- usage();
+ grib_usage();
exit(1);
}
}
@@ -4089,7 +4089,7 @@
set_value(user_r, "shuffle", "true");
else {
fprintf(stderr, "Invalid shuffle option. Deflate option needed.\n");
- usage();
+ grib_usage();
exit(1);
}
}
@@ -4100,7 +4100,7 @@
char* theArg = grib_options_get_option("R:");
if (!is_number(theArg)) {
fprintf(stderr, "Invalid reference date: %s\n", theArg);
- usage();
+ grib_usage();
exit(1);
}
set_value(user_r, "referencedate", theArg);
@@ -4274,7 +4274,7 @@
int creation_mode = NC_CLOBBER;
if (options->outfile == NULL || options->outfile->name == NULL) {
- usage();
+ grib_usage();
exit(1);
}
--- a/tools/bufr_compare.c
+++ b/tools/bufr_compare.c
@@ -367,7 +367,7 @@
options->tolerance_count = MAX_KEYS;
ret = parse_keyval_string(tool_name, sarg, 1, GRIB_TYPE_DOUBLE, options->tolerance, &(options->tolerance_count));
if (ret == GRIB_INVALID_ARGUMENT) {
- usage();
+ grib_usage();
exit(1);
}
}
|