From 2bd54826298b18eaa4a964e01356e5fd47cc3b1b Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Thu, 17 Oct 2024 12:06:14 +0200 Subject: [PATCH] Modernisation: has_next() returns bool instead of long --- src/iterator/grib_iterator.h | 2 +- src/iterator/grib_iterator_class_gen.cc | 8 ++++---- src/iterator/grib_iterator_class_gen.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/iterator/grib_iterator.h b/src/iterator/grib_iterator.h index 5ac433f60..0b98821ca 100644 --- a/src/iterator/grib_iterator.h +++ b/src/iterator/grib_iterator.h @@ -29,7 +29,7 @@ public: virtual int previous(double*, double*, double*) = 0; virtual int reset() = 0; virtual int destroy() = 0; - virtual long has_next() = 0; + virtual bool has_next() = 0; virtual Iterator* create() const = 0; public: diff --git a/src/iterator/grib_iterator_class_gen.cc b/src/iterator/grib_iterator_class_gen.cc index e5e7b727d..c2f87280b 100644 --- a/src/iterator/grib_iterator_class_gen.cc +++ b/src/iterator/grib_iterator_class_gen.cc @@ -88,13 +88,13 @@ int Gen::destroy() return Iterator::destroy(); } -long Gen::has_next() +bool Gen::has_next() { if (flags_ == 0 && data_ == NULL) - return 0; + return false; if (e_ >= (long)(nv_ - 1)) - return 0; - return 1; + return false; + return true; } int Gen::previous(double*, double*, double*) { diff --git a/src/iterator/grib_iterator_class_gen.h b/src/iterator/grib_iterator_class_gen.h index c7b349663..0fe7d4874 100644 --- a/src/iterator/grib_iterator_class_gen.h +++ b/src/iterator/grib_iterator_class_gen.h @@ -27,7 +27,7 @@ public: int previous(double*, double*, double*) override; int reset() override; int destroy() override; - long has_next() override; // TODO(maee/masn): return bool please! + bool has_next() override; public: //int get(double*, double*, double*);