Skip to content

Commit

Permalink
try fix -Wno-class-memaccess warning again
Browse files Browse the repository at this point in the history
  • Loading branch information
nilason committed Nov 21, 2022
1 parent a5e5f47 commit 9ca17df
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ jobs:
# TODO: -pedantic-errors here won't go through ./configure (with GNU C)
CFLAGS: "-std=${{ matrix.c }} -fPIC -Wall -Wno-error=maybe-uninitialized"
# TODO: -pedantic-errors here won't compile
CXXFLAGS: "-std=${{ matrix.cpp }} -fPIC -Wall -Wno-error=class-memaccess"
CXXFLAGS: "-std=${{ matrix.cpp }} -fPIC -Wall"
run: .github/workflows/build_ubuntu-20.04.sh $HOME/install -Werror
11 changes: 6 additions & 5 deletions raster/r.terraflow/ccforest.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,17 @@ class keyvalue {
keyvalue() : key(-1), value(-1) {};
keyvalue(T vk, T vv) : key(vk), value(vv) {};

keyvalue(const keyvalue &) = default;
keyvalue& operator=(const keyvalue &) = default;
keyvalue(keyvalue &&) = default;
keyvalue& operator=(keyvalue &&) = default;
~keyvalue() = default;

T getPriority() const { return key; };
T getValue() const { return value; };
T src() const { return key; };
T dst() const { return value; };

keyvalue operator =(const keyvalue &that) {
key = that.key;
value = that.value;
return *this;
};
int operator != (const keyvalue &e2) const {
return (key != e2.key) || (value != e2.value);
}
Expand Down
2 changes: 2 additions & 0 deletions raster/r.terraflow/genericWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ class genericWindow {
}
}

genericWindow<T> &operator=(const genericWindow<T> &) = default;

/***************************************************************/
genericWindow(const genericWindow<T> &win) {
for (int i=0;i<9;i++) {
Expand Down
45 changes: 21 additions & 24 deletions raster/r.terraflow/sweep.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,15 @@ class flowPriority {
dimension_type i,j;

public:
flowPriority(elevation_type a=0, toporank_type b=0,
dimension_type c=0, dimension_type d=0):
h(a), toporank(b), i(c), j(d) {}

flowPriority(const flowPriority &p):
h(p.h), toporank(p.toporank), i(p.i), j(p.j) {}

~flowPriority() {}
flowPriority(elevation_type a=0, toporank_type b=0,
dimension_type c=0, dimension_type d=0):
h(a), toporank(b), i(c), j(d) {}

flowPriority(const flowPriority &) = default;
flowPriority& operator=(const flowPriority &) = default;
flowPriority(flowPriority &&) = default;
flowPriority& operator=(flowPriority &&) = default;
~flowPriority() = default;

elevation_type field1() const {
return h;
Expand Down Expand Up @@ -436,9 +437,13 @@ class flowValue {

public:
flowValue(flowaccumulation_type x=0): value(x) {}

~flowValue() {}


flowValue(const flowValue &) = default;
flowValue& operator=(const flowValue &) = default;
flowValue(flowValue &&) = default;
flowValue& operator=(flowValue &&) = default;
~flowValue() = default;

flowaccumulation_type get() const {
return value;
}
Expand All @@ -453,10 +458,6 @@ class flowValue {
flowValue elt(elt1.value + elt2.value);
return elt;
}
flowValue operator =(const flowValue &elt) {
value = elt.value;
return *this;
}
flowValue operator != (const flowValue &elt) {
return value != elt.value;
}
Expand Down Expand Up @@ -495,15 +496,11 @@ class flowStructure {
flowStructure(const flowPriority &p = 0, const flowValue &e = 0):
prio(p), val(e) {}

/* flowStructure(const flowValue &e, const flowPriority &p):
prio(p), val(e) {}
*/
flowStructure(const flowStructure &fl):
prio(fl.prio),
val(fl.val)
{}

~flowStructure() {}
flowStructure(const flowStructure &) = default;
flowStructure& operator=(const flowStructure &) = default;
flowStructure(flowStructure &&) = default;
flowStructure& operator=(flowStructure &&) = default;
~flowStructure() = default;

flowPriority getPriority() const {
return prio;
Expand Down

0 comments on commit 9ca17df

Please sign in to comment.