Skip to content

Commit

Permalink
r.terrafow: explicit use of default constructors (OSGeo#2660)
Browse files Browse the repository at this point in the history
Fixes -Wclass-memaccess and -Wdeprecated-declaration warnings.

Use 'default' for implicitly-declared constructors and use default
(implicit) destructor.

Simplify; modernise constructs.
  • Loading branch information
a0x8o committed Jul 2, 2024
1 parent 3eda12a commit 1b1f0f4
Show file tree
Hide file tree
Showing 28 changed files with 397 additions and 39 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
# COPYRIGHT: (C) 2002-2023 by the GRASS Development Team
=======
<<<<<<< HEAD
Expand Down Expand Up @@ -47,6 +48,8 @@
>>>>>>> 6f30700108 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))
# COPYRIGHT: (C) 2002-2024 by the GRASS Development Team
=======
# COPYRIGHT: (C) 2002-2022 by the GRASS Development Team
Expand All @@ -71,6 +74,7 @@
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
# COPYRIGHT: (C) 2002-2023 by the GRASS Development Team
>>>>>>> 6104ec7096 (i.maxlik: fix crash when classification result is NULL (#2724))
Expand Down Expand Up @@ -112,6 +116,8 @@
# COPYRIGHT: (C) 2002-2022 by the GRASS Development Team
>>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704))
>>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))
#
# This program is free software under the GNU General Public
# License (>=v2). Read the file COPYING that comes with GRASS
Expand Down
4 changes: 4 additions & 0 deletions REQUIREMENTS.html
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ <h3>Note:</h3>
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> osgeo-main
=======
Expand Down Expand Up @@ -399,6 +400,9 @@ <h3>Note:</h3>
>>>>>>> da1bbb9bd2 (Programmer's manual: update GRASS GIS arch drawing (#1610))
=======
<i>&copy; GRASS Development Team 1997-2022</i>
=======
<i>&copy; GRASS Development Team 1997-2023</i>
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))

<p>Please report bugs here:
<br><a href="https://grass.osgeo.org/contribute/">https://grass.osgeo.org/contribute/</a>
Expand Down
6 changes: 6 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
# COPYRIGHT: (C) 2000-2023 by the GRASS Development Team
=======
<<<<<<< HEAD
Expand Down Expand Up @@ -47,6 +48,8 @@
>>>>>>> 6f30700108 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))
# COPYRIGHT: (C) 2000-2024 by the GRASS Development Team
=======
# COPYRIGHT: (C) 2000-2022 by the GRASS Development Team
Expand All @@ -71,6 +74,7 @@
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
# COPYRIGHT: (C) 2000-2023 by the GRASS Development Team
>>>>>>> 6104ec7096 (i.maxlik: fix crash when classification result is NULL (#2724))
Expand Down Expand Up @@ -112,6 +116,8 @@
# COPYRIGHT: (C) 2000-2022 by the GRASS Development Team
>>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704))
>>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))
#
# This program is free software under the GNU General
# Public License (>=v2). Read the file COPYING that
Expand Down
12 changes: 12 additions & 0 deletions grasslib.dox
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
* updated 8/2005, 2006-2008, 2010-2011, 2017-2023
=======
Expand Down Expand Up @@ -53,6 +54,8 @@
>>>>>>> 6f30700108 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))
* updated 8/2005, 2006-2024
=======
* updated 8/2005, 2006-2008, 2010-2011, 2017, 2018, 2019, 2021
Expand Down Expand Up @@ -93,6 +96,7 @@
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
* updated 8/2005, 2006-2008, 2010-2011, 2017-2023
>>>>>>> 6104ec7096 (i.maxlik: fix crash when classification result is NULL (#2724))
Expand Down Expand Up @@ -148,6 +152,8 @@
* updated 8/2005, 2006-2008, 2010-2011, 2017-2022
>>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704))
>>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))
-->

<a href="https://grass.osgeo.org">GRASS GIS</a> (<b>Geographic
Expand Down Expand Up @@ -180,6 +186,7 @@ pages.
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
&copy; 2000-2023 by the GRASS Development Team
=======
<<<<<<< HEAD
Expand Down Expand Up @@ -207,6 +214,8 @@ pages.
>>>>>>> 6f30700108 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))
&copy; 2000-2024 by the GRASS Development Team
=======
&copy; 2000-2022 by the GRASS Development Team
Expand All @@ -231,6 +240,7 @@ pages.
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
&copy; 2000-2023 by the GRASS Development Team
>>>>>>> 6104ec7096 (i.maxlik: fix crash when classification result is NULL (#2724))
Expand Down Expand Up @@ -272,6 +282,8 @@ pages.
&copy; 2000-2022 by the GRASS Development Team
>>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704))
>>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))

