fix for older compilers

This commit is contained in:
John
2022-09-18 18:08:59 +02:00
parent 1a90cd874d
commit 7d8a87111a
3 changed files with 14 additions and 18 deletions
+11 -15
View File
@@ -237,11 +237,11 @@ KnxHandler::KnxHandler(UserInfo* userInfo, BusHandler* busHandler, MessageMap* m
continue;
}
m_subscribedGlobals[index] = dest|FLAG_READ;
m_subscribedGroups[dest|FLAG_READ] = {
.messageKey = 0,
.globalIndex = index,
.lengthFlag = lengthFlag,
};
groupInfo_t grpInfo;
grpInfo.messageKey = 0;
grpInfo.globalIndex = index;
grpInfo.lengthFlag = lengthFlag;
m_subscribedGroups[dest|FLAG_READ] = grpInfo;
globalCnt++;
}
logOtherInfo("knx", "parsed %d global and %d message assignments", globalCnt, messageCnt);
@@ -847,11 +847,11 @@ void KnxHandler::run() {
} // else: overwrite "write-read" with readable message
logOtherDebug("knx", "replacing write-read association %s to %4.4x", key.c_str(), dest);
}
m_subscribedGroups[subKey] = {
.messageKey = message->getKey(),
.fieldIndex = static_cast<uint8_t>(index),
.lengthFlag = lengthFlag,
};
groupInfo_t grpInfo;
grpInfo.messageKey = message->getKey();
grpInfo.globalIndex = static_cast<global_t>(index);
grpInfo.lengthFlag = lengthFlag;
m_subscribedGroups[subKey] = grpInfo;
m_subscribedMessages[message->getKey()].push_back(subKey);
logOtherDebug("knx", "added %s association %s to %4.4x", isWrite ? "write" : "read", key.c_str(), dest);
if (isWrite) {
@@ -860,11 +860,7 @@ void KnxHandler::run() {
subKey = static_cast<uint32_t>(dest | FLAG_READ);
sit = m_subscribedGroups.find(subKey);
if (sit == m_subscribedGroups.cend()) {
m_subscribedGroups[subKey] = {
.messageKey = message->getKey(),
.fieldIndex = static_cast<uint8_t>(index),
.lengthFlag = lengthFlag,
};
m_subscribedGroups[subKey] = grpInfo;
logOtherDebug("knx", "added write-read association %s to %4.4x", key.c_str(), dest);
}
}
+2 -2
View File
@@ -94,8 +94,8 @@ typedef union {
uint64_t value;
} dtlf_t;
#define DTLF_1BIT {.length = 0}
#define DTLF_8BIT {.length = 1}
#define DTLF_1BIT dtlf_t{.length = 0}
#define DTLF_8BIT dtlf_t{.length = 1}
/** type for global values not associated with an ebus message. */
enum global_t {
+1 -1
View File
@@ -152,7 +152,7 @@ SSLSocket* SSLSocket::connect(const string& host, const uint16_t& port, bool htt
time_t until = time(nullptr) + (timeout <= 3 ? 3 : timeout); // at least 3 seconds
if (!https) {
do {
bio = BIO_new_connect(hostPort.c_str());
bio = BIO_new_connect((char*)hostPort.c_str());
if (isError("connect", bio)) {
break;
}