Skip to content

Commit

Permalink
src: fix compiler warning for debug build
Browse files Browse the repository at this point in the history
This commit updates the check of the offset argument passed to
CallJSOnreadMethod to avoid doing a cast as this currently generates
the following compiler warning when doing a debug build:

./src/stream_base.cc:295:3:
warning: comparison of integers of different signs:
'int32_t' (aka 'int') and 'size_t' (aka 'unsigned long')
[-Wsign-compare]
  CHECK_EQ(static_cast<int32_t>(offset), offset);
  ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~
  • Loading branch information
danbev committed Nov 1, 2018
1 parent d32b5bd commit 62a3402
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stream_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ void StreamBase::CallJSOnreadMethod(ssize_t nread,

#ifdef DEBUG
CHECK_EQ(static_cast<int32_t>(nread), nread);
CHECK_EQ(static_cast<int32_t>(offset), offset);
CHECK_LE(offset, INT32_MAX);

if (ab.IsEmpty()) {
CHECK_EQ(offset, 0);
Expand Down

0 comments on commit 62a3402

Please sign in to comment.