Build: Resolve warnings

This commit is contained in:
Kyle Schwarz
2026-07-24 13:09:29 -04:00
parent 77a886bbe0
commit 9b01e488da
14 changed files with 36 additions and 35 deletions
-24
View File
@@ -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
#-------------------------------------------------------------------------------
+1 -1
View File
@@ -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)
+2
View File
@@ -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;
}
+1 -2
View File
@@ -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
+1 -2
View File
@@ -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
+3
View File
@@ -563,6 +563,9 @@ bool Decoder::decode(std::shared_ptr<Message>& result, const std::shared_ptr<Pac
}
break;
}
default:
report(APIEvent::Type::UnexpectedNetworkType, APIEvent::Severity::Error);
return false;
}
// For the moment other types of messages will automatically be decoded as raw messages
+3 -1
View File
@@ -234,7 +234,9 @@ bool Encoder::encode(const Packetizer& packetizer, std::vector<uint8_t>& 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
+2
View File
@@ -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) {
+1 -1
View File
@@ -35,7 +35,7 @@ bool EthPhyMessage::appendPhyMessage(bool writeEnable, bool clause45, uint8_t ph
bool EthPhyMessage::appendPhyMessage(std::shared_ptr<PhyMessage> message)
{
if(message != nullptr)
if(message)
{
messages.push_back(message);
return true;
@@ -142,6 +142,8 @@ void MultiChannelCommunication::hidReadTask() {
dispatchMessage(msg);
break;
}
default:
break;
}
if(currentQueue == nullptr) {
+10 -2
View File
@@ -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<VSA> 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<VSAExtendedMessage>(midRecord);
uint64_t pos = readPos;
@@ -3317,6 +3322,9 @@ bool Device::findVSAOffsetFromTimepoint(ICSClock::time_point point, uint64_t& vs
midRecord = extendedRecord;
break;
}
default:
break;
}
if(midIndex <= leftIndex) {
// Extended records cause problems with binary search
// Just move on to linear search
@@ -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 <vector>
#include <memory>
@@ -126,6 +126,8 @@ public:
static std::vector<ChipInfo> 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<ChipInfo> chips = {};
+8 -1
View File
@@ -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 */