Skip to content

Commit

Permalink
change the type of start and end from int to size_t
Browse files Browse the repository at this point in the history
  • Loading branch information
Change72 committed Mar 31, 2024
1 parent 48c5f8e commit 02e0b2e
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions include/geos/geom/Envelope3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ class GEOS_DLL Envelope3d {
, maxy(DoubleNotANumber)
, minz(DoubleNotANumber)
, maxz(DoubleNotANumber)
, start_(-1)
, end_(-1)
, start_(0)
, end_(0)
{};

/** \brief
Expand All @@ -88,7 +88,7 @@ class GEOS_DLL Envelope3d {
* @param z1 the first y-value
* @param z2 the second y-value
*/
Envelope3d(double x1, double x2, double y1, double y2, double z1, double z2, int start = -1, int end = -1, std::string bloom_filter = "")
Envelope3d(double x1, double x2, double y1, double y2, double z1, double z2, size_t start = 0, size_t end = 0, std::string bloom_filter = "")
{
init(x1, x2, y1, y2, z1, z2, start, end, std::move(bloom_filter));
}
Expand Down Expand Up @@ -208,7 +208,7 @@ class GEOS_DLL Envelope3d {
* @param z1 the first y-value
* @param z2 the second y-value
*/
void init(double x1, double x2, double y1, double y2, double z1, double z2, int start = -1, int end = -1, std::string bloom_filter = "")
void init(double x1, double x2, double y1, double y2, double z1, double z2, size_t start = -1, size_t end = -1, std::string bloom_filter = "")
{
if(x1 < x2) {
minx = x1;
Expand Down Expand Up @@ -268,8 +268,8 @@ class GEOS_DLL Envelope3d {
void setToNull()
{
minx = maxx = miny = maxy = minz = maxz = DoubleNotANumber;
start_ = -1;
end_ = -1;
start_ = 0;
end_ = 0;
bloom_filter_ = "";
};

Expand All @@ -283,7 +283,7 @@ class GEOS_DLL Envelope3d {
{
return std::isnan(maxx) && std::isnan(maxy) && std::isnan(maxz) &&
std::isnan(minx) && std::isnan(miny) && std::isnan(minz) &&
start_ == -1 && end_ == -1 && bloom_filter_.empty();
start_ == 0 && end_ == 0 && bloom_filter_.empty();
};

/** \brief
Expand Down Expand Up @@ -971,25 +971,25 @@ class GEOS_DLL Envelope3d {
operator< (const Envelope3d& a, const Envelope3d& b);

// get the start_
int getStart() const
size_t getStart() const
{
return start_;
}

// set the start_
void setStart(int start)
void setStart(size_t start)
{
start_ = start;
}

// get the end_
int getEnd() const
size_t getEnd() const
{
return end_;
}

// set the end_
void setEnd(int end)
void setEnd(size_t end)
{
end_ = end;
}
Expand Down Expand Up @@ -1057,10 +1057,10 @@ class GEOS_DLL Envelope3d {
double maxz;

/// the start
int start_;
size_t start_;

/// the end
int end_;
size_t end_;

/// bloom filter
std::string bloom_filter_;
Expand Down

0 comments on commit 02e0b2e

Please sign in to comment.