Quiet down warnings on Windows
parent
debaf8f0cb
commit
eb856dffec
|
|
@ -1,5 +1,6 @@
|
|||
#include <icsneo/communication/message/flexray/control/flexraycontrolmessage.h>
|
||||
#include <cstring> // memcpy
|
||||
#include <limits>
|
||||
|
||||
using namespace icsneo;
|
||||
|
||||
|
|
@ -7,7 +8,7 @@ std::vector<uint8_t> FlexRayControlMessage::BuildBaseControlArgs(uint8_t control
|
|||
std::vector<uint8_t> ret;
|
||||
ret.reserve(args.size() + 4);
|
||||
ret.push_back(controller);
|
||||
const uint16_t size = args.size() + 1; // Add 1 for the opcode
|
||||
const uint16_t size = uint16_t(std::min(args.size() + 1, size_t(std::numeric_limits<uint16_t>::max()))); // Add 1 for the opcode
|
||||
ret.push_back(uint8_t(size));
|
||||
ret.push_back(uint8_t(size >> 8));
|
||||
ret.push_back(uint8_t(op));
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ std::shared_ptr<FlexRayMessage> HardwareFlexRayPacket::DecodeToMessage(const std
|
|||
}
|
||||
|
||||
uint32_t numBytes = data->payload_len * 2;
|
||||
if(ssize_t(numBytes) >= ssize_t(data->Length) - 4) {
|
||||
if(int64_t(numBytes) >= int64_t(data->Length) - 4) {
|
||||
if(data->statusBits.bits.fcrc_error)
|
||||
msg->crcStatus = FlexRay::CRCStatus::Error;
|
||||
} else {
|
||||
|
|
@ -47,7 +47,7 @@ std::shared_ptr<FlexRayMessage> HardwareFlexRayPacket::DecodeToMessage(const std
|
|||
msg->sync = data->sync;
|
||||
msg->startup = data->startup;
|
||||
msg->id = data->id;
|
||||
if(ssize_t(numBytes) != ssize_t(data->Length) - 4) {
|
||||
if(int64_t(numBytes) != int64_t(data->Length) - 4) {
|
||||
|
||||
} else {
|
||||
// This is an error, probably need to flag it
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public:
|
|||
virtual size_t getNetworkCountByType(Network::Type) const;
|
||||
virtual Network getNetworkByNumber(Network::Type, size_t) const;
|
||||
|
||||
virtual std::shared_ptr<FlexRay::Controller> getFlexRayControllerByNetwork(const Network& net) const { return nullptr; }
|
||||
virtual std::shared_ptr<FlexRay::Controller> getFlexRayControllerByNetwork(const Network&) const { return nullptr; }
|
||||
|
||||
const device_eventhandler_t& getEventHandler() const { return report; }
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ public:
|
|||
DeviceExtension(Device& device) : device(device) {}
|
||||
virtual ~DeviceExtension() = default;
|
||||
virtual const char* getName() const = 0;
|
||||
virtual void handleMessage(const std::shared_ptr<Message>& message) {}
|
||||
virtual void handleMessage(const std::shared_ptr<Message>&) {}
|
||||
|
||||
protected:
|
||||
Device& device;
|
||||
|
|
|
|||
Loading…
Reference in New Issue