Skip to content

Commit

Permalink
Address a few other issues found by cppcheck
Browse files Browse the repository at this point in the history
Thanks matthiaskrgr for running it.
  • Loading branch information
CelticMinstrel committed Mar 16, 2017
1 parent 12cf0fb commit 6b251d4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/config.cpp
Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions src/game_board.cpp
Expand Up @@ -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_) {}

Expand Down
1 change: 1 addition & 0 deletions src/units/filter.hpp
Expand Up @@ -55,6 +55,7 @@ class unit_filter {
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);
Expand Down
3 changes: 2 additions & 1 deletion src/utils/functional.hpp
Expand Up @@ -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)...);
}
Expand Down
14 changes: 7 additions & 7 deletions src/xBRZ/xbrz.cpp
Expand Up @@ -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() {}
};
Expand Down Expand Up @@ -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() {}
};
Expand Down

0 comments on commit 6b251d4

Please sign in to comment.