summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-08 11:32:24 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-08 11:32:29 +0200
commit8b0120194e5ab01aa8344d781782dd818a262f02 (patch)
tree034e6be56a535ae922f475afdc2819a43e294e31
parent05f708f025018a96d3fa6c49ea0dc94f5131af23 (diff)
parent2d67519c9d0a67ea5526a481e30ec2cf5b464694 (diff)
Merge "Merge remote-tracking branch 'origin/5.12' into 5.13"
-rw-r--r--config.tests/compiletest/compiletest.pro5
-rw-r--r--config.tests/compiletest/main.cpp32
-rw-r--r--config.tests/compiletest/main_less_5.cpp32
-rw-r--r--configure.json5
-rw-r--r--qtknx.pro5
-rw-r--r--src/knx/configure.json37
-rw-r--r--src/knx/core/qknxbytearray.cpp8
-rw-r--r--src/knx/core/qknxbytearray.h6
-rw-r--r--src/knx/knxproj/qknxgroupaddressinfos.cpp10
-rw-r--r--src/knx/netip/qknxnetipstruct.cpp20
-rw-r--r--src/knx/netip/qknxnetipstruct.h23
-rw-r--r--src/knx/netip/qknxnetipstructheader.cpp16
-rw-r--r--src/knx/netip/qknxnetipstructheader.h44
-rw-r--r--src/knx/qknxcontrolfield.cpp8
-rw-r--r--src/knx/qknxcontrolfield.h9
15 files changed, 73 insertions, 187 deletions
diff --git a/config.tests/compiletest/compiletest.pro b/config.tests/compiletest/compiletest.pro
deleted file mode 100644
index 66f8581..0000000
--- a/config.tests/compiletest/compiletest.pro
+++ /dev/null
@@ -1,5 +0,0 @@
- gcc:!clang:lessThan(QT_GCC_MAJOR_VERSION, 5) {
- SOURCES += main_less_5.cpp
-} else {
- SOURCES += main.cpp
-}
diff --git a/config.tests/compiletest/main.cpp b/config.tests/compiletest/main.cpp
deleted file mode 100644
index 6afec07..0000000
--- a/config.tests/compiletest/main.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/******************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtKnx module.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-******************************************************************************/
-
-int main(int /*argc*/, char** /*argv*/)
-{
- return 0;
-}
diff --git a/config.tests/compiletest/main_less_5.cpp b/config.tests/compiletest/main_less_5.cpp
deleted file mode 100644
index f9bf68f..0000000
--- a/config.tests/compiletest/main_less_5.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/******************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtKnx module.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-******************************************************************************/
-
-int main(int /*argc*/, char** /*argv*/)
-{
- return 0 /* forcibly broken compile test */
-}
diff --git a/configure.json b/configure.json
deleted file mode 100644
index 78a1945..0000000
--- a/configure.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "subconfigs": [
- "src/knx"
- ]
-}
diff --git a/qtknx.pro b/qtknx.pro
index db1bea4..118b159 100644
--- a/qtknx.pro
+++ b/qtknx.pro
@@ -6,8 +6,3 @@ requires(!integrity)
load(configure)
load(qt_parts)
-
-include($$OUT_PWD/src/knx/qtknx-config.pri)
-QT_FOR_CONFIG += knx-private
-
-requires(qtConfig(compiletest))
diff --git a/src/knx/configure.json b/src/knx/configure.json
deleted file mode 100644
index 92c66b0..0000000
--- a/src/knx/configure.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "module": "knx",
- "testDir": "../../config.tests",
-
- "tests": {
- "compiletest": {
- "label": "Minimum compiler version",
- "type": "compile",
- "test": "compiletest"
- }
- },
-
- "features": {
- "compiletest": {
- "label": "Minimum compiler version detected",
- "condition": "tests.compiletest",
- "output": [ "privateFeature" ]
- }
- },
-
- "report": [
- {
- "type": "note",
- "condition": "!features.compiletest",
- "message": "QtKnx: Your compiler is not officially supported or was not detected properly."
- }
- ],
-
- "summary": [
- {
- "section": "Qt KNX",
- "entries": [
- "compiletest"
- ]
- }
- ]
-}
diff --git a/src/knx/core/qknxbytearray.cpp b/src/knx/core/qknxbytearray.cpp
index 6a573d6..a93e3fa 100644
--- a/src/knx/core/qknxbytearray.cpp
+++ b/src/knx/core/qknxbytearray.cpp
@@ -259,18 +259,18 @@ void QKnxByteArray::resize(int size)
*/
/*!
- \fn void QKnxByteArray::set(int i, quint8 value)
+ \fn void QKnxByteArray::set(int i, quint8 val)
- Sets the character at the index position \a i in the byte array to \a value.
+ Sets the character at the index position \a i in the byte array to \a val.
\a i must be a valid index position in the byte array (that is, between
0 and the value returned by size()).
*/
/*!
- \fn void QKnxByteArray::setValue(int i, quint8 value)
+ \fn void QKnxByteArray::setValue(int i, quint8 val)
- Sets the value at the index position \a i in the byte array to \a value.
+ Sets the value at the index position \a i in the byte array to \a val.
If the index \a i is out of bounds, the function does nothing. If you
are certain that \a i is within bounds, you can use set() instead, which
diff --git a/src/knx/core/qknxbytearray.h b/src/knx/core/qknxbytearray.h
index 4f1fdb1..f6feba5 100644
--- a/src/knx/core/qknxbytearray.h
+++ b/src/knx/core/qknxbytearray.h
@@ -92,11 +92,11 @@ public:
void resize(int size);
inline quint8 at(int i) const { return m_bytes.at(i); }
- inline void set(int i, quint8 value) { m_bytes[i] = value; }
+ inline void set(int i, quint8 val) { m_bytes[i] = val; }
- inline void setValue(int i, quint8 value)
+ inline void setValue(int i, quint8 val)
{
- if (i >= 0 && i < m_bytes.size()) m_bytes[i] = value;
+ if (i >= 0 && i < m_bytes.size()) m_bytes[i] = val;
}
inline quint8 value(int i, quint8 defaultValue = {}) const
{
diff --git a/src/knx/knxproj/qknxgroupaddressinfos.cpp b/src/knx/knxproj/qknxgroupaddressinfos.cpp
index 510fcab..b82c06f 100644
--- a/src/knx/knxproj/qknxgroupaddressinfos.cpp
+++ b/src/knx/knxproj/qknxgroupaddressinfos.cpp
@@ -142,7 +142,7 @@ bool QKnxGroupAddressInfosPrivate::readProject(const QKnxProject &project)
}
projects.insert(project.Id, info);
} else {
- projects.insert(project.Id, {}); // projects can have empty installations
+ projects.insert(project.Id, { QString(), {} }); // projects can have empty installations
}
return status == QKnxGroupAddressInfos::Status::NoError;
@@ -369,7 +369,7 @@ QVector<QString> QKnxGroupAddressInfos::projectIds() const
*/
QString QKnxGroupAddressInfos::projectName(const QString &projectId) const
{
- return d_ptr->projects.value(projectId, {}).name;
+ return d_ptr->projects.value(projectId, { QString(), {} }).name;
}
/*!
@@ -377,7 +377,7 @@ QString QKnxGroupAddressInfos::projectName(const QString &projectId) const
*/
QVector<QString> QKnxGroupAddressInfos::installations(const QString &projectId) const
{
- return d_ptr->projects.value(projectId, {}).installations.keys().toVector();
+ return d_ptr->projects.value(projectId, { QString(), {} }).installations.keys().toVector();
}
/*!
@@ -386,7 +386,7 @@ QVector<QString> QKnxGroupAddressInfos::installations(const QString &projectId)
*/
qint32 QKnxGroupAddressInfos::infoCount(const QString &projectId, const QString &installation) const
{
- const auto installations = d_ptr->projects.value(projectId, {}).installations;
+ const auto installations = d_ptr->projects.value(projectId, { QString(), {} }).installations;
if (installations.isEmpty())
return -1;
@@ -404,7 +404,7 @@ QVector<QKnxGroupAddressInfo> QKnxGroupAddressInfos::addressInfos(const QString
{
if (projectId.isEmpty())
return {};
- return d_ptr->projects.value(projectId, {}).installations.value(installation);
+ return d_ptr->projects.value(projectId, { QString(), {} }).installations.value(installation);
}
/*!
diff --git a/src/knx/netip/qknxnetipstruct.cpp b/src/knx/netip/qknxnetipstruct.cpp
index affe641..124700f 100644
--- a/src/knx/netip/qknxnetipstruct.cpp
+++ b/src/knx/netip/qknxnetipstruct.cpp
@@ -156,17 +156,17 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn template <typename CodeType> QKnxNetIpStruct<CodeType>::QKnxNetIpStruct(CodeType code, const QKnxByteArray &data = {})
+ \fn template <typename CodeType> QKnxNetIpStruct<CodeType>::QKnxNetIpStruct(CodeType codeType, const QKnxByteArray &dataField = {})
- Creates a new KNXnet/IP structure with the specified \a code and payload
- \a data.
+ Creates a new KNXnet/IP structure with the specified \a codeType and payload
+ \a dataField.
*/
/*!
- \fn template <typename CodeType> QKnxNetIpStruct<CodeType>::QKnxNetIpStruct(const QKnxNetIpStructHeader<CodeType> &header, const QKnxByteArray &data = {})
+ \fn template <typename CodeType> QKnxNetIpStruct<CodeType>::QKnxNetIpStruct(const QKnxNetIpStructHeader<CodeType> &headerField, const QKnxByteArray &dataField = {})
- Creates a new KNXnet/IP structure with the specified \a header and payload
- \a data.
+ Creates a new KNXnet/IP structure with the specified \a headerField and payload
+ \a dataField.
The header is expected to be fully set up and all values describing the
payload are expected to match the specified payload.
@@ -238,16 +238,16 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn template <typename CodeType> QKnxNetIpStruct<CodeType>::setData(const QKnxByteArray &data)
+ \fn template <typename CodeType> QKnxNetIpStruct<CodeType>::setData(const QKnxByteArray &dataField)
- Sets the data stored in the KNXnet/IP structure to \a data and updates the
+ Sets the data stored in the KNXnet/IP structure to \a dataField and updates the
data size accordingly.
*/
/*!
- \fn template <typename CodeType> QKnxNetIpStruct<CodeType>::setHeader(const QKnxNetIpStructHeader<CodeType> &header)
+ \fn template <typename CodeType> QKnxNetIpStruct<CodeType>::setHeader(const QKnxNetIpStructHeader<CodeType> &headerField)
- Sets the header stored in the KNXnet/IP structure to \a header.
+ Sets the header stored in the KNXnet/IP structure to \a headerField.
*/
/*!
diff --git a/src/knx/netip/qknxnetipstruct.h b/src/knx/netip/qknxnetipstruct.h
index 0662ef1..0e2d196 100644
--- a/src/knx/netip/qknxnetipstruct.h
+++ b/src/knx/netip/qknxnetipstruct.h
@@ -46,15 +46,16 @@ public:
QKnxNetIpStruct() = default;
~QKnxNetIpStruct() = default;
- QKnxNetIpStruct(CodeType code, const QKnxByteArray &data = {})
- : m_header(code)
+ QKnxNetIpStruct(CodeType codeType, const QKnxByteArray &dataField = {})
+ : m_header(codeType)
{
- setData(data);
+ setData(dataField);
}
- QKnxNetIpStruct(const QKnxNetIpStructHeader<CodeType> &header, const QKnxByteArray &data = {})
- : m_header(header)
- , m_data(data)
+ QKnxNetIpStruct(const QKnxNetIpStructHeader<CodeType> &headerField,
+ const QKnxByteArray &dataField = {})
+ : m_header(headerField)
+ , m_data(dataField)
{}
bool isNull() const
@@ -82,9 +83,9 @@ public:
return m_header;
}
- void setHeader(const QKnxNetIpStructHeader<CodeType> &header)
+ void setHeader(const QKnxNetIpStructHeader<CodeType> &headerField)
{
- m_header = header;
+ m_header = headerField;
}
CodeType code() const
@@ -102,10 +103,10 @@ public:
return m_data;
}
- void setData(const QKnxByteArray &data)
+ void setData(const QKnxByteArray &dataField)
{
- m_data = data;
- m_header.setDataSize(data.size());
+ m_data = dataField;
+ m_header.setDataSize(dataField.size());
}
QKnxByteArray bytes() const
diff --git a/src/knx/netip/qknxnetipstructheader.cpp b/src/knx/netip/qknxnetipstructheader.cpp
index 3d977f5..34f7fc2 100644
--- a/src/knx/netip/qknxnetipstructheader.cpp
+++ b/src/knx/netip/qknxnetipstructheader.cpp
@@ -64,19 +64,19 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn template <typename CodeType> QKnxNetIpStructHeader<CodeType>::QKnxNetIpStructHeader(CodeType code)
+ \fn template <typename CodeType> QKnxNetIpStructHeader<CodeType>::QKnxNetIpStructHeader(CodeType codeType)
Constructs a valid header object and sets the KNXnet/IP structure identifier
- to \a code.
+ to \a codeType.
\sa isValid(), code(), setCode()
*/
/*!
- \fn template <typename CodeType> QKnxNetIpStructHeader<CodeType>::QKnxNetIpStructHeader(CodeType code, quint16 dataSize)
+ \fn template <typename CodeType> QKnxNetIpStructHeader<CodeType>::QKnxNetIpStructHeader(CodeType codeType, quint16 dataFieldSize)
Constructs a valid header object and sets the KNXnet/IP structure identifier
- to \a code and the data size to \a dataSize and updates the header size and
+ to \a codeType and the data size to \a dataFieldSize and updates the header size and
total size accordingly.
\sa isValid(), code(), setCode(), dataSize(), setDataSize()
@@ -143,9 +143,9 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn template <typename CodeType> void QKnxNetIpStructHeader<CodeType>::setDataSize(quint16 dataSize)
+ \fn template <typename CodeType> void QKnxNetIpStructHeader<CodeType>::setDataSize(quint16 dataFieldSize)
- Sets the KNXnet/IP structure data size to \a dataSize and updates the
+ Sets the KNXnet/IP structure data size to \a dataFieldSize and updates the
header and total size accordingly.
*/
@@ -156,9 +156,9 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn template <typename CodeType> void QKnxNetIpStructHeader<CodeType>::setCode(CodeType code)
+ \fn template <typename CodeType> void QKnxNetIpStructHeader<CodeType>::setCode(CodeType codeType)
- Sets the KNXnet/IP structure's code identifier to \a code.
+ Sets the KNXnet/IP structure's code identifier to \a codeType.
*/
/*!
diff --git a/src/knx/netip/qknxnetipstructheader.h b/src/knx/netip/qknxnetipstructheader.h
index a808a86..e57cfe4 100644
--- a/src/knx/netip/qknxnetipstructheader.h
+++ b/src/knx/netip/qknxnetipstructheader.h
@@ -46,22 +46,22 @@ public:
QKnxNetIpStructHeader() = default;
~QKnxNetIpStructHeader() = default;
- explicit QKnxNetIpStructHeader(CodeType code)
- : QKnxNetIpStructHeader(code, 0)
+ explicit QKnxNetIpStructHeader(CodeType c)
+ : QKnxNetIpStructHeader(c, 0)
{}
- QKnxNetIpStructHeader(CodeType code, quint16 dataSize)
+ QKnxNetIpStructHeader(CodeType c, quint16 dataFieldSize)
{
- setCode(code);
- setDataSize(dataSize);
+ setCode(c);
+ setDataSize(dataFieldSize);
}
template <typename T = CodeType,
typename = typename std::enable_if<is_type<T, QKnxNetIp::SearchParameterType>::value>::type>
- QKnxNetIpStructHeader(CodeType code, quint16 dataSize, bool mandatory)
+ QKnxNetIpStructHeader(CodeType c, quint16 dSize, bool mandatory)
{
- setCode(code);
- setDataSize(dataSize);
+ setCode(c);
+ setDataSize(dSize);
setMandatory(mandatory);
}
@@ -97,21 +97,21 @@ public:
return totalSize() - size();
}
- void setDataSize(quint16 dataSize)
+ void setDataSize(quint16 dataFieldSize)
{
// 2.1.3 Structures: If the amount of data exceeds 252 octets, the length octet shall
// be 0xff and the next two octets shall contain the length as a 16 bit value. Then the
// structure data shall start at the fifth octet.
const auto tmp = code();
- setSize(dataSize > 0xfc ? 4 : 2);
+ setSize(dataFieldSize > 0xfc ? 4 : 2);
- if (dataSize > 0xfc) {
+ if (dataFieldSize > 0xfc) {
setByte(0, 0xff);
- setByte(1, quint8((dataSize + 4) >> 8));
- setByte(2, quint8(dataSize + 4));
+ setByte(1, quint8((dataFieldSize + 4) >> 8));
+ setByte(2, quint8(dataFieldSize + 4));
} else {
- setByte(0, quint8(dataSize + 2));
+ setByte(0, quint8(dataFieldSize + 2));
}
setCode(tmp);
}
@@ -121,9 +121,9 @@ public:
return codeType();
}
- void setCode(CodeType code)
+ void setCode(CodeType c)
{
- setCodeType(code);
+ setCodeType(c);
}
quint8 byte(quint8 index) const
@@ -197,9 +197,9 @@ public:
}
private:
- void setSize(quint8 size)
+ void setSize(quint8 structSize)
{
- m_bytes[0] = size;
+ m_bytes[0] = structSize;
}
void setByte(quint8 index, quint8 value)
@@ -227,24 +227,24 @@ private:
template<class T = CodeType>
typename std::enable_if<is_type<T, QKnxNetIp::SearchParameterType>::value, void>::type
- /* void */ setCodeType(CodeType code)
+ /* void */ setCodeType(CodeType c)
{
if (isNull()) {
setSize(2);
setByte(0, 2);
}
- setByte(size() - 1, (quint8(code) & ~(1 << 7)) | (quint8(isMandatory()) << 7));
+ setByte(size() - 1, (quint8(c) & ~(1 << 7)) | (quint8(isMandatory()) << 7));
}
template<class T = CodeType>
typename std::enable_if<!is_type<T, QKnxNetIp::SearchParameterType>::value, void>::type
- /* void */ setCodeType(CodeType code)
+ /* void */ setCodeType(CodeType c)
{
if (isNull()) {
setSize(2);
setByte(0, 2);
}
- setByte(size() - 1, quint8(code));
+ setByte(size() - 1, quint8(c));
}
template<class T = CodeType>
diff --git a/src/knx/qknxcontrolfield.cpp b/src/knx/qknxcontrolfield.cpp
index 6a10ad3..e6f9702 100644
--- a/src/knx/qknxcontrolfield.cpp
+++ b/src/knx/qknxcontrolfield.cpp
@@ -198,9 +198,9 @@ const std::bitset<8> gPriorityMask = 0x0c;
*/
/*!
- \fn QKnxControlField::setRepeat(QKnxControlField::Repeat repeat)
+ \fn QKnxControlField::setRepeat(QKnxControlField::Repeat rep)
- Sets the repetition flag to \a repeat.
+ Sets the repetition flag to \a rep.
*/
/*!
@@ -219,9 +219,9 @@ const std::bitset<8> gPriorityMask = 0x0c;
*/
/*!
- \fn QKnxControlField::setConfirm(QKnxControlField::Confirm confirm)
+ \fn QKnxControlField::setConfirm(QKnxControlField::Confirm conf)
- Sets the confirm flag to \a confirm.
+ Sets the confirm flag to \a conf.
*/
/*!
diff --git a/src/knx/qknxcontrolfield.h b/src/knx/qknxcontrolfield.h
index 02a0ddb..a418b79 100644
--- a/src/knx/qknxcontrolfield.h
+++ b/src/knx/qknxcontrolfield.h
@@ -77,8 +77,9 @@ public:
Q_ENUM(Repeat)
QKnxControlField::Repeat repeat() const // ### Qt6: Replace byte() with m_ctrl1
{ return static_cast<Repeat> (quint8(testBit(byte(), 5))); }
- void setRepeat(QKnxControlField::Repeat repeat) // ### Qt6: Replace byte() with m_ctrl1
- { m_ctrl1 = setBit(byte(), bool(static_cast<int> (repeat)), 5); }
+ void setRepeat(QKnxControlField::Repeat rep) // ### Qt6: Replace byte() with m_ctrl1
+ { m_ctrl1 = setBit(byte(), bool(static_cast<int> (rep)), 5); }
+
enum class Broadcast : quint8
{
@@ -121,8 +122,8 @@ public:
Q_ENUM(Confirm)
QKnxControlField::Confirm confirm() const // ### Qt6: Replace byte() with m_ctrl1
{ return static_cast<Confirm> (quint8(testBit(byte(), 0))); }
- void setConfirm(QKnxControlField::Confirm confirm) // ### Qt6: Replace byte() with m_ctrl1
- { m_ctrl1 = setBit(byte(), bool(static_cast<int> (confirm)), 0); }
+ void setConfirm(QKnxControlField::Confirm conf) // ### Qt6: Replace byte() with m_ctrl1
+ { m_ctrl1 = setBit(byte(), bool(static_cast<int> (conf)), 0); }
quint8 byte() const { return quint8(m_ctrl1.to_ulong()); }
QKnxByteArray bytes() const { return { byte() }; }