Skip to content

Commit

Permalink
Fixed compiler warnings regarding issues identified by clang.
Browse files Browse the repository at this point in the history
  • Loading branch information
Herbert Jordan committed Mar 21, 2017
1 parent 9898d58 commit d69678d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build/
build*/
third_party/

# Editor Specific
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ namespace reference {
public:

template<typename ... Args>
dependencies(const Args& ... args) : list({args...}) {}
dependencies(const Args& ... args) : list({{args...}}) {}

dependencies(const dependencies&) = default;
dependencies(dependencies&&) = default;
Expand Down
8 changes: 4 additions & 4 deletions code/api/include/allscale/api/user/data/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ namespace user {
/**
* An operator to load an instance of this range from the given archive.
*/
static SetRegion load(utils::Archive& a) {
static SetRegion load(utils::Archive&) {
assert_not_implemented();
return SetRegion();
}

/**
* An operator to store an instance of this range into the given archive.
*/
void store(utils::Archive& a) const {
void store(utils::Archive&) const {
assert_not_implemented();
// nothing so far
}
Expand Down Expand Up @@ -255,11 +255,11 @@ namespace user {
}
}

void save(utils::Archive& a, const region_type& keys) const {
void save(utils::Archive&, const region_type&) const {
assert_not_implemented();
}

void load(utils::Archive& a) {
void load(utils::Archive&) {
assert_not_implemented();
}

Expand Down
18 changes: 10 additions & 8 deletions code/api/include/allscale/api/user/operator/pfor.h
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,9 @@ namespace user {
template<typename Iter>
class neighborhood_sync_dependency : public detail::loop_dependency {

std::array<detail::iteration_reference<Iter>,3> deps;
using deps_list = std::array<detail::iteration_reference<Iter>,3>;

deps_list deps;

std::size_t size;

Expand All @@ -758,7 +760,7 @@ namespace user {
public:

neighborhood_sync_dependency(const detail::iteration_reference<Iter>& loop)
: deps({ loop }), size(1) {}
: deps({{ loop }}), size(1) {}

auto toCoreDependencies() const {
return core::after(deps[0],deps[1],deps[2]);
Expand All @@ -776,12 +778,12 @@ namespace user {
const iter_dependency& right = dependency.getRight();

// combine sub-dependencies
iter_dependency start ({left.getRange().begin(),left.getRange().begin()});
iter_dependency finish({right.getRange().end(), right.getRange().end() });
iter_dependency start ({{left.getRange().begin(),left.getRange().begin()}});
iter_dependency finish({{right.getRange().end(), right.getRange().end() }});

return {
neighborhood_sync_dependency({ start, left, right }),
neighborhood_sync_dependency({ left, right, finish })
neighborhood_sync_dependency(deps_list{{ start, left, right }}),
neighborhood_sync_dependency(deps_list{{ left, right, finish }})
};
}

Expand All @@ -807,8 +809,8 @@ namespace user {

// and pack accordingly
return {
leftPart.covers(left.grow(full)) ? neighborhood_sync_dependency({ a,b,c }) : *this,
rightPart.covers(right.grow(full)) ? neighborhood_sync_dependency({ b,c,d }) : *this
leftPart.covers(left.grow(full)) ? neighborhood_sync_dependency(deps_list{{ a,b,c }}) : *this,
rightPart.covers(right.grow(full)) ? neighborhood_sync_dependency(deps_list{{ b,c,d }}) : *this
};

}
Expand Down
8 changes: 4 additions & 4 deletions code/api/test/user/operator/pfor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ namespace user {
using Point = std::array<int,3>;
using Grid = std::array<std::array<std::array<int,N>,N>,N>;

Point zero = {0,0,0};
Point full = {N,N,N};
Point zero = {{0,0,0}};
Point full = {{N,N,N}};

// create data
Grid* data = new Grid();
Expand Down Expand Up @@ -550,8 +550,8 @@ namespace user {

using range = detail::range<std::array<int,2>>;

range limit({0,2},{5,7});
range a({1,4},{2,5});
range limit({{0,2}},{{5,7}});
range a({{1,4}},{{2,5}});

EXPECT_EQ("[[0,2],[5,7])",toString(limit));
EXPECT_EQ("[[1,4],[2,5])",toString(a));
Expand Down

0 comments on commit d69678d

Please sign in to comment.