Skip to content

Commit

Permalink
Modernisation: has_next() returns bool instead of long
Browse files Browse the repository at this point in the history
  • Loading branch information
joobog committed Oct 17, 2024
1 parent b490cfc commit 2bd5482
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/iterator/grib_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Iterator
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:
Expand Down
8 changes: 4 additions & 4 deletions src/iterator/grib_iterator_class_gen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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*) {
Expand Down
2 changes: 1 addition & 1 deletion src/iterator/grib_iterator_class_gen.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Gen : public Iterator
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*);
Expand Down

0 comments on commit 2bd5482

Please sign in to comment.