From 23413a4d12ad070c8a356c5a3186f81def705c54 Mon Sep 17 00:00:00 2001 From: gatecat Date: Thu, 25 Feb 2021 11:21:39 +0000 Subject: Fix compiler warnings introduced by -Wextra Signed-off-by: gatecat --- machxo2/arch.cc | 1 + machxo2/archdefs.h | 1 - machxo2/bitstream.cc | 14 -------------- 3 files changed, 1 insertion(+), 15 deletions(-) (limited to 'machxo2') diff --git a/machxo2/arch.cc b/machxo2/arch.cc index 74bfc598..6a29dbb1 100644 --- a/machxo2/arch.cc +++ b/machxo2/arch.cc @@ -153,6 +153,7 @@ std::string Arch::get_full_chip_name() const break; case ArchArgs::SPEED_3: name += "3"; + break; case ArchArgs::SPEED_4: name += "4"; break; diff --git a/machxo2/archdefs.h b/machxo2/archdefs.h index f822b907..433b1b6b 100644 --- a/machxo2/archdefs.h +++ b/machxo2/archdefs.h @@ -48,7 +48,6 @@ struct Location Location() : x(-1), y(-1){}; Location(int16_t x, int16_t y) : x(x), y(y){}; Location(const LocationPOD &pod) : x(pod.x), y(pod.y){}; - Location(const Location &loc) : x(loc.x), y(loc.y){}; bool operator==(const Location &other) const { return x == other.x && y == other.y; } bool operator!=(const Location &other) const { return x != other.x || y != other.y; } diff --git a/machxo2/bitstream.cc b/machxo2/bitstream.cc index 37363b09..d695b094 100644 --- a/machxo2/bitstream.cc +++ b/machxo2/bitstream.cc @@ -114,20 +114,6 @@ static std::vector int_to_bitvector(int val, int size) return bv; } -static std::vector str_to_bitvector(std::string str, int size) -{ - std::vector bv; - bv.resize(size, 0); - if (str.substr(0, 2) != "0b") - log_error("error parsing value '%s', expected 0b prefix\n", str.c_str()); - for (int i = 0; i < int(str.size()) - 2; i++) { - char c = str.at((str.size() - i) - 1); - NPNR_ASSERT(c == '0' || c == '1'); - bv.at(i) = (c == '1'); - } - return bv; -} - std::string intstr_or_default(const std::unordered_map &ct, const IdString &key, std::string def = "0") { -- cgit v1.2.3