From 52a172f983827fdbf4506a2babb08ff4d12b4051 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Tue, 10 Aug 2021 14:02:08 -0400 Subject: [PATCH] tools: fix more build warnings in inspector_protocol PR-URL: https://github.com/nodejs/node/pull/39725 Reviewed-By: Rich Trott Reviewed-By: James M Snell --- tools/inspector_protocol/encoding/encoding.cc | 5 +++-- tools/inspector_protocol/lib/encoding_cpp.template | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/inspector_protocol/encoding/encoding.cc b/tools/inspector_protocol/encoding/encoding.cc index 46bd67bc1356b5..636281dd8ad894 100644 --- a/tools/inspector_protocol/encoding/encoding.cc +++ b/tools/inspector_protocol/encoding/encoding.cc @@ -850,8 +850,9 @@ void CBORTokenizer::ReadNextToken(bool enter_envelope) { // We check the the payload in token_start_internal_value_ against // that range (2^31-1 is also known as // std::numeric_limits::max()). - if (!bytes_read || token_start_internal_value_ > - std::numeric_limits::max()) { + if (!bytes_read || + static_cast(token_start_internal_value_) > + static_cast(std::numeric_limits::max())) { SetError(Error::CBOR_INVALID_INT32); return; } diff --git a/tools/inspector_protocol/lib/encoding_cpp.template b/tools/inspector_protocol/lib/encoding_cpp.template index 47662e71baf8de..d3646491140663 100644 --- a/tools/inspector_protocol/lib/encoding_cpp.template +++ b/tools/inspector_protocol/lib/encoding_cpp.template @@ -858,8 +858,9 @@ void CBORTokenizer::ReadNextToken(bool enter_envelope) { // We check the the payload in token_start_internal_value_ against // that range (2^31-1 is also known as // std::numeric_limits::max()). - if (!bytes_read || token_start_internal_value_ > - std::numeric_limits::max()) { + if (!bytes_read || + static_cast(token_start_internal_value_) > + static_cast(std::numeric_limits::max())) { SetError(Error::CBOR_INVALID_INT32); return; }