mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Build: Resolve warnings
This commit is contained in:
@@ -35,30 +35,6 @@ unit_test windows/x64:
|
|||||||
- libicsneo-win-x64
|
- libicsneo-win-x64
|
||||||
timeout: 5m
|
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
|
# Ubuntu
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|||||||
+1
-1
@@ -82,7 +82,7 @@ if(MSVC)
|
|||||||
add_definitions(-D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING)
|
add_definitions(-D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING)
|
||||||
add_definitions(-D_ITERATOR_DEBUG_LEVEL=0)
|
add_definitions(-D_ITERATOR_DEBUG_LEVEL=0)
|
||||||
else() #if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
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()
|
endif()
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
|
|||||||
@@ -462,6 +462,8 @@ const char* APIEvent::DescriptionForType(Type type) {
|
|||||||
return TOO_MANY_EVENTS;
|
return TOO_MANY_EVENTS;
|
||||||
case Type::Unknown:
|
case Type::Unknown:
|
||||||
return UNKNOWN;
|
return UNKNOWN;
|
||||||
|
case Type::Any:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return INVALID;
|
return INVALID;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -1,7 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DLIBICSNEO_BUILD_EXAMPLES=ON \
|
cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DLIBICSNEO_BUILD_EXAMPLES=ON -DLIBICSNEO_BUILD_UNIT_TESTS=ON -DLIBICSNEO_ENABLE_TCP=OFF || exit 1
|
||||||
-DLIBICSNEO_BUILD_UNIT_TESTS=ON -DLIBICSNEO_ENABLE_TCP=OFF || exit 1
|
|
||||||
|
|
||||||
cmake --build build || exit 1
|
cmake --build build || exit 1
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
mkdir build >nul 2>&1
|
mkdir build >nul 2>&1
|
||||||
|
|
||||||
cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DLIBICSNEO_BUILD_UNIT_TESTS=ON ^
|
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
|
||||||
-DLIBICSNEO_ENABLE_TCP=ON || exit /b 1
|
|
||||||
|
|
||||||
cmake --build build || exit /b 1
|
cmake --build build || exit /b 1
|
||||||
|
|||||||
@@ -563,6 +563,9 @@ bool Decoder::decode(std::shared_ptr<Message>& result, const std::shared_ptr<Pac
|
|||||||
}
|
}
|
||||||
break;
|
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
|
// For the moment other types of messages will automatically be decoded as raw messages
|
||||||
|
|||||||
@@ -234,7 +234,9 @@ bool Encoder::encode(const Packetizer& packetizer, std::vector<uint8_t>& result,
|
|||||||
result = packetizer.packetWrap(result, false);
|
result = packetizer.packetWrap(result, false);
|
||||||
return true;
|
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
|
// Early returns may mean we don't reach this far, check the type you're concerned with
|
||||||
|
|||||||
@@ -163,6 +163,8 @@ void A2BMessage::setChannelSample(Direction dir, uint8_t channel, size_t frame,
|
|||||||
case PCMType::L24:
|
case PCMType::L24:
|
||||||
sampleToSet = sampleToSet << 8;
|
sampleToSet = sampleToSet << 8;
|
||||||
break;
|
break;
|
||||||
|
case PCMType::L32:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(channelSize16) {
|
if(channelSize16) {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ bool EthPhyMessage::appendPhyMessage(bool writeEnable, bool clause45, uint8_t ph
|
|||||||
|
|
||||||
bool EthPhyMessage::appendPhyMessage(std::shared_ptr<PhyMessage> message)
|
bool EthPhyMessage::appendPhyMessage(std::shared_ptr<PhyMessage> message)
|
||||||
{
|
{
|
||||||
if(message != nullptr)
|
if(message)
|
||||||
{
|
{
|
||||||
messages.push_back(message);
|
messages.push_back(message);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -142,6 +142,8 @@ void MultiChannelCommunication::hidReadTask() {
|
|||||||
dispatchMessage(msg);
|
dispatchMessage(msg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(currentQueue == nullptr) {
|
if(currentQueue == nullptr) {
|
||||||
|
|||||||
+10
-2
@@ -575,12 +575,16 @@ bool Device::goOnline() {
|
|||||||
case NetworkMutexEvent::Acquired:
|
case NetworkMutexEvent::Acquired:
|
||||||
lockedNetworks.emplace(*netMutexMsg->networks.begin());
|
lockedNetworks.emplace(*netMutexMsg->networks.begin());
|
||||||
break;
|
break;
|
||||||
|
case NetworkMutexEvent::Expired:
|
||||||
|
case NetworkMutexEvent::Preempted:
|
||||||
case NetworkMutexEvent::Released: {
|
case NetworkMutexEvent::Released: {
|
||||||
auto it = lockedNetworks.find(*netMutexMsg->networks.begin());
|
auto it = lockedNetworks.find(*netMutexMsg->networks.begin());
|
||||||
if (it != lockedNetworks.end())
|
if (it != lockedNetworks.end())
|
||||||
lockedNetworks.erase(it);
|
lockedNetworks.erase(it);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case NetworkMutexEvent::Queued:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -3297,11 +3301,12 @@ bool Device::findVSAOffsetFromTimepoint(ICSClock::time_point point, uint64_t& vs
|
|||||||
std::shared_ptr<VSA> midRecord;
|
std::shared_ptr<VSA> midRecord;
|
||||||
auto midRecordStatus = parser.getRecordFromBytes(buffer.data(), Disk::SectorSize, midRecord);
|
auto midRecordStatus = parser.getRecordFromBytes(buffer.data(), Disk::SectorSize, midRecord);
|
||||||
switch(midRecordStatus) {
|
switch(midRecordStatus) {
|
||||||
case VSAParser::RecordParseStatus::NotARecordStart:
|
case VSAParser::RecordParseStatus::NotARecordStart: {
|
||||||
// This part of the buffer does not contain records
|
// This part of the buffer does not contain records
|
||||||
rightIndex = midIndex - 1;
|
rightIndex = midIndex - 1;
|
||||||
continue;
|
continue;
|
||||||
case VSAParser::RecordParseStatus::ConsecutiveExtended:
|
}
|
||||||
|
case VSAParser::RecordParseStatus::ConsecutiveExtended: {
|
||||||
// We dropped in the middle of an extended message record
|
// We dropped in the middle of an extended message record
|
||||||
auto extendedRecord = std::dynamic_pointer_cast<VSAExtendedMessage>(midRecord);
|
auto extendedRecord = std::dynamic_pointer_cast<VSAExtendedMessage>(midRecord);
|
||||||
uint64_t pos = readPos;
|
uint64_t pos = readPos;
|
||||||
@@ -3316,6 +3321,9 @@ bool Device::findVSAOffsetFromTimepoint(ICSClock::time_point point, uint64_t& vs
|
|||||||
midIndex = (pos - firstOffset) / Disk::SectorSize;
|
midIndex = (pos - firstOffset) / Disk::SectorSize;
|
||||||
midRecord = extendedRecord;
|
midRecord = extendedRecord;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if(midIndex <= leftIndex) {
|
if(midIndex <= leftIndex) {
|
||||||
// Extended records cause problems with binary search
|
// Extended records cause problems with binary search
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
#include "icsneo/communication/packet/ethphyregpacket.h"
|
#include "icsneo/communication/packet/ethphyregpacket.h"
|
||||||
#include "icsneo/communication/message/message.h"
|
#include "icsneo/communication/message/message.h"
|
||||||
#include "icsneo/communication/packet.h"
|
#include "icsneo/communication/packet.h"
|
||||||
#include "icsneo/api/eventmanager.h"
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <memory>
|
#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}};
|
static std::vector<ChipInfo> chips = {{ChipID::RADBMS_MCHIP, true, "MCHIP", "rad_bms_mchip_WIL_3_3_0_27_ief", 0, FirmwareType::IEF}};
|
||||||
return chips;
|
return chips;
|
||||||
}
|
}
|
||||||
|
case FirmwareVariant::Invalid:
|
||||||
|
break; // invalid will be handled below
|
||||||
}
|
}
|
||||||
// Return empty chip information if the WIL version is not set
|
// Return empty chip information if the WIL version is not set
|
||||||
static std::vector<ChipInfo> chips = {};
|
static std::vector<ChipInfo> chips = {};
|
||||||
|
|||||||
@@ -44,7 +44,10 @@ typedef unsigned __int64 uint64_t;
|
|||||||
#include "cicsSpyStatusBits.h"
|
#include "cicsSpyStatusBits.h"
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#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
|
#endif
|
||||||
|
|
||||||
// MSVC++ 10.0 _MSC_VER == 1600 64-bit version doesn't allow multi-line #if directives...
|
// 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
|
#undef CHECK_STRUCT_SIZE
|
||||||
#endif /* INTREPID_NO_CHECK_STRUCT_SIZE */
|
#endif /* INTREPID_NO_CHECK_STRUCT_SIZE */
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _ICSNVC40_H */
|
#endif /* _ICSNVC40_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user