Skip to content

Commit 5e68fd0

Browse files
committed
[C++] Warnings cleanup.
1 parent 690e833 commit 5e68fd0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

sbe-samples/src/main/cpp/OtfExample.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,10 +449,11 @@ int main(int argc, char **argv)
449449
std::uint64_t actingVersion = headerDecoder.getSchemaVersion(buffer);
450450
std::uint64_t blockLength = headerDecoder.getBlockLength(buffer);
451451

452-
std::shared_ptr<std::vector<Token>> messageTokens = irDecoder.message(templateId, actingVersion);
452+
std::shared_ptr<std::vector<Token>> messageTokens = irDecoder.message(
453+
static_cast<int>(templateId), static_cast<int>(actingVersion));
453454

454-
const std::size_t result =
455-
OtfMessageDecoder::decode(messageBuffer, length, actingVersion, blockLength, messageTokens, tokenListener);
455+
const std::size_t result = OtfMessageDecoder::decode(
456+
messageBuffer, length, actingVersion, blockLength, messageTokens, tokenListener);
456457

457458
std::cout << "result = " << result << "\n";
458459

sbe-tool/src/main/cpp/otf/IrDecoder.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class IrDecoder
6969

7070
int decode(const char *filename)
7171
{
72-
long fileSize = getFileSize(filename);
72+
long long fileSize = getFileSize(filename);
7373

7474
if (fileSize < 0)
7575
{
@@ -140,7 +140,7 @@ class IrDecoder
140140

141141
protected:
142142
// OS specifics
143-
static long getFileSize(const char *filename)
143+
static long long getFileSize(const char *filename)
144144
{
145145
struct stat fileStat;
146146

@@ -165,7 +165,7 @@ class IrDecoder
165165
int fd = fileno(fptr);
166166
while (remaining > 0)
167167
{
168-
long sz = ::read(fd, buffer + (length - remaining), 4098 < remaining ? 4098 : remaining);
168+
ssize_t sz = ::read(fd, buffer + (length - remaining), 4098 < remaining ? 4098 : remaining);
169169
remaining -= sz;
170170
if (sz < 0)
171171
{

0 commit comments

Comments
 (0)