diff --git a/api/icsneolegacy/icsneolegacy.cpp b/api/icsneolegacy/icsneolegacy.cpp index c71b1a7..79dc7d9 100644 --- a/api/icsneolegacy/icsneolegacy.cpp +++ b/api/icsneolegacy/icsneolegacy.cpp @@ -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; diff --git a/include/icsneo/communication/decoder.h b/include/icsneo/communication/decoder.h index e12fb56..e401d8f 100644 --- a/include/icsneo/communication/decoder.h +++ b/include/icsneo/communication/decoder.h @@ -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; diff --git a/include/icsneo/communication/encoder.h b/include/icsneo/communication/encoder.h index 575a4b0..c2db16e 100644 --- a/include/icsneo/communication/encoder.h +++ b/include/icsneo/communication/encoder.h @@ -11,8 +11,6 @@ #include #include -#pragma pack(push, 1) - namespace icsneo { class Encoder { @@ -29,6 +27,4 @@ private: } -#pragma pack(pop) - #endif \ No newline at end of file diff --git a/include/icsneo/communication/message/neomessage.h b/include/icsneo/communication/message/neomessage.h index b4b7709..53f5798 100644 --- a/include/icsneo/communication/message/neomessage.h +++ b/include/icsneo/communication/message/neomessage.h @@ -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; diff --git a/include/icsneo/device/neovifire2/neovifire2eth.h b/include/icsneo/device/neovifire2/neovifire2eth.h index a18af76..c760a46 100644 --- a/include/icsneo/device/neovifire2/neovifire2eth.h +++ b/include/icsneo/device/neovifire2/neovifire2eth.h @@ -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(new PCAP(getWritableNeoDevice()))); + com = MakeCommunication(std::unique_ptr(new PCAP(getWritableNeoDevice()))); settings = std::unique_ptr(new NeoVIFIRE2Settings(com)); settings->readonly = true; productId = PRODUCT_ID; diff --git a/include/icsneo/icsnVC40.h b/include/icsneo/icsnVC40.h index e144c62..de9046f 100644 --- a/include/icsneo/icsnVC40.h +++ b/include/icsneo/icsnVC40.h @@ -3,6 +3,11 @@ #include #include +#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 \ No newline at end of file diff --git a/include/icsneo/third-party/winpcap/Packet32.h b/third-party/winpcap/include/Packet32.h similarity index 100% rename from include/icsneo/third-party/winpcap/Packet32.h rename to third-party/winpcap/include/Packet32.h diff --git a/include/icsneo/third-party/winpcap/Win32-Extensions.h b/third-party/winpcap/include/Win32-Extensions.h similarity index 100% rename from include/icsneo/third-party/winpcap/Win32-Extensions.h rename to third-party/winpcap/include/Win32-Extensions.h diff --git a/include/icsneo/third-party/winpcap/bittypes.h b/third-party/winpcap/include/bittypes.h similarity index 100% rename from include/icsneo/third-party/winpcap/bittypes.h rename to third-party/winpcap/include/bittypes.h diff --git a/include/icsneo/third-party/winpcap/ip6_misc.h b/third-party/winpcap/include/ip6_misc.h similarity index 100% rename from include/icsneo/third-party/winpcap/ip6_misc.h rename to third-party/winpcap/include/ip6_misc.h diff --git a/include/icsneo/third-party/winpcap/pcap-bpf.h b/third-party/winpcap/include/pcap-bpf.h similarity index 100% rename from include/icsneo/third-party/winpcap/pcap-bpf.h rename to third-party/winpcap/include/pcap-bpf.h diff --git a/include/icsneo/third-party/winpcap/pcap-namedb.h b/third-party/winpcap/include/pcap-namedb.h similarity index 100% rename from include/icsneo/third-party/winpcap/pcap-namedb.h rename to third-party/winpcap/include/pcap-namedb.h diff --git a/include/icsneo/third-party/winpcap/pcap-stdinc.h b/third-party/winpcap/include/pcap-stdinc.h similarity index 100% rename from include/icsneo/third-party/winpcap/pcap-stdinc.h rename to third-party/winpcap/include/pcap-stdinc.h diff --git a/include/icsneo/third-party/winpcap/pcap.h b/third-party/winpcap/include/pcap.h similarity index 100% rename from include/icsneo/third-party/winpcap/pcap.h rename to third-party/winpcap/include/pcap.h diff --git a/include/icsneo/third-party/winpcap/pcap/bluetooth.h b/third-party/winpcap/include/pcap/bluetooth.h similarity index 100% rename from include/icsneo/third-party/winpcap/pcap/bluetooth.h rename to third-party/winpcap/include/pcap/bluetooth.h diff --git a/include/icsneo/third-party/winpcap/pcap/bpf.h b/third-party/winpcap/include/pcap/bpf.h similarity index 100% rename from include/icsneo/third-party/winpcap/pcap/bpf.h rename to third-party/winpcap/include/pcap/bpf.h diff --git a/include/icsneo/third-party/winpcap/pcap/namedb.h b/third-party/winpcap/include/pcap/namedb.h similarity index 100% rename from include/icsneo/third-party/winpcap/pcap/namedb.h rename to third-party/winpcap/include/pcap/namedb.h diff --git a/include/icsneo/third-party/winpcap/pcap/pcap.h b/third-party/winpcap/include/pcap/pcap.h similarity index 100% rename from include/icsneo/third-party/winpcap/pcap/pcap.h rename to third-party/winpcap/include/pcap/pcap.h diff --git a/include/icsneo/third-party/winpcap/pcap/sll.h b/third-party/winpcap/include/pcap/sll.h similarity index 100% rename from include/icsneo/third-party/winpcap/pcap/sll.h rename to third-party/winpcap/include/pcap/sll.h diff --git a/include/icsneo/third-party/winpcap/pcap/usb.h b/third-party/winpcap/include/pcap/usb.h similarity index 100% rename from include/icsneo/third-party/winpcap/pcap/usb.h rename to third-party/winpcap/include/pcap/usb.h diff --git a/include/icsneo/third-party/winpcap/pcap/vlan.h b/third-party/winpcap/include/pcap/vlan.h similarity index 100% rename from include/icsneo/third-party/winpcap/pcap/vlan.h rename to third-party/winpcap/include/pcap/vlan.h diff --git a/include/icsneo/third-party/winpcap/remote-ext.h b/third-party/winpcap/include/remote-ext.h similarity index 100% rename from include/icsneo/third-party/winpcap/remote-ext.h rename to third-party/winpcap/include/remote-ext.h