Package: eccodes / 2.12.0-1

static-fix.patch Patch series | download
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
172
173
174
175
176
177
178
179
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

Index: eccodes-2.12.0/tools/grib_tools.h
===================================================================
--- eccodes-2.12.0.orig/tools/grib_tools.h
+++ eccodes-2.12.0/tools/grib_tools.h
@@ -181,7 +181,7 @@ int grib_tool(int argc, char **argv);
 char* grib_options_get_help(char* id);
 char* grib_options_get_args(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);
Index: eccodes-2.12.0/tools/grib_compare.c
===================================================================
--- eccodes-2.12.0.orig/tools/grib_compare.c
+++ eccodes-2.12.0/tools/grib_compare.c
@@ -301,7 +301,7 @@ int grib_tool_init(grib_runtime_options*
         options->tolerance_count=MAX_KEYS;
         ret=parse_keyval_string(grib_tool_name, sarg,1,GRIB_TYPE_DOUBLE,options->tolerance,&(options->tolerance_count));
         if (ret == GRIB_INVALID_ARGUMENT) {
-            usage();
+            grib_usage();
             exit(1);
         }
     }
Index: eccodes-2.12.0/tools/grib_options.c
===================================================================
--- eccodes-2.12.0.orig/tools/grib_options.c
+++ eccodes-2.12.0/tools/grib_options.c
@@ -114,7 +114,7 @@ grib_options_help grib_options_help_list
 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",grib_tool_name);
@@ -174,7 +174,7 @@ int grib_get_runtime_options(int argc,ch
 
 
     while ((c = getopt (argc, argv, optstr)) != -1) {
-        if (c == '?') usage();
+        if (c == '?') grib_usage();
         i=0;
         while ( i < grib_options_count && grib_options[i].id[0] != c) i++;
         grib_options[i].on=1;
@@ -253,7 +253,7 @@ int grib_process_runtime_options(grib_co
     if (grib_options_on("G")) grib_gribex_mode_on(context);
 
     nfiles=argc-optind;
-    if ( nfiles < (1+has_output+has_input_extra) && !options->infile ) usage();
+    if ( nfiles < (1+has_output+has_input_extra) && !options->infile ) grib_usage();
 
     if (has_input_extra) {
         options->infile_extra=(grib_tools_file*)calloc(1,sizeof(grib_tools_file));
@@ -311,7 +311,7 @@ int grib_process_runtime_options(grib_co
     options->requested_print_keys_count=MAX_KEYS;
     ret = parse_keyval_string(grib_tool_name,karg,0,GRIB_TYPE_UNDEFINED,
             options->requested_print_keys,&(options->requested_print_keys_count));
-    if (ret == GRIB_INVALID_ARGUMENT) usage();
+    if (ret == GRIB_INVALID_ARGUMENT) grib_usage();
     GRIB_CHECK_NOLINE(ret,0);
 
     options->strict=grib_options_on("S");
@@ -332,14 +332,14 @@ int grib_process_runtime_options(grib_co
         sarg=grib_options_get_option("s:");
         options->set_values_count=MAX_KEYS;
         ret=parse_keyval_string(grib_tool_name, sarg,1,GRIB_TYPE_UNDEFINED,options->set_values,&(options->set_values_count));
-        if (ret == GRIB_INVALID_ARGUMENT) usage();
+        if (ret == GRIB_INVALID_ARGUMENT) grib_usage();
     }
 
     if (grib_options_on("b:")) {
         barg=grib_options_get_option("b:");
         options->set_values_count=MAX_KEYS;
         ret=parse_keyval_string(grib_tool_name,barg,0,GRIB_TYPE_STRING,options->set_values,&(options->set_values_count));
-        if (ret == GRIB_INVALID_ARGUMENT) usage();
+        if (ret == GRIB_INVALID_ARGUMENT) grib_usage();
     }
 
     if (grib_options_on("c:")) {
@@ -347,7 +347,7 @@ int grib_process_runtime_options(grib_co
         options->compare_count=MAX_KEYS;
         ret=parse_keyval_string(grib_tool_name,sarg,0,GRIB_TYPE_UNDEFINED,options->compare,
                 &(options->compare_count));
-        if (ret == GRIB_INVALID_ARGUMENT) usage();
+        if (ret == GRIB_INVALID_ARGUMENT) grib_usage();
     }
     if (grib_options_on("e")) {
         for (i=0;i<names_count; i++) {
@@ -362,7 +362,7 @@ int grib_process_runtime_options(grib_co
     options->constraints_count=MAX_KEYS;
     ret=parse_keyval_string(grib_tool_name,warg,1,GRIB_TYPE_UNDEFINED,
             options->constraints,&(options->constraints_count));
-    if (ret == GRIB_INVALID_ARGUMENT) usage();
+    if (ret == GRIB_INVALID_ARGUMENT) grib_usage();
 
     return GRIB_SUCCESS;
 }
Index: eccodes-2.12.0/tools/grib_to_netcdf.c
===================================================================
--- eccodes-2.12.0.orig/tools/grib_to_netcdf.c
+++ eccodes-2.12.0/tools/grib_to_netcdf.c
@@ -4115,7 +4115,7 @@ int grib_tool_init(grib_runtime_options*
         }
         if (kvalue->name == NULL) {
             fprintf(stderr, "Invalid format: %s", kind_name);
-            usage();
+            grib_usage();
             exit(1);
         }
     }
@@ -4126,14 +4126,14 @@ int grib_tool_init(grib_runtime_options*
             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);
             deflate_option=1;
         } else {
             fprintf(stderr, "Invalid deflate option for non netCDF-4 output formats\n");
-            usage();
+            grib_usage();
             exit(1);
         }
     }
@@ -4149,7 +4149,7 @@ int grib_tool_init(grib_runtime_options*
         else
         {
             fprintf(stderr, "Invalid shuffle option. Deflate option needed.\n");
-            usage();
+            grib_usage();
             exit(1);
         }
 
@@ -4162,7 +4162,7 @@ int grib_tool_init(grib_runtime_options*
         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);
@@ -4345,7 +4345,7 @@ int grib_tool_finalise_action(grib_runti
 
     if(options->outfile==NULL || options->outfile->name==NULL)
     {
-        usage();
+        grib_usage();
         exit(1);
     }
 
Index: eccodes-2.12.0/tools/bufr_compare.c
===================================================================
--- eccodes-2.12.0.orig/tools/bufr_compare.c
+++ eccodes-2.12.0/tools/bufr_compare.c
@@ -362,7 +362,7 @@ int grib_tool_init(grib_runtime_options*
         options->tolerance_count=MAX_KEYS;
         ret=parse_keyval_string(grib_tool_name, sarg,1,GRIB_TYPE_DOUBLE,options->tolerance,&(options->tolerance_count));
         if (ret == GRIB_INVALID_ARGUMENT) {
-            usage();
+            grib_usage();
             exit(1);
         }
     }