From b88ac2cf6b0bc096872689d815c661a35a9f7115 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Tue, 5 Nov 2024 13:34:38 +0100 Subject: [PATCH] Modernisation: Nearest: Move extern variabls to header file --- src/grib_iterator_factory.cc | 12 ------------ src/grib_iterator_factory.h | 13 +++++++++++++ src/grib_nearest_factory.cc | 10 ---------- src/grib_nearest_factory.h | 10 ++++++++++ 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/grib_iterator_factory.cc b/src/grib_iterator_factory.cc index a670df6d1..9c5fc31dc 100644 --- a/src/grib_iterator_factory.cc +++ b/src/grib_iterator_factory.cc @@ -45,18 +45,6 @@ struct table_entry eccodes::geo_iterator::Iterator** iterator; }; -extern eccodes::geo_iterator::Iterator* grib_iterator_gaussian; -extern eccodes::geo_iterator::Iterator* grib_iterator_gaussian_reduced; -extern eccodes::geo_iterator::Iterator* grib_iterator_healpix; -extern eccodes::geo_iterator::Iterator* grib_iterator_lambert_azimuthal_equal_area; -extern eccodes::geo_iterator::Iterator* grib_iterator_lambert_conformal; -extern eccodes::geo_iterator::Iterator* grib_iterator_latlon; -extern eccodes::geo_iterator::Iterator* grib_iterator_latlon_reduced; -extern eccodes::geo_iterator::Iterator* grib_iterator_mercator; -extern eccodes::geo_iterator::Iterator* grib_iterator_polar_stereographic; -extern eccodes::geo_iterator::Iterator* grib_iterator_regular; -extern eccodes::geo_iterator::Iterator* grib_iterator_space_view; - static const struct table_entry table[] = { { "gaussian", &grib_iterator_gaussian, }, { "gaussian_reduced", &grib_iterator_gaussian_reduced, }, diff --git a/src/grib_iterator_factory.h b/src/grib_iterator_factory.h index 0c0e288fa..256c204e6 100644 --- a/src/grib_iterator_factory.h +++ b/src/grib_iterator_factory.h @@ -13,4 +13,17 @@ #include "grib_api_internal.h" #include "geo_iterator/grib_iterator.h" +extern eccodes::geo_iterator::Iterator* grib_iterator_gaussian; +extern eccodes::geo_iterator::Iterator* grib_iterator_gaussian_reduced; +extern eccodes::geo_iterator::Iterator* grib_iterator_healpix; +extern eccodes::geo_iterator::Iterator* grib_iterator_lambert_azimuthal_equal_area; +extern eccodes::geo_iterator::Iterator* grib_iterator_lambert_conformal; +extern eccodes::geo_iterator::Iterator* grib_iterator_latlon; +extern eccodes::geo_iterator::Iterator* grib_iterator_latlon_reduced; +extern eccodes::geo_iterator::Iterator* grib_iterator_mercator; +extern eccodes::geo_iterator::Iterator* grib_iterator_polar_stereographic; +extern eccodes::geo_iterator::Iterator* grib_iterator_regular; +extern eccodes::geo_iterator::Iterator* grib_iterator_space_view; + + eccodes::geo_iterator::Iterator* grib_iterator_factory(grib_handle* h, grib_arguments* args, unsigned long flags, int* error); diff --git a/src/grib_nearest_factory.cc b/src/grib_nearest_factory.cc index bfe6c9ecc..6babc985c 100644 --- a/src/grib_nearest_factory.cc +++ b/src/grib_nearest_factory.cc @@ -11,16 +11,6 @@ #include "grib_nearest_factory.h" #include "accessor/grib_accessor_class_nearest.h" -extern eccodes::geo_nearest::Nearest* grib_nearest_healpix; -extern eccodes::geo_nearest::Nearest* grib_nearest_lambert_azimuthal_equal_area; -extern eccodes::geo_nearest::Nearest* grib_nearest_lambert_conformal; -extern eccodes::geo_nearest::Nearest* grib_nearest_latlon_reduced; -extern eccodes::geo_nearest::Nearest* grib_nearest_mercator; -extern eccodes::geo_nearest::Nearest* grib_nearest_polar_stereographic; -extern eccodes::geo_nearest::Nearest* grib_nearest_reduced; -extern eccodes::geo_nearest::Nearest* grib_nearest_regular; -extern eccodes::geo_nearest::Nearest* grib_nearest_space_view; - struct table_entry { const char* type; diff --git a/src/grib_nearest_factory.h b/src/grib_nearest_factory.h index b203f7590..658abff30 100644 --- a/src/grib_nearest_factory.h +++ b/src/grib_nearest_factory.h @@ -13,4 +13,14 @@ #include "grib_api_internal.h" #include "geo_nearest/grib_nearest.h" +extern eccodes::geo_nearest::Nearest* grib_nearest_healpix; +extern eccodes::geo_nearest::Nearest* grib_nearest_lambert_azimuthal_equal_area; +extern eccodes::geo_nearest::Nearest* grib_nearest_lambert_conformal; +extern eccodes::geo_nearest::Nearest* grib_nearest_latlon_reduced; +extern eccodes::geo_nearest::Nearest* grib_nearest_mercator; +extern eccodes::geo_nearest::Nearest* grib_nearest_polar_stereographic; +extern eccodes::geo_nearest::Nearest* grib_nearest_reduced; +extern eccodes::geo_nearest::Nearest* grib_nearest_regular; +extern eccodes::geo_nearest::Nearest* grib_nearest_space_view; + eccodes::geo_nearest::Nearest* grib_nearest_factory(grib_handle* h, grib_arguments* args, int* error);