summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/main.cpp b/main.cpp
index 1c39dea..bf6e3e4 100644
--- a/main.cpp
+++ b/main.cpp
@@ -285,7 +285,7 @@ void printNodeConfig() {
line = trim(line);
parts = MTS::Text::split(line, " ");
- if (configSize == parts.size()) {
+ if (configSize == (int)parts.size()) {
Json::Value jNode(Json::objectValue);
int index = 0;
jNode[NODE_ADDR] = parts[index++];
@@ -323,19 +323,19 @@ void printNodeList() {
line = trim(line);
parts = MTS::Text::split(line, " ");
- if (nodeSize == parts.size()) {
+ if (nodeSize == (int)parts.size()) {
Json::Value jNode(Json::objectValue);
int index = 0;
jNode[NODE_ADDR] = parts[index++];
jNode[NODE_DEV_EUI] = parts[index++];
jNode[NODE_CLASS] = parts[index++];
jNode[NODE_JOINED] = parts[index++];
- jNode[NODE_SEQ_NUM] = atoi(parts[index++].c_str());
- jNode[NODE_PKTS_UP] = atoi(parts[index++].c_str());
- jNode[NODE_PKTS_DOWN] = atoi(parts[index++].c_str());
- jNode[NODE_PKTS_1ST] = atoi(parts[index++].c_str());
- jNode[NODE_PKTS_2ND] = atoi(parts[index++].c_str());
- jNode[NODE_DROPPED] = atoi(parts[index++].c_str());
+ jNode[NODE_SEQ_NUM] = (uint32_t)std::strtoul(parts[index++].c_str(), nullptr, 10);
+ jNode[NODE_PKTS_UP] = (uint32_t)std::strtoul(parts[index++].c_str(), nullptr, 10);
+ jNode[NODE_PKTS_DOWN] = (uint32_t)std::strtoul(parts[index++].c_str(), nullptr, 10);
+ jNode[NODE_PKTS_1ST] = (uint32_t)std::strtoul(parts[index++].c_str(), nullptr, 10);
+ jNode[NODE_PKTS_2ND] = (uint32_t)std::strtoul(parts[index++].c_str(), nullptr, 10);
+ jNode[NODE_DROPPED] = (uint32_t)std::strtoul(parts[index++].c_str(), nullptr, 10);
jNode[NODE_RSSI_MIN] = atof(parts[index++].c_str());
jNode[NODE_RSSI_MAX] = atof(parts[index++].c_str());
jNode[NODE_RSSI_AVR] = atof(parts[index++].c_str());