mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
build: Fix cppcheck issues
This commit is contained in:
@@ -99,6 +99,7 @@ namespace hex::plugin::builtin {
|
||||
socket.writeString(packet);
|
||||
|
||||
auto receivedPacket = socket.readString(6);
|
||||
std::ignore = receivedPacket;
|
||||
}
|
||||
|
||||
bool enableNoAckMode(const wolv::net::SocketClient &socket) {
|
||||
@@ -157,7 +158,7 @@ namespace hex::plugin::builtin {
|
||||
if (size <= CacheLineSize) {
|
||||
std::scoped_lock lock(m_cacheLock);
|
||||
|
||||
const auto &cacheLine = std::find_if(m_cache.begin(), m_cache.end(), [&](auto &line) {
|
||||
const auto &cacheLine = std::ranges::find_if(m_cache, [&](const auto &line) {
|
||||
return line.address == alignedOffset;
|
||||
});
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace hex::plugin::builtin {
|
||||
if (!data.empty() && checksum != 0x00)
|
||||
throw std::runtime_error("Checksum mismatch");
|
||||
|
||||
while (std::isspace(string[offset]) && offset < string.length())
|
||||
while (offset < string.length() && std::isspace(string[offset]))
|
||||
offset++;
|
||||
|
||||
// Construct region
|
||||
@@ -145,7 +145,7 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
}
|
||||
|
||||
while (std::isspace(string[offset]) && offset < string.length())
|
||||
while (offset < string.length() && std::isspace(string[offset]))
|
||||
offset++;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,21 +57,21 @@ namespace hex::plugin::builtin {
|
||||
return value;
|
||||
};
|
||||
|
||||
enum class RecordType {
|
||||
Header = 0x00,
|
||||
Data16 = 0x01,
|
||||
Data24 = 0x02,
|
||||
Data32 = 0x03,
|
||||
Reserved = 0x04,
|
||||
Count16 = 0x05,
|
||||
Count24 = 0x06,
|
||||
StartAddress32 = 0x07,
|
||||
StartAddress24 = 0x08,
|
||||
StartAddress16 = 0x09,
|
||||
} recordType;
|
||||
|
||||
bool endOfFile = false;
|
||||
try {
|
||||
enum class RecordType {
|
||||
Header = 0x00,
|
||||
Data16 = 0x01,
|
||||
Data24 = 0x02,
|
||||
Data32 = 0x03,
|
||||
Reserved = 0x04,
|
||||
Count16 = 0x05,
|
||||
Count24 = 0x06,
|
||||
StartAddress32 = 0x07,
|
||||
StartAddress24 = 0x08,
|
||||
StartAddress16 = 0x09,
|
||||
} recordType;
|
||||
bool endOfFile = false;
|
||||
|
||||
while (offset < string.length()) {
|
||||
// Parse record start
|
||||
if (c() != 'S')
|
||||
@@ -159,7 +159,7 @@ namespace hex::plugin::builtin {
|
||||
break;
|
||||
}
|
||||
|
||||
while (std::isspace(string[offset]) && offset < string.length())
|
||||
while (offset < string.length() && std::isspace(string[offset]))
|
||||
offset++;
|
||||
}
|
||||
} catch (const std::runtime_error &e) {
|
||||
|
||||
Reference in New Issue
Block a user