From 523b2e6efbd90dbe2d3a0289831c8a46a2c3d65d Mon Sep 17 00:00:00 2001 From: David Kilzer Date: Mon, 16 Jan 2023 08:58:28 -0800 Subject: [PATCH] [WebRTC] Fix -Wunused-but-set-variable warnings in the libwebrtc project https://bugs.webkit.org/show_bug.cgi?id=250622 Reviewed by Youenn Fablet. * Source/ThirdParty/libwebrtc/Configurations/Base.xcconfig: (WK_FIXME_WARNING_CFLAGS): - Remove -Wno-unused-but-set-variable. * Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_pps_parser.cc: - Add empty statements for bits_tmp and golomb_ignored variables. * Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_sps_parser.cc: - Add empty statement for golomb_ignored variable. * Source/ThirdParty/libwebrtc/WebKit/libwebrtc-fix-Wunused-but-set-variable.diff: Add. Canonical link: https://commits.webkit.org/258956@main --- .../common_video/h265/h265_pps_parser.cc | 4 +++ .../common_video/h265/h265_sps_parser.cc | 1 + ...ibwebrtc-fix-Wunused-but-set-variable.diff | 27 +++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 Source/ThirdParty/libwebrtc/WebKit/libwebrtc-fix-Wunused-but-set-variable.diff diff --git a/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_pps_parser.cc b/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_pps_parser.cc index 6f13f3b807bb3..1df2667d2eaea 100644 --- a/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_pps_parser.cc +++ b/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_pps_parser.cc @@ -172,6 +172,10 @@ absl::optional H265PpsParser::ParseInternal( // redundant_pic_cnt_present_flag: u(1) pps.redundant_pic_cnt_present_flag = bit_buffer->ReadBits(1); + // Ignore -Wunused-but-set-variable warnings. + (void)bits_tmp; + (void)golomb_ignored; + return pps; } diff --git a/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_sps_parser.cc b/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_sps_parser.cc index f4628ad63eebd..0d157624f5334 100644 --- a/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_sps_parser.cc +++ b/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_sps_parser.cc @@ -128,6 +128,7 @@ absl::optional H265SpsParser::ParseSpsUpToVui(Bitstream } // sps_seq_parameter_set_id: ue(v) golomb_ignored = buffer->ReadExponentialGolomb(); + (void)golomb_ignored; // Ignore -Wunused-but-set-variable warning. // chrome_format_idc: ue(v) chroma_format_idc = buffer->ReadExponentialGolomb(); if (chroma_format_idc == 3) { diff --git a/Source/ThirdParty/libwebrtc/WebKit/libwebrtc-fix-Wunused-but-set-variable.diff b/Source/ThirdParty/libwebrtc/WebKit/libwebrtc-fix-Wunused-but-set-variable.diff new file mode 100644 index 0000000000000..50a53bdfe1289 --- /dev/null +++ b/Source/ThirdParty/libwebrtc/WebKit/libwebrtc-fix-Wunused-but-set-variable.diff @@ -0,0 +1,27 @@ +diff --git a/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_pps_parser.cc b/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_pps_parser.cc +index 6f13f3b807bb..1df2667d2eae 100644 +--- a/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_pps_parser.cc ++++ b/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_pps_parser.cc +@@ -172,6 +172,10 @@ absl::optional H265PpsParser::ParseInternal( + // redundant_pic_cnt_present_flag: u(1) + pps.redundant_pic_cnt_present_flag = bit_buffer->ReadBits(1); + ++ // Ignore -Wunused-but-set-variable warnings. ++ (void)bits_tmp; ++ (void)golomb_ignored; ++ + return pps; + } + +diff --git a/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_sps_parser.cc b/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_sps_parser.cc +index f4628ad63eeb..0d157624f533 100644 +--- a/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_sps_parser.cc ++++ b/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_sps_parser.cc +@@ -128,6 +128,7 @@ absl::optional H265SpsParser::ParseSpsUpToVui(Bitstream + } + // sps_seq_parameter_set_id: ue(v) + golomb_ignored = buffer->ReadExponentialGolomb(); ++ (void)golomb_ignored; // Ignore -Wunused-but-set-variable warning. + // chrome_format_idc: ue(v) + chroma_format_idc = buffer->ReadExponentialGolomb(); + if (chroma_format_idc == 3) {