Skip to content

Commit 0a64641

Browse files
Fixed some annoying warnings
1 parent b1f6af3 commit 0a64641

20 files changed

+520
-265
lines changed

src/common/sockettcp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2572,7 +2572,7 @@ stcp_connect_remote_impl( const char *host,
25722572
int port,
25732573
struct stcp_secure_options *secure_options,
25742574
int bUseSSL,
2575-
int timeout )
2575+
int /*timeout*/ )
25762576
{
25772577
struct stcp_connection *conn = NULL;
25782578
int sock;

src/vscp/common/mdf.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,7 +1827,7 @@ void
18271827
CMDF::writeMap_json(std::ofstream &fout,
18281828
std::map<std::string, std::string> *pmap,
18291829
const std::string &tag,
1830-
bool bCommaAtEnd)
1830+
bool /*bCommaAtEnd*/)
18311831
{
18321832
if ((nullptr != pmap) && pmap->size()) {
18331833
fout << "," << std::endl;
@@ -1919,7 +1919,7 @@ CMDF::save_xml(const std::string &path)
19191919
}
19201920

19211921
if ((cnt = pManufacturer->getPhoneObjCount())) {
1922-
for (int i = 0; i < cnt; i++) {
1922+
for (size_t i = 0; i < cnt; i++) {
19231923
CMDF_Item *pitem = pManufacturer->getPhoneObj(i);
19241924
if (nullptr != pitem) {
19251925
fout << "<telephone>" << std::endl;
@@ -1932,7 +1932,7 @@ CMDF::save_xml(const std::string &path)
19321932
}
19331933

19341934
if ((cnt = pManufacturer->getFaxObjCount())) {
1935-
for (int i = 0; i < cnt; i++) {
1935+
for (size_t i = 0; i < cnt; i++) {
19361936
CMDF_Item *pitem = pManufacturer->getFaxObj(i);
19371937
if (nullptr != pitem) {
19381938
fout << "<fax>" << std::endl;
@@ -1945,7 +1945,7 @@ CMDF::save_xml(const std::string &path)
19451945
}
19461946

19471947
if ((cnt = pManufacturer->getEmailObjCount())) {
1948-
for (int i = 0; i < cnt; i++) {
1948+
for (size_t i = 0; i < cnt; i++) {
19491949
CMDF_Item *pitem = pManufacturer->getEmailObj(i);
19501950
if (nullptr != pitem) {
19511951
fout << "<email>" << std::endl;
@@ -1958,7 +1958,7 @@ CMDF::save_xml(const std::string &path)
19581958
}
19591959

19601960
if ((cnt = pManufacturer->getWebObjCount())) {
1961-
for (int i = 0; i < cnt; i++) {
1961+
for (size_t i = 0; i < cnt; i++) {
19621962
CMDF_Item *pitem = pManufacturer->getWebObj(i);
19631963
if (nullptr != pitem) {
19641964
fout << "<web>" << std::endl;
@@ -1971,7 +1971,7 @@ CMDF::save_xml(const std::string &path)
19711971
}
19721972

19731973
if ((cnt = pManufacturer->getSocialObjCount())) {
1974-
for (int i = 0; i < cnt; i++) {
1974+
for (size_t i = 0; i < cnt; i++) {
19751975
CMDF_Item *pitem = pManufacturer->getSocialObj(i);
19761976
if (nullptr != pitem) {
19771977
fout << "<social>" << std::endl;
@@ -1999,7 +1999,7 @@ CMDF::save_xml(const std::string &path)
19991999

20002000
std::deque<CMDF_Picture *> *pPictureQueue = getPictureObjList();
20012001
if ((nullptr != pPictureQueue) && (pPictureQueue->size())) {
2002-
size_t pos = 0;
2002+
//size_t pos = 0;
20032003
for (auto it = pPictureQueue->begin(); it != pPictureQueue->end(); it++) {
20042004
CMDF_Picture *pPicture = *it;
20052005
fout << "<picture name=\"" << pPicture->getName() << "\" ";
@@ -2013,7 +2013,7 @@ CMDF::save_xml(const std::string &path)
20132013

20142014
std::deque<CMDF_Video *> *pVideoQueue = getVideoObjList();
20152015
if ((nullptr != pVideoQueue) && (pVideoQueue->size())) {
2016-
size_t pos = 0;
2016+
//size_t pos = 0;
20172017
for (auto it = pVideoQueue->begin(); it != pVideoQueue->end(); it++) {
20182018
CMDF_Video *pVideo = *it;
20192019
fout << "<video name=\"" << pVideo->getName() << "\" ";
@@ -2027,7 +2027,7 @@ CMDF::save_xml(const std::string &path)
20272027

20282028
std::deque<CMDF_Manual *> *pManualQueue = getManualObjList();
20292029
if ((nullptr != pManualQueue) && (pManualQueue->size())) {
2030-
size_t pos = 0;
2030+
//size_t pos = 0;
20312031
for (auto it = pManualQueue->begin(); it != pManualQueue->end(); it++) {
20322032
CMDF_Manual *pManual = *it;
20332033
fout << "<manual name=\"" << pManual->getName() << "\" ";
@@ -2042,7 +2042,7 @@ CMDF::save_xml(const std::string &path)
20422042

20432043
std::deque<CMDF_Firmware *> *pFirmwareQueue = getFirmwareObjList();
20442044
if ((nullptr != pFirmwareQueue) && (pFirmwareQueue->size())) {
2045-
size_t pos = 0;
2045+
//size_t pos = 0;
20462046
for (auto it = pFirmwareQueue->begin(); it != pFirmwareQueue->end(); it++) {
20472047
CMDF_Firmware *pFirmware = *it;
20482048
fout << "<firmware name=\"" << pFirmware->getName() << "\" ";
@@ -2065,7 +2065,7 @@ CMDF::save_xml(const std::string &path)
20652065

20662066
std::deque<CMDF_Driver *> *pDriverQueue = getDriverObjList();
20672067
if ((nullptr != pDriverQueue) && (pDriverQueue->size())) {
2068-
size_t pos = 0;
2068+
//size_t pos = 0;
20692069
for (auto it = pDriverQueue->begin(); it != pDriverQueue->end(); it++) {
20702070
CMDF_Driver *pDriver = *it;
20712071
fout << "<driver name=\"" << pDriver->getName() << "\" ";
@@ -2113,7 +2113,7 @@ CMDF::save_xml(const std::string &path)
21132113
// get pages
21142114
std::set<uint16_t> pages;
21152115
std::deque<CMDF_Register *> *pregs = getRegisterObjList();
2116-
uint32_t nPageCnt = getPages(pages);
2116+
//uint32_t nPageCnt = getPages(pages);
21172117

21182118
// Go throu pages
21192119
for (auto itr : pages) {

src/vscp/common/register.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ vscp_readLevel1Register(CVscpClient &client,
7979
int rv = VSCP_ERROR_ERROR;
8080
vscpEventEx ex;
8181

82-
CVscpClient::connType conntype = client.getType();
82+
//CVscpClient::connType conntype = client.getType();
8383
uint8_t nickname = guidNode.getNickname();
8484
uint8_t ifoffset = guidInterface.isNULL() ? 0 : 16;
8585

@@ -160,7 +160,7 @@ vscp_writeLevel1Register(CVscpClient &client,
160160
{
161161
int rv = VSCP_ERROR_ERROR;
162162
vscpEventEx ex;
163-
CVscpClient::connType conntype = client.getType();
163+
//CVscpClient::connType conntype = client.getType();
164164
uint8_t nickname = guidNode.getNickname();
165165
uint8_t ifoffset = guidInterface.isNULL() ? 0 : 16;
166166

@@ -247,7 +247,7 @@ vscp_readLevel1RegisterBlock(CVscpClient &client,
247247
int rv = VSCP_ERROR_ERROR;
248248
uint8_t rcvcnt = 0; // Number of registers read
249249
vscpEventEx ex;
250-
CVscpClient::connType conntype = client.getType();
250+
//CVscpClient::connType conntype = client.getType();
251251
uint8_t nickname = guidNode.getNickname();
252252
uint8_t ifoffset = guidInterface.isNULL() ? 0 : 16;
253253

@@ -374,13 +374,13 @@ vscp_writeLevel1RegisterBlock(CVscpClient &client,
374374
uint32_t timeout)
375375
{
376376
int rv = VSCP_ERROR_SUCCESS;
377-
CVscpClient::connType conntype = client.getType();
377+
//CVscpClient::connType conntype = client.getType();
378378
uint8_t nickname = guidNode.getNickname();
379379
uint8_t ifoffset = guidInterface.isNULL() ? 0 : 16;
380380
int reg = -99;
381381
int count = 0;
382382
vscpEventEx ex;
383-
uint8_t offset_data = 0;
383+
//uint8_t offset_data = 0;
384384
std::map<uint8_t, uint8_t> startmap;
385385

386386
// The startregs map contains reg, count for each sequence start
@@ -439,7 +439,7 @@ vscp_writeLevel1RegisterBlock(CVscpClient &client,
439439
}
440440

441441
uint32_t startTime = vscp_getMsTimeStamp();
442-
uint32_t callbackTime = vscp_getMsTimeStamp();
442+
//uint32_t callbackTime = vscp_getMsTimeStamp();
443443

444444
// Wait for reponse
445445

@@ -598,7 +598,7 @@ vscp_scanSlowForDevices(CVscpClient &client,
598598
uint8_t offset = guidIf.isNULL() ? 0 : 16;
599599
int rv = VSCP_ERROR_SUCCESS;
600600
vscpEventEx ex;
601-
CVscpClient::connType conntype = client.getType();
601+
//CVscpClient::connType conntype = client.getType();
602602

603603
memset(&ex, 0, sizeof(vscpEventEx));
604604
ex.vscp_class = VSCP_CLASS1_PROTOCOL + (guidIf.isNULL() ? 0 : 512);
@@ -1035,7 +1035,7 @@ vscp_getDeviceInfoHtml(CMDF &mdf, CStandardRegisters &stdregs)
10351035

10361036
html += "<br><b>Pictures</b><ul>";
10371037

1038-
for (int i = 0; i < mdf.getPictureCount(); i++) {
1038+
for (size_t i = 0; i < mdf.getPictureCount(); i++) {
10391039
html += "<li><a href=\"";
10401040
html += mdf.getPictureObj(i)->getUrl();
10411041
html += "\">";
@@ -1056,7 +1056,7 @@ vscp_getDeviceInfoHtml(CMDF &mdf, CStandardRegisters &stdregs)
10561056

10571057
html += "<br><b>Videos</b><ul>";
10581058

1059-
for (int i = 0; i < mdf.getVideoCount(); i++) {
1059+
for (size_t i = 0; i < mdf.getVideoCount(); i++) {
10601060
html += "<li><a href=\"";
10611061
html += mdf.getVideoObj(i)->getUrl();
10621062
html += "\">";
@@ -1077,7 +1077,7 @@ vscp_getDeviceInfoHtml(CMDF &mdf, CStandardRegisters &stdregs)
10771077

10781078
html += "<br><b>Firmware</b><ul>";
10791079

1080-
for (int i = 0; i < mdf.getFirmwareCount(); i++) {
1080+
for (size_t i = 0; i < mdf.getFirmwareCount(); i++) {
10811081
html += "<li><a href=\"";
10821082
html += mdf.getFirmwareObj(i)->getUrl();
10831083
html += "\">";
@@ -1098,7 +1098,7 @@ vscp_getDeviceInfoHtml(CMDF &mdf, CStandardRegisters &stdregs)
10981098

10991099
html += "<br><b>Drivers</b><ul>";
11001100

1101-
for (int i = 0; i < mdf.getDriverCount(); i++) {
1101+
for (size_t i = 0; i < mdf.getDriverCount(); i++) {
11021102
html += "<li><a href=\"";
11031103
html += mdf.getDriverObj(i)->getUrl();
11041104
html += "\">";
@@ -1119,7 +1119,7 @@ vscp_getDeviceInfoHtml(CMDF &mdf, CStandardRegisters &stdregs)
11191119

11201120
html += "<br><b>Manuals</b><ul>";
11211121

1122-
for (int i = 0; i < mdf.getManualCount(); i++) {
1122+
for (size_t i = 0; i < mdf.getManualCount(); i++) {
11231123
html += "<li><a href=\"";
11241124
html += mdf.getManualObj(i)->getUrl();
11251125
html += "\">";
@@ -1140,7 +1140,7 @@ vscp_getDeviceInfoHtml(CMDF &mdf, CStandardRegisters &stdregs)
11401140

11411141
html += "<br><b>Setup wizards</b><ul>";
11421142

1143-
for (int i = 0; i < mdf.getSetupCount(); i++) {
1143+
for (size_t i = 0; i < mdf.getSetupCount(); i++) {
11441144
html += "<li><a href=\"";
11451145
html += mdf.getSetupObj(i)->getUrl();
11461146
html += "\">";
@@ -1812,8 +1812,8 @@ CUserRegisters::remoteVarFromRegToString(CMDF_RemoteVariable &remoteVar, std::st
18121812
for (int i = 0; i < remoteVar.getTypeByteCount(); i++) {
18131813
buf[i] = ppage->getReg(remoteVar.getOffset() + i);
18141814
}
1815-
uint32_t n = VSCP_UINT32_SWAP_ON_LE(*((uint32_t *) buf));
1816-
float f = *((float *) ((uint8_t *) &n));
1815+
//uint32_t n = VSCP_UINT32_SWAP_ON_LE(*((uint32_t *) buf));
1816+
//float f = *((float *) ((uint8_t *) &n));
18171817
strValue = vscp_str_format("%f", *((float *) buf));
18181818
free(buf);
18191819
}
@@ -1826,8 +1826,8 @@ CUserRegisters::remoteVarFromRegToString(CMDF_RemoteVariable &remoteVar, std::st
18261826
for (int i = 0; i < remoteVar.getTypeByteCount(); i++) {
18271827
buf[i] = ppage->getReg(remoteVar.getOffset() + i);
18281828
}
1829-
uint64_t n = VSCP_UINT32_SWAP_ON_LE(*((uint32_t *) buf));
1830-
double f = *((double *) ((uint8_t *) &n));
1829+
//uint64_t n = VSCP_UINT32_SWAP_ON_LE(*((uint32_t *) buf));
1830+
//double f = *((double *) ((uint8_t *) &n));
18311831
strValue = vscp_str_format("%g", *((double *) buf));
18321832

18331833
free(buf);
@@ -1889,7 +1889,7 @@ CUserRegisters::remoteVarFromStringToReg(CMDF_RemoteVariable &remoteVar, std::st
18891889
for a level I device but that is not a problem as they never
18901890
will be written to the device.
18911891
*/
1892-
for (int i = 0; i < strValue.length(); i++) {
1892+
for (size_t i = 0; i < strValue.length(); i++) {
18931893
ppage->putReg(remoteVar.getOffset() + i, strValue[i]);
18941894
}
18951895
} break;

src/vscp/common/vscp-bootdevice-pic1.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ CBootDevice_PIC1::deviceInfo(void)
228228
//
229229

230230
int
231-
CBootDevice_PIC1::deviceInit(cguid& ourguid, uint16_t devicecode, bool bAbortOnFirmwareCodeFail)
231+
CBootDevice_PIC1::deviceInit(cguid& ourguid, uint16_t /*devicecode*/, bool bAbortOnFirmwareCodeFail)
232232
{
233233
int rv;
234234

@@ -664,7 +664,7 @@ CBootDevice_PIC1::checkResponseLevel1(uint32_t response_id)
664664
//
665665

666666
int
667-
CBootDevice_PIC1::checkResponseLevel2(uint32_t id)
667+
CBootDevice_PIC1::checkResponseLevel2(uint32_t /*id*/)
668668
{
669669
int rv;
670670
vscpEventEx ex;
@@ -877,7 +877,7 @@ CBootDevice_PIC1::writeFirmwareBlock(uint32_t start, uint32_t end)
877877
//
878878

879879
int
880-
CBootDevice_PIC1::deviceLoad(std::function<void(int, const char *)> statusCallback, bool bAbortOnFirmwareCodeFail)
880+
CBootDevice_PIC1::deviceLoad(std::function<void(int, const char *)> /*statusCallback*/, bool /*bAbortOnFirmwareCodeFail*/)
881881
{
882882
//bool bRun = true;
883883
int rv;

0 commit comments

Comments
 (0)