diff --git a/src/core/encoding/ByteUtils.cpp b/src/core/encoding/ByteUtils.cpp index 2c03981..61f943f 100644 --- a/src/core/encoding/ByteUtils.cpp +++ b/src/core/encoding/ByteUtils.cpp @@ -58,7 +58,7 @@ unsigned char ByteUtils::getLowerNBits(uint32_t input, unsigned num) case 7: return input & 0x7F; case 8: - return input; + return static_cast(input); default: return 0; } diff --git a/src/core/memory/SharedMemory.cpp b/src/core/memory/SharedMemory.cpp index d15b525..2ccd7f3 100644 --- a/src/core/memory/SharedMemory.cpp +++ b/src/core/memory/SharedMemory.cpp @@ -10,7 +10,7 @@ #include #endif -void SharedMemory::allocate(const std::string& namePrefix, std::size_t size) +void SharedMemory::allocate(const std::string& namePrefix, std::size_t) { createFile(namePrefix); @@ -60,7 +60,9 @@ void SharedMemory::createFile(const std::string& namePrefix) break; } } while (retries > 0 && errno == EEXIST); -#endif +#else + (void)(namePrefix); +#endif } std::string SharedMemory::getRandomName(const std::string& namePrefix) const diff --git a/src/core/streams/BitStream.cpp b/src/core/streams/BitStream.cpp index 010a0c5..28afdb6 100644 --- a/src/core/streams/BitStream.cpp +++ b/src/core/streams/BitStream.cpp @@ -30,8 +30,8 @@ void BitStream::write(uint32_t data) void BitStream::writeWord(uint16_t data) { - const auto byte0 = data >> 8; - const auto byte1 = (data << 8) >> 8; + const auto byte0 = static_cast(data >> 8); + const auto byte1 = static_cast((data << 8) >> 8); writeByte(byte0); writeByte(byte1); } @@ -81,13 +81,13 @@ void BitStream::writeNBits(uint32_t data, unsigned length) unsigned num_bytes = overshoot / 8; for (unsigned idx=0; idx< num_bytes; idx++) { - mCurrentByte = ByteUtils::getMBitsAtN(data, overshoot, idx*8 + num_left); + mCurrentByte = ByteUtils::getMBitsAtN(static_cast(data), overshoot, idx*8 + num_left); writeByte(mCurrentByte, false); } if (const auto remainder = overshoot % 8; remainder > 0) { - mCurrentByte = ByteUtils::getMBitsAtN(data, remainder, num_bytes*8 + num_left); + mCurrentByte = ByteUtils::getMBitsAtN(static_cast(data), remainder, num_bytes*8 + num_left); mBitOffset = remainder; } else diff --git a/src/core/streams/InputBitStream.cpp b/src/core/streams/InputBitStream.cpp index 75bd78f..8568853 100644 --- a/src/core/streams/InputBitStream.cpp +++ b/src/core/streams/InputBitStream.cpp @@ -12,7 +12,7 @@ bool InputBitStream::isFinished() const return mStream->good(); } -std::vector InputBitStream::peekNextNBytes(unsigned n) const +std::vector InputBitStream::peekNextNBytes(unsigned) const { return {}; } @@ -29,7 +29,7 @@ std::optional InputBitStream::readNextByte() } } -void InputBitStream::writeByte(unsigned char data, bool checkOverflow ) +void InputBitStream::writeByte(unsigned char, bool) { } diff --git a/src/core/streams/OutputBitStream.cpp b/src/core/streams/OutputBitStream.cpp index 9418ede..2579e24 100644 --- a/src/core/streams/OutputBitStream.cpp +++ b/src/core/streams/OutputBitStream.cpp @@ -12,7 +12,7 @@ bool OutputBitStream::isFinished() const return true; } -std::vector OutputBitStream::peekNextNBytes(unsigned n) const +std::vector OutputBitStream::peekNextNBytes(unsigned) const { return {}; } @@ -22,7 +22,7 @@ std::optional OutputBitStream::readNextByte() return std::nullopt; } -void OutputBitStream::writeByte(unsigned char data, bool checkOverflow ) +void OutputBitStream::writeByte(unsigned char data, bool) { (*mStream) << data; }