From cd6574ecf652901573cbc6b89e1a59dd383ec496 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sat, 26 Jul 2014 15:57:27 +0200 Subject: Added some missing "const" in rtlil.h --- kernel/rtlil.cc | 10 +++++----- kernel/rtlil.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 1638682c..73f5d71f 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -883,7 +883,7 @@ void RTLIL::Module::connect(const RTLIL::SigSpec &lhs, const RTLIL::SigSpec &rhs connections_.push_back(RTLIL::SigSig(lhs, rhs)); } -const std::vector &RTLIL::Module::connections() +const std::vector &RTLIL::Module::connections() const { return connections_; } @@ -1350,12 +1350,12 @@ void RTLIL::Cell::set(RTLIL::IdString portname, RTLIL::SigSpec signal) connections_[portname] = signal; } -RTLIL::SigSpec RTLIL::Cell::get(RTLIL::IdString portname) const +const RTLIL::SigSpec &RTLIL::Cell::get(RTLIL::IdString portname) const { return connections_.at(portname); } -const std::map &RTLIL::Cell::connections() +const std::map &RTLIL::Cell::connections() const { return connections_; } @@ -1839,7 +1839,7 @@ void RTLIL::SigSpec::remove2(const RTLIL::SigSpec &pattern, RTLIL::SigSpec *othe check(); } -RTLIL::SigSpec RTLIL::SigSpec::extract(RTLIL::SigSpec pattern, RTLIL::SigSpec *other) const +RTLIL::SigSpec RTLIL::SigSpec::extract(RTLIL::SigSpec pattern, const RTLIL::SigSpec *other) const { if (other) cover("kernel.rtlil.sigspec.extract_other"); @@ -1859,7 +1859,7 @@ RTLIL::SigSpec RTLIL::SigSpec::extract(RTLIL::SigSpec pattern, RTLIL::SigSpec *o RTLIL::SigSpec ret; if (other) { - std::vector bits_other = other ? other->to_sigbit_vector() : bits_match; + std::vector bits_other = other->to_sigbit_vector(); for (int i = 0; i < width_; i++) if (bits_match[i].wire && pat.count(bits_match[i])) ret.append_bit(bits_other[i]); diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 1775975d..25d0a830 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -290,7 +290,7 @@ struct RTLIL::Module void connect(const RTLIL::SigSig &conn); void connect(const RTLIL::SigSpec &lhs, const RTLIL::SigSpec &rhs); - const std::vector &connections(); + const std::vector &connections() const; void fixup_ports(); template void rewrite_sigspecs(T functor); @@ -490,8 +490,8 @@ public: // access cell ports void unset(RTLIL::IdString portname); void set(RTLIL::IdString portname, RTLIL::SigSpec signal); - RTLIL::SigSpec get(RTLIL::IdString portname) const; - const std::map &connections(); + const RTLIL::SigSpec &get(RTLIL::IdString portname) const; + const std::map &connections() const; void check(); void fixup_parameters(bool set_a_signed = false, bool set_b_signed = false); @@ -608,7 +608,7 @@ public: void remove(int offset, int length = 1); void remove_const(); - RTLIL::SigSpec extract(RTLIL::SigSpec pattern, RTLIL::SigSpec *other = NULL) const; + RTLIL::SigSpec extract(RTLIL::SigSpec pattern, const RTLIL::SigSpec *other = NULL) const; RTLIL::SigSpec extract(int offset, int length = 1) const; void append(const RTLIL::SigSpec &signal); -- cgit v1.2.3