mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-21 21:05:52 +00:00
Address a few other issues found by cppcheck
Thanks matthiaskrgr for running it.
This commit is contained in:
parent
12cf0fb45e
commit
6b251d445c
@ -1016,6 +1016,7 @@ struct config_has_value {
|
||||
config_has_value(const std::string& name, const std::string& value)
|
||||
: name_(name), value_()
|
||||
{
|
||||
// TODO: This is assigned here instead of in the init-list because attribute_value doesn't have a matching constructor
|
||||
value_ = value;
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@ game_board::game_board(const ter_data_cache & tdata, const config & level)
|
||||
game_board::game_board(const game_board & other)
|
||||
: teams_(other.teams_)
|
||||
, map_(new gamemap(*(other.map_)))
|
||||
, labels_(other.labels_)
|
||||
, unit_id_manager_(other.unit_id_manager_)
|
||||
, units_(other.units_) {}
|
||||
|
||||
|
@ -55,6 +55,7 @@ public:
|
||||
unit_filter(const unit_filter & o ) : impl_(o.impl_), max_matches_() {}
|
||||
void swap(unit_filter & o) {
|
||||
impl_.swap(o.impl_);
|
||||
std::swap(max_matches_, o.max_matches_);
|
||||
}
|
||||
unit_filter & operator=(unit_filter o) {
|
||||
swap(o);
|
||||
|
@ -36,7 +36,8 @@ namespace detail {
|
||||
template<typename Ret, typename... T>
|
||||
struct apply {
|
||||
using result_type = void;
|
||||
apply(std::function<Ret(T...)> fcn) : fcn(fcn) {}
|
||||
apply(const std::function<Ret(T...)>& fcn) : fcn(fcn) {}
|
||||
apply(Ret(*fcn)(T...)) : fcn(fcn) {}
|
||||
void operator()(T... params) {
|
||||
fcn(std::forward<T>(params)...);
|
||||
}
|
||||
|
@ -564,10 +564,10 @@ struct BlendResult
|
||||
struct Kernel_4x4 //kernel for preprocessing step
|
||||
{
|
||||
uint32_t
|
||||
/**/a, b, c, d,
|
||||
/**/e, f, g, h,
|
||||
/**/i, j, k, l,
|
||||
/**/m, n, o, p;
|
||||
/**/a=0, b=0, c=0, d=0,
|
||||
/**/e=0, f=0, g=0, h=0,
|
||||
/**/i=0, j=0, k=0, l=0,
|
||||
/**/m=0, n=0, o=0, p=0;
|
||||
|
||||
Kernel_4x4() {}
|
||||
};
|
||||
@ -625,9 +625,9 @@ BlendResult preProcessCorners(const Kernel_4x4& ker, const xbrz::ScalerCfg& cfg)
|
||||
struct Kernel_3x3
|
||||
{
|
||||
uint32_t
|
||||
/**/a, b, c,
|
||||
/**/d, e, f,
|
||||
/**/g, h, i;
|
||||
/**/a=0, b=0, c=0,
|
||||
/**/d=0, e=0, f=0,
|
||||
/**/g=0, h=0, i=0;
|
||||
|
||||
Kernel_3x3() {}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user