This manual is published under <a
href="http://www.fsf.org/copyleft/fdl.html">GNU Free Documentation
Expand Down
20 changes: 20 additions & 0 deletions gui/wxpython/gui_core/goutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
from gui_core.wrap import Button, ClearButton, StaticText, StaticBox
=======
<<<<<<< HEAD
Expand All @@ -66,6 +67,8 @@
>>>>>>> osgeo-main
=======
>>>>>>> osgeo-main
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))
from gui_core.wrap import Button, ClearButton, StaticText
=======
from gui_core.wrap import Button, ClearButton, StaticText, StaticBox
Expand All @@ -74,6 +77,7 @@
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
from gui_core.wrap import Button, ClearButton, StaticText, StaticBox
>>>>>>> f130b43e6c (r.horizon manual - fix typo (#2794))
Expand Down Expand Up @@ -101,6 +105,8 @@
from gui_core.wrap import Button, ClearButton, StaticText, StaticBox
>>>>>>> f130b43e6c (r.horizon manual - fix typo (#2794))
>>>>>>> osgeo-main
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))
from core.settings import UserSettings


Expand Down Expand Up @@ -207,6 +213,7 @@ def __init__(
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
<<<<<<< HEAD
=======
Expand All @@ -222,6 +229,8 @@ def __init__(
>>>>>>> osgeo-main
=======
>>>>>>> osgeo-main
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))

self.btnClear.Bind(wx.EVT_BUTTON, self.OnClear)
self.btnOutputSave.Bind(wx.EVT_BUTTON, self.OnOutputSave)
Expand All @@ -231,6 +240,7 @@ def __init__(
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> f130b43e6c (r.horizon manual - fix typo (#2794))
<<<<<<< HEAD
Expand All @@ -254,6 +264,8 @@ def __init__(
=======
>>>>>>> f130b43e6c (r.horizon manual - fix typo (#2794))
>>>>>>> osgeo-main
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))
self.btnCmdExportHistory = Button(parent=self.panelOutput, id=wx.ID_ANY)
self.btnCmdExportHistory.SetLabel(_("&Export history"))
self.btnCmdExportHistory.SetToolTip(
Expand All @@ -276,6 +288,7 @@ def __init__(
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
<<<<<<< HEAD
>>>>>>> 021dfb5d52 (r.terrafow: explicit use of default constructors (#2660))
Expand Down Expand Up @@ -310,6 +323,9 @@ def __init__(
=======
>>>>>>> f130b43e6c (r.horizon manual - fix typo (#2794))
>>>>>>> osgeo-main
=======
>>>>>>> 021dfb5d52 (r.terrafow: explicit use of default constructors (#2660))
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))

self._layout()

Expand Down Expand Up @@ -604,6 +620,7 @@ def OnCmdProgress(self, event):
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
<<<<<<< HEAD
<<<<<<< HEAD
Expand Down Expand Up @@ -639,6 +656,9 @@ def OnCmdProgress(self, event):
=======
>>>>>>> f130b43e6c (r.horizon manual - fix typo (#2794))
>>>>>>> osgeo-main
=======
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))
def OnCmdExportHistory(self, event):
"""Export the history of executed commands stored
in a .wxgui_history file to a selected file."""
Expand Down
6 changes: 6 additions & 0 deletions imagery/i.maxlik/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,13 @@ int main(int argc, char *argv[])
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> fc6ae6c77c (r.terrafow: explicit use of default constructors (#2660))
=======
>>>>>>> 630833279b (i.maxlik: fix crash when classification result is NULL (#2724))
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))
if (Rast_is_c_null_value(&class_cell[col]) == 0)
class_cell[col] = S.sig[class_cell[col] - 1].oclass;
=======
Expand Down Expand Up @@ -292,6 +295,7 @@ int main(int argc, char *argv[])
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 630833279b (i.maxlik: fix crash when classification result is NULL (#2724))
=======
Expand Down Expand Up @@ -350,6 +354,8 @@ int main(int argc, char *argv[])
class_cell[col] = S.sig[class_cell[col] - 1].oclass;
>>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704))
>>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))
}
}
Rast_put_row(class_fd, class_cell, CELL_TYPE);
Expand Down
6 changes: 6 additions & 0 deletions imagery/i.maxlik/testsuite/test_i_maxlik.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,13 @@ def setUpClass(cls):
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> fc6ae6c77c (r.terrafow: explicit use of default constructors (#2660))
=======
>>>>>>> 630833279b (i.maxlik: fix crash when classification result is NULL (#2724))
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))
expression=f"{cls.b2}=if(row() == 3 && col() == 3, null(), 5.0+rand(-1.0,1.0))",
=======
<<<<<<< HEAD
Expand Down Expand Up @@ -122,6 +125,7 @@ def setUpClass(cls):
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
expression=f"{cls.b2}=if(row() == 3 && col() == 3, null(), 5.0+rand(-1.0,1.0))",
>>>>>>> 6104ec7096 (i.maxlik: fix crash when classification result is NULL (#2724))
Expand Down Expand Up @@ -177,6 +181,8 @@ def setUpClass(cls):
expression=f"{cls.b2}=5.0+rand(-1.0,1.0)",
>>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704))
>>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))
flags="s",
quiet=True,
)
Expand Down
3 changes: 3 additions & 0 deletions include/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ dev
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
2023
>>>>>>> 6104ec7096 (i.maxlik: fix crash when classification result is NULL (#2724))
Expand Down Expand Up @@ -204,3 +205,5 @@ dev
>>>>>>> 6f30700108 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))
6 changes: 6 additions & 0 deletions include/grass/gis.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
* COPYRIGHT: (C) 2000-2023 by the GRASS Development Team
=======
Expand Down Expand Up @@ -58,6 +59,8 @@
>>>>>>> 6f30700108 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))
* COPYRIGHT: (C) 2000-2024 by the GRASS Development Team
=======
* COPYRIGHT: (C) 2000-2021 by the GRASS Development Team
Expand Down Expand Up @@ -98,6 +101,7 @@
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
* COPYRIGHT: (C) 2000-2023 by the GRASS Development Team
>>>>>>> 6104ec7096 (i.maxlik: fix crash when classification result is NULL (#2724))
Expand Down Expand Up @@ -153,6 +157,8 @@
* COPYRIGHT: (C) 2000-2022 by the GRASS Development Team
>>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704))
>>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704))
=======
>>>>>>> b4675dccbc (r.terrafow: explicit use of default constructors (#2660))
*
* This program is free software under the GNU General Public
* License (>=v2). Read the file COPYING that comes with GRASS
Expand Down
Loading

0 comments on commit 1b1f0f4

Please sign in to comment.