Skip to content

Commit d1ab5ef

Browse files
authored
src: use static_cast instead of C-style cast
PR-URL: #60868 Reviewed-By: René <[email protected]> Reviewed-By: Deokjin Kim <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]>
1 parent 7643c2a commit d1ab5ef

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/node_http2.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ size_t Http2Settings::Init(
251251
for (uint32_t i = 0; i < numAddSettings; i++) {
252252
uint32_t key = buffer[offset + i * 2 + 0];
253253
uint32_t val = buffer[offset + i * 2 + 1];
254-
entries[count++] = nghttp2_settings_entry{(int32_t)key, val};
254+
entries[count++] = nghttp2_settings_entry{static_cast<int32_t>(key), val};
255255
}
256256
}
257257

@@ -331,8 +331,8 @@ void Http2Settings::Update(Http2Session* session, get_setting fn, bool local) {
331331
for (size_t i = 0; i < imax; i++) {
332332
// We flag unset the settings with a bit above the allowed range
333333
if (!(custom_settings.entries[i].settings_id & (~0xffff))) {
334-
uint32_t settings_id =
335-
(uint32_t)(custom_settings.entries[i].settings_id & 0xffff);
334+
uint32_t settings_id = static_cast<uint32_t>(
335+
custom_settings.entries[i].settings_id & 0xffff);
336336
size_t j = 0;
337337
while (j < count) {
338338
if ((buffer[IDX_SETTINGS_COUNT + 1 + j * 2 + 1] & 0xffff) ==
@@ -647,7 +647,7 @@ void Http2Session::FetchAllowedRemoteCustomSettings() {
647647
(buffer[offset + i * 2 + 0] & 0xffff) |
648648
(1
649649
<< 16); // setting the bit 16 indicates, that no values has been set
650-
entries[count++] = nghttp2_settings_entry{(int32_t)key, 0};
650+
entries[count++] = nghttp2_settings_entry{static_cast<int32_t>(key), 0};
651651
}
652652
remote_custom_settings_.number = count;
653653
}

0 commit comments

Comments
 (0)