fixed compiler warnings.

This commit is contained in:
Martin Preuss
2024-04-17 23:11:52 +02:00
parent 02c256ffa2
commit 7ea260031e
2 changed files with 10 additions and 8 deletions

View File

@@ -108,9 +108,9 @@ void _processSendStatsMessage(AQHOMED *aqh, const GWEN_MSG *nodeMsg)
double collisionsPercentage=0.0; double collisionsPercentage=0.0;
double busyPercentage=0.0; double busyPercentage=0.0;
packetsOut=(double) packetsOutInt; packetsOut=/*(double)*/ packetsOutInt;
collisions=(double)AQH_SendStatsMsg_GetCollisions(nodeMsg); collisions=/*(double)*/ AQH_SendStatsMsg_GetCollisions(nodeMsg);
busy=(double)AQH_SendStatsMsg_GetBusyErrors(nodeMsg); busy=/*(double)*/ AQH_SendStatsMsg_GetBusyErrors(nodeMsg);
collisionsPercentage=collisions*100.0/packetsOut; collisionsPercentage=collisions*100.0/packetsOut;
busyPercentage=busy*100.0/packetsOut; busyPercentage=busy*100.0/packetsOut;
@@ -136,9 +136,9 @@ void _processRecvStatsMessage(AQHOMED *aqh, const GWEN_MSG *nodeMsg)
double crcErrorsPercentage=0.0; double crcErrorsPercentage=0.0;
double ioErrorsPercentage=0.0; double ioErrorsPercentage=0.0;
packetsIn=(double) packetsInInt; packetsIn=/*(double)*/ packetsInInt;
crcErrors=(double)AQH_RecvStatsMsg_GetCrcErrors(nodeMsg); crcErrors=/*(double)*/AQH_RecvStatsMsg_GetCrcErrors(nodeMsg);
ioErrors=(double)AQH_RecvStatsMsg_GetIoErrors(nodeMsg); ioErrors=/*(double)*/AQH_RecvStatsMsg_GetIoErrors(nodeMsg);
crcErrorsPercentage=crcErrors*100.0/packetsIn; crcErrorsPercentage=crcErrors*100.0/packetsIn;
ioErrorsPercentage=ioErrors*100.0/packetsIn; ioErrorsPercentage=ioErrors*100.0/packetsIn;
@@ -155,7 +155,7 @@ void _processRecvStatsMessage(AQHOMED *aqh, const GWEN_MSG *nodeMsg)
void _publishInt(AQHOMED *aqh, uint32_t uid, int valueId, const char *valueUnits, const char *valuePath, int v) void _publishInt(AQHOMED *aqh, uint32_t uid, int valueId, const char *valueUnits, const char *valuePath, int v)
{ {
_publishDouble(aqh, uid, valueId, valueUnits, valuePath, (double) v); _publishDouble(aqh, uid, valueId, valueUnits, valuePath, /*(double)*/ v);
} }

View File

@@ -213,9 +213,11 @@ void _awaitAndPrintChanges(GWEN_MSG_ENDPOINT *epTcp, int timeoutInSeconds, const
} }
if (timeoutInSeconds) { if (timeoutInSeconds) {
time_t now; time_t now;
double delta;
now=time(NULL); now=time(NULL);
if ((int)(difftime(now, tStart))>=timeoutInSeconds) { delta=difftime(now, tStart);
if ((int)delta>=timeoutInSeconds) {
DBG_INFO(NULL, "Timeout"); DBG_INFO(NULL, "Timeout");
break; break;
} }