mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Resolve macOS warnings and standardize style
This commit is contained in:
@@ -13,7 +13,7 @@ int Communication::messageCallbackIDCounter = 1;
|
||||
|
||||
uint8_t Communication::ICSChecksum(const std::vector<uint8_t>& data) {
|
||||
uint32_t checksum = 0;
|
||||
for(auto i = 0; i < data.size(); i++)
|
||||
for(size_t i = 0; i < data.size(); i++)
|
||||
checksum += data[i];
|
||||
checksum = ~checksum;
|
||||
checksum++;
|
||||
|
||||
@@ -60,6 +60,6 @@ private:
|
||||
void readTask();
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -38,6 +38,6 @@ protected:
|
||||
std::atomic<bool> closing{false};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -41,6 +41,6 @@ public:
|
||||
CANMessageCallback(CANMessageFilter f, fn_messageCallback cb) : MessageCallback(cb, std::make_shared<CANMessageFilter>(f)) {}
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -67,6 +67,6 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -97,6 +97,6 @@ private:
|
||||
void readTask();
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -335,6 +335,6 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -10,6 +10,6 @@ public:
|
||||
uint32_t arbid;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -14,6 +14,6 @@ public:
|
||||
uint64_t timestamp;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -33,8 +33,10 @@ typedef struct {
|
||||
#include "communication/message/include/message.h"
|
||||
|
||||
namespace icsneo {
|
||||
neomessage_t CreateNeoMessage(const Message& message);
|
||||
};
|
||||
|
||||
neomessage_t CreateNeoMessage(const Message& message);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -97,7 +97,7 @@ void MultiChannelCommunication::readTask() {
|
||||
continue;
|
||||
}
|
||||
|
||||
for(auto i = 0; i < currentReadIndex; i++)
|
||||
for(size_t i = 0; i < currentReadIndex; i++)
|
||||
usbReadFifo.pop_front();
|
||||
|
||||
payloadBytes.clear();
|
||||
|
||||
@@ -68,7 +68,7 @@ bool Packetizer::input(const std::vector<uint8_t>& inputBytes) {
|
||||
break;
|
||||
case ReadState::GetData:
|
||||
// We do not include the checksum in packetLength so it doesn't get copied into the payload buffer
|
||||
if(bytes.size() < packetLength + (checksum ? 1 : 0)) { // Read until we have the rest of the packet
|
||||
if(bytes.size() < (size_t)(packetLength + (checksum ? 1 : 0))) { // Read until we have the rest of the packet
|
||||
haveEnoughData = false;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user