Skip to content

Commit

Permalink
[C++] Fix warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpt777 committed Jan 29, 2024
1 parent 4269f36 commit f4423d2
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions sbe-tool/src/main/cpp/otf/IrDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ namespace sbe { namespace otf {
class IrDecoder
{
public:
IrDecoder() :
m_length(0)
IrDecoder()
{
}

Expand Down Expand Up @@ -142,7 +141,7 @@ class IrDecoder
// OS specifics
static long long getFileSize(const char *filename)
{
struct stat fileStat;
struct stat fileStat{};

if (::stat(filename, &fileStat) != 0)
{
Expand All @@ -165,7 +164,7 @@ class IrDecoder
int fd = fileno(fptr);
while (remaining > 0)
{
unsigned int bytes = static_cast<unsigned int>(4098 < remaining ? 4098 : remaining);
auto bytes = static_cast<unsigned int>(4098 < remaining ? 4098 : remaining);
long long sz = ::read(fd, buffer + (length - remaining), bytes);
remaining -= sz;
if (sz < 0)
Expand All @@ -183,8 +182,8 @@ class IrDecoder
std::shared_ptr<std::vector<Token>> m_headerTokens;
std::vector<std::shared_ptr<std::vector<Token>>> m_messages;
std::unique_ptr<char[]> m_buffer;
std::uint64_t m_length;
int m_id;
std::uint64_t m_length = 0;
int m_id = 0;

int decodeIr()
{
Expand Down Expand Up @@ -232,10 +231,10 @@ class IrDecoder
tokenCodec.wrapForDecode(
m_buffer.get(), offset, tokenCodec.sbeBlockLength(), tokenCodec.sbeSchemaVersion(), m_length);

Signal signal = static_cast<Signal>(tokenCodec.signal());
PrimitiveType type = static_cast<PrimitiveType>(tokenCodec.primitiveType());
Presence presence = static_cast<Presence>(tokenCodec.presence());
ByteOrder byteOrder = static_cast<ByteOrder>(tokenCodec.byteOrder());
auto signal = static_cast<Signal>(tokenCodec.signal());
auto type = static_cast<PrimitiveType>(tokenCodec.primitiveType());
auto presence = static_cast<Presence>(tokenCodec.presence());
auto byteOrder = static_cast<ByteOrder>(tokenCodec.byteOrder());
std::int32_t tokenOffset = tokenCodec.tokenOffset();
std::int32_t tokenSize = tokenCodec.tokenSize();
std::int32_t id = tokenCodec.fieldId();
Expand Down

0 comments on commit f4423d2

Please sign in to comment.