diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5067c68..cded9aa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,30 +35,6 @@ unit_test windows/x64: - libicsneo-win-x64 timeout: 5m -build windows/x86: - stage: build - script: - - cmd /C ci\build-windows32.bat - artifacts: - when: always - paths: - - build - expire_in: 3 days - tags: - - libicsneo-win-x64 - -unit_test windows/x86: - stage: unit_test - script: - - build\libicsneo-unit-tests.exe - dependencies: - - build windows/x86 - needs: - - build windows/x86 - tags: - - libicsneo-win-x64 - timeout: 5m - #------------------------------------------------------------------------------- # Ubuntu #------------------------------------------------------------------------------- diff --git a/CMakeLists.txt b/CMakeLists.txt index 97ef81d..cace15f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,7 +82,7 @@ if(MSVC) add_definitions(-D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING) add_definitions(-D_ITERATOR_DEBUG_LEVEL=0) else() #if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) - set(LIBICSNEO_COMPILER_WARNINGS -Wall -Wno-switch -Wno-unknown-pragmas) + set(LIBICSNEO_COMPILER_WARNINGS -Wall -Wno-unknown-pragmas) endif() find_package(Threads REQUIRED) diff --git a/api/icsneocpp/event.cpp b/api/icsneocpp/event.cpp index 9ad080d..9ee0c52 100644 --- a/api/icsneocpp/event.cpp +++ b/api/icsneocpp/event.cpp @@ -462,6 +462,8 @@ const char* APIEvent::DescriptionForType(Type type) { return TOO_MANY_EVENTS; case Type::Unknown: return UNKNOWN; + case Type::Any: + break; } return INVALID; } diff --git a/ci/build-posix.sh b/ci/build-posix.sh index 07a2748..da8568c 100644 --- a/ci/build-posix.sh +++ b/ci/build-posix.sh @@ -1,7 +1,6 @@ #!/bin/sh -cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DLIBICSNEO_BUILD_EXAMPLES=ON \ - -DLIBICSNEO_BUILD_UNIT_TESTS=ON -DLIBICSNEO_ENABLE_TCP=OFF || exit 1 +cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DLIBICSNEO_BUILD_EXAMPLES=ON -DLIBICSNEO_BUILD_UNIT_TESTS=ON -DLIBICSNEO_ENABLE_TCP=OFF || exit 1 cmake --build build || exit 1 diff --git a/ci/build-windows.bat b/ci/build-windows.bat index e7fd84a..82bae77 100644 --- a/ci/build-windows.bat +++ b/ci/build-windows.bat @@ -3,7 +3,6 @@ mkdir build >nul 2>&1 -cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DLIBICSNEO_BUILD_UNIT_TESTS=ON ^ - -DLIBICSNEO_ENABLE_TCP=ON || exit /b 1 +cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DLIBICSNEO_BUILD_UNIT_TESTS=ON-DLIBICSNEO_ENABLE_TCP=ON || exit /b 1 cmake --build build || exit /b 1 diff --git a/communication/decoder.cpp b/communication/decoder.cpp index 8642f87..4e3b602 100644 --- a/communication/decoder.cpp +++ b/communication/decoder.cpp @@ -563,6 +563,9 @@ bool Decoder::decode(std::shared_ptr& result, const std::shared_ptr& result, result = packetizer.packetWrap(result, false); return true; } - break; + default: + report(APIEvent::Type::MessageFormattingError, APIEvent::Severity::Error); + return false; // The message was not a properly formed Message } // Early returns may mean we don't reach this far, check the type you're concerned with diff --git a/communication/message/a2bmessage.cpp b/communication/message/a2bmessage.cpp index 4c12567..7e49b0d 100644 --- a/communication/message/a2bmessage.cpp +++ b/communication/message/a2bmessage.cpp @@ -163,6 +163,8 @@ void A2BMessage::setChannelSample(Direction dir, uint8_t channel, size_t frame, case PCMType::L24: sampleToSet = sampleToSet << 8; break; + case PCMType::L32: + break; } if(channelSize16) { diff --git a/communication/message/ethphymessage.cpp b/communication/message/ethphymessage.cpp index 39b6fc6..96789fb 100644 --- a/communication/message/ethphymessage.cpp +++ b/communication/message/ethphymessage.cpp @@ -35,7 +35,7 @@ bool EthPhyMessage::appendPhyMessage(bool writeEnable, bool clause45, uint8_t ph bool EthPhyMessage::appendPhyMessage(std::shared_ptr message) { - if(message != nullptr) + if(message) { messages.push_back(message); return true; diff --git a/communication/multichannelcommunication.cpp b/communication/multichannelcommunication.cpp index 0c70609..ba0ce60 100644 --- a/communication/multichannelcommunication.cpp +++ b/communication/multichannelcommunication.cpp @@ -142,6 +142,8 @@ void MultiChannelCommunication::hidReadTask() { dispatchMessage(msg); break; } + default: + break; } if(currentQueue == nullptr) { diff --git a/device/device.cpp b/device/device.cpp index 6600da1..709bc4e 100644 --- a/device/device.cpp +++ b/device/device.cpp @@ -575,12 +575,16 @@ bool Device::goOnline() { case NetworkMutexEvent::Acquired: lockedNetworks.emplace(*netMutexMsg->networks.begin()); break; + case NetworkMutexEvent::Expired: + case NetworkMutexEvent::Preempted: case NetworkMutexEvent::Released: { auto it = lockedNetworks.find(*netMutexMsg->networks.begin()); if (it != lockedNetworks.end()) lockedNetworks.erase(it); break; } + case NetworkMutexEvent::Queued: + break; } } }); @@ -3297,11 +3301,12 @@ bool Device::findVSAOffsetFromTimepoint(ICSClock::time_point point, uint64_t& vs std::shared_ptr midRecord; auto midRecordStatus = parser.getRecordFromBytes(buffer.data(), Disk::SectorSize, midRecord); switch(midRecordStatus) { - case VSAParser::RecordParseStatus::NotARecordStart: + case VSAParser::RecordParseStatus::NotARecordStart: { // This part of the buffer does not contain records rightIndex = midIndex - 1; continue; - case VSAParser::RecordParseStatus::ConsecutiveExtended: + } + case VSAParser::RecordParseStatus::ConsecutiveExtended: { // We dropped in the middle of an extended message record auto extendedRecord = std::dynamic_pointer_cast(midRecord); uint64_t pos = readPos; @@ -3316,6 +3321,9 @@ bool Device::findVSAOffsetFromTimepoint(ICSClock::time_point point, uint64_t& vs midIndex = (pos - firstOffset) / Disk::SectorSize; midRecord = extendedRecord; break; + } + default: + break; } if(midIndex <= leftIndex) { // Extended records cause problems with binary search diff --git a/include/icsneo/communication/message/ethphymessage.h b/include/icsneo/communication/message/ethphymessage.h index 531fb2d..9220d98 100644 --- a/include/icsneo/communication/message/ethphymessage.h +++ b/include/icsneo/communication/message/ethphymessage.h @@ -6,7 +6,6 @@ #include "icsneo/communication/packet/ethphyregpacket.h" #include "icsneo/communication/message/message.h" #include "icsneo/communication/packet.h" -#include "icsneo/api/eventmanager.h" #include #include diff --git a/include/icsneo/device/tree/radwbms/radwbms.h b/include/icsneo/device/tree/radwbms/radwbms.h index e8b7287..5556fb4 100644 --- a/include/icsneo/device/tree/radwbms/radwbms.h +++ b/include/icsneo/device/tree/radwbms/radwbms.h @@ -126,6 +126,8 @@ public: static std::vector chips = {{ChipID::RADBMS_MCHIP, true, "MCHIP", "rad_bms_mchip_WIL_3_3_0_27_ief", 0, FirmwareType::IEF}}; return chips; } + case FirmwareVariant::Invalid: + break; // invalid will be handled below } // Return empty chip information if the WIL version is not set static std::vector chips = {}; diff --git a/include/icsneo/icsnVC40.h b/include/icsneo/icsnVC40.h index 99fe25d..df91bb3 100644 --- a/include/icsneo/icsnVC40.h +++ b/include/icsneo/icsnVC40.h @@ -44,7 +44,10 @@ typedef unsigned __int64 uint64_t; #include "cicsSpyStatusBits.h" #if defined(_MSC_VER) -#pragma warning(disable : 4200) +#pragma warning(push) +#pragma warning(disable : 4200) // zero-sized array in struct/union +#pragma warning(disable : 4201) // nameless struct/union +#pragma warning(disable : 4121) // member alignment sensitive to packing #endif // MSVC++ 10.0 _MSC_VER == 1600 64-bit version doesn't allow multi-line #if directives... @@ -5440,4 +5443,8 @@ CHECK_STRUCT_SIZE(FlashAccessoryFirmwareParams); #undef CHECK_STRUCT_SIZE #endif /* INTREPID_NO_CHECK_STRUCT_SIZE */ +#if defined(_MSC_VER) +#pragma warning(pop) +#endif + #endif /* _ICSNVC40_H */