From 74456f5c0dd0e215e9d5b868b54b083e2ecfbe45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Wed, 26 Nov 2025 18:02:14 +0100 Subject: [PATCH] src: use static_cast instead of C-style cast --- 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; }