aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-02-25 11:21:39 +0000
committergatecat <gatecat@ds0.me>2021-02-25 15:15:25 +0000
commit23413a4d12ad070c8a356c5a3186f81def705c54 (patch)
treee18884eb5006aa991402b3576e188d7977ef88e8 /common
parent17183fff05e52471ff4c619fc24e104234489803 (diff)
downloadnextpnr-23413a4d12ad070c8a356c5a3186f81def705c54.tar.gz
nextpnr-23413a4d12ad070c8a356c5a3186f81def705c54.tar.bz2
nextpnr-23413a4d12ad070c8a356c5a3186f81def705c54.zip
Fix compiler warnings introduced by -Wextra
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'common')
-rw-r--r--common/nextpnr.h6
-rw-r--r--common/relptr.h4
-rw-r--r--common/router2.cc2
3 files changed, 6 insertions, 6 deletions
diff --git a/common/nextpnr.h b/common/nextpnr.h
index 59198d6d..549e8e35 100644
--- a/common/nextpnr.h
+++ b/common/nextpnr.h
@@ -99,7 +99,7 @@ inline void assert_fail_impl_str(std::string message, const char *expr_str, cons
#define NPNR_ASSERT_FALSE(msg) (assert_fail_impl(msg, "false", __FILE__, __LINE__))
#define NPNR_ASSERT_FALSE_STR(msg) (assert_fail_impl_str(msg, "false", __FILE__, __LINE__))
-#define STRINGIFY(x) #x
+#define NPNR_STRINGIFY(x) #x
struct BaseCtx;
struct Context;
@@ -541,7 +541,7 @@ struct Property
ret.is_string = false;
ret.str.reserve(len);
for (int i = offset; i < offset + len; i++)
- ret.str.push_back(i < int(str.size()) ? str[i] : padding);
+ ret.str.push_back(i < int(str.size()) ? str[i] : char(padding));
ret.update_intval();
return ret;
}
@@ -1255,7 +1255,7 @@ template <typename R> struct BaseArch : ArchAPI<R>
// Default, trivial, implementations of Arch API functions for arches that don't need complex behaviours
// Basic config
- virtual IdString archId() const override { return this->id(STRINGIFY(ARCHNAME)); }
+ virtual IdString archId() const override { return this->id(NPNR_STRINGIFY(ARCHNAME)); }
virtual IdString archArgsToId(typename R::ArchArgsT args) const override { return IdString(); }
virtual int getTilePipDimZ(int x, int y) const override { return 1; }
virtual char getNameDelimiter() const override { return ' '; }
diff --git a/common/relptr.h b/common/relptr.h
index d45912ab..76850bc9 100644
--- a/common/relptr.h
+++ b/common/relptr.h
@@ -31,8 +31,8 @@ NPNR_PACKED_STRUCT(template <typename T> struct RelSlice {
const T *begin() const { return get(); }
const T *end() const { return get() + length; }
- const size_t size() const { return length; }
- const ptrdiff_t ssize() const { return length; }
+ size_t size() const { return length; }
+ ptrdiff_t ssize() const { return length; }
const T &operator*() const { return *(get()); }
diff --git a/common/router2.cc b/common/router2.cc
index a2023f47..f5779356 100644
--- a/common/router2.cc
+++ b/common/router2.cc
@@ -1211,7 +1211,7 @@ Router2Cfg::Router2Cfg(Context *ctx)
hist_cong_weight = ctx->setting<float>("router2/histCongWeight", 1.0f);
curr_cong_mult = ctx->setting<float>("router2/currCongWeightMult", 2.0f);
estimate_weight = ctx->setting<float>("router2/estimateWeight", 1.75f);
- perf_profile = ctx->setting<float>("router2/perfProfile", false);
+ perf_profile = ctx->setting<bool>("router2/perfProfile", false);
}
NEXTPNR_NAMESPACE_END