Skip to content

Commit

Permalink
Removing clang:find_bad_constructs from logging (part 1).
Browse files Browse the repository at this point in the history
Bug: webrtc:9251, webrtc:163
Change-Id: I42ce2edd4d5974e89d7d29f242d99d1c721b9bc0
Reviewed-on: https://webrtc-review.googlesource.com/88763
Reviewed-by: Stefan Holmer <[email protected]>
Commit-Queue: Mirko Bonadei <[email protected]>
Cr-Commit-Position: refs/heads/master@{#24017}
  • Loading branch information
MirkoBonadei authored and Commit Bot committed Jul 18, 2018
1 parent 61b86af commit 9d764e8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 35 deletions.
26 changes: 1 addition & 25 deletions logging/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,6 @@ rtc_static_library("rtc_event_log_impl_encoder") {
defines += [ "ENABLE_RTC_EVENT_LOG" ]
deps += [ ":rtc_event_log_proto" ]
}

# TODO(eladalon): Remove this.
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
}

rtc_source_set("rtc_event_log_impl_output") {
Expand All @@ -203,11 +197,6 @@ rtc_source_set("rtc_event_log_impl_output") {
"../rtc_base:checks",
"../rtc_base:rtc_base_approved",
]

if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
}

rtc_static_library("rtc_event_log_impl_base") {
Expand Down Expand Up @@ -237,11 +226,6 @@ rtc_static_library("rtc_event_log_impl_base") {
defines += [ "ENABLE_RTC_EVENT_LOG" ]
deps += [ ":rtc_event_log_proto" ]
}

if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
}

rtc_source_set("fake_rtc_event_log") {
Expand Down Expand Up @@ -359,6 +343,7 @@ if (rtc_enable_protobuf) {
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
}

rtc_test("rtc_event_log2rtp_dump") {
testonly = true
sources = [
Expand Down Expand Up @@ -423,10 +408,6 @@ if (rtc_enable_protobuf) {
"../rtc_base:checks",
"../rtc_base:rtc_base_approved",
]
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
}
}
}
Expand All @@ -447,11 +428,6 @@ rtc_source_set("ice_log") {
"../rtc_base:rtc_base_approved",
"//third_party/abseil-cpp/absl/memory",
]

if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
}

if (rtc_include_tests) {
Expand Down
21 changes: 11 additions & 10 deletions logging/rtc_event_log/encoder/rtc_event_log_encoder_legacy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ std::string RtcEventLogEncoderLegacy::EncodeAlrState(
rtclog_event.set_timestamp_us(event.timestamp_us_);
rtclog_event.set_type(rtclog::Event::ALR_STATE_EVENT);

auto alr_state = rtclog_event.mutable_alr_state();
auto* alr_state = rtclog_event.mutable_alr_state();
alr_state->set_in_alr(event.in_alr_);
return Serialize(&rtclog_event);
}
Expand All @@ -371,7 +371,7 @@ std::string RtcEventLogEncoderLegacy::EncodeAudioNetworkAdaptation(
rtclog_event.set_timestamp_us(event.timestamp_us_);
rtclog_event.set_type(rtclog::Event::AUDIO_NETWORK_ADAPTATION_EVENT);

auto audio_network_adaptation =
auto* audio_network_adaptation =
rtclog_event.mutable_audio_network_adaptation();
if (event.config_->bitrate_bps)
audio_network_adaptation->set_bitrate_bps(*event.config_->bitrate_bps);
Expand All @@ -398,7 +398,7 @@ std::string RtcEventLogEncoderLegacy::EncodeAudioPlayout(
rtclog_event.set_timestamp_us(event.timestamp_us_);
rtclog_event.set_type(rtclog::Event::AUDIO_PLAYOUT_EVENT);

auto playout_event = rtclog_event.mutable_audio_playout_event();
auto* playout_event = rtclog_event.mutable_audio_playout_event();
playout_event->set_local_ssrc(event.ssrc_);

return Serialize(&rtclog_event);
Expand Down Expand Up @@ -452,7 +452,7 @@ std::string RtcEventLogEncoderLegacy::EncodeBweUpdateDelayBased(
rtclog_event.set_timestamp_us(event.timestamp_us_);
rtclog_event.set_type(rtclog::Event::DELAY_BASED_BWE_UPDATE);

auto bwe_event = rtclog_event.mutable_delay_based_bwe_update();
auto* bwe_event = rtclog_event.mutable_delay_based_bwe_update();
bwe_event->set_bitrate_bps(event.bitrate_bps_);
bwe_event->set_detector_state(ConvertDetectorState(event.detector_state_));

Expand All @@ -465,7 +465,7 @@ std::string RtcEventLogEncoderLegacy::EncodeBweUpdateLossBased(
rtclog_event.set_timestamp_us(event.timestamp_us_);
rtclog_event.set_type(rtclog::Event::LOSS_BASED_BWE_UPDATE);

auto bwe_event = rtclog_event.mutable_loss_based_bwe_update();
auto* bwe_event = rtclog_event.mutable_loss_based_bwe_update();
bwe_event->set_bitrate_bps(event.bitrate_bps_);
bwe_event->set_fraction_loss(event.fraction_loss_);
bwe_event->set_total_packets(event.total_packets_);
Expand All @@ -479,7 +479,7 @@ std::string RtcEventLogEncoderLegacy::EncodeIceCandidatePairConfig(
encoded_rtc_event.set_timestamp_us(event.timestamp_us_);
encoded_rtc_event.set_type(rtclog::Event::ICE_CANDIDATE_PAIR_CONFIG);

auto encoded_ice_event =
auto* encoded_ice_event =
encoded_rtc_event.mutable_ice_candidate_pair_config();
encoded_ice_event->set_config_type(
ConvertIceCandidatePairConfigType(event.type_));
Expand Down Expand Up @@ -508,7 +508,8 @@ std::string RtcEventLogEncoderLegacy::EncodeIceCandidatePairEvent(
encoded_rtc_event.set_timestamp_us(event.timestamp_us_);
encoded_rtc_event.set_type(rtclog::Event::ICE_CANDIDATE_PAIR_EVENT);

auto encoded_ice_event = encoded_rtc_event.mutable_ice_candidate_pair_event();
auto* encoded_ice_event =
encoded_rtc_event.mutable_ice_candidate_pair_event();
encoded_ice_event->set_event_type(
ConvertIceCandidatePairEventType(event.type_));
encoded_ice_event->set_candidate_pair_id(event.candidate_pair_id_);
Expand All @@ -521,7 +522,7 @@ std::string RtcEventLogEncoderLegacy::EncodeProbeClusterCreated(
rtclog_event.set_timestamp_us(event.timestamp_us_);
rtclog_event.set_type(rtclog::Event::BWE_PROBE_CLUSTER_CREATED_EVENT);

auto probe_cluster = rtclog_event.mutable_probe_cluster();
auto* probe_cluster = rtclog_event.mutable_probe_cluster();
probe_cluster->set_id(event.id_);
probe_cluster->set_bitrate_bps(event.bitrate_bps_);
probe_cluster->set_min_packets(event.min_probes_);
Expand All @@ -536,7 +537,7 @@ std::string RtcEventLogEncoderLegacy::EncodeProbeResultFailure(
rtclog_event.set_timestamp_us(event.timestamp_us_);
rtclog_event.set_type(rtclog::Event::BWE_PROBE_RESULT_EVENT);

auto probe_result = rtclog_event.mutable_probe_result();
auto* probe_result = rtclog_event.mutable_probe_result();
probe_result->set_id(event.id_);
probe_result->set_result(ConvertProbeResultType(event.failure_reason_));

Expand All @@ -549,7 +550,7 @@ std::string RtcEventLogEncoderLegacy::EncodeProbeResultSuccess(
rtclog_event.set_timestamp_us(event.timestamp_us_);
rtclog_event.set_type(rtclog::Event::BWE_PROBE_RESULT_EVENT);

auto probe_result = rtclog_event.mutable_probe_result();
auto* probe_result = rtclog_event.mutable_probe_result();
probe_result->set_id(event.id_);
probe_result->set_result(rtclog::BweProbeResult::SUCCESS);
probe_result->set_bitrate_bps(event.bitrate_bps_);
Expand Down

0 comments on commit 9d764e8

Please sign in to comment.