Skip to content

Commit 0a89cc4

Browse files
David Kilzerphiln
authored andcommitted
[WebRTC] Fix -Wunused-but-set-variable warnings in the libwebrtc project
https://bugs.webkit.org/show_bug.cgi?id=250622 <rdar://104261631> 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
1 parent 5ada4df commit 0a89cc4

3 files changed

Lines changed: 32 additions & 0 deletions

File tree

Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_pps_parser.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ absl::optional<H265PpsParser::PpsState> H265PpsParser::ParseInternal(
172172
// redundant_pic_cnt_present_flag: u(1)
173173
pps.redundant_pic_cnt_present_flag = bit_buffer->ReadBits(1);
174174

175+
// Ignore -Wunused-but-set-variable warnings.
176+
(void)bits_tmp;
177+
(void)golomb_ignored;
178+
175179
return pps;
176180
}
177181

Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_sps_parser.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ absl::optional<H265SpsParser::SpsState> H265SpsParser::ParseSpsUpToVui(Bitstream
128128
}
129129
// sps_seq_parameter_set_id: ue(v)
130130
golomb_ignored = buffer->ReadExponentialGolomb();
131+
(void)golomb_ignored; // Ignore -Wunused-but-set-variable warning.
131132
// chrome_format_idc: ue(v)
132133
chroma_format_idc = buffer->ReadExponentialGolomb();
133134
if (chroma_format_idc == 3) {
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
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
2+
index 6f13f3b807bb..1df2667d2eae 100644
3+
--- a/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_pps_parser.cc
4+
+++ b/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_pps_parser.cc
5+
@@ -172,6 +172,10 @@ absl::optional<H265PpsParser::PpsState> H265PpsParser::ParseInternal(
6+
// redundant_pic_cnt_present_flag: u(1)
7+
pps.redundant_pic_cnt_present_flag = bit_buffer->ReadBits(1);
8+
9+
+ // Ignore -Wunused-but-set-variable warnings.
10+
+ (void)bits_tmp;
11+
+ (void)golomb_ignored;
12+
+
13+
return pps;
14+
}
15+
16+
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
17+
index f4628ad63eeb..0d157624f533 100644
18+
--- a/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_sps_parser.cc
19+
+++ b/Source/ThirdParty/libwebrtc/Source/webrtc/common_video/h265/h265_sps_parser.cc
20+
@@ -128,6 +128,7 @@ absl::optional<H265SpsParser::SpsState> H265SpsParser::ParseSpsUpToVui(Bitstream
21+
}
22+
// sps_seq_parameter_set_id: ue(v)
23+
golomb_ignored = buffer->ReadExponentialGolomb();
24+
+ (void)golomb_ignored; // Ignore -Wunused-but-set-variable warning.
25+
// chrome_format_idc: ue(v)
26+
chroma_format_idc = buffer->ReadExponentialGolomb();
27+
if (chroma_format_idc == 3) {

0 commit comments

Comments
 (0)