Skip to content

Commit

Permalink
Cleanup: Use default virtual destructors wherever possible
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent d49d1fb commit 20f9591
Show file tree
Hide file tree
Showing 44 changed files with 60 additions and 60 deletions.
4 changes: 2 additions & 2 deletions doomsday/apps/client/include/misc/ihplane.h
Expand Up @@ -44,7 +44,7 @@ class IHPlane
public:
IIntercept(ddouble distance) : _distance(distance) {}

virtual ~IIntercept() {}
virtual ~IIntercept() = default;

/**
* Determines the distance between "this" and the @a other intercept
Expand Down Expand Up @@ -75,7 +75,7 @@ class IHPlane
};

public:
virtual ~IHPlane() {}
virtual ~IHPlane() = default;

/**
* Reconfigure the half-plane according to the given Partition line.
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/include/render/ilightsource.h
Expand Up @@ -46,7 +46,7 @@ class ILightSource
typedef de::Vec3f Colorf;

public:
virtual ~ILightSource() {}
virtual ~ILightSource() = default;

virtual LightId lightSourceId() const = 0;

Expand Down Expand Up @@ -78,7 +78,7 @@ class IPointLightSource : public ILightSource
typedef de::Vec3d Origin;

public:
virtual ~IPointLightSource() {}
virtual ~IPointLightSource() = default;

/**
* Returns the position of the light source, in map units.
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/include/render/trianglestripbuilder.h
Expand Up @@ -35,7 +35,7 @@ class IEdge
class IEvent
{
public:
virtual ~IEvent() {}
virtual ~IEvent() = default;

virtual bool operator < (IEvent const &other) const {
return distance() < other.distance();
Expand All @@ -45,7 +45,7 @@ class IEdge
};

public:
virtual ~IEdge() {}
virtual ~IEdge() = default;

virtual bool isValid() const = 0;

Expand Down
10 changes: 5 additions & 5 deletions doomsday/apps/client/include/ui/clientwindow.h
Expand Up @@ -32,15 +32,15 @@

#undef main

#define DE_GAMEVIEW_X ClientWindow::main().game().rule().left().valuei()
#define DE_GAMEVIEW_Y ClientWindow::main().game().rule().top().valuei()
#define DE_GAMEVIEW_WIDTH ClientWindow::main().game().rule().width().valuei()
#define DE_GAMEVIEW_HEIGHT ClientWindow::main().game().rule().height().valuei()
#define DE_GAMEVIEW_X ClientWindow::main().game().rule().left().valuei()
#define DE_GAMEVIEW_Y ClientWindow::main().game().rule().top().valuei()
#define DE_GAMEVIEW_WIDTH ClientWindow::main().game().rule().width().valuei()
#define DE_GAMEVIEW_HEIGHT ClientWindow::main().game().rule().height().valuei()

/**
* A helpful macro that changes the origin of the window space coordinate system.
*/
#define FLIP(y) (ClientWindow::main().height() - ((y)+1))
#define FLIP(y) (ClientWindow::main().height() - ((y) + 1))

class ConsoleWidget;
class TaskBarWidget;
Expand Down
Expand Up @@ -48,7 +48,7 @@ class VariableGroupEditor : public de::FoldPanelWidget
virtual de::ScrollAreaWidget &containerWidget() = 0;
virtual void resetToDefaults(de::String const &name) = 0;

virtual ~IOwner() {}
virtual ~IOwner() = default;
};

public:
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/include/ui/widgets/icvarwidget.h
Expand Up @@ -25,7 +25,7 @@
class ICVarWidget
{
public:
virtual ~ICVarWidget() {}
virtual ~ICVarWidget() = default;

virtual char const *cvarPath() const = 0;
virtual void updateFromCVar() = 0;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/plugins/common/src/game/g_eventsequence.cpp
Expand Up @@ -31,7 +31,7 @@
class ISequenceCompleteHandler
{
public:
virtual ~ISequenceCompleteHandler() {}
virtual ~ISequenceCompleteHandler() = default;
virtual void invoke(int player, EventSequenceArg* args, int numArgs) = 0;
};

Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/plugins/importidtech1/src/mapimporter.cpp
Expand Up @@ -44,7 +44,7 @@ class Id1MapElement
public:
Id1MapElement(MapImporter &map) : _map(&map) {}
Id1MapElement(Id1MapElement const &other) : _map(other._map) {}
virtual ~Id1MapElement() {}
virtual ~Id1MapElement() = default;

MapImporter &map() const {
DE_ASSERT(_map != 0);
Expand Down
Expand Up @@ -46,7 +46,7 @@ class LIBAPPFW_PUBLIC ChildWidgetOrganizer
class IWidgetFactory
{
public:
virtual ~IWidgetFactory() {}
virtual ~IWidgetFactory() = default;

/**
* Called when the organizer needs a widget for a context item. This allows
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/appfw/include/de/framework/guiwidget.h
Expand Up @@ -155,7 +155,7 @@ class LIBAPPFW_PUBLIC GuiWidget : public Widget
class IEventHandler
{
public:
virtual ~IEventHandler() {}
virtual ~IEventHandler() = default;

/**
* Handle an event.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/appfw/include/de/framework/ipersistent.h
Expand Up @@ -36,7 +36,7 @@ class PersistentState;
class LIBAPPFW_PUBLIC IPersistent
{
public:
virtual ~IPersistent() {}
virtual ~IPersistent() = default;

virtual void operator >> (PersistentState &toState) const = 0;
virtual void operator << (PersistentState const &fromState) = 0;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/core/include/de/concurrency/task.h
Expand Up @@ -29,7 +29,7 @@ class DE_PUBLIC IRunnable
{
public:
virtual void run() = 0;
virtual ~IRunnable() {}
virtual ~IRunnable() = default;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/core/include/de/concurrency/taskpool.h
Expand Up @@ -56,7 +56,7 @@ class DE_PUBLIC TaskPool
{
public:
virtual void taskFinishedRunning(Task &) = 0;
virtual ~IPool() {}
virtual ~IPool() = default;
};

typedef std::function<void ()> TaskFunction;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/core/include/de/core/logbuffer.h
Expand Up @@ -51,7 +51,7 @@ class DE_PUBLIC LogBuffer : public Lockable
class IFilter
{
public:
virtual ~IFilter() {}
virtual ~IFilter() = default;

/**
* Determines if a log entry should be allowed into the log buffer
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/core/include/de/core/logsink.h
Expand Up @@ -53,7 +53,7 @@ class DE_PUBLIC LogSink
typedef StringList Lines;

virtual Lines logEntryToTextLines(const LogEntry &entry) = 0;
virtual ~IFormatter() {}
virtual ~IFormatter() = default;
};

public:
Expand Down
4 changes: 2 additions & 2 deletions doomsday/libs/core/include/de/data/bank.h
Expand Up @@ -144,7 +144,7 @@ class DE_PUBLIC Bank
class ISource
{
public:
virtual ~ISource() {}
virtual ~ISource() = default;

/**
* Returns the timestamp of the source data, which determines when the
Expand All @@ -166,7 +166,7 @@ class DE_PUBLIC Bank
class IData
{
public:
virtual ~IData() {}
virtual ~IData() = default;

/// Serialization should be done?
virtual bool shouldBeSerialized() const { return true; }
Expand Down
4 changes: 2 additions & 2 deletions doomsday/libs/core/include/de/data/iblock.h
Expand Up @@ -14,7 +14,7 @@
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
* http://www.gnu.org/licenses</small>
*/

#ifndef LIBCORE_IBLOCK_H
Expand All @@ -33,7 +33,7 @@ namespace de {
class IBlock
{
public:
virtual ~IBlock() {}
virtual ~IBlock() = default;

/// Empties the data of the block.
virtual void clear() = 0;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/core/include/de/data/ibytearray.h
Expand Up @@ -48,7 +48,7 @@ class DE_PUBLIC IByteArray
typedef dbyte Byte;

public:
virtual ~IByteArray() {}
virtual ~IByteArray() = default;

/// Returns the length of the array.
virtual Size size() const = 0;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/core/include/de/data/iistream.h
Expand Up @@ -43,7 +43,7 @@ class IIStream
DE_ERROR(InputError);

public:
virtual ~IIStream() {}
virtual ~IIStream() = default;

/**
* Reads all the available bytes into the array @a bytes. If there is
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/core/include/de/data/info.h
Expand Up @@ -265,7 +265,7 @@ class DE_PUBLIC Info
class DE_PUBLIC IIncludeFinder
{
public:
virtual ~IIncludeFinder() {}
virtual ~IIncludeFinder() = default;

/**
* Finds an Info document.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/core/include/de/data/iostream.h
Expand Up @@ -36,7 +36,7 @@ class IOStream
DE_ERROR(OutputError);

public:
virtual ~IOStream() {}
virtual ~IOStream() = default;

/**
* Writes an array of bytes to the stream.
Expand Down
6 changes: 3 additions & 3 deletions doomsday/libs/core/include/de/data/ireadable.h
Expand Up @@ -14,9 +14,9 @@
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
* http://www.gnu.org/licenses</small>
*/

#ifndef LIBCORE_IREADABLE_H
#define LIBCORE_IREADABLE_H

Expand All @@ -37,7 +37,7 @@ class Reader;
class DE_PUBLIC IReadable
{
public:
virtual ~IReadable() {}
virtual ~IReadable() = default;

/**
* Restore the object from the provided Reader.
Expand Down
6 changes: 3 additions & 3 deletions doomsday/libs/core/include/de/data/iserializable.h
Expand Up @@ -14,9 +14,9 @@
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
* http://www.gnu.org/licenses</small>
*/

#ifndef LIBCORE_ISERIALIZABLE_H
#define LIBCORE_ISERIALIZABLE_H

Expand Down Expand Up @@ -45,7 +45,7 @@ class DE_PUBLIC ISerializable : public IWritable, public IReadable
DE_ERROR(DeserializationError);

public:
virtual ~ISerializable() {}
virtual ~ISerializable() = default;
};

} // namespace de
Expand Down
6 changes: 3 additions & 3 deletions doomsday/libs/core/include/de/data/iwritable.h
Expand Up @@ -14,9 +14,9 @@
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
* http://www.gnu.org/licenses</small>
*/

#ifndef LIBCORE_IWRITABLE_H
#define LIBCORE_IWRITABLE_H

Expand All @@ -38,7 +38,7 @@ class Writer;
class DE_PUBLIC IWritable
{
public:
virtual ~IWritable() {}
virtual ~IWritable() = default;

/**
* Serialize the object using the provided Writer.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/core/include/de/data/pointerset.h
Expand Up @@ -48,7 +48,7 @@ class DE_PUBLIC PointerSet
class DE_PUBLIC IIterationObserver
{
public:
virtual ~IIterationObserver() {}
virtual ~IIterationObserver() = default;
virtual void pointerSetIteratorsWereInvalidated(Pointer const *oldBase, Pointer const *newBase) = 0;
};

Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/core/include/de/data/string.h
Expand Up @@ -163,7 +163,7 @@ class DE_PUBLIC String : public IByteArray
DE_ERROR(TypeError);

public:
virtual ~IPatternArg() {}
virtual ~IPatternArg() = default;

/// Returns the value of the argument as a text string.
virtual String asText() const = 0;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/core/include/de/filesys/fileindex.h
Expand Up @@ -46,7 +46,7 @@ class DE_PUBLIC FileIndex
class DE_PUBLIC IPredicate
{
public:
virtual ~IPredicate() {}
virtual ~IPredicate() = default;

/**
* Determines if a file should be included in the index.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/core/include/de/filesys/idownloadable.h
Expand Up @@ -30,7 +30,7 @@ namespace de {
class DE_PUBLIC IDownloadable
{
public:
virtual ~IDownloadable() {}
virtual ~IDownloadable() = default;

virtual Asset &asset() = 0;

Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/core/include/de/filesys/iinterpreter.h
Expand Up @@ -36,7 +36,7 @@ namespace filesys {
class IInterpreter
{
public:
virtual ~IInterpreter() {}
virtual ~IInterpreter() = default;

/**
* Attempts to interpret a file.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/core/include/de/scriptsys/iobject.h
Expand Up @@ -39,7 +39,7 @@ class Variable;
class DE_PUBLIC IObject
{
public:
virtual ~IObject() {}
virtual ~IObject() = default;

/**
* Returns the Record that contains the instance namespace of the object.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/core/include/de/scriptsys/iparser.h
Expand Up @@ -39,7 +39,7 @@ class Script;
class IParser
{
public:
virtual ~IParser() {}
virtual ~IParser() = default;

/**
* Reads an input script in text format, and according to the
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/core/include/de/widgets/isizerule.h
Expand Up @@ -30,7 +30,7 @@ namespace de {
class DE_PUBLIC ISizeRule
{
public:
virtual ~ISizeRule() {}
virtual ~ISizeRule() = default;

virtual Rule const &width() const = 0;
virtual Rule const &height() const = 0;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/doomsday/include/doomsday/busymode.h
Expand Up @@ -59,7 +59,7 @@ class LIBDOOMSDAY_PUBLIC BusyMode
class LIBDOOMSDAY_PUBLIC ITaskRunner
{
public:
virtual ~ITaskRunner() {}
virtual ~ITaskRunner() = default;

struct LIBDOOMSDAY_PUBLIC Result {
bool wasRun;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/libs/doomsday/include/doomsday/gamestatefolder.h
Expand Up @@ -112,7 +112,7 @@ class LIBDOOMSDAY_PUBLIC GameStateFolder : public de::ArchiveFolder
class IMapStateReaderFactory
{
public:
virtual ~IMapStateReaderFactory() {}
virtual ~IMapStateReaderFactory() = default;

/**
* Called while loading a saved session to acquire a MapStateReader for the
Expand Down

0 comments on commit 20f9591

Please sign in to comment.