Replace ABSL_FALLTHROUGH_INTENDED with c++17 attribute

the new spelling is more standard and more compact, in particular doesn't need extra include and thus dependency

Bug: None
Change-Id: Iaea69d2154e4d9eff2468514f5734cb3fe016ff8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/245080
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35709}
This commit is contained in:
Danil Chapovalov
2022-01-17 14:41:13 +01:00
committed by WebRTC LUCI CQ
parent 506e5d5d14
commit 46cc32d89f
11 changed files with 11 additions and 22 deletions

View File

@ -16,7 +16,6 @@
#include <string>
#include <utility>
#include "absl/base/macros.h"
#include "api/video/encoded_image.h"
#include "api/video_codecs/video_decoder.h"
#include "modules/video_coding/include/video_error_codes.h"
@ -209,7 +208,7 @@ int32_t VideoDecoderSoftwareFallbackWrapper::Decode(
}
// Fallback decoder initialized, fall-through.
ABSL_FALLTHROUGH_INTENDED;
[[fallthrough]];
}
case DecoderType::kFallback:
return fallback_decoder_->Decode(input_image, missing_frames,

View File

@ -155,7 +155,7 @@ class VideoEncoderSoftwareFallbackWrapper final : public VideoEncoder {
RTC_LOG(LS_WARNING)
<< "Trying to access encoder in uninitialized fallback wrapper.";
// Return main encoder to preserve previous behavior.
ABSL_FALLTHROUGH_INTENDED;
[[fallthrough]];
case EncoderState::kMainEncoderUsed:
return encoder_.get();
case EncoderState::kFallbackDueToFailure:

View File

@ -375,7 +375,7 @@ VideoStreamAdapter::RestrictionsOrState VideoStreamAdapter::GetAdaptationUpStep(
return increase_frame_rate;
}
// else, increase resolution.
ABSL_FALLTHROUGH_INTENDED;
[[fallthrough]];
}
case DegradationPreference::MAINTAIN_FRAMERATE: {
// Attempt to increase pixel count.
@ -459,7 +459,7 @@ VideoStreamAdapter::GetAdaptationDownStep(
return decrease_frame_rate;
}
// else, decrease resolution.
ABSL_FALLTHROUGH_INTENDED;
[[fallthrough]];
}
case DegradationPreference::MAINTAIN_FRAMERATE: {
return DecreaseResolution(input_state, current_restrictions);

View File

@ -15,7 +15,6 @@
#include <utility>
#include <vector>
#include "absl/base/macros.h"
#include "absl/types/optional.h"
#include "absl/types/variant.h"
#include "common_video/h264/h264_common.h"
@ -197,7 +196,7 @@ absl::optional<VideoRtpDepacketizer::ParsedRtpPayload> ProcessStapAOrSingleNalu(
case H264::NaluType::kIdr:
parsed_payload->video_header.frame_type =
VideoFrameType::kVideoFrameKey;
ABSL_FALLTHROUGH_INTENDED;
[[fallthrough]];
case H264::NaluType::kSlice: {
absl::optional<uint32_t> pps_id = PpsParser::ParsePpsIdFromSlice(
&payload_data[start_offset], end_offset - start_offset);

View File

@ -116,7 +116,7 @@ void RtpSeqNumOnlyRefFinder::RetryStashedFrames(
case kHandOff:
complete_frame = true;
res.push_back(std::move(*frame_it));
ABSL_FALLTHROUGH_INTENDED;
[[fallthrough]];
case kDrop:
frame_it = stashed_frames_.erase(frame_it);
}

View File

@ -218,7 +218,7 @@ void RtpVp8RefFinder::RetryStashedFrames(
case kHandOff:
complete_frame = true;
res.push_back(std::move(*frame_it));
ABSL_FALLTHROUGH_INTENDED;
[[fallthrough]];
case kDrop:
frame_it = stashed_frames_.erase(frame_it);
}

View File

@ -314,7 +314,7 @@ void RtpVp9RefFinder::RetryStashedFrames(
case kHandOff:
complete_frame = true;
res.push_back(std::move(*frame_it));
ABSL_FALLTHROUGH_INTENDED;
[[fallthrough]];
case kDrop:
frame_it = stashed_frames_.erase(frame_it);
}

View File

@ -494,17 +494,13 @@ SocketState DcSctpSocket::state() const {
case State::kClosed:
return SocketState::kClosed;
case State::kCookieWait:
ABSL_FALLTHROUGH_INTENDED;
case State::kCookieEchoed:
return SocketState::kConnecting;
case State::kEstablished:
return SocketState::kConnected;
case State::kShutdownPending:
ABSL_FALLTHROUGH_INTENDED;
case State::kShutdownSent:
ABSL_FALLTHROUGH_INTENDED;
case State::kShutdownReceived:
ABSL_FALLTHROUGH_INTENDED;
case State::kShutdownAckSent:
return SocketState::kShuttingDown;
}

View File

@ -10,7 +10,6 @@
#import "voice_processing_audio_unit.h"
#include "absl/base/macros.h"
#include "rtc_base/checks.h"
#include "system_wrappers/include/metrics.h"
@ -466,13 +465,11 @@ void VoiceProcessingAudioUnit::DisposeAudioUnit() {
switch (state_) {
case kStarted:
Stop();
// Fall through.
ABSL_FALLTHROUGH_INTENDED;
[[fallthrough]];
case kInitialized:
Uninitialize();
break;
case kUninitialized:
ABSL_FALLTHROUGH_INTENDED;
case kInitRequired:
break;
}

View File

@ -17,7 +17,6 @@
#include <vector>
#include "absl/algorithm/container.h"
#include "absl/base/macros.h"
#include "absl/memory/memory.h"
#include "absl/types/optional.h"
#include "media/base/media_constants.h"
@ -620,7 +619,7 @@ void RtpVideoStreamReceiver::OnReceivedPayloadData(
case video_coding::H264SpsPpsTracker::kRequestKeyframe:
rtcp_feedback_buffer_.RequestKeyFrame();
rtcp_feedback_buffer_.SendBufferedRtcpFeedback();
ABSL_FALLTHROUGH_INTENDED;
[[fallthrough]];
case video_coding::H264SpsPpsTracker::kDrop:
return;
case video_coding::H264SpsPpsTracker::kInsert:

View File

@ -17,7 +17,6 @@
#include <vector>
#include "absl/algorithm/container.h"
#include "absl/base/macros.h"
#include "absl/memory/memory.h"
#include "absl/types/optional.h"
#include "api/video/video_codec_type.h"
@ -603,7 +602,7 @@ void RtpVideoStreamReceiver2::OnReceivedPayloadData(
case video_coding::H264SpsPpsTracker::kRequestKeyframe:
rtcp_feedback_buffer_.RequestKeyFrame();
rtcp_feedback_buffer_.SendBufferedRtcpFeedback();
ABSL_FALLTHROUGH_INTENDED;
[[fallthrough]];
case video_coding::H264SpsPpsTracker::kDrop:
return;
case video_coding::H264SpsPpsTracker::kInsert: