aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/chip.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-06-09 18:41:38 +0200
committerClifford Wolf <clifford@clifford.at>2018-06-09 18:41:38 +0200
commit8cabb39d6d6270f3f721c903d20f7b2cf8fe79a4 (patch)
tree7e9a38d080f4da3354cf88bed8d840bed6567aa9 /ice40/chip.cc
parent0bc5b1c2d94dcfd83c4d55082ee9936435c8488b (diff)
downloadnextpnr-8cabb39d6d6270f3f721c903d20f7b2cf8fe79a4.tar.gz
nextpnr-8cabb39d6d6270f3f721c903d20f7b2cf8fe79a4.tar.bz2
nextpnr-8cabb39d6d6270f3f721c903d20f7b2cf8fe79a4.zip
Getting rid of .nil() methods, compare with zero- and default-constructed objects instead
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'ice40/chip.cc')
-rw-r--r--ice40/chip.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/ice40/chip.cc b/ice40/chip.cc
index 9c6d7a1a..26a2dc6e 100644
--- a/ice40/chip.cc
+++ b/ice40/chip.cc
@@ -41,7 +41,7 @@ BelType belTypeFromId(IdString id)
return TYPE_ICESTORM_RAM;
if (id == "SB_IO")
return TYPE_SB_IO;
- return TYPE_NIL;
+ return TYPE_NONE;
}
// -----------------------------------------------------------------------
@@ -67,7 +67,7 @@ PortPin portPinFromId(IdString id)
#include "portpins.inc"
#undef X
- return PIN_NIL;
+ return PIN_NONE;
}
// -----------------------------------------------------------------------
@@ -121,7 +121,7 @@ WireId Chip::getWireBelPin(BelId bel, PortPin pin) const
{
WireId ret;
- assert(!bel.nil());
+ assert(bel != BelId());
int num_bel_wires = chip_info.bel_data[bel.index].num_bel_wires;
BelWirePOD *bel_wires = chip_info.bel_data[bel.index].bel_wires;
@@ -178,21 +178,21 @@ PipId Chip::getPipByName(IdString name) const
void Chip::getBelPosition(BelId bel, float &x, float &y) const
{
- assert(!bel.nil());
+ assert(bel != BelId());
x = chip_info.bel_data[bel.index].x;
y = chip_info.bel_data[bel.index].y;
}
void Chip::getWirePosition(WireId wire, float &x, float &y) const
{
- assert(!wire.nil());
+ assert(wire != WireId());
x = chip_info.wire_data[wire.index].x;
y = chip_info.wire_data[wire.index].y;
}
void Chip::getPipPosition(PipId pip, float &x, float &y) const
{
- assert(!pip.nil());
+ assert(pip != PipId());
x = chip_info.pip_data[pip.index].x;
y = chip_info.pip_data[pip.index].y;
}