Skip to content

Commit

Permalink
Sign-conversion warnings fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mikir committed Jun 14, 2024
1 parent d9cb919 commit 0d70cbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmake/compiler_utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ endfunction()
# Prepares warnings setup for current target
function(compiler_get_warnings_setup VARNAME)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(WARNINGS_SETUP "-Wall -Wextra -pedantic -Wconversion -Wno-long-long")
set(WARNINGS_SETUP "-Wall -Wextra -pedantic -Wconversion -Wsign-conversion -Wno-long-long")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(WARNINGS_SETUP_LIST "-Weverything"
"-Wno-system-headers"
Expand Down
4 changes: 2 additions & 2 deletions compiler/extensions/cpp/runtime/src/zserio/DeltaContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class DeltaContext
}
else
{
return m_maxBitNumber + (m_maxBitNumber > 0 ? 1 : 0);
return static_cast<size_t>(m_maxBitNumber + (m_maxBitNumber > 0 ? 1 : 0));
}
}

Expand Down Expand Up @@ -273,7 +273,7 @@ class DeltaContext
{
if (isFlagSet(IS_PACKED_FLAG))
{
const size_t deltaBitSize = m_maxBitNumber + (m_maxBitNumber > 0 ? 1 : 0);
const size_t deltaBitSize = static_cast<size_t>(m_maxBitNumber + (m_maxBitNumber > 0 ? 1 : 0));
const size_t packedBitSizeWithDescriptor = 1 + MAX_BIT_NUMBER_BITS + // descriptor
m_firstElementBitSize + (m_numElements - 1) * deltaBitSize;
const size_t unpackedBitSizeWithDescriptor = 1 + m_unpackedBitSize;
Expand Down

0 comments on commit 0d70cbe

Please sign in to comment.