From d1ab5ef4ba18e27388fc193126238dc771289428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sat, 29 Nov 2025 07:50:41 +0100 Subject: [PATCH] src: use static_cast instead of C-style cast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/60868 Reviewed-By: René Reviewed-By: Deokjin Kim Reviewed-By: Chengzhong Wu Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: Gerhard Stöbich Reviewed-By: Stephen Belanger Reviewed-By: Rafael Gonzaga --- src/node_http2.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/node_http2.cc b/src/node_http2.cc index e53022d94f5ca1..72b52ef575c50c 100644 --- a/src/node_http2.cc +++ b/src/node_http2.cc @@ -251,7 +251,7 @@ size_t Http2Settings::Init( for (uint32_t i = 0; i < numAddSettings; i++) { uint32_t key = buffer[offset + i * 2 + 0]; uint32_t val = buffer[offset + i * 2 + 1]; - entries[count++] = nghttp2_settings_entry{(int32_t)key, val}; + entries[count++] = nghttp2_settings_entry{static_cast(key), val}; } } @@ -331,8 +331,8 @@ void Http2Settings::Update(Http2Session* session, get_setting fn, bool local) { for (size_t i = 0; i < imax; i++) { // We flag unset the settings with a bit above the allowed range if (!(custom_settings.entries[i].settings_id & (~0xffff))) { - uint32_t settings_id = - (uint32_t)(custom_settings.entries[i].settings_id & 0xffff); + uint32_t settings_id = static_cast( + custom_settings.entries[i].settings_id & 0xffff); size_t j = 0; while (j < count) { if ((buffer[IDX_SETTINGS_COUNT + 1 + j * 2 + 1] & 0xffff) == @@ -647,7 +647,7 @@ void Http2Session::FetchAllowedRemoteCustomSettings() { (buffer[offset + i * 2 + 0] & 0xffff) | (1 << 16); // setting the bit 16 indicates, that no values has been set - entries[count++] = nghttp2_settings_entry{(int32_t)key, 0}; + entries[count++] = nghttp2_settings_entry{static_cast(key), 0}; } remote_custom_settings_.number = count; }