summaryrefslogtreecommitdiffstats
path: root/src/common-lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/common-lib')
-rw-r--r--src/common-lib/configcache.h1
-rw-r--r--src/common-lib/configcache_p.h4
-rw-r--r--src/common-lib/crashhandler.cpp4
-rw-r--r--src/common-lib/exception.cpp24
-rw-r--r--src/common-lib/exception.h4
-rw-r--r--src/common-lib/logging.cpp9
-rw-r--r--src/common-lib/logging.h5
-rw-r--r--src/common-lib/qtyaml.cpp6
-rw-r--r--src/common-lib/utilities.h2
9 files changed, 40 insertions, 19 deletions
diff --git a/src/common-lib/configcache.h b/src/common-lib/configcache.h
index 7b7613be..10e58924 100644
--- a/src/common-lib/configcache.h
+++ b/src/common-lib/configcache.h
@@ -80,6 +80,7 @@ public:
ConfigCache(const QStringList &configFiles, const QString &cacheBaseName, std::array<char, 4> typeId,
quint32 typeVersion = 0, Options options = None)
: AbstractConfigCache(configFiles, cacheBaseName, typeId, typeVersion, options)
+ , m_adaptor()
{ }
~ConfigCache() override
diff --git a/src/common-lib/configcache_p.h b/src/common-lib/configcache_p.h
index 50f44ee2..5c656593 100644
--- a/src/common-lib/configcache_p.h
+++ b/src/common-lib/configcache_p.h
@@ -36,8 +36,8 @@ class ConfigCachePrivate
{
public:
AbstractConfigCache::Options options;
- quint32 typeId;
- quint32 typeVersion;
+ quint32 typeId = 0;
+ quint32 typeVersion = 0;
QStringList rawFiles;
QString cacheBaseName;
QVector<ConfigCacheEntry> cache;
diff --git a/src/common-lib/crashhandler.cpp b/src/common-lib/crashhandler.cpp
index 427e036a..8c25d88b 100644
--- a/src/common-lib/crashhandler.cpp
+++ b/src/common-lib/crashhandler.cpp
@@ -351,9 +351,9 @@ static void initBacktraceUnix()
throw;
} catch (const std::exception &exc) {
snprintf(buffer, sizeof(buffer), "uncaught exception of type %s (%s)", typeName, exc.what());
- } catch (const std::exception *exc) {
+ } catch (const std::exception *exc) { // AXIVION Line Qt-Generic-ThrowByValueCatchByReference: cope with anything
snprintf(buffer, sizeof(buffer), "uncaught exception of type %s (%s)", typeName, exc->what());
- } catch (const char *exc) {
+ } catch (const char *exc) { // AXIVION Line Qt-Generic-ThrowByValueCatchByReference: cope with anything
snprintf(buffer, sizeof(buffer), "uncaught exception of type 'const char *' (%s)", exc);
} catch (...) {
snprintf(buffer, sizeof(buffer), "uncaught exception of type %s", typeName);
diff --git a/src/common-lib/exception.cpp b/src/common-lib/exception.cpp
index 2421a18c..175aa91c 100644
--- a/src/common-lib/exception.cpp
+++ b/src/common-lib/exception.cpp
@@ -41,15 +41,33 @@ Exception::Exception(const QFileDevice &file, const char *errorString) noexcept
{ }
Exception::Exception(const Exception &copy) noexcept
- : m_errorCode(copy.m_errorCode)
+ : QException(copy)
+ , m_errorCode(copy.m_errorCode)
, m_errorString(copy.m_errorString)
{ }
+Exception &Exception::operator=(const Exception &copy) noexcept
+{
+ if (this != &copy) {
+ QException::operator=(copy);
+ m_errorCode = copy.m_errorCode;
+ m_errorString = copy.m_errorString;
+ }
+ return *this;
+}
+
Exception::Exception(Exception &&move) noexcept
- : m_errorCode(move.m_errorCode)
+ : QException(move)
+ , m_errorCode(move.m_errorCode)
, m_errorString(move.m_errorString)
+{ }
+
+Exception &Exception::operator=(Exception &&move) noexcept
{
- std::swap(m_whatBuffer, move.m_whatBuffer);
+ QException::operator=(move);
+ m_errorCode = move.m_errorCode;
+ m_errorString = move.m_errorString;
+ return *this;
}
Exception::~Exception() noexcept
diff --git a/src/common-lib/exception.h b/src/common-lib/exception.h
index c1959ab3..4383c8d1 100644
--- a/src/common-lib/exception.h
+++ b/src/common-lib/exception.h
@@ -29,7 +29,9 @@ public:
explicit Exception(const QFileDevice &file, const char *errorString) noexcept;
Exception(const Exception &copy) noexcept;
+ Exception &operator=(const Exception &copy) noexcept;
Exception(Exception &&move) noexcept;
+ Exception &operator=(Exception &&move) noexcept;
~Exception() noexcept override;
@@ -74,7 +76,7 @@ public:
// this will generate compiler errors if there's no suitable QString::arg(const Ts &) overload
template <typename... Ts> Exception &arg(const Ts & ...ts) noexcept
{
- m_errorString = m_errorString.arg(ts...);
+ m_errorString = m_errorString.arg(ts...); // AXIVION Line Qt-QStringArg: Axivion thinks ts is an int
return *this;
}
diff --git a/src/common-lib/logging.cpp b/src/common-lib/logging.cpp
index 846ff624..14688166 100644
--- a/src/common-lib/logging.cpp
+++ b/src/common-lib/logging.cpp
@@ -108,6 +108,7 @@ static constexpr const char *s_defaultSystemUiDltDescription = "Qt Application M
\endtable
//! [am-logging-categories]
*/
+// AXIVION DISABLE Qt-NonPodGlobalStatic
QDLT_REGISTER_CONTEXT_ON_FIRST_USE(true)
QDLT_REGISTER_APPLICATION(s_defaultSystemUiDltId, s_defaultSystemUiDltDescription)
QDLT_LOGGING_CATEGORY(LogSystem, "am.system", "SYS", "General system messages")
@@ -125,13 +126,16 @@ QDLT_LOGGING_CATEGORY(LogCache, "am.cache", "CACH", "Cache sub-system messages")
QDLT_LOGGING_CATEGORY(LogDBus, "am.dbus", "DBUS", "D-Bus related messages")
QDLT_LOGGING_CATEGORY(LogGeneral, "general", "GEN", "Messages without dedicated context ID (fallback)")
QDLT_FALLBACK_CATEGORY(LogGeneral)
-
+// AXIVION ENABLE Qt-NonPodGlobalStatic
struct DeferredMessage
{
DeferredMessage(QtMsgType _msgType, const QMessageLogContext &_context, const QString &_message);
+ DeferredMessage(const DeferredMessage &copy) = delete;
DeferredMessage(DeferredMessage &&other) noexcept;
~DeferredMessage();
+ DeferredMessage &operator=(const DeferredMessage &copy) = delete;
+ DeferredMessage &operator=(DeferredMessage &&move) = delete;
QtMsgType msgType;
int line;
@@ -576,7 +580,4 @@ void Logging::logToDlt(QtMsgType msgType, const QMessageLogContext &context, con
#endif
}
-void am_trace(QDebug)
-{ }
-
QT_END_NAMESPACE_AM
diff --git a/src/common-lib/logging.h b/src/common-lib/logging.h
index 938ab429..818984cb 100644
--- a/src/common-lib/logging.h
+++ b/src/common-lib/logging.h
@@ -65,9 +65,8 @@ private:
static void deferredMessageHandler(QtMsgType msgType, const QMessageLogContext &context, const QString &message);
};
-void am_trace(QDebug);
-template <typename T, typename... TRest> void am_trace(QDebug dbg, T t, TRest... trest)
-{ dbg << t; am_trace(dbg, trest...); }
+template <typename... Ts> void am_trace(QDebug dbg, Ts &&... ts)
+{ (dbg << ... << ts); }
#define AM_TRACE(category, ...) \
for (bool qt_category_enabled = category().isDebugEnabled(); qt_category_enabled; qt_category_enabled = false) { \
diff --git a/src/common-lib/qtyaml.cpp b/src/common-lib/qtyaml.cpp
index 059e681d..272b950f 100644
--- a/src/common-lib/qtyaml.cpp
+++ b/src/common-lib/qtyaml.cpp
@@ -153,8 +153,8 @@ public:
QString sourceDir;
QByteArray data;
bool parsedHeader = false;
- yaml_parser_t parser;
- yaml_event_t event;
+ yaml_parser_t parser; // AXIVION Line Qt-Generic-InitializeAllFieldsInConstructor: not possible
+ yaml_event_t event; // AXIVION Line Qt-Generic-InitializeAllFieldsInConstructor: not possible
};
@@ -332,7 +332,7 @@ QVariant YamlParser::parseScalar() const
struct StaticMapping
{
QString text;
- ValueIndex index;
+ ValueIndex index = ValueNull;
};
static const QVariant staticValues[] = {
diff --git a/src/common-lib/utilities.h b/src/common-lib/utilities.h
index 2201a6e3..db0bc7c4 100644
--- a/src/common-lib/utilities.h
+++ b/src/common-lib/utilities.h
@@ -106,7 +106,7 @@ template <typename T>
QVector<T *> loadPlugins(const char *type, const QStringList &files) noexcept(false)
{
QVector<T *> result;
- auto plugins = loadPlugins_helper(type, files, qobject_interface_iid<T *>());
+ const auto plugins = loadPlugins_helper(type, files, qobject_interface_iid<T *>());
for (auto p : plugins)
result << qobject_cast<T *>(p);
return result;