Resolve MSVC errors and warnings with refactor
parent
8e6b0d0b0e
commit
9675bb81f7
|
|
@ -2,6 +2,8 @@
|
|||
#error "icsneoc.cpp must be compiled with a C++ compiler!"
|
||||
#endif
|
||||
|
||||
#define NOMINMAX
|
||||
|
||||
#define ICSNEOC_MAKEDLL
|
||||
#include "icsneo/icsneolegacy.h"
|
||||
|
||||
|
|
@ -73,6 +75,7 @@ int icsneoOpenNeoDevice(NeoDevice* pNeoDevice, void** hObject, unsigned char* bN
|
|||
try {
|
||||
device = &neodevices.at(uint64_t(pNeoDevice->Handle) << 32 | pNeoDevice->SerialNumber);
|
||||
} catch(std::out_of_range& e) {
|
||||
(void)e; // Unused
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -124,7 +127,7 @@ int icsneoGetMessages(void* hObject, icsSpyMessage* pMsg, int* pNumberOfMessages
|
|||
memcpy(oldmsg.Data, newmsg.data, std::min(newmsg.length, (size_t)8));
|
||||
oldmsg.ArbIDOrHeader = *(uint32_t*)newmsg.header;
|
||||
oldmsg.ExtraDataPtrEnabled = newmsg.length > 8;
|
||||
oldmsg.NetworkID = newmsg.netid;
|
||||
oldmsg.NetworkID = (uint8_t)newmsg.netid; // TODO Handling for this?
|
||||
switch(Network::Type(newmsg.type)) {
|
||||
case Network::Type::CAN:
|
||||
oldmsg.Protocol = SPY_PROTOCOL_CAN;
|
||||
|
|
|
|||
|
|
@ -55,6 +55,10 @@ private:
|
|||
} timestamp;
|
||||
};
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4201) // nameless struct/union
|
||||
#endif
|
||||
union CoreMiniStatusBits_t {
|
||||
struct {
|
||||
unsigned just_reset : 1;
|
||||
|
|
@ -75,6 +79,9 @@ private:
|
|||
};
|
||||
uint32_t dword;
|
||||
};
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
struct HardwareResetStatusPacket {
|
||||
uint16_t main_loop_time_25ns;
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@
|
|||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class Encoder {
|
||||
|
|
@ -29,6 +27,4 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif
|
||||
|
|
@ -6,6 +6,10 @@
|
|||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4201) // nameless struct/union
|
||||
#endif
|
||||
typedef union {
|
||||
struct {
|
||||
uint32_t globalError : 1;
|
||||
|
|
@ -91,6 +95,9 @@ typedef union {
|
|||
};
|
||||
uint32_t statusBitfield[4];
|
||||
} neomessage_statusbitfield_t;
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
neomessage_statusbitfield_t status;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class NeoVIFIRE2ETH : public NeoVIFIRE2 {
|
|||
public:
|
||||
static constexpr const uint16_t PRODUCT_ID = 0x0004;
|
||||
NeoVIFIRE2ETH(neodevice_t neodevice) : NeoVIFIRE2(neodevice) {
|
||||
com = MakeCommunicaiton(std::unique_ptr<ICommunication>(new PCAP(getWritableNeoDevice())));
|
||||
com = MakeCommunication(std::unique_ptr<ICommunication>(new PCAP(getWritableNeoDevice())));
|
||||
settings = std::unique_ptr<IDeviceSettings>(new NeoVIFIRE2Settings(com));
|
||||
settings->readonly = true;
|
||||
productId = PRODUCT_ID;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,11 @@
|
|||
#include <string>
|
||||
#include <cstdint>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4201) // nameless struct/union
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define ALIGNED_(x) __declspec(align(x))
|
||||
#else
|
||||
|
|
@ -817,8 +822,8 @@ typedef struct ALIGNED_(2)
|
|||
unsigned short brgh;
|
||||
unsigned short parity;
|
||||
unsigned short stop_bits;
|
||||
byte flow_control; // 0- off, 1 - Simple CTS RTS,
|
||||
byte reserved_1;
|
||||
unsigned char flow_control; // 0- off, 1 - Simple CTS RTS,
|
||||
unsigned char reserved_1;
|
||||
|
||||
union
|
||||
{
|
||||
|
|
@ -1060,7 +1065,10 @@ typedef struct ALIGNED_(2) _stCM_ISO157652_TxMessage
|
|||
}stCM_ISO157652_TxMessage;
|
||||
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4324) // nameless struct/union
|
||||
#endif
|
||||
typedef struct ALIGNED_(2)
|
||||
{
|
||||
//transmit message
|
||||
|
|
@ -1102,6 +1110,9 @@ typedef struct ALIGNED_(2)
|
|||
unsigned char reserved[16];
|
||||
|
||||
}stCM_ISO157652_RxMessage;
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
|
@ -1194,3 +1205,6 @@ typedef struct // matching C structure
|
|||
unsigned char MiscData;
|
||||
} icsSpyMessageJ1850;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
Loading…
Reference in New Issue