From 2743b6f52494e2562ec6e8f7f90811f189e32d7e Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 7 Nov 2019 12:03:45 +0000 Subject: [PATCH] Fix includes: IWYU --- examples/C/grib_iterator.c | 1 - examples/C/grib_iterator_bitmap.c | 1 - examples/C/grib_keys_iterator.c | 1 - examples/C/grib_list.c | 1 - examples/C/grib_multi.c | 1 - examples/C/grib_multi_write.c | 1 - examples/C/mars_param.c | 1 - examples/python/grib_keys_iterator.c | 1 - fortran/grib_fortran.c | 2 ++ src/grib_accessor_class_bufr_data_element.c | 1 - src/grib_accessor_class_bufr_elements_table.c | 1 - src/grib_accessor_class_codetable_title.c | 5 ----- src/grib_accessor_class_codetable_units.c | 5 ----- src/grib_accessor_class_data_g1complex_packing.c | 2 +- src/grib_accessor_class_data_g2bifourier_packing.c | 1 - src/grib_accessor_class_data_g2complex_packing.c | 2 +- src/grib_accessor_class_dictionary.c | 5 ----- src/grib_accessor_class_global_gaussian.c | 6 +----- src/grib_accessor_class_octahedral_gaussian.c | 6 +----- src/grib_accessor_class_pack_bufr_values.c | 5 ----- src/grib_accessor_class_smart_table_column.c | 5 ----- src/grib_accessor_class_transient_darray.c | 2 +- src/grib_accessor_class_unpack_bufr_values.c | 5 ----- src/grib_api_version.c | 2 -- src/grib_dumper_class_grib_encode_C.c | 2 +- src/grib_expression.c | 1 - src/grib_gaussian_reduced.c | 2 +- src/grib_header_compute.c | 1 - src/grib_iterator_class_gaussian_reduced.c | 1 - src/grib_optimize_decimal_factor.c | 1 - tests/bufr_extract_headers.c | 9 ++++----- tests/bufr_get_element.c | 2 +- tests/bufr_keys_iter.c | 2 +- tests/gauss_sub.c | 1 - tests/grib_ecc-386.c | 1 - tests/grib_ecc-604-encode.c | 1 - tests/grib_encode_pthreads.c | 1 - tests/grib_multi_from_message.c | 1 - tests/grib_optimize_scaling_sh.c | 2 -- tests/grib_sh_ieee64.c | 1 - tests/grib_util_set_spec.c | 1 - tests/read_any.c | 2 +- tigge/tigge_accumulations.c | 1 - tigge/tigge_name.c | 4 +--- tigge/tigge_split.c | 1 - tigge/tigge_tools.c | 1 - tools/big2gribex.c | 1 - tools/bufr_split_by_rdbSubtype.c | 1 - tools/gg_sub_area_check.c | 1 - tools/grib_to_netcdf.c | 1 - tools/grib_tools.h | 1 - 51 files changed, 17 insertions(+), 90 deletions(-) diff --git a/examples/C/grib_iterator.c b/examples/C/grib_iterator.c index 1193a8e28..980d2439c 100644 --- a/examples/C/grib_iterator.c +++ b/examples/C/grib_iterator.c @@ -17,7 +17,6 @@ #include #include -#include #include "eccodes.h" diff --git a/examples/C/grib_iterator_bitmap.c b/examples/C/grib_iterator_bitmap.c index 1da1200a8..6e0274893 100644 --- a/examples/C/grib_iterator_bitmap.c +++ b/examples/C/grib_iterator_bitmap.c @@ -16,7 +16,6 @@ #include #include -#include #include #include "eccodes.h" diff --git a/examples/C/grib_keys_iterator.c b/examples/C/grib_keys_iterator.c index 66fb47049..dfc313f41 100644 --- a/examples/C/grib_keys_iterator.c +++ b/examples/C/grib_keys_iterator.c @@ -18,7 +18,6 @@ * */ -#include #include #include #include diff --git a/examples/C/grib_list.c b/examples/C/grib_list.c index 5d6eac68e..49c23cedf 100644 --- a/examples/C/grib_list.c +++ b/examples/C/grib_list.c @@ -15,7 +15,6 @@ * */ #include -#include #include #include "eccodes.h" diff --git a/examples/C/grib_multi.c b/examples/C/grib_multi.c index 67d19ca58..3f0520d0d 100644 --- a/examples/C/grib_multi.c +++ b/examples/C/grib_multi.c @@ -18,7 +18,6 @@ * */ #include -#include #include "eccodes.h" diff --git a/examples/C/grib_multi_write.c b/examples/C/grib_multi_write.c index 4e4dcc63c..aea0b7b93 100644 --- a/examples/C/grib_multi_write.c +++ b/examples/C/grib_multi_write.c @@ -16,7 +16,6 @@ */ #include #include -#include #include "eccodes.h" static void usage(const char* prog) { diff --git a/examples/C/mars_param.c b/examples/C/mars_param.c index 37595fbed..687dc7656 100644 --- a/examples/C/mars_param.c +++ b/examples/C/mars_param.c @@ -15,7 +15,6 @@ * */ #include -#include #include "eccodes.h" diff --git a/examples/python/grib_keys_iterator.c b/examples/python/grib_keys_iterator.c index a1ce7f60a..faa96410f 100644 --- a/examples/python/grib_keys_iterator.c +++ b/examples/python/grib_keys_iterator.c @@ -18,7 +18,6 @@ * */ -#include #include #include #include diff --git a/fortran/grib_fortran.c b/fortran/grib_fortran.c index 45bcaeb46..f9235c5ce 100644 --- a/fortran/grib_fortran.c +++ b/fortran/grib_fortran.c @@ -15,9 +15,11 @@ # include #endif +/* #if HAVE_SYS_STAT_H # include #endif +*/ #ifdef HAVE_FCNTL_H # include diff --git a/src/grib_accessor_class_bufr_data_element.c b/src/grib_accessor_class_bufr_data_element.c index fea8e9cf0..f940a1a00 100644 --- a/src/grib_accessor_class_bufr_data_element.c +++ b/src/grib_accessor_class_bufr_data_element.c @@ -13,7 +13,6 @@ ****************************************/ #include "grib_api_internal.h" -#include /* This is used by make_class.pl diff --git a/src/grib_accessor_class_bufr_elements_table.c b/src/grib_accessor_class_bufr_elements_table.c index 1c19ed90b..68cff98af 100644 --- a/src/grib_accessor_class_bufr_elements_table.c +++ b/src/grib_accessor_class_bufr_elements_table.c @@ -13,7 +13,6 @@ ****************************************/ #include "grib_api_internal.h" -#include #if GRIB_PTHREADS static pthread_once_t once = PTHREAD_ONCE_INIT; diff --git a/src/grib_accessor_class_codetable_title.c b/src/grib_accessor_class_codetable_title.c index 070c7f1e3..81352165b 100644 --- a/src/grib_accessor_class_codetable_title.c +++ b/src/grib_accessor_class_codetable_title.c @@ -8,12 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/***************************************** - * Enrico Fucile - ****************************************/ - #include "grib_api_internal.h" -#include /* This is used by make_class.pl diff --git a/src/grib_accessor_class_codetable_units.c b/src/grib_accessor_class_codetable_units.c index 850489686..0839d87a1 100644 --- a/src/grib_accessor_class_codetable_units.c +++ b/src/grib_accessor_class_codetable_units.c @@ -8,12 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/***************************************** - * Enrico Fucile - ****************************************/ - #include "grib_api_internal.h" -#include /* This is used by make_class.pl diff --git a/src/grib_accessor_class_data_g1complex_packing.c b/src/grib_accessor_class_data_g1complex_packing.c index e68a407c6..b44891933 100644 --- a/src/grib_accessor_class_data_g1complex_packing.c +++ b/src/grib_accessor_class_data_g1complex_packing.c @@ -9,7 +9,7 @@ */ #include "grib_api_internal.h" -#include + /* This is used by make_class.pl diff --git a/src/grib_accessor_class_data_g2bifourier_packing.c b/src/grib_accessor_class_data_g2bifourier_packing.c index a9e59560d..a3fccd2c3 100644 --- a/src/grib_accessor_class_data_g2bifourier_packing.c +++ b/src/grib_accessor_class_data_g2bifourier_packing.c @@ -13,7 +13,6 @@ *******************************/ #include "grib_api_internal.h" -#include "grib_accessor_class.h" #include "grib_optimize_decimal_factor.h" #include diff --git a/src/grib_accessor_class_data_g2complex_packing.c b/src/grib_accessor_class_data_g2complex_packing.c index 9c923da85..bf429f9fe 100644 --- a/src/grib_accessor_class_data_g2complex_packing.c +++ b/src/grib_accessor_class_data_g2complex_packing.c @@ -9,7 +9,7 @@ */ #include "grib_api_internal.h" -#include + /* This is used by make_class.pl diff --git a/src/grib_accessor_class_dictionary.c b/src/grib_accessor_class_dictionary.c index 80d4be72e..0278769d8 100644 --- a/src/grib_accessor_class_dictionary.c +++ b/src/grib_accessor_class_dictionary.c @@ -8,12 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/***************************************** - * Enrico Fucile - ****************************************/ - #include "grib_api_internal.h" -#include /* This is used by make_class.pl diff --git a/src/grib_accessor_class_global_gaussian.c b/src/grib_accessor_class_global_gaussian.c index 2971da4eb..6f7289463 100644 --- a/src/grib_accessor_class_global_gaussian.c +++ b/src/grib_accessor_class_global_gaussian.c @@ -8,12 +8,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/************************************************* - * Enrico Fucile - ***********************************************/ - #include "grib_api_internal.h" -#include + /* This is used by make_class.pl diff --git a/src/grib_accessor_class_octahedral_gaussian.c b/src/grib_accessor_class_octahedral_gaussian.c index 10ec416ee..943504cf1 100644 --- a/src/grib_accessor_class_octahedral_gaussian.c +++ b/src/grib_accessor_class_octahedral_gaussian.c @@ -8,12 +8,8 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/************************************************* - * Enrico Fucile - ***********************************************/ - #include "grib_api_internal.h" -#include + /* This is used by make_class.pl diff --git a/src/grib_accessor_class_pack_bufr_values.c b/src/grib_accessor_class_pack_bufr_values.c index 7b7a10986..da2f0d44b 100644 --- a/src/grib_accessor_class_pack_bufr_values.c +++ b/src/grib_accessor_class_pack_bufr_values.c @@ -8,12 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/***************************************** - * Enrico Fucile - ****************************************/ - #include "grib_api_internal.h" -#include /* This is used by make_class.pl diff --git a/src/grib_accessor_class_smart_table_column.c b/src/grib_accessor_class_smart_table_column.c index d9f76535e..97d851aff 100644 --- a/src/grib_accessor_class_smart_table_column.c +++ b/src/grib_accessor_class_smart_table_column.c @@ -8,12 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/***************************************** - * Enrico Fucile - ****************************************/ - #include "grib_api_internal.h" -#include /* This is used by make_class.pl diff --git a/src/grib_accessor_class_transient_darray.c b/src/grib_accessor_class_transient_darray.c index 9b9943595..6e6bd5433 100644 --- a/src/grib_accessor_class_transient_darray.c +++ b/src/grib_accessor_class_transient_darray.c @@ -9,7 +9,7 @@ */ #include "grib_api_internal.h" -#include + /* This is used by make_class.pl diff --git a/src/grib_accessor_class_unpack_bufr_values.c b/src/grib_accessor_class_unpack_bufr_values.c index 303a2dca8..0c4481432 100644 --- a/src/grib_accessor_class_unpack_bufr_values.c +++ b/src/grib_accessor_class_unpack_bufr_values.c @@ -8,12 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -/***************************************** - * Enrico Fucile - ****************************************/ - #include "grib_api_internal.h" -#include /* This is used by make_class.pl diff --git a/src/grib_api_version.c b/src/grib_api_version.c index 4c3b455ef..5b9f046f5 100644 --- a/src/grib_api_version.c +++ b/src/grib_api_version.c @@ -1,3 +1 @@ -#include "grib_api_internal.h" - const char * grib_get_git_sha1() { return ""; } diff --git a/src/grib_dumper_class_grib_encode_C.c b/src/grib_dumper_class_grib_encode_C.c index 771551752..bb656ec26 100644 --- a/src/grib_dumper_class_grib_encode_C.c +++ b/src/grib_dumper_class_grib_encode_C.c @@ -9,7 +9,7 @@ */ #include "grib_api_internal.h" -#include + /* This is used by make_class.pl diff --git a/src/grib_expression.c b/src/grib_expression.c index 31fe8868b..63eeaf80c 100644 --- a/src/grib_expression.c +++ b/src/grib_expression.c @@ -8,7 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include #include "grib_api_internal.h" int grib_expression_native_type(grib_handle* h,grib_expression* g) diff --git a/src/grib_gaussian_reduced.c b/src/grib_gaussian_reduced.c index 2ff49cf74..2d4b0a27e 100644 --- a/src/grib_gaussian_reduced.c +++ b/src/grib_gaussian_reduced.c @@ -8,7 +8,7 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ #include "grib_api_internal.h" -#include + /* * C Implementation: gaussian_reduced diff --git a/src/grib_header_compute.c b/src/grib_header_compute.c index fb5b279f4..6ac1e3121 100644 --- a/src/grib_header_compute.c +++ b/src/grib_header_compute.c @@ -16,7 +16,6 @@ #include "grib_api_internal.h" #include -#include #include #include #include diff --git a/src/grib_iterator_class_gaussian_reduced.c b/src/grib_iterator_class_gaussian_reduced.c index f986f7471..e76c1b522 100644 --- a/src/grib_iterator_class_gaussian_reduced.c +++ b/src/grib_iterator_class_gaussian_reduced.c @@ -14,7 +14,6 @@ #include "grib_api_internal.h" -#include #include /* diff --git a/src/grib_optimize_decimal_factor.c b/src/grib_optimize_decimal_factor.c index afeb6c008..9a4975fa9 100644 --- a/src/grib_optimize_decimal_factor.c +++ b/src/grib_optimize_decimal_factor.c @@ -13,7 +13,6 @@ #include #include #include -#include static double epsilon() { diff --git a/tests/bufr_extract_headers.c b/tests/bufr_extract_headers.c index 9a989b46b..32e176a49 100644 --- a/tests/bufr_extract_headers.c +++ b/tests/bufr_extract_headers.c @@ -9,7 +9,6 @@ */ #include "eccodes.h" -#include static const char* not_found = "not_found"; @@ -38,7 +37,7 @@ int main(int argc, char* argv[]) char *filename, *keys; int i, err = 0; int num_messages = 0; - codes_bufr_header* headers = NULL; + codes_bufr_header* header_array = NULL; codes_context* c = codes_context_get_default(); if (argc != 3) return 1; @@ -46,11 +45,11 @@ int main(int argc, char* argv[]) keys = argv[1]; /* comma-separated like bufr_ls/bufr_get */ filename = argv[2]; - err = codes_bufr_extract_headers_malloc(c, filename, &headers, &num_messages); + err = codes_bufr_extract_headers_malloc(c, filename, &header_array, &num_messages); if (err) return 1; for (i=0; i < num_messages; ++i) { - codes_bufr_header bh = headers[i]; + codes_bufr_header bh = header_array[i]; /* * Mimic the behaviour of bufr_get -f -p keys for testing */ @@ -113,7 +112,7 @@ int main(int argc, char* argv[]) printf("\n"); } - free(headers); + free(header_array); return 0; } diff --git a/tests/bufr_get_element.c b/tests/bufr_get_element.c index 15a32ccc4..a91410259 100644 --- a/tests/bufr_get_element.c +++ b/tests/bufr_get_element.c @@ -7,7 +7,7 @@ * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" + #include "eccodes.h" #include diff --git a/tests/bufr_keys_iter.c b/tests/bufr_keys_iter.c index 58440362f..039a292c3 100644 --- a/tests/bufr_keys_iter.c +++ b/tests/bufr_keys_iter.c @@ -7,7 +7,7 @@ * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" + #include "eccodes.h" #include diff --git a/tests/gauss_sub.c b/tests/gauss_sub.c index 88d224f20..12d64f6ac 100644 --- a/tests/gauss_sub.c +++ b/tests/gauss_sub.c @@ -9,7 +9,6 @@ */ #include "grib_api.h" -#include "math.h" static void usage(char* prog) { printf("usage: %s file1.grib file2.grib\n",prog); diff --git a/tests/grib_ecc-386.c b/tests/grib_ecc-386.c index 857b52ffc..0f4908faa 100644 --- a/tests/grib_ecc-386.c +++ b/tests/grib_ecc-386.c @@ -13,7 +13,6 @@ * */ #include -#include #include "grib_api_internal.h" static void usage(const char* prog) { diff --git a/tests/grib_ecc-604-encode.c b/tests/grib_ecc-604-encode.c index bd9046469..ad6a4c33a 100644 --- a/tests/grib_ecc-604-encode.c +++ b/tests/grib_ecc-604-encode.c @@ -3,7 +3,6 @@ */ #include #include -#include #include #include "grib_api.h" diff --git a/tests/grib_encode_pthreads.c b/tests/grib_encode_pthreads.c index 7f0820477..2de35b24c 100644 --- a/tests/grib_encode_pthreads.c +++ b/tests/grib_encode_pthreads.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include "grib_api.h" diff --git a/tests/grib_multi_from_message.c b/tests/grib_multi_from_message.c index da38562a0..450449c1d 100644 --- a/tests/grib_multi_from_message.c +++ b/tests/grib_multi_from_message.c @@ -13,7 +13,6 @@ */ #include "grib_api.h" -#include #include #include diff --git a/tests/grib_optimize_scaling_sh.c b/tests/grib_optimize_scaling_sh.c index ea3031445..cb4c5d68e 100644 --- a/tests/grib_optimize_scaling_sh.c +++ b/tests/grib_optimize_scaling_sh.c @@ -8,8 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include - #include "grib_api.h" /* diff --git a/tests/grib_sh_ieee64.c b/tests/grib_sh_ieee64.c index ffce2f9b9..3d4b286e5 100644 --- a/tests/grib_sh_ieee64.c +++ b/tests/grib_sh_ieee64.c @@ -8,7 +8,6 @@ * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ #include -#include #include #include diff --git a/tests/grib_util_set_spec.c b/tests/grib_util_set_spec.c index a7b073e7e..3e227a2c8 100644 --- a/tests/grib_util_set_spec.c +++ b/tests/grib_util_set_spec.c @@ -11,7 +11,6 @@ #include "grib_api_internal.h" #include "eccodes.h" #include -#include #define STR_EQUAL(s1, s2) (strcmp((s1), (s2)) == 0) diff --git a/tests/read_any.c b/tests/read_any.c index 82ce10e93..5e40fc26e 100644 --- a/tests/read_any.c +++ b/tests/read_any.c @@ -7,7 +7,7 @@ * In applying this licence, ECMWF does not waive the privileges and immunities granted to it by * virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. */ -#include "grib_api_internal.h" +#include "grib_api.h" static void usage (const char *prog) { diff --git a/tigge/tigge_accumulations.c b/tigge/tigge_accumulations.c index 3794a784a..6be85a842 100755 --- a/tigge/tigge_accumulations.c +++ b/tigge/tigge_accumulations.c @@ -19,7 +19,6 @@ #endif #include -#include #include #include "grib_api.h" diff --git a/tigge/tigge_name.c b/tigge/tigge_name.c index 4389d661a..468963ea3 100755 --- a/tigge/tigge_name.c +++ b/tigge/tigge_name.c @@ -27,9 +27,7 @@ #include #include "tigge_tools.h" -#ifndef ECCODES_ON_WINDOWS - #include -#else +#ifdef ECCODES_ON_WINDOWS #include #include #endif diff --git a/tigge/tigge_split.c b/tigge/tigge_split.c index 5882fdc91..fec42821d 100755 --- a/tigge/tigge_split.c +++ b/tigge/tigge_split.c @@ -27,7 +27,6 @@ #include #ifndef ECCODES_ON_WINDOWS - #include #include #else #include diff --git a/tigge/tigge_tools.c b/tigge/tigge_tools.c index 0526d6d0e..0bad072dd 100644 --- a/tigge/tigge_tools.c +++ b/tigge/tigge_tools.c @@ -15,7 +15,6 @@ #include "tigge_tools.h" #include "eccodes_windef.h" -#include #include #ifndef ECCODES_ON_WINDOWS diff --git a/tools/big2gribex.c b/tools/big2gribex.c index 02e535fc1..37d479d8b 100644 --- a/tools/big2gribex.c +++ b/tools/big2gribex.c @@ -16,7 +16,6 @@ */ #include -#include #include #include "grib_api.h" diff --git a/tools/bufr_split_by_rdbSubtype.c b/tools/bufr_split_by_rdbSubtype.c index 29d9a9a68..6e3dbfee3 100644 --- a/tools/bufr_split_by_rdbSubtype.c +++ b/tools/bufr_split_by_rdbSubtype.c @@ -17,7 +17,6 @@ */ #include "grib_api_internal.h" -#include static int verbose = 0; static const char* OUTPUT_FILENAME_DEFAULT = "split_rdbSubtype.undef.bufr"; diff --git a/tools/gg_sub_area_check.c b/tools/gg_sub_area_check.c index df59cf4d7..a5e60cbb8 100644 --- a/tools/gg_sub_area_check.c +++ b/tools/gg_sub_area_check.c @@ -9,7 +9,6 @@ */ #include "grib_api.h" -#include "math.h" static void usage(char* prog) { printf("Usage: %s file1.grib file2.grib\n",prog); diff --git a/tools/grib_to_netcdf.c b/tools/grib_to_netcdf.c index 4783d0661..2c83a22eb 100644 --- a/tools/grib_to_netcdf.c +++ b/tools/grib_to_netcdf.c @@ -18,7 +18,6 @@ #include #include -#include #include #include diff --git a/tools/grib_tools.h b/tools/grib_tools.h index 9af1e1330..8833183f8 100644 --- a/tools/grib_tools.h +++ b/tools/grib_tools.h @@ -17,7 +17,6 @@ #ifndef ECCODES_ON_WINDOWS # include #endif -#include #ifndef GRIB_TOOLS_H #define GRIB_TOOLS_H