★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/fdba226d13Nouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files
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: #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>
  • Loading branch information
danbev authored and targos committed Nov 3, 2018
1 parent b86a89b commit fdba226d131ca2c153ded371a333809eda04f239
Showing with 1 addition and 1 deletion.
  1. +1 −1 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);

0 comments on commit fdba226

Please sign in to comment.