diff options
author | gatecat <gatecat@ds0.me> | 2021-03-15 21:08:28 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-15 21:08:28 +0000 |
commit | bf5f0fc58f2c055b6f45a6300ce3895aa79cd27c (patch) | |
tree | 25817e9ea10d339bf4c127b0a082cc5ac9a51deb /common/bits.cc | |
parent | a8e35062c6a1a21838346dd7536bb2fcc7f820ed (diff) | |
parent | 351ca3b5eac472b4bd08b11a4aa6fb67e545eda3 (diff) | |
download | nextpnr-bf5f0fc58f2c055b6f45a6300ce3895aa79cd27c.tar.gz nextpnr-bf5f0fc58f2c055b6f45a6300ce3895aa79cd27c.tar.bz2 nextpnr-bf5f0fc58f2c055b6f45a6300ce3895aa79cd27c.zip |
Merge pull request #625 from litghost/use_namespace_macro
Use NEXTPNR_NAMESPACE macro's now that headers are seperated.
Diffstat (limited to 'common/bits.cc')
-rw-r--r-- | common/bits.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/common/bits.cc b/common/bits.cc index 36c7539a..b20c2e86 100644 --- a/common/bits.cc +++ b/common/bits.cc @@ -19,10 +19,13 @@ */ #include "bits.h" + #include <limits> #include <stdexcept> -namespace nextpnr { +#include "log.h" + +NEXTPNR_NAMESPACE_BEGIN int Bits::generic_popcount(unsigned int v) { @@ -37,7 +40,7 @@ int Bits::generic_popcount(unsigned int v) int Bits::generic_ctz(unsigned int x) { if (x == 0) { - throw std::runtime_error("Cannot call ctz with arg = 0"); + log_error("Cannot call ctz with arg = 0"); } for (size_t i = 0; i < std::numeric_limits<unsigned int>::digits; ++i) { @@ -47,7 +50,7 @@ int Bits::generic_ctz(unsigned int x) } // Unreachable! - throw std::runtime_error("Unreachable!"); + log_error("Unreachable!"); } -}; // namespace nextpnr +NEXTPNR_NAMESPACE_END |