diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-05-29 14:59:09 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-06-25 10:45:28 +0200 |
commit | 4ccfd8de6462ce2ed938587eb0518038640c310f (patch) | |
tree | dbb4a1ff15a6729c2b4a213669f23861da779d3f /sources/shiboken2/ApiExtractor/abstractmetalang.h | |
parent | 3680a489521e4c13488b4f3f462b8e34cebd0e47 (diff) |
shiboken: Fix various clang warnings
- Avoid copying complex types by using const ref
- Use isEmpty() to check for container emptyness
- Use range-based for
- Use Q_DISABLE_COPY in 'public:' area
- Fix spelling error
- Use '= default' for trivial constructors/destructors
- Remove non-null checks before deletion
- Fix misleading indentation
- Fix else after return
- Simplify boolean expressions
- Fix unused parameters, streamline code
Change-Id: I8c6cadd8653e220ba8e5bdb4dd55524d13a81768
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/abstractmetalang.h')
-rw-r--r-- | sources/shiboken2/ApiExtractor/abstractmetalang.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.h b/sources/shiboken2/ApiExtractor/abstractmetalang.h index 779da7d2d..afb4e5fbd 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetalang.h +++ b/sources/shiboken2/ApiExtractor/abstractmetalang.h @@ -72,7 +72,7 @@ public: Target }; - Documentation() {} + Documentation() = default; Documentation(const QString& value, Format fmt = Documentation::Native) : m_data(value.trimmed()), m_format(fmt) {} @@ -105,9 +105,10 @@ private: class AbstractMetaAttributes { - Q_DISABLE_COPY(AbstractMetaAttributes) Q_GADGET public: + Q_DISABLE_COPY(AbstractMetaAttributes) + AbstractMetaAttributes(); virtual ~AbstractMetaAttributes(); @@ -592,8 +593,7 @@ public: } void replaceType(AbstractMetaType *type) { - if (m_type) - delete m_type; + delete m_type; m_type = type; } @@ -902,8 +902,7 @@ public: void replaceType(AbstractMetaType *type) { - if (m_type) - delete m_type; + delete m_type; m_type = type; } @@ -1132,7 +1131,7 @@ QDebug operator<<(QDebug d, const AbstractMetaFunction *af); class AbstractMetaEnumValue { public: - AbstractMetaEnumValue() {} + AbstractMetaEnumValue() = default; EnumValue value() const { @@ -1507,7 +1506,7 @@ public: m_innerClasses << cl; } - void setInnerClasses(AbstractMetaClassList innerClasses) + void setInnerClasses(const AbstractMetaClassList &innerClasses) { m_innerClasses = innerClasses; } |