Skip to content

Commit

Permalink
Fixed some annoying warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
grodansparadis committed Dec 12, 2024
1 parent b1f6af3 commit 0a64641
Show file tree
Hide file tree
Showing 20 changed files with 520 additions and 265 deletions.
2 changes: 1 addition & 1 deletion src/common/sockettcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
24 changes: 12 additions & 12 deletions src/vscp/common/mdf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1827,7 +1827,7 @@ void
CMDF::writeMap_json(std::ofstream &fout,
std::map<std::string, std::string> *pmap,
const std::string &tag,
bool bCommaAtEnd)
bool /*bCommaAtEnd*/)
{
if ((nullptr != pmap) && pmap->size()) {
fout << "," << std::endl;
Expand Down Expand Up @@ -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 << "<telephone>" << std::endl;
Expand All @@ -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 << "<fax>" << std::endl;
Expand All @@ -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 << "<email>" << std::endl;
Expand All @@ -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 << "<web>" << std::endl;
Expand All @@ -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 << "<social>" << std::endl;
Expand Down Expand Up @@ -1999,7 +1999,7 @@ CMDF::save_xml(const std::string &path)

std::deque<CMDF_Picture *> *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 << "<picture name=\"" << pPicture->getName() << "\" ";
Expand All @@ -2013,7 +2013,7 @@ CMDF::save_xml(const std::string &path)

std::deque<CMDF_Video *> *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 << "<video name=\"" << pVideo->getName() << "\" ";
Expand All @@ -2027,7 +2027,7 @@ CMDF::save_xml(const std::string &path)

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

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

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

// Go throu pages
for (auto itr : pages) {
Expand Down
36 changes: 18 additions & 18 deletions src/vscp/common/register.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ vscp_readLevel1Register(CVscpClient &client,
int rv = VSCP_ERROR_ERROR;
vscpEventEx ex;

CVscpClient::connType conntype = client.getType();
//CVscpClient::connType conntype = client.getType();
uint8_t nickname = guidNode.getNickname();
uint8_t ifoffset = guidInterface.isNULL() ? 0 : 16;

Expand Down Expand Up @@ -160,7 +160,7 @@ vscp_writeLevel1Register(CVscpClient &client,
{
int rv = VSCP_ERROR_ERROR;
vscpEventEx ex;
CVscpClient::connType conntype = client.getType();
//CVscpClient::connType conntype = client.getType();
uint8_t nickname = guidNode.getNickname();
uint8_t ifoffset = guidInterface.isNULL() ? 0 : 16;

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

Expand Down Expand Up @@ -374,13 +374,13 @@ vscp_writeLevel1RegisterBlock(CVscpClient &client,
uint32_t timeout)
{
int rv = VSCP_ERROR_SUCCESS;
CVscpClient::connType conntype = client.getType();
//CVscpClient::connType conntype = client.getType();
uint8_t nickname = guidNode.getNickname();
uint8_t ifoffset = guidInterface.isNULL() ? 0 : 16;
int reg = -99;
int count = 0;
vscpEventEx ex;
uint8_t offset_data = 0;
//uint8_t offset_data = 0;
std::map<uint8_t, uint8_t> startmap;

// The startregs map contains reg, count for each sequence start
Expand Down Expand Up @@ -439,7 +439,7 @@ vscp_writeLevel1RegisterBlock(CVscpClient &client,
}

uint32_t startTime = vscp_getMsTimeStamp();
uint32_t callbackTime = vscp_getMsTimeStamp();
//uint32_t callbackTime = vscp_getMsTimeStamp();

// Wait for reponse

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

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

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

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

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

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

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

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

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

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

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

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

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

for (int i = 0; i < mdf.getSetupCount(); i++) {
for (size_t i = 0; i < mdf.getSetupCount(); i++) {
html += "<li><a href=\"";
html += mdf.getSetupObj(i)->getUrl();
html += "\">";
Expand Down Expand Up @@ -1812,8 +1812,8 @@ CUserRegisters::remoteVarFromRegToString(CMDF_RemoteVariable &remoteVar, std::st
for (int i = 0; i < remoteVar.getTypeByteCount(); i++) {
buf[i] = ppage->getReg(remoteVar.getOffset() + i);
}
uint32_t n = VSCP_UINT32_SWAP_ON_LE(*((uint32_t *) buf));
float f = *((float *) ((uint8_t *) &n));
//uint32_t n = VSCP_UINT32_SWAP_ON_LE(*((uint32_t *) buf));
//float f = *((float *) ((uint8_t *) &n));
strValue = vscp_str_format("%f", *((float *) buf));
free(buf);
}
Expand All @@ -1826,8 +1826,8 @@ CUserRegisters::remoteVarFromRegToString(CMDF_RemoteVariable &remoteVar, std::st
for (int i = 0; i < remoteVar.getTypeByteCount(); i++) {
buf[i] = ppage->getReg(remoteVar.getOffset() + i);
}
uint64_t n = VSCP_UINT32_SWAP_ON_LE(*((uint32_t *) buf));
double f = *((double *) ((uint8_t *) &n));
//uint64_t n = VSCP_UINT32_SWAP_ON_LE(*((uint32_t *) buf));
//double f = *((double *) ((uint8_t *) &n));
strValue = vscp_str_format("%g", *((double *) buf));

free(buf);
Expand Down Expand Up @@ -1889,7 +1889,7 @@ CUserRegisters::remoteVarFromStringToReg(CMDF_RemoteVariable &remoteVar, std::st
for a level I device but that is not a problem as they never
will be written to the device.
*/
for (int i = 0; i < strValue.length(); i++) {
for (size_t i = 0; i < strValue.length(); i++) {
ppage->putReg(remoteVar.getOffset() + i, strValue[i]);
}
} break;
Expand Down
6 changes: 3 additions & 3 deletions src/vscp/common/vscp-bootdevice-pic1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ CBootDevice_PIC1::deviceInfo(void)
//

int
CBootDevice_PIC1::deviceInit(cguid& ourguid, uint16_t devicecode, bool bAbortOnFirmwareCodeFail)
CBootDevice_PIC1::deviceInit(cguid& ourguid, uint16_t /*devicecode*/, bool bAbortOnFirmwareCodeFail)
{
int rv;

Expand Down Expand Up @@ -664,7 +664,7 @@ CBootDevice_PIC1::checkResponseLevel1(uint32_t response_id)
//

int
CBootDevice_PIC1::checkResponseLevel2(uint32_t id)
CBootDevice_PIC1::checkResponseLevel2(uint32_t /*id*/)
{
int rv;
vscpEventEx ex;
Expand Down Expand Up @@ -877,7 +877,7 @@ CBootDevice_PIC1::writeFirmwareBlock(uint32_t start, uint32_t end)
//

int
CBootDevice_PIC1::deviceLoad(std::function<void(int, const char *)> statusCallback, bool bAbortOnFirmwareCodeFail)
CBootDevice_PIC1::deviceLoad(std::function<void(int, const char *)> /*statusCallback*/, bool /*bAbortOnFirmwareCodeFail*/)
{
//bool bRun = true;
int rv;
Expand Down
Loading

0 comments on commit 0a64641

Please sign in to comment.