From 62a3402b5d027b7173f03c8930f3504456bea87d Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 31 Oct 2018 07:48:59 +0100 Subject: [PATCH] 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(offset), offset); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ --- src/stream_base.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream_base.cc b/src/stream_base.cc index adb839c3e5d633..670b3cbd5091d1 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(nread), nread); - CHECK_EQ(static_cast(offset), offset); + CHECK_LE(offset, INT32_MAX); if (ab.IsEmpty()) { CHECK_EQ(offset, 0);