From 0a6464178bbce3dd0ea99255224e5a1ea33e7679 Mon Sep 17 00:00:00 2001 From: Ake Hedman Date: Thu, 12 Dec 2024 23:20:53 +0100 Subject: [PATCH] Fixed some annoying warnings --- src/common/sockettcp.c | 2 +- src/vscp/common/mdf.cpp | 24 +- src/vscp/common/register.cpp | 36 +- src/vscp/common/vscp-bootdevice-pic1.cpp | 6 +- src/vscp/common/vscp-bootdevice-vscp.cpp | 425 +++++++++++++++------- src/vscp/common/vscp-bootdevice-vscp.h | 2 +- src/vscp/common/vscp-client-base.cpp | 4 +- src/vscp/common/vscp-client-base.h | 31 +- src/vscp/common/vscp-client-canal.cpp | 12 +- src/vscp/common/vscp-client-mqtt.cpp | 18 +- src/vscp/common/vscp-client-multicast.cpp | 20 +- src/vscp/common/vscp-client-socketcan.cpp | 93 +++-- src/vscp/common/vscp-client-socketcan.h | 22 +- src/vscp/common/vscp-client-tcp.cpp | 2 +- src/vscp/common/vscp-client-udp.cpp | 20 +- src/vscp/common/vscp-client-ws1.cpp | 8 +- src/vscp/common/vscp-client-ws2.cpp | 36 +- src/vscp/common/vscpcanaldeviceif.cpp | 4 +- src/vscp/common/vscphelper.cpp | 18 +- src/vscp/common/vscphelper.h | 2 +- 20 files changed, 520 insertions(+), 265 deletions(-) diff --git a/src/common/sockettcp.c b/src/common/sockettcp.c index 5d5885e63..ea66e13f4 100644 --- a/src/common/sockettcp.c +++ b/src/common/sockettcp.c @@ -2572,7 +2572,7 @@ stcp_connect_remote_impl( const char *host, int port, struct stcp_secure_options *secure_options, int bUseSSL, - int timeout ) + int /*timeout*/ ) { struct stcp_connection *conn = NULL; int sock; diff --git a/src/vscp/common/mdf.cpp b/src/vscp/common/mdf.cpp index 50d80a256..f85102265 100644 --- a/src/vscp/common/mdf.cpp +++ b/src/vscp/common/mdf.cpp @@ -1827,7 +1827,7 @@ void CMDF::writeMap_json(std::ofstream &fout, std::map *pmap, const std::string &tag, - bool bCommaAtEnd) + bool /*bCommaAtEnd*/) { if ((nullptr != pmap) && pmap->size()) { fout << "," << std::endl; @@ -1919,7 +1919,7 @@ CMDF::save_xml(const std::string &path) } if ((cnt = pManufacturer->getPhoneObjCount())) { - for (int i = 0; i < cnt; i++) { + for (size_t i = 0; i < cnt; i++) { CMDF_Item *pitem = pManufacturer->getPhoneObj(i); if (nullptr != pitem) { fout << "" << std::endl; @@ -1932,7 +1932,7 @@ CMDF::save_xml(const std::string &path) } if ((cnt = pManufacturer->getFaxObjCount())) { - for (int i = 0; i < cnt; i++) { + for (size_t i = 0; i < cnt; i++) { CMDF_Item *pitem = pManufacturer->getFaxObj(i); if (nullptr != pitem) { fout << "" << std::endl; @@ -1945,7 +1945,7 @@ CMDF::save_xml(const std::string &path) } if ((cnt = pManufacturer->getEmailObjCount())) { - for (int i = 0; i < cnt; i++) { + for (size_t i = 0; i < cnt; i++) { CMDF_Item *pitem = pManufacturer->getEmailObj(i); if (nullptr != pitem) { fout << "" << std::endl; @@ -1958,7 +1958,7 @@ CMDF::save_xml(const std::string &path) } if ((cnt = pManufacturer->getWebObjCount())) { - for (int i = 0; i < cnt; i++) { + for (size_t i = 0; i < cnt; i++) { CMDF_Item *pitem = pManufacturer->getWebObj(i); if (nullptr != pitem) { fout << "" << std::endl; @@ -1971,7 +1971,7 @@ CMDF::save_xml(const std::string &path) } if ((cnt = pManufacturer->getSocialObjCount())) { - for (int i = 0; i < cnt; i++) { + for (size_t i = 0; i < cnt; i++) { CMDF_Item *pitem = pManufacturer->getSocialObj(i); if (nullptr != pitem) { fout << "" << std::endl; @@ -1999,7 +1999,7 @@ CMDF::save_xml(const std::string &path) std::deque *pPictureQueue = getPictureObjList(); if ((nullptr != pPictureQueue) && (pPictureQueue->size())) { - size_t pos = 0; + //size_t pos = 0; for (auto it = pPictureQueue->begin(); it != pPictureQueue->end(); it++) { CMDF_Picture *pPicture = *it; fout << "getName() << "\" "; @@ -2013,7 +2013,7 @@ CMDF::save_xml(const std::string &path) std::deque *pVideoQueue = getVideoObjList(); if ((nullptr != pVideoQueue) && (pVideoQueue->size())) { - size_t pos = 0; + //size_t pos = 0; for (auto it = pVideoQueue->begin(); it != pVideoQueue->end(); it++) { CMDF_Video *pVideo = *it; fout << "