common/kernel: Fixed unused parameters and spurious ; warnings in some of the headers

This commit is contained in:
dragonmux 2024-01-03 15:02:59 +00:00 committed by myrtle
parent 50d43742ce
commit 7fd80c5a92
7 changed files with 68 additions and 68 deletions

View File

@ -143,8 +143,8 @@ template <typename R> struct BaseArch : ArchAPI<R>
// Basic config // Basic config
virtual IdString archId() const override { return this->id(NPNR_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 IdString archArgsToId(typename R::ArchArgsT /*args*/) const override { return IdString(); }
virtual int getTilePipDimZ(int x, int y) const override { return 1; } virtual int getTilePipDimZ(int /*x*/, int /*y*/) const override { return 1; }
virtual char getNameDelimiter() const override { return ' '; } virtual char getNameDelimiter() const override { return ' '; }
// Bel methods // Bel methods
@ -170,9 +170,9 @@ template <typename R> struct BaseArch : ArchAPI<R>
this->refreshUiBel(bel); this->refreshUiBel(bel);
} }
virtual bool getBelHidden(BelId bel) const override { return false; } virtual bool getBelHidden(BelId /*bel*/) const override { return false; }
virtual bool getBelGlobalBuf(BelId bel) const override { return false; } virtual bool getBelGlobalBuf(BelId /*bel*/) const override { return false; }
virtual bool checkBelAvail(BelId bel) const override { return getBoundBelCell(bel) == nullptr; }; virtual bool checkBelAvail(BelId bel) const override { return getBoundBelCell(bel) == nullptr; };
virtual CellInfo *getBoundBelCell(BelId bel) const override virtual CellInfo *getBoundBelCell(BelId bel) const override
{ {
@ -180,18 +180,18 @@ template <typename R> struct BaseArch : ArchAPI<R>
return fnd == base_bel2cell.end() ? nullptr : fnd->second; return fnd == base_bel2cell.end() ? nullptr : fnd->second;
} }
virtual CellInfo *getConflictingBelCell(BelId bel) const override { return getBoundBelCell(bel); } virtual CellInfo *getConflictingBelCell(BelId bel) const override { return getBoundBelCell(bel); }
virtual typename R::BelAttrsRangeT getBelAttrs(BelId bel) const override virtual typename R::BelAttrsRangeT getBelAttrs(BelId /*bel*/) const override
{ {
return empty_if_possible<typename R::BelAttrsRangeT>(); return empty_if_possible<typename R::BelAttrsRangeT>();
} }
virtual typename R::CellBelPinRangeT getBelPinsForCellPin(const CellInfo *cell_info, IdString pin) const override virtual typename R::CellBelPinRangeT getBelPinsForCellPin(const CellInfo * /*cell_info*/, IdString pin) const override
{ {
return return_if_match<std::array<IdString, 1>, typename R::CellBelPinRangeT>({pin}); return return_if_match<std::array<IdString, 1>, typename R::CellBelPinRangeT>({pin});
} }
// Wire methods // Wire methods
virtual IdString getWireType(WireId wire) const override { return IdString(); } virtual IdString getWireType(WireId /*wire*/) const override { return IdString(); }
virtual typename R::WireAttrsRangeT getWireAttrs(WireId) const override virtual typename R::WireAttrsRangeT getWireAttrs(WireId) const override
{ {
return empty_if_possible<typename R::WireAttrsRangeT>(); return empty_if_possible<typename R::WireAttrsRangeT>();
@ -237,10 +237,10 @@ template <typename R> struct BaseArch : ArchAPI<R>
} }
virtual WireId getConflictingWireWire(WireId wire) const override { return wire; }; virtual WireId getConflictingWireWire(WireId wire) const override { return wire; };
virtual NetInfo *getConflictingWireNet(WireId wire) const override { return getBoundWireNet(wire); } virtual NetInfo *getConflictingWireNet(WireId wire) const override { return getBoundWireNet(wire); }
virtual IdString getWireConstantValue(WireId wire) const override { return {}; } virtual IdString getWireConstantValue(WireId /*wire*/) const override { return {}; }
// Pip methods // Pip methods
virtual IdString getPipType(PipId pip) const override { return IdString(); } virtual IdString getPipType(PipId /*pip*/) const override { return IdString(); }
virtual typename R::PipAttrsRangeT getPipAttrs(PipId) const override virtual typename R::PipAttrsRangeT getPipAttrs(PipId) const override
{ {
return empty_if_possible<typename R::PipAttrsRangeT>(); return empty_if_possible<typename R::PipAttrsRangeT>();
@ -285,60 +285,60 @@ template <typename R> struct BaseArch : ArchAPI<R>
auto fnd = base_pip2net.find(pip); auto fnd = base_pip2net.find(pip);
return fnd == base_pip2net.end() ? nullptr : fnd->second; return fnd == base_pip2net.end() ? nullptr : fnd->second;
} }
virtual WireId getConflictingPipWire(PipId pip) const override { return WireId(); } virtual WireId getConflictingPipWire(PipId /*pip*/) const override { return WireId(); }
virtual NetInfo *getConflictingPipNet(PipId pip) const override { return getBoundPipNet(pip); } virtual NetInfo *getConflictingPipNet(PipId pip) const override { return getBoundPipNet(pip); }
// Group methods // Group methods
virtual GroupId getGroupByName(IdStringList name) const override { return GroupId(); }; virtual GroupId getGroupByName(IdStringList /*name*/) const override { return GroupId(); };
virtual IdStringList getGroupName(GroupId group) const override { return IdStringList(); }; virtual IdStringList getGroupName(GroupId /*group*/) const override { return IdStringList(); };
virtual typename R::AllGroupsRangeT getGroups() const override virtual typename R::AllGroupsRangeT getGroups() const override
{ {
return empty_if_possible<typename R::AllGroupsRangeT>(); return empty_if_possible<typename R::AllGroupsRangeT>();
} }
// Default implementation of these assumes no groups so never called // Default implementation of these assumes no groups so never called
virtual typename R::GroupBelsRangeT getGroupBels(GroupId group) const override virtual typename R::GroupBelsRangeT getGroupBels(GroupId /*group*/) const override
{ {
NPNR_ASSERT_FALSE("unreachable"); NPNR_ASSERT_FALSE("unreachable");
}; };
virtual typename R::GroupWiresRangeT getGroupWires(GroupId group) const override virtual typename R::GroupWiresRangeT getGroupWires(GroupId /*group*/) const override
{ {
NPNR_ASSERT_FALSE("unreachable"); NPNR_ASSERT_FALSE("unreachable");
}; };
virtual typename R::GroupPipsRangeT getGroupPips(GroupId group) const override virtual typename R::GroupPipsRangeT getGroupPips(GroupId /*group*/) const override
{ {
NPNR_ASSERT_FALSE("unreachable"); NPNR_ASSERT_FALSE("unreachable");
}; };
virtual typename R::GroupGroupsRangeT getGroupGroups(GroupId group) const override virtual typename R::GroupGroupsRangeT getGroupGroups(GroupId /*group*/) const override
{ {
NPNR_ASSERT_FALSE("unreachable"); NPNR_ASSERT_FALSE("unreachable");
}; };
// Delay methods // Delay methods
virtual bool getArcDelayOverride(const NetInfo *net_info, const PortRef &sink, DelayQuad &delay) const override virtual bool getArcDelayOverride(const NetInfo * /*net_info*/, const PortRef &/*sink*/, DelayQuad &/*delay*/) const override
{ {
return false; return false;
} }
// Decal methods // Decal methods
virtual typename R::DecalGfxRangeT getDecalGraphics(DecalId decal) const override virtual typename R::DecalGfxRangeT getDecalGraphics(DecalId /*decal*/) const override
{ {
return empty_if_possible<typename R::DecalGfxRangeT>(); return empty_if_possible<typename R::DecalGfxRangeT>();
}; };
virtual DecalXY getBelDecal(BelId bel) const override { return DecalXY(); } virtual DecalXY getBelDecal(BelId /*bel*/) const override { return DecalXY(); }
virtual DecalXY getWireDecal(WireId wire) const override { return DecalXY(); } virtual DecalXY getWireDecal(WireId /*wire*/) const override { return DecalXY(); }
virtual DecalXY getPipDecal(PipId pip) const override { return DecalXY(); } virtual DecalXY getPipDecal(PipId /*pip*/) const override { return DecalXY(); }
virtual DecalXY getGroupDecal(GroupId group) const override { return DecalXY(); } virtual DecalXY getGroupDecal(GroupId /*group*/) const override { return DecalXY(); }
// Cell timing methods // Cell timing methods
virtual bool getCellDelay(const CellInfo *cell, IdString fromPort, IdString toPort, DelayQuad &delay) const override virtual bool getCellDelay(const CellInfo * /*cell*/, IdString /*fromPort*/, IdString /*toPort*/, DelayQuad &/*delay*/) const override
{ {
return false; return false;
} }
virtual TimingPortClass getPortTimingClass(const CellInfo *cell, IdString port, int &clockInfoCount) const override virtual TimingPortClass getPortTimingClass(const CellInfo * /*cell*/, IdString /*port*/, int &/*clockInfoCount*/) const override
{ {
return TMG_IGNORE; return TMG_IGNORE;
} }
virtual TimingClockingInfo getPortClockingInfo(const CellInfo *cell, IdString port, int index) const override virtual TimingClockingInfo getPortClockingInfo(const CellInfo * /*cell*/, IdString /*port*/, int /*index*/) const override
{ {
NPNR_ASSERT_FALSE("unreachable"); NPNR_ASSERT_FALSE("unreachable");
} }
@ -358,7 +358,7 @@ template <typename R> struct BaseArch : ArchAPI<R>
{ {
return getBelBucketByName(cell_type); return getBelBucketByName(cell_type);
}; };
virtual bool isBelLocationValid(BelId bel, bool explain_invalid = false) const override { return true; } virtual bool isBelLocationValid(BelId /*bel*/, bool /*explain_invalid*/ = false) const override { return true; }
virtual typename R::CellTypeRangeT getCellTypes() const override virtual typename R::CellTypeRangeT getCellTypes() const override
{ {
NPNR_ASSERT(cell_types_initialised); NPNR_ASSERT(cell_types_initialised);
@ -400,7 +400,7 @@ template <typename R> struct BaseArch : ArchAPI<R>
[](const BaseClusterInfo *c) { return Loc(c->constr_x, c->constr_y, 0); }); [](const BaseClusterInfo *c) { return Loc(c->constr_x, c->constr_y, 0); });
} }
virtual bool isClusterStrict(const CellInfo *cell) const override { return true; } virtual bool isClusterStrict(const CellInfo * /*cell*/) const override { return true; }
virtual bool getClusterPlacement(ClusterId cluster, BelId root_bel, virtual bool getClusterPlacement(ClusterId cluster, BelId root_bel,
std::vector<std::pair<CellInfo *, BelId>> &placement) const override std::vector<std::pair<CellInfo *, BelId>> &placement) const override

View File

@ -34,7 +34,7 @@ class CommandHandler
{ {
public: public:
CommandHandler(int argc, char **argv); CommandHandler(int argc, char **argv);
virtual ~CommandHandler(){}; virtual ~CommandHandler() { }
int exec(); int exec();
void load_json(Context *ctx, std::string filename); void load_json(Context *ctx, std::string filename);
@ -45,9 +45,9 @@ class CommandHandler
virtual void setupArchContext(Context *ctx) = 0; virtual void setupArchContext(Context *ctx) = 0;
virtual std::unique_ptr<Context> createContext(dict<std::string, Property> &values) = 0; virtual std::unique_ptr<Context> createContext(dict<std::string, Property> &values) = 0;
virtual po::options_description getArchOptions() = 0; virtual po::options_description getArchOptions() = 0;
virtual void validate(){}; virtual void validate() { }
virtual void customAfterLoad(Context *ctx){}; virtual void customAfterLoad(Context * /*ctx*/) { }
virtual void customBitstream(Context *ctx){}; virtual void customBitstream(Context * /*ctx*/) { }
void conflicting_options(const boost::program_options::variables_map &vm, const char *opt1, const char *opt2); void conflicting_options(const boost::program_options::variables_map &vm, const char *opt1, const char *opt2);
private: private:

View File

@ -35,10 +35,10 @@ struct IdStringList
{ {
SSOArray<IdString, 4> ids; SSOArray<IdString, 4> ids;
IdStringList() : ids(1, IdString()){}; IdStringList() : ids(1, IdString()) { }
explicit IdStringList(size_t n) : ids(n, IdString()){}; explicit IdStringList(size_t n) : ids(n, IdString()) { }
explicit IdStringList(IdString id) : ids(1, id){}; explicit IdStringList(IdString id) : ids(1, id) { }
template <typename Tlist> explicit IdStringList(const Tlist &list) : ids(list){}; template <typename Tlist> explicit IdStringList(const Tlist &list) : ids(list) { }
static IdStringList parse(Context *ctx, const std::string &str); static IdStringList parse(Context *ctx, const std::string &str);
void build_str(const Context *ctx, std::string &str) const; void build_str(const Context *ctx, std::string &str) const;

View File

@ -81,10 +81,10 @@ struct PortRef
struct DelayPair struct DelayPair
{ {
DelayPair(){}; DelayPair(){};
explicit DelayPair(delay_t delay) : min_delay(delay), max_delay(delay){}; explicit DelayPair(delay_t delay) : min_delay(delay), max_delay(delay) { }
DelayPair(delay_t min_delay, delay_t max_delay) : min_delay(min_delay), max_delay(max_delay){}; DelayPair(delay_t min_delay, delay_t max_delay) : min_delay(min_delay), max_delay(max_delay) { }
delay_t minDelay() const { return min_delay; }; delay_t minDelay() const { return min_delay; }
delay_t maxDelay() const { return max_delay; }; delay_t maxDelay() const { return max_delay; }
delay_t min_delay, max_delay; delay_t min_delay, max_delay;
DelayPair operator+(const DelayPair &other) const DelayPair operator+(const DelayPair &other) const
{ {
@ -100,21 +100,21 @@ struct DelayPair
struct DelayQuad struct DelayQuad
{ {
DelayPair rise, fall; DelayPair rise, fall;
DelayQuad(){}; DelayQuad() { }
explicit DelayQuad(delay_t delay) : rise(delay), fall(delay){}; explicit DelayQuad(delay_t delay) : rise(delay), fall(delay) { }
DelayQuad(delay_t min_delay, delay_t max_delay) : rise(min_delay, max_delay), fall(min_delay, max_delay){}; DelayQuad(delay_t min_delay, delay_t max_delay) : rise(min_delay, max_delay), fall(min_delay, max_delay) { }
DelayQuad(DelayPair rise, DelayPair fall) : rise(rise), fall(fall){}; DelayQuad(DelayPair rise, DelayPair fall) : rise(rise), fall(fall) { }
DelayQuad(delay_t min_rise, delay_t max_rise, delay_t min_fall, delay_t max_fall) DelayQuad(delay_t min_rise, delay_t max_rise, delay_t min_fall, delay_t max_fall)
: rise(min_rise, max_rise), fall(min_fall, max_fall){}; : rise(min_rise, max_rise), fall(min_fall, max_fall) { }
delay_t minRiseDelay() const { return rise.minDelay(); }; delay_t minRiseDelay() const { return rise.minDelay(); }
delay_t maxRiseDelay() const { return rise.maxDelay(); }; delay_t maxRiseDelay() const { return rise.maxDelay(); }
delay_t minFallDelay() const { return fall.minDelay(); }; delay_t minFallDelay() const { return fall.minDelay(); }
delay_t maxFallDelay() const { return fall.maxDelay(); }; delay_t maxFallDelay() const { return fall.maxDelay(); }
delay_t minDelay() const { return std::min<delay_t>(rise.minDelay(), fall.minDelay()); }; delay_t minDelay() const { return std::min<delay_t>(rise.minDelay(), fall.minDelay()); }
delay_t maxDelay() const { return std::max<delay_t>(rise.maxDelay(), fall.maxDelay()); }; delay_t maxDelay() const { return std::max<delay_t>(rise.maxDelay(), fall.maxDelay()); }
DelayPair delayPair() const { return DelayPair(minDelay(), maxDelay()); }; DelayPair delayPair() const { return DelayPair(minDelay(), maxDelay()); }
DelayQuad operator+(const DelayQuad &other) const { return {rise + other.rise, fall + other.fall}; } DelayQuad operator+(const DelayQuad &other) const { return {rise + other.rise, fall + other.fall}; }
DelayQuad operator-(const DelayQuad &other) const { return {rise - other.rise, fall - other.fall}; } DelayQuad operator-(const DelayQuad &other) const { return {rise - other.rise, fall - other.fall}; }
@ -124,7 +124,7 @@ struct ClockConstraint;
struct NetInfo : ArchNetInfo struct NetInfo : ArchNetInfo
{ {
explicit NetInfo(IdString name) : name(name){}; explicit NetInfo(IdString name) : name(name) { }
IdString name, hierpath; IdString name, hierpath;
int32_t udata = 0; int32_t udata = 0;
@ -203,14 +203,14 @@ struct PseudoCell
struct RegionPlug : PseudoCell struct RegionPlug : PseudoCell
{ {
RegionPlug(Loc loc) : loc(loc){}; // 'loc' is a notional location for the placer only RegionPlug(Loc loc) : loc(loc) { } // 'loc' is a notional location for the placer only
Loc getLocation() const override { return loc; } Loc getLocation() const override { return loc; }
WireId getPortWire(IdString port) const override { return port_wires.at(port); } WireId getPortWire(IdString port) const override { return port_wires.at(port); }
// TODO: partial reconfiguration region timing // TODO: partial reconfiguration region timing
bool getDelay(IdString fromPort, IdString toPort, DelayQuad &delay) const override { return false; } bool getDelay(IdString /*fromPort*/, IdString /*toPort*/, DelayQuad &/*delay*/) const override { return false; }
TimingPortClass getPortTimingClass(IdString port, int &clockInfoCount) const override { return TMG_IGNORE; } TimingPortClass getPortTimingClass(IdString /*port*/, int &/*clockInfoCount*/) const override { return TMG_IGNORE; }
TimingClockingInfo getPortClockingInfo(IdString port, int index) const override { return TimingClockingInfo{}; } TimingClockingInfo getPortClockingInfo(IdString /*port*/, int /*index*/) const override { return TimingClockingInfo{}; }
dict<IdString, WireId> port_wires; dict<IdString, WireId> port_wires;
Loc loc; Loc loc;
@ -218,7 +218,7 @@ struct RegionPlug : PseudoCell
struct CellInfo : ArchCellInfo struct CellInfo : ArchCellInfo
{ {
CellInfo(Context *ctx, IdString name, IdString type) : ctx(ctx), name(name), type(type){}; CellInfo(Context *ctx, IdString name, IdString type) : ctx(ctx), name(name), type(type) { }
Context *ctx = nullptr; Context *ctx = nullptr;
IdString name, type, hierpath; IdString name, type, hierpath;

View File

@ -290,7 +290,7 @@ template <typename T1, typename T2> struct pair_wrapper
x.second = val.cast<T2>(); x.second = val.cast<T2>();
} }
static int len(T &x) { return 2; } static int len(T &/*x*/) { return 2; }
static iter_pair<T &, int> iter(T &x) { return iter_pair<T &, int>(boost::ref(x), 0); }; static iter_pair<T &, int> iter(T &x) { return iter_pair<T &, int>(boost::ref(x), 0); };
@ -348,7 +348,7 @@ template <typename T1, typename T2, typename value_conv> struct map_pair_wrapper
x.base.first)); x.base.first));
} }
static int len(wrapped_pair &x) { return 2; } static int len(wrapped_pair &/*x*/) { return 2; }
static iter_pair<wrapped_pair &, int> iter(wrapped_pair &x) static iter_pair<wrapped_pair &, int> iter(wrapped_pair &x)
{ {
@ -469,14 +469,14 @@ template <typename T1, typename T2> struct map_pair_wrapper_uptr
static py::object get(wrapped_pair &x, int i) static py::object get(wrapped_pair &x, int i)
{ {
if ((i >= 2) || (i < 0)) if (i >= 2 || i < 0)
KeyError(); KeyError();
return (i == 1) ? py::cast(PythonConversion::ContextualWrapper<V &>(x.ctx, *x.base.second.get())) return i == 1 ? py::cast(PythonConversion::ContextualWrapper<V &>(x.ctx, *x.base.second.get()))
: py::cast(PythonConversion::string_converter<decltype(x.base.first)>().to_str(x.ctx, : py::cast(PythonConversion::string_converter<decltype(x.base.first)>().to_str(x.ctx,
x.base.first)); x.base.first));
} }
static int len(wrapped_pair &x) { return 2; } static int len(wrapped_pair &/*x*/) { return 2; }
static iter_pair<wrapped_pair &, int> iter(wrapped_pair &x) static iter_pair<wrapped_pair &, int> iter(wrapped_pair &x)
{ {

View File

@ -35,9 +35,9 @@ template <typename T> struct ContextualWrapper
Context *ctx; Context *ctx;
T base; T base;
inline ContextualWrapper(Context *c, T x) : ctx(c), base(x){}; inline ContextualWrapper(Context *c, T x) : ctx(c), base(x) { }
inline operator T() { return base; }; inline operator T() { return base; }
typedef T base_type; typedef T base_type;
}; };
@ -83,7 +83,7 @@ class bad_wrap
// Action options // Action options
template <typename T> struct pass_through template <typename T> struct pass_through
{ {
inline T operator()(Context *ctx, T x) { return x; } inline T operator()(Context * /*ctx*/, T x) { return x; }
using ret_type = T; using ret_type = T;
using arg_type = T; using arg_type = T;
@ -99,7 +99,7 @@ template <typename T> struct wrap_context
template <typename T> struct unwrap_context template <typename T> struct unwrap_context
{ {
inline T operator()(Context *ctx, ContextualWrapper<T> x) { return x.base; } inline T operator()(Context * /*ctx*/, ContextualWrapper<T> x) { return x.base; }
using ret_type = T; using ret_type = T;
using arg_type = ContextualWrapper<T>; using arg_type = ContextualWrapper<T>;
@ -136,7 +136,7 @@ template <typename T> struct deref_and_wrap
template <typename T> struct addr_and_unwrap template <typename T> struct addr_and_unwrap
{ {
inline T *operator()(Context *ctx, ContextualWrapper<T &> x) { return &(x.base); } inline T *operator()(Context * /*ctx*/, ContextualWrapper<T &> x) { return &(x.base); }
using arg_type = ContextualWrapper<T &>; using arg_type = ContextualWrapper<T &>;
using ret_type = T *; using ret_type = T *;

View File

@ -24,7 +24,7 @@ NEXTPNR_NAMESPACE_BEGIN
struct TimingOptCfg struct TimingOptCfg
{ {
TimingOptCfg(Context *ctx) {} TimingOptCfg(Context * /*ctx*/) { }
// The timing optimiser will *only* optimise cells of these types // The timing optimiser will *only* optimise cells of these types
// Normally these would only be logic cells (or tiles if applicable), the algorithm makes little sense // Normally these would only be logic cells (or tiles if applicable), the algorithm makes little sense