summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-06-15 17:02:56 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2018-06-18 12:27:01 +0000
commit004e50d84773242a000f5cadb89466bbc793e1a8 (patch)
tree019c32e65caa08fe7cf90b521787531a7b1d2225 /src/util
parentRun clang-tidy’s modernize-use-nullptr pass. (diff)
downloadinkscape-004e50d84773242a000f5cadb89466bbc793e1a8.tar.gz
inkscape-004e50d84773242a000f5cadb89466bbc793e1a8.zip
Run clang-tidy’s modernize-use-equals-default pass.
This replaces empty constructors and destructors with the default keyword.
Diffstat (limited to 'src/util')
-rw-r--r--src/util/ege-tags.cpp9
-rw-r--r--src/util/expression-evaluator.h2
-rw-r--r--src/util/fixed_point.h2
-rw-r--r--src/util/forward-pointer-iterator.h2
-rw-r--r--src/util/list-container.h2
-rw-r--r--src/util/list.h4
-rw-r--r--src/util/share.h7
-rw-r--r--src/util/units.cpp2
-rw-r--r--src/util/ziptool.cpp19
9 files changed, 18 insertions, 31 deletions
diff --git a/src/util/ege-tags.cpp b/src/util/ege-tags.cpp
index dcc28f370..3b9f68df8 100644
--- a/src/util/ege-tags.cpp
+++ b/src/util/ege-tags.cpp
@@ -62,14 +62,12 @@ Label::Label(std::string const& lang, std::string const& value) :
}
Label::~Label()
-{
-}
+= default;
// =========================================================================
Tag::~Tag()
-{
-}
+= default;
Tag::Tag(std::string const& key) :
key(key)
@@ -86,8 +84,7 @@ TagSet::TagSet() :
}
TagSet::~TagSet()
-{
-}
+= default;
void TagSet::setLang(std::string const& lang)
{
diff --git a/src/util/expression-evaluator.h b/src/util/expression-evaluator.h
index bb29d7f26..23b431a8e 100644
--- a/src/util/expression-evaluator.h
+++ b/src/util/expression-evaluator.h
@@ -177,7 +177,7 @@ public:
msgstr = os.str();
}
- ~EvaluatorException() throw() override {} // necessary to destroy the string object!!!
+ ~EvaluatorException() throw() override = default; // necessary to destroy the string object!!!
const char *what() const throw () override {
return msgstr.c_str();
diff --git a/src/util/fixed_point.h b/src/util/fixed_point.h
index cfc6e4020..02d536ecc 100644
--- a/src/util/fixed_point.h
+++ b/src/util/fixed_point.h
@@ -24,7 +24,7 @@ namespace Util {
template <typename T, unsigned int precision>
class FixedPoint {
public:
- FixedPoint() {}
+ FixedPoint() = default;
FixedPoint(const FixedPoint& value) : v(value.v) {}
FixedPoint(char value) : v(static_cast<T>(value)<<precision) {}
FixedPoint(unsigned char value) : v(static_cast<T>(value)<<precision) {}
diff --git a/src/util/forward-pointer-iterator.h b/src/util/forward-pointer-iterator.h
index 4f8e88637..eaf5a7a25 100644
--- a/src/util/forward-pointer-iterator.h
+++ b/src/util/forward-pointer-iterator.h
@@ -37,7 +37,7 @@ public:
typedef ForwardPointerIterator<BaseType const, Strategy> Self;
- ForwardPointerIterator() : _p(NULL) {}
+ ForwardPointerIterator() = default;
ForwardPointerIterator(pointer p) : _p(p) {}
operator pointer() const { return _p; }
diff --git a/src/util/list-container.h b/src/util/list-container.h
index e123fea0c..d39a40ee7 100644
--- a/src/util/list-container.h
+++ b/src/util/list-container.h
@@ -24,7 +24,7 @@ template <typename T>
class ListContainer {
public:
/* default constructible */
- ListContainer() {}
+ ListContainer() = default;
/* assignable */
ListContainer(ListContainer const &other) {
diff --git a/src/util/list.h b/src/util/list.h
index ea2fa871e..ffe04d9f3 100644
--- a/src/util/list.h
+++ b/src/util/list.h
@@ -22,7 +22,7 @@ namespace Util {
/// Generic ListCell for Inkscape::Util::List.
template <typename T>
struct ListCell : public GC::Managed<> {
- ListCell() {}
+ ListCell() = default;
ListCell(typename Traits::Reference<T>::RValue v, ListCell *n)
: value(v), next(n) {}
@@ -205,7 +205,7 @@ protected:
template <typename T>
class MutableList : public List<T> {
public:
- MutableList() {}
+ MutableList() = default;
explicit MutableList(typename List<T>::const_reference value,
MutableList const &next=MutableList())
: List<T>(value, next) {}
diff --git a/src/util/share.h b/src/util/share.h
index a2672afa4..cc3387325 100644
--- a/src/util/share.h
+++ b/src/util/share.h
@@ -24,7 +24,7 @@ class ptr_shared {
public:
ptr_shared() : _string(nullptr) {}
- ptr_shared(ptr_shared const &other) : _string(other._string) {}
+ ptr_shared(ptr_shared const &other) = default;
operator char const *() const { return _string; }
operator bool() const { return _string; }
@@ -54,10 +54,7 @@ public:
return _string - other._string;
}
- ptr_shared &operator=(ptr_shared const &other) {
- _string = other._string;
- return *this;
- }
+ ptr_shared &operator=(ptr_shared const &other) = default;
bool operator==(ptr_shared const &other) const {
return _string == other._string;
diff --git a/src/util/units.cpp b/src/util/units.cpp
index 7854abf77..ffa2681c6 100644
--- a/src/util/units.cpp
+++ b/src/util/units.cpp
@@ -129,7 +129,7 @@ public:
typedef Glib::Markup::ParseContext Ctx;
UnitParser(UnitTable *table);
- ~UnitParser() override {}
+ ~UnitParser() override = default;
protected:
void on_start_element(Ctx &ctx, Glib::ustring const &name, AttrMap const &attrs) override;
diff --git a/src/util/ziptool.cpp b/src/util/ziptool.cpp
index e5ece00e4..2146710dd 100644
--- a/src/util/ziptool.cpp
+++ b/src/util/ziptool.cpp
@@ -60,8 +60,7 @@ Adler32::Adler32()
* Destructor
*/
Adler32::~Adler32()
-{
-}
+= default;
/**
* Reset Adler-32 checksum to initial value.
@@ -117,8 +116,7 @@ Crc32::Crc32()
* Destructor
*/
Crc32::~Crc32()
-{
-}
+= default;
static bool crc_table_ready = false;
static unsigned long crc_table[256];
@@ -315,8 +313,7 @@ Inflater::Inflater() :
*
*/
Inflater::~Inflater()
-{
-}
+= default;
/**
*
@@ -915,9 +912,7 @@ Deflater::Deflater()
*
*/
Deflater::~Deflater()
-{
-
-}
+= default;
/**
*
@@ -1439,8 +1434,7 @@ GzipFile::GzipFile() :
* Destructor
*/
GzipFile::~GzipFile()
-{
-}
+= default;
/**
* Print error messages
@@ -1925,8 +1919,7 @@ ZipEntry::ZipEntry(const std::string &fileNameArg,
* Destructor
*/
ZipEntry::~ZipEntry()
-{
-}
+= default;
/**