aboutsummaryrefslogtreecommitdiffstats
path: root/gui/quadtree.h
diff options
context:
space:
mode:
authorSergiusz Bazanski <q3k@q3k.org>2018-07-27 13:46:44 +0100
committerSergiusz Bazanski <q3k@q3k.org>2018-07-27 13:47:21 +0100
commitdc46eea24d37311e28bc5830e899a77a625a075e (patch)
treee4752b8dac91a03049db9ebd060be532a89576a0 /gui/quadtree.h
parent96608c8d07dd149c033c98172e79d15e7bd2b69c (diff)
downloadnextpnr-dc46eea24d37311e28bc5830e899a77a625a075e.tar.gz
nextpnr-dc46eea24d37311e28bc5830e899a77a625a075e.tar.bz2
nextpnr-dc46eea24d37311e28bc5830e899a77a625a075e.zip
gui: allow building for ECP5 and on Windows
Diffstat (limited to 'gui/quadtree.h')
-rw-r--r--gui/quadtree.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/gui/quadtree.h b/gui/quadtree.h
index 22065c2f..b3ebf81c 100644
--- a/gui/quadtree.h
+++ b/gui/quadtree.h
@@ -157,7 +157,7 @@ template <typename CoordinateT, typename ElementT> class QuadTreeNode
// - any of the 4 children nodes.
enum Quadrant
{
- THIS = -1,
+ THIS_NODE = -1,
NW = 0,
NE = 1,
SW = 2,
@@ -171,7 +171,7 @@ template <typename CoordinateT, typename ElementT> class QuadTreeNode
Quadrant quadrant(const BoundingBox &b) const
{
if (children_ == nullptr) {
- return THIS;
+ return THIS_NODE;
}
bool west0 = b.x0_ < splitx_;
@@ -187,7 +187,7 @@ template <typename CoordinateT, typename ElementT> class QuadTreeNode
return SW;
if (!west0 && !west1 && !north0 && !north1)
return SE;
- return THIS;
+ return THIS_NODE;
}
// Checks whether this node should split.
@@ -252,7 +252,7 @@ template <typename CoordinateT, typename ElementT> class QuadTreeNode
// Put the element either recursively into a child if it fits
// entirely or keep it for ourselves if not.
auto quad = quadrant(k);
- if (quad == THIS) {
+ if (quad == THIS_NODE) {
elems_.push_back(BoundElement(k, std::move(v)));
} else {
return children_[quad].insert(k, std::move(v));
@@ -286,7 +286,7 @@ template <typename CoordinateT, typename ElementT> class QuadTreeNode
auto it = elems_.begin();
while (it != elems_.end()) {
auto quad = quadrant(it->bb_);
- if (quad != THIS) {
+ if (quad != THIS_NODE) {
// Move to one of the children.
if (!children_[quad].insert(it->bb_, std::move(it->elem_)))
return false;