From 342124eb01ac95d7408dbb54086a4d4363d9c5fc Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Sat, 21 Oct 2017 19:55:30 -0400 Subject: [PATCH] http2: fix errors in debug statements When compiling with --debug-http2 flag, compiler complains about passing wrong type of argument to DEBUG_HTTP2. Fix by using static_cast to uint32_t. PR-URL: https://github.com/nodejs/node/pull/16373 Reviewed-By: James M Snell --- src/node_http2.cc | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/node_http2.cc b/src/node_http2.cc index e10c71e9a84e1e..568b59b5b4d722 100644 --- a/src/node_http2.cc +++ b/src/node_http2.cc @@ -141,42 +141,45 @@ void PackSettings(const FunctionCallbackInfo& args) { if (flags & (1 << IDX_SETTINGS_HEADER_TABLE_SIZE)) { DEBUG_HTTP2("Setting header table size: %d\n", - buffer[IDX_SETTINGS_HEADER_TABLE_SIZE]); + static_cast(buffer[IDX_SETTINGS_HEADER_TABLE_SIZE])); entries.push_back({NGHTTP2_SETTINGS_HEADER_TABLE_SIZE, buffer[IDX_SETTINGS_HEADER_TABLE_SIZE]}); } if (flags & (1 << IDX_SETTINGS_MAX_CONCURRENT_STREAMS)) { DEBUG_HTTP2("Setting max concurrent streams: %d\n", - buffer[IDX_SETTINGS_MAX_CONCURRENT_STREAMS]); + static_cast( + buffer[IDX_SETTINGS_MAX_CONCURRENT_STREAMS])); entries.push_back({NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, buffer[IDX_SETTINGS_MAX_CONCURRENT_STREAMS]}); } if (flags & (1 << IDX_SETTINGS_MAX_FRAME_SIZE)) { DEBUG_HTTP2("Setting max frame size: %d\n", - buffer[IDX_SETTINGS_MAX_FRAME_SIZE]); + static_cast(buffer[IDX_SETTINGS_MAX_FRAME_SIZE])); entries.push_back({NGHTTP2_SETTINGS_MAX_FRAME_SIZE, buffer[IDX_SETTINGS_MAX_FRAME_SIZE]}); } if (flags & (1 << IDX_SETTINGS_INITIAL_WINDOW_SIZE)) { DEBUG_HTTP2("Setting initial window size: %d\n", - buffer[IDX_SETTINGS_INITIAL_WINDOW_SIZE]); + static_cast( + buffer[IDX_SETTINGS_INITIAL_WINDOW_SIZE])); entries.push_back({NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE, buffer[IDX_SETTINGS_INITIAL_WINDOW_SIZE]}); } if (flags & (1 << IDX_SETTINGS_MAX_HEADER_LIST_SIZE)) { DEBUG_HTTP2("Setting max header list size: %d\n", - buffer[IDX_SETTINGS_MAX_HEADER_LIST_SIZE]); + static_cast( + buffer[IDX_SETTINGS_MAX_HEADER_LIST_SIZE])); entries.push_back({NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE, buffer[IDX_SETTINGS_MAX_HEADER_LIST_SIZE]}); } if (flags & (1 << IDX_SETTINGS_ENABLE_PUSH)) { DEBUG_HTTP2("Setting enable push: %d\n", - buffer[IDX_SETTINGS_ENABLE_PUSH]); + static_cast(buffer[IDX_SETTINGS_ENABLE_PUSH])); entries.push_back({NGHTTP2_SETTINGS_ENABLE_PUSH, buffer[IDX_SETTINGS_ENABLE_PUSH]}); } @@ -418,42 +421,45 @@ void Http2Session::SubmitSettings(const FunctionCallbackInfo& args) { if (flags & (1 << IDX_SETTINGS_HEADER_TABLE_SIZE)) { DEBUG_HTTP2("Setting header table size: %d\n", - buffer[IDX_SETTINGS_HEADER_TABLE_SIZE]); + static_cast(buffer[IDX_SETTINGS_HEADER_TABLE_SIZE])); entries.push_back({NGHTTP2_SETTINGS_HEADER_TABLE_SIZE, buffer[IDX_SETTINGS_HEADER_TABLE_SIZE]}); } if (flags & (1 << IDX_SETTINGS_MAX_CONCURRENT_STREAMS)) { DEBUG_HTTP2("Setting max concurrent streams: %d\n", - buffer[IDX_SETTINGS_MAX_CONCURRENT_STREAMS]); + static_cast( + buffer[IDX_SETTINGS_MAX_CONCURRENT_STREAMS])); entries.push_back({NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, buffer[IDX_SETTINGS_MAX_CONCURRENT_STREAMS]}); } if (flags & (1 << IDX_SETTINGS_MAX_FRAME_SIZE)) { DEBUG_HTTP2("Setting max frame size: %d\n", - buffer[IDX_SETTINGS_MAX_FRAME_SIZE]); + static_cast(buffer[IDX_SETTINGS_MAX_FRAME_SIZE])); entries.push_back({NGHTTP2_SETTINGS_MAX_FRAME_SIZE, buffer[IDX_SETTINGS_MAX_FRAME_SIZE]}); } if (flags & (1 << IDX_SETTINGS_INITIAL_WINDOW_SIZE)) { DEBUG_HTTP2("Setting initial window size: %d\n", - buffer[IDX_SETTINGS_INITIAL_WINDOW_SIZE]); + static_cast( + buffer[IDX_SETTINGS_INITIAL_WINDOW_SIZE])); entries.push_back({NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE, buffer[IDX_SETTINGS_INITIAL_WINDOW_SIZE]}); } if (flags & (1 << IDX_SETTINGS_MAX_HEADER_LIST_SIZE)) { DEBUG_HTTP2("Setting max header list size: %d\n", - buffer[IDX_SETTINGS_MAX_HEADER_LIST_SIZE]); + static_cast( + buffer[IDX_SETTINGS_MAX_HEADER_LIST_SIZE])); entries.push_back({NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE, buffer[IDX_SETTINGS_MAX_HEADER_LIST_SIZE]}); } if (flags & (1 << IDX_SETTINGS_ENABLE_PUSH)) { DEBUG_HTTP2("Setting enable push: %d\n", - buffer[IDX_SETTINGS_ENABLE_PUSH]); + static_cast(buffer[IDX_SETTINGS_ENABLE_PUSH])); entries.push_back({NGHTTP2_SETTINGS_ENABLE_PUSH, buffer[IDX_SETTINGS_ENABLE_PUSH]}); }