Revert "Rename FATAL() into RTC_FATAL()."

This reverts commit 9653d26f8e83bb685477e7ba5c2adf2863187743.

Reason for revert: Breaks downstream project.

Original change's description:
> Rename FATAL() into RTC_FATAL().
>
> No-Try: True
> Bug: webrtc:8454
> Change-Id: I9130487a92463a2128cf1493e6c5117b2fab313a
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/193703
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32620}

TBR=mbonadei@webrtc.org,kwiberg@webrtc.org

Change-Id: I0ad01bcac60c87b30bd4575a9d631e7dd8f34992
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8454
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/193863
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32627}
This commit is contained in:
Mirko Bonadei
2020-11-18 07:03:37 +00:00
committed by Commit Bot
parent f24143d3b0
commit a4fd641f51
10 changed files with 27 additions and 28 deletions

View File

@ -56,9 +56,8 @@ void RemixAndResample(const int16_t* src_data,
if (resampler->InitializeIfNeeded(sample_rate_hz, dst_frame->sample_rate_hz_,
audio_ptr_num_channels) == -1) {
RTC_FATAL() << "InitializeIfNeeded failed: sample_rate_hz = "
<< sample_rate_hz << ", dst_frame->sample_rate_hz_ = "
<< dst_frame->sample_rate_hz_
FATAL() << "InitializeIfNeeded failed: sample_rate_hz = " << sample_rate_hz
<< ", dst_frame->sample_rate_hz_ = " << dst_frame->sample_rate_hz_
<< ", audio_ptr_num_channels = " << audio_ptr_num_channels;
}
@ -71,10 +70,9 @@ void RemixAndResample(const int16_t* src_data,
resampler->Resample(audio_ptr, src_length, dst_frame->mutable_data(),
AudioFrame::kMaxDataSizeSamples);
if (out_length == -1) {
RTC_FATAL() << "Resample failed: audio_ptr = " << audio_ptr
FATAL() << "Resample failed: audio_ptr = " << audio_ptr
<< ", src_length = " << src_length
<< ", dst_frame->mutable_data() = "
<< dst_frame->mutable_data();
<< ", dst_frame->mutable_data() = " << dst_frame->mutable_data();
}
dst_frame->samples_per_channel_ = out_length / audio_ptr_num_channels;

View File

@ -266,7 +266,8 @@ rtc::scoped_refptr<PlanarYuvBuffer> WrapYuvBuffer(
return WrapI444Buffer(width, height, y_plane, y_stride, u_plane, u_stride,
v_plane, v_stride, no_longer_used);
default:
RTC_CHECK_NOTREACHED();
FATAL() << "Unexpected frame buffer type.";
return nullptr;
}
}

View File

@ -171,8 +171,9 @@ AudioEncoder::EncodedInfo AudioEncoderCng::EncodeImpl(
last_frame_active_ = true;
break;
}
default: {
RTC_CHECK_NOTREACHED();
case Vad::kError: {
FATAL(); // Fails only if fed invalid data.
break;
}
}

View File

@ -51,12 +51,12 @@ void DefaultNetEqTestErrorCallback::OnInsertPacketError(
const NetEqInput::PacketData& packet) {
std::cerr << "InsertPacket returned an error." << std::endl;
std::cerr << "Packet data: " << packet.ToString() << std::endl;
RTC_FATAL();
FATAL();
}
void DefaultNetEqTestErrorCallback::OnGetAudioError() {
std::cerr << "GetAudio returned an error." << std::endl;
RTC_FATAL();
FATAL();
}
NetEqTest::NetEqTest(const NetEq::Config& config,

View File

@ -91,9 +91,8 @@ bool RtpFileSource::OpenFile(const std::string& file_name) {
return true;
rtp_reader_.reset(RtpFileReader::Create(RtpFileReader::kPcap, file_name));
if (!rtp_reader_) {
RTC_FATAL()
<< "Couldn't open input file as either a rtpdump or .pcap. Note "
<< "that .pcapng is not supported.";
FATAL() << "Couldn't open input file as either a rtpdump or .pcap. Note "
"that .pcapng is not supported.";
}
return true;
}

View File

@ -43,7 +43,7 @@ int main(int argc, char* argv[]) {
return 0;
}
}
RTC_FATAL() << kErrorMessage;
FATAL() << kErrorMessage;
}
} // namespace test

View File

@ -43,9 +43,8 @@ WavBasedSimulator::GetCustomEventChain(const std::string& filename) {
case '\n':
break;
default:
RTC_FATAL()
<< "Incorrect custom call order file, reverting to using the "
<< "default call order";
FATAL() << "Incorrect custom call order file, reverting to using the "
"default call order";
return WavBasedSimulator::GetDefaultEventChain();
}

View File

@ -95,7 +95,7 @@ RTC_NORETURN void rtc_FatalMessage(const char* file, int line, const char* msg);
// messages if the condition doesn't hold. Prefer them to raw RTC_CHECK and
// RTC_DCHECK.
//
// - RTC_FATAL() aborts unconditionally.
// - FATAL() aborts unconditionally.
namespace rtc {
namespace webrtc_checks_impl {
@ -454,7 +454,8 @@ RTC_NORETURN RTC_EXPORT void UnreachableCodeReached();
RTC_UNREACHABLE_FILE_AND_LINE_CALL_ARGS); \
} while (0)
#define RTC_FATAL() \
// TODO(bugs.webrtc.org/8454): Add an RTC_ prefix or rename differently.
#define FATAL() \
::rtc::webrtc_checks_impl::FatalLogCall<false>(__FILE__, __LINE__, \
"FATAL()") & \
::rtc::webrtc_checks_impl::LogStreamer<>()

View File

@ -21,7 +21,7 @@ TEST(ChecksTest, ExpressionNotEvaluatedWhenCheckPassing) {
#if GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
TEST(ChecksDeathTest, Checks) {
#if RTC_CHECK_MSG_ENABLED
EXPECT_DEATH(RTC_FATAL() << "message",
EXPECT_DEATH(FATAL() << "message",
"\n\n#\n"
"# Fatal error in: \\S+, line \\w+\n"
"# last system error: \\w+\n"
@ -45,7 +45,7 @@ TEST(ChecksDeathTest, Checks) {
"# Check failed: false\n"
"# Hi there!");
#else
EXPECT_DEATH(RTC_FATAL() << "message",
EXPECT_DEATH(FATAL() << "message",
"\n\n#\n"
"# Fatal error in: \\S+, line \\w+\n"
"# last system error: \\w+\n"

View File

@ -87,10 +87,10 @@ class InterleavedRtpFileReader : public RtpFileReaderImpl {
uint32_t len = 0;
TRY(ReadUint32(&len, file_));
if (packet->length < len) {
RTC_FATAL() << "Packet is too large to fit: " << len << " bytes vs "
FATAL() << "Packet is too large to fit: " << len << " bytes vs "
<< packet->length
<< " bytes allocated. Consider increasing the buffer "
<< "size";
"size";
}
if (fread(packet->data, 1, len, file_) != len)
return false;