Skip to content

Commit fdba226

Browse files
danbevtargos
authored andcommitted
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 <[email protected]> Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent b86a89b commit fdba226

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/stream_base.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ void StreamBase::CallJSOnreadMethod(ssize_t nread,
292292

293293
#ifdef DEBUG
294294
CHECK_EQ(static_cast<int32_t>(nread), nread);
295-
CHECK_EQ(static_cast<int32_t>(offset), offset);
295+
CHECK_LE(offset, INT32_MAX);
296296

297297
if (ab.IsEmpty()) {
298298
CHECK_EQ(offset, 0);

0 commit comments

Comments
 (0)