diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-10-31 07:48:59 +0100 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-11-03 00:13:09 -0700 |
commit | 2ea70eae732682851ae6f9403daad7a966c11f5f (patch) | |
tree | 064b612a4fbe53ecd2053c12aa0b849665ac8753 /src | |
parent | eada8c7ca20092858790b522299e80d8f4fdd497 (diff) | |
download | android-node-v8-2ea70eae732682851ae6f9403daad7a966c11f5f.tar.gz android-node-v8-2ea70eae732682851ae6f9403daad7a966c11f5f.tar.bz2 android-node-v8-2ea70eae732682851ae6f9403daad7a966c11f5f.zip |
src: fix compiler warning for debug build
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);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
PR-URL: https://github.com/nodejs/node/pull/23994
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/stream_base.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stream_base.cc b/src/stream_base.cc index adb839c3e5..670b3cbd50 100644 --- a/src/stream_base.cc +++ b/src/stream_base.cc @@ -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); |