aboutsummaryrefslogtreecommitdiffstats
path: root/common/util.h
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-17 11:45:41 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-17 11:45:41 +0200
commit3afce5ff5a6adfa1baccb4f4625005300b9a3862 (patch)
tree6217511802c19514a1168a4e6412d1268ac07fb3 /common/util.h
parentc604426341c75bc34b9d97ad5cd49cc28f9198fb (diff)
downloadnextpnr-3afce5ff5a6adfa1baccb4f4625005300b9a3862.tar.gz
nextpnr-3afce5ff5a6adfa1baccb4f4625005300b9a3862.tar.bz2
nextpnr-3afce5ff5a6adfa1baccb4f4625005300b9a3862.zip
Improving the placer output
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'common/util.h')
-rw-r--r--common/util.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/common/util.h b/common/util.h
index 2313a290..34b2ed02 100644
--- a/common/util.h
+++ b/common/util.h
@@ -27,7 +27,7 @@ NEXTPNR_NAMESPACE_BEGIN
// Get a value from a map-style container, returning default if value is not
// found
-template<typename Container, typename KeyType, typename ValueType>
+template <typename Container, typename KeyType, typename ValueType>
ValueType get_or_default(const Container &ct, const KeyType &key,
ValueType def = ValueType())
{
@@ -40,9 +40,8 @@ ValueType get_or_default(const Container &ct, const KeyType &key,
// Get a value from a map-style container, converting to int, and returning
// default if value is not found
-template<typename Container, typename KeyType>
-int int_or_default(const Container &ct, const KeyType &key,
- int def = 0)
+template <typename Container, typename KeyType>
+int int_or_default(const Container &ct, const KeyType &key, int def = 0)
{
auto found = ct.find(key);
if (found == ct.end())
@@ -52,9 +51,8 @@ int int_or_default(const Container &ct, const KeyType &key,
};
// As above, but convert to bool
-template<typename Container, typename KeyType>
-bool bool_or_default(const Container &ct, const KeyType &key,
- bool def = false)
+template <typename Container, typename KeyType>
+bool bool_or_default(const Container &ct, const KeyType &key, bool def = false)
{
return bool(int_or_default(ct, key, int(def)));
};