[reland] Comment unused variables in implemented functions
Compiling webrtc with `-Werror=unused-parameters` is failling duo to those parameters. Also, it shouldn't harm us to put those in comment for code readability as well. NOTE: This time I made sure to iterate over the C files in the audio_processing folder and compile them using gcc. On the original CL that was reverted - that failed with the same error Danil mentioned. This time it seems fine. I'll make sure to run the same script on the rest of my CLs for sanity Bug: webrtc:370878648 Change-Id: I83cea3a08777e21d26a95bcad503a2d1b74566eb Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364537 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Dor Hen <dorhen@meta.com> Cr-Commit-Position: refs/heads/main@{#43249}
This commit is contained in:
parent
558c2dc539
commit
049b43bd02
@ -97,7 +97,7 @@ class ArrayViewBase {
|
|||||||
static_assert(Size > 0, "ArrayView size must be variable or non-negative");
|
static_assert(Size > 0, "ArrayView size must be variable or non-negative");
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ArrayViewBase(T* data, size_t size) : data_(data) {}
|
ArrayViewBase(T* data, size_t /* size */) : data_(data) {}
|
||||||
|
|
||||||
static constexpr size_t size() { return Size; }
|
static constexpr size_t size() { return Size; }
|
||||||
static constexpr bool empty() { return false; }
|
static constexpr bool empty() { return false; }
|
||||||
@ -114,7 +114,7 @@ class ArrayViewBase {
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
class ArrayViewBase<T, 0> {
|
class ArrayViewBase<T, 0> {
|
||||||
public:
|
public:
|
||||||
explicit ArrayViewBase(T* data, size_t size) {}
|
explicit ArrayViewBase(T* /* data */, size_t /* size */) {}
|
||||||
|
|
||||||
static constexpr size_t size() { return 0; }
|
static constexpr size_t size() { return 0; }
|
||||||
static constexpr bool empty() { return true; }
|
static constexpr bool empty() { return true; }
|
||||||
|
|||||||
@ -27,12 +27,12 @@ class DtmfSenderObserverInterface {
|
|||||||
// tones.
|
// tones.
|
||||||
// The callback includes the state of the tone buffer at the time when
|
// The callback includes the state of the tone buffer at the time when
|
||||||
// the tone finished playing.
|
// the tone finished playing.
|
||||||
virtual void OnToneChange(const std::string& tone,
|
virtual void OnToneChange(const std::string& /* tone */,
|
||||||
const std::string& tone_buffer) {}
|
const std::string& /* tone_buffer */) {}
|
||||||
// DEPRECATED: Older API without tone buffer.
|
// DEPRECATED: Older API without tone buffer.
|
||||||
// TODO(bugs.webrtc.org/9725): Remove old API and default implementation
|
// TODO(bugs.webrtc.org/9725): Remove old API and default implementation
|
||||||
// when old callers are gone.
|
// when old callers are gone.
|
||||||
virtual void OnToneChange(const std::string& tone) {}
|
virtual void OnToneChange(const std::string& /* tone */) {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~DtmfSenderObserverInterface() = default;
|
virtual ~DtmfSenderObserverInterface() = default;
|
||||||
@ -91,7 +91,7 @@ class DtmfSenderInterface : public webrtc::RefCountInterface {
|
|||||||
virtual bool InsertDtmf(const std::string& tones,
|
virtual bool InsertDtmf(const std::string& tones,
|
||||||
int duration,
|
int duration,
|
||||||
int inter_tone_gap,
|
int inter_tone_gap,
|
||||||
int comma_delay) {
|
int /* comma_delay */) {
|
||||||
// TODO(bugs.webrtc.org/165700): Remove once downstream implementations
|
// TODO(bugs.webrtc.org/165700): Remove once downstream implementations
|
||||||
// override this signature rather than the 3-parameter one.
|
// override this signature rather than the 3-parameter one.
|
||||||
return InsertDtmf(tones, duration, inter_tone_gap);
|
return InsertDtmf(tones, duration, inter_tone_gap);
|
||||||
|
|||||||
@ -139,9 +139,9 @@ class FrameTransformerInterface : public RefCountInterface {
|
|||||||
rtc::scoped_refptr<TransformedFrameCallback>) {}
|
rtc::scoped_refptr<TransformedFrameCallback>) {}
|
||||||
virtual void RegisterTransformedFrameSinkCallback(
|
virtual void RegisterTransformedFrameSinkCallback(
|
||||||
rtc::scoped_refptr<TransformedFrameCallback>,
|
rtc::scoped_refptr<TransformedFrameCallback>,
|
||||||
uint32_t ssrc) {}
|
uint32_t /* ssrc */) {}
|
||||||
virtual void UnregisterTransformedFrameCallback() {}
|
virtual void UnregisterTransformedFrameCallback() {}
|
||||||
virtual void UnregisterTransformedFrameSinkCallback(uint32_t ssrc) {}
|
virtual void UnregisterTransformedFrameSinkCallback(uint32_t /* ssrc */) {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
~FrameTransformerInterface() override = default;
|
~FrameTransformerInterface() override = default;
|
||||||
|
|||||||
@ -86,7 +86,7 @@ class FunctionView<RetT(ArgT...)> final {
|
|||||||
typename std::enable_if<std::is_same<
|
typename std::enable_if<std::is_same<
|
||||||
std::nullptr_t,
|
std::nullptr_t,
|
||||||
typename std::remove_cv<F>::type>::value>::type* = nullptr>
|
typename std::remove_cv<F>::type>::value>::type* = nullptr>
|
||||||
FunctionView(F&& f) : call_(nullptr) {}
|
FunctionView(F&& /* f */) : call_(nullptr) {}
|
||||||
|
|
||||||
// Default constructor. Creates an empty FunctionView.
|
// Default constructor. Creates an empty FunctionView.
|
||||||
FunctionView() : call_(nullptr) {}
|
FunctionView() : call_(nullptr) {}
|
||||||
|
|||||||
@ -161,7 +161,7 @@ class VideoTrackSourceInterface : public MediaSourceInterface,
|
|||||||
// The call is expected to happen on the network thread.
|
// The call is expected to happen on the network thread.
|
||||||
// TODO(crbug/1255737): make pure virtual once downstream project adapts.
|
// TODO(crbug/1255737): make pure virtual once downstream project adapts.
|
||||||
virtual void ProcessConstraints(
|
virtual void ProcessConstraints(
|
||||||
const webrtc::VideoTrackSourceConstraints& constraints) {}
|
const webrtc::VideoTrackSourceConstraints& /* constraints */) {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
~VideoTrackSourceInterface() override = default;
|
~VideoTrackSourceInterface() override = default;
|
||||||
@ -184,14 +184,14 @@ class RTC_EXPORT VideoTrackInterface
|
|||||||
|
|
||||||
// Register a video sink for this track. Used to connect the track to the
|
// Register a video sink for this track. Used to connect the track to the
|
||||||
// underlying video engine.
|
// underlying video engine.
|
||||||
void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
|
void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* /* sink */,
|
||||||
const rtc::VideoSinkWants& wants) override {}
|
const rtc::VideoSinkWants& /* wants */) override {}
|
||||||
void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override {}
|
void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* /* sink */) override {}
|
||||||
|
|
||||||
virtual VideoTrackSourceInterface* GetSource() const = 0;
|
virtual VideoTrackSourceInterface* GetSource() const = 0;
|
||||||
|
|
||||||
virtual ContentHint content_hint() const;
|
virtual ContentHint content_hint() const;
|
||||||
virtual void set_content_hint(ContentHint hint) {}
|
virtual void set_content_hint(ContentHint /* hint */) {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
~VideoTrackInterface() override = default;
|
~VideoTrackInterface() override = default;
|
||||||
@ -200,11 +200,11 @@ class RTC_EXPORT VideoTrackInterface
|
|||||||
// Interface for receiving audio data from a AudioTrack.
|
// Interface for receiving audio data from a AudioTrack.
|
||||||
class AudioTrackSinkInterface {
|
class AudioTrackSinkInterface {
|
||||||
public:
|
public:
|
||||||
virtual void OnData(const void* audio_data,
|
virtual void OnData(const void* /* audio_data */,
|
||||||
int bits_per_sample,
|
int /* bits_per_sample */,
|
||||||
int sample_rate,
|
int /* sample_rate */,
|
||||||
size_t number_of_channels,
|
size_t /* number_of_channels */,
|
||||||
size_t number_of_frames) {
|
size_t /* number_of_frames */) {
|
||||||
RTC_DCHECK_NOTREACHED() << "This method must be overridden, or not used.";
|
RTC_DCHECK_NOTREACHED() << "This method must be overridden, or not used.";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,12 +212,13 @@ class AudioTrackSinkInterface {
|
|||||||
// supposed to deliver the timestamp when this audio frame was originally
|
// supposed to deliver the timestamp when this audio frame was originally
|
||||||
// captured. This timestamp MUST be based on the same clock as
|
// captured. This timestamp MUST be based on the same clock as
|
||||||
// rtc::TimeMillis().
|
// rtc::TimeMillis().
|
||||||
virtual void OnData(const void* audio_data,
|
virtual void OnData(
|
||||||
int bits_per_sample,
|
const void* audio_data,
|
||||||
int sample_rate,
|
int bits_per_sample,
|
||||||
size_t number_of_channels,
|
int sample_rate,
|
||||||
size_t number_of_frames,
|
size_t number_of_channels,
|
||||||
std::optional<int64_t> absolute_capture_timestamp_ms) {
|
size_t number_of_frames,
|
||||||
|
std::optional<int64_t> /* absolute_capture_timestamp_ms */) {
|
||||||
// TODO(bugs.webrtc.org/10739): Deprecate the old OnData and make this one
|
// TODO(bugs.webrtc.org/10739): Deprecate the old OnData and make this one
|
||||||
// pure virtual.
|
// pure virtual.
|
||||||
return OnData(audio_data, bits_per_sample, sample_rate, number_of_channels,
|
return OnData(audio_data, bits_per_sample, sample_rate, number_of_channels,
|
||||||
@ -251,15 +252,15 @@ class RTC_EXPORT AudioSourceInterface : public MediaSourceInterface {
|
|||||||
// Sets the volume of the source. `volume` is in the range of [0, 10].
|
// Sets the volume of the source. `volume` is in the range of [0, 10].
|
||||||
// TODO(tommi): This method should be on the track and ideally volume should
|
// TODO(tommi): This method should be on the track and ideally volume should
|
||||||
// be applied in the track in a way that does not affect clones of the track.
|
// be applied in the track in a way that does not affect clones of the track.
|
||||||
virtual void SetVolume(double volume) {}
|
virtual void SetVolume(double /* volume */) {}
|
||||||
|
|
||||||
// Registers/unregisters observers to the audio source.
|
// Registers/unregisters observers to the audio source.
|
||||||
virtual void RegisterAudioObserver(AudioObserver* observer) {}
|
virtual void RegisterAudioObserver(AudioObserver* /* observer */) {}
|
||||||
virtual void UnregisterAudioObserver(AudioObserver* observer) {}
|
virtual void UnregisterAudioObserver(AudioObserver* /* observer */) {}
|
||||||
|
|
||||||
// TODO(tommi): Make pure virtual.
|
// TODO(tommi): Make pure virtual.
|
||||||
virtual void AddSink(AudioTrackSinkInterface* sink) {}
|
virtual void AddSink(AudioTrackSinkInterface* /* sink */) {}
|
||||||
virtual void RemoveSink(AudioTrackSinkInterface* sink) {}
|
virtual void RemoveSink(AudioTrackSinkInterface* /* sink */) {}
|
||||||
|
|
||||||
// Returns options for the AudioSource.
|
// Returns options for the AudioSource.
|
||||||
// (for some of the settings this approach is broken, e.g. setting
|
// (for some of the settings this approach is broken, e.g. setting
|
||||||
@ -339,16 +340,18 @@ class MediaStreamInterface : public webrtc::RefCountInterface,
|
|||||||
// Note: Default implementations are for avoiding link time errors in
|
// Note: Default implementations are for avoiding link time errors in
|
||||||
// implementations that mock this API.
|
// implementations that mock this API.
|
||||||
// TODO(bugs.webrtc.org/13980): Remove default implementations.
|
// TODO(bugs.webrtc.org/13980): Remove default implementations.
|
||||||
virtual bool AddTrack(rtc::scoped_refptr<AudioTrackInterface> track) {
|
virtual bool AddTrack(rtc::scoped_refptr<AudioTrackInterface> /* track */) {
|
||||||
RTC_CHECK_NOTREACHED();
|
RTC_CHECK_NOTREACHED();
|
||||||
}
|
}
|
||||||
virtual bool AddTrack(rtc::scoped_refptr<VideoTrackInterface> track) {
|
virtual bool AddTrack(rtc::scoped_refptr<VideoTrackInterface> /* track */) {
|
||||||
RTC_CHECK_NOTREACHED();
|
RTC_CHECK_NOTREACHED();
|
||||||
}
|
}
|
||||||
virtual bool RemoveTrack(rtc::scoped_refptr<AudioTrackInterface> track) {
|
virtual bool RemoveTrack(
|
||||||
|
rtc::scoped_refptr<AudioTrackInterface> /* track */) {
|
||||||
RTC_CHECK_NOTREACHED();
|
RTC_CHECK_NOTREACHED();
|
||||||
}
|
}
|
||||||
virtual bool RemoveTrack(rtc::scoped_refptr<VideoTrackInterface> track) {
|
virtual bool RemoveTrack(
|
||||||
|
rtc::scoped_refptr<VideoTrackInterface> /* track */) {
|
||||||
RTC_CHECK_NOTREACHED();
|
RTC_CHECK_NOTREACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -60,7 +60,7 @@ class RtcEventLogNull final : public RtcEventLog {
|
|||||||
bool StartLogging(std::unique_ptr<RtcEventLogOutput> output,
|
bool StartLogging(std::unique_ptr<RtcEventLogOutput> output,
|
||||||
int64_t output_period_ms) override;
|
int64_t output_period_ms) override;
|
||||||
void StopLogging() override {}
|
void StopLogging() override {}
|
||||||
void Log(std::unique_ptr<RtcEvent> event) override {}
|
void Log(std::unique_ptr<RtcEvent> /* event */) override {}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|||||||
@ -80,7 +80,9 @@ class RTC_EXPORT RtpReceiverInterface : public webrtc::RefCountInterface,
|
|||||||
virtual RtpParameters GetParameters() const = 0;
|
virtual RtpParameters GetParameters() const = 0;
|
||||||
// TODO(dinosaurav): Delete SetParameters entirely after rolling to Chromium.
|
// TODO(dinosaurav): Delete SetParameters entirely after rolling to Chromium.
|
||||||
// Currently, doesn't support changing any parameters.
|
// Currently, doesn't support changing any parameters.
|
||||||
virtual bool SetParameters(const RtpParameters& parameters) { return false; }
|
virtual bool SetParameters(const RtpParameters& /* parameters */) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Does not take ownership of observer.
|
// Does not take ownership of observer.
|
||||||
// Must call SetObserver(nullptr) before the observer is destroyed.
|
// Must call SetObserver(nullptr) before the observer is destroyed.
|
||||||
|
|||||||
@ -119,7 +119,7 @@ class RTC_EXPORT RtpSenderInterface : public webrtc::RefCountInterface,
|
|||||||
// Default implementation of SetFrameTransformer.
|
// Default implementation of SetFrameTransformer.
|
||||||
// TODO: bugs.webrtc.org/15929 - remove when all implementations are good
|
// TODO: bugs.webrtc.org/15929 - remove when all implementations are good
|
||||||
void SetFrameTransformer(rtc::scoped_refptr<FrameTransformerInterface>
|
void SetFrameTransformer(rtc::scoped_refptr<FrameTransformerInterface>
|
||||||
frame_transformer) override {}
|
/* frame_transformer */) override {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
~RtpSenderInterface() override = default;
|
~RtpSenderInterface() override = default;
|
||||||
|
|||||||
@ -88,7 +88,7 @@ class DataChannelSink {
|
|||||||
// Callback issued when the data channel becomes unusable (closed).
|
// Callback issued when the data channel becomes unusable (closed).
|
||||||
// TODO(https://crbug.com/webrtc/10360): Make pure virtual when all
|
// TODO(https://crbug.com/webrtc/10360): Make pure virtual when all
|
||||||
// consumers updated.
|
// consumers updated.
|
||||||
virtual void OnTransportClosed(RTCError error) {}
|
virtual void OnTransportClosed(RTCError /* error */) {}
|
||||||
|
|
||||||
// The data channel's buffered_amount has fallen to or below the threshold
|
// The data channel's buffered_amount has fallen to or below the threshold
|
||||||
// set when calling `SetBufferedAmountLowThreshold`
|
// set when calling `SetBufferedAmountLowThreshold`
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class VideoSinkInterface {
|
|||||||
// Called on the network thread when video constraints change.
|
// Called on the network thread when video constraints change.
|
||||||
// TODO(crbug/1255737): make pure virtual once downstream project adapts.
|
// TODO(crbug/1255737): make pure virtual once downstream project adapts.
|
||||||
virtual void OnConstraintsChanged(
|
virtual void OnConstraintsChanged(
|
||||||
const webrtc::VideoTrackSourceConstraints& constraints) {}
|
const webrtc::VideoTrackSourceConstraints& /* constraints */) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rtc
|
} // namespace rtc
|
||||||
|
|||||||
@ -107,7 +107,7 @@ class RTC_EXPORT VideoDecoder {
|
|||||||
// TODO(bugs.webrtc.org/15444): Migrate all subclasses to Decode() without
|
// TODO(bugs.webrtc.org/15444): Migrate all subclasses to Decode() without
|
||||||
// missing_frame and delete this.
|
// missing_frame and delete this.
|
||||||
virtual int32_t Decode(const EncodedImage& input_image,
|
virtual int32_t Decode(const EncodedImage& input_image,
|
||||||
bool missing_frames,
|
bool /* missing_frames */,
|
||||||
int64_t render_time_ms) {
|
int64_t render_time_ms) {
|
||||||
return Decode(input_image, render_time_ms);
|
return Decode(input_image, render_time_ms);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,7 +82,7 @@ class RTC_EXPORT EncodedImageCallback {
|
|||||||
const EncodedImage& encoded_image,
|
const EncodedImage& encoded_image,
|
||||||
const CodecSpecificInfo* codec_specific_info) = 0;
|
const CodecSpecificInfo* codec_specific_info) = 0;
|
||||||
|
|
||||||
virtual void OnDroppedFrame(DropReason reason) {}
|
virtual void OnDroppedFrame(DropReason /* reason */) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class RTC_EXPORT VideoEncoder {
|
class RTC_EXPORT VideoEncoder {
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class VideoEncoderFactory {
|
|||||||
// Called every time the encoder input resolution change. Should return a
|
// Called every time the encoder input resolution change. Should return a
|
||||||
// non-empty if an encoder switch should be performed.
|
// non-empty if an encoder switch should be performed.
|
||||||
virtual std::optional<SdpVideoFormat> OnResolutionChange(
|
virtual std::optional<SdpVideoFormat> OnResolutionChange(
|
||||||
const RenderResolution& resolution) {
|
const RenderResolution& /* resolution */) {
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -246,9 +246,9 @@ class MediaSendChannelInterface {
|
|||||||
// note: The encoder_selector object must remain valid for the lifetime of the
|
// note: The encoder_selector object must remain valid for the lifetime of the
|
||||||
// MediaChannel, unless replaced.
|
// MediaChannel, unless replaced.
|
||||||
virtual void SetEncoderSelector(
|
virtual void SetEncoderSelector(
|
||||||
uint32_t ssrc,
|
uint32_t /* ssrc */,
|
||||||
webrtc::VideoEncoderFactory::EncoderSelectorInterface* encoder_selector) {
|
webrtc::VideoEncoderFactory::
|
||||||
}
|
EncoderSelectorInterface* /* encoder_selector */) {}
|
||||||
virtual webrtc::RtpParameters GetRtpSendParameters(uint32_t ssrc) const = 0;
|
virtual webrtc::RtpParameters GetRtpSendParameters(uint32_t ssrc) const = 0;
|
||||||
virtual bool SendCodecHasNack() const = 0;
|
virtual bool SendCodecHasNack() const = 0;
|
||||||
// Called whenever the list of sending SSRCs changes.
|
// Called whenever the list of sending SSRCs changes.
|
||||||
|
|||||||
@ -168,20 +168,22 @@ class NetworkLinkRtcpObserver {
|
|||||||
public:
|
public:
|
||||||
virtual ~NetworkLinkRtcpObserver() = default;
|
virtual ~NetworkLinkRtcpObserver() = default;
|
||||||
|
|
||||||
virtual void OnTransportFeedback(Timestamp receive_time,
|
virtual void OnTransportFeedback(
|
||||||
const rtcp::TransportFeedback& feedback) {}
|
Timestamp /* receive_time */,
|
||||||
|
const rtcp::TransportFeedback& /* feedback */) {}
|
||||||
// RFC 8888 congestion control feedback.
|
// RFC 8888 congestion control feedback.
|
||||||
virtual void OnCongestionControlFeedback(
|
virtual void OnCongestionControlFeedback(
|
||||||
Timestamp receive_time,
|
Timestamp /* receive_time */,
|
||||||
const rtcp::CongestionControlFeedback& feedback) {}
|
const rtcp::CongestionControlFeedback& /* feedback */) {}
|
||||||
virtual void OnReceiverEstimatedMaxBitrate(Timestamp receive_time,
|
virtual void OnReceiverEstimatedMaxBitrate(Timestamp /* receive_time */,
|
||||||
DataRate bitrate) {}
|
DataRate /* bitrate */) {}
|
||||||
|
|
||||||
// Called on an RTCP packet with sender or receiver reports with non zero
|
// Called on an RTCP packet with sender or receiver reports with non zero
|
||||||
// report blocks. Report blocks are combined from all reports into one array.
|
// report blocks. Report blocks are combined from all reports into one array.
|
||||||
virtual void OnReport(Timestamp receive_time,
|
virtual void OnReport(
|
||||||
rtc::ArrayView<const ReportBlockData> report_blocks) {}
|
Timestamp /* receive_time */,
|
||||||
virtual void OnRttUpdate(Timestamp receive_time, TimeDelta rtt) {}
|
rtc::ArrayView<const ReportBlockData> /* report_blocks */) {}
|
||||||
|
virtual void OnRttUpdate(Timestamp /* receive_time */, TimeDelta /* rtt */) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// NOTE! `kNumMediaTypes` must be kept in sync with RtpPacketMediaType!
|
// NOTE! `kNumMediaTypes` must be kept in sync with RtpPacketMediaType!
|
||||||
|
|||||||
@ -78,8 +78,8 @@ RTC_NORETURN void WriteFatalLog(absl::string_view output) {
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
RTC_NORETURN void WriteFatalLog(const char* file,
|
RTC_NORETURN void WriteFatalLog(const char* /* file */,
|
||||||
int line,
|
int /* line */,
|
||||||
absl::string_view output) {
|
absl::string_view output) {
|
||||||
WriteFatalLog(output);
|
WriteFatalLog(output);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,7 +34,7 @@ class SecureRandomGenerator : public RandomGenerator {
|
|||||||
public:
|
public:
|
||||||
SecureRandomGenerator() {}
|
SecureRandomGenerator() {}
|
||||||
~SecureRandomGenerator() override {}
|
~SecureRandomGenerator() override {}
|
||||||
bool Init(const void* seed, size_t len) override { return true; }
|
bool Init(const void* /* seed */, size_t /* len */) override { return true; }
|
||||||
bool Generate(void* buf, size_t len) override {
|
bool Generate(void* buf, size_t len) override {
|
||||||
return (RAND_bytes(reinterpret_cast<unsigned char*>(buf), len) > 0);
|
return (RAND_bytes(reinterpret_cast<unsigned char*>(buf), len) > 0);
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ class TestRandomGenerator : public RandomGenerator {
|
|||||||
public:
|
public:
|
||||||
TestRandomGenerator() : seed_(7) {}
|
TestRandomGenerator() : seed_(7) {}
|
||||||
~TestRandomGenerator() override {}
|
~TestRandomGenerator() override {}
|
||||||
bool Init(const void* seed, size_t len) override { return true; }
|
bool Init(const void* /* seed */, size_t /* len */) override { return true; }
|
||||||
bool Generate(void* buf, size_t len) override {
|
bool Generate(void* buf, size_t len) override {
|
||||||
for (size_t i = 0; i < len; ++i) {
|
for (size_t i = 0; i < len; ++i) {
|
||||||
static_cast<uint8_t*>(buf)[i] = static_cast<uint8_t>(GetRandom());
|
static_cast<uint8_t*>(buf)[i] = static_cast<uint8_t>(GetRandom());
|
||||||
|
|||||||
@ -220,7 +220,7 @@ LogMessage::~LogMessage() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogMessage::AddTag(const char* tag) {
|
void LogMessage::AddTag([[maybe_unused]] const char* tag) {
|
||||||
#ifdef WEBRTC_ANDROID
|
#ifdef WEBRTC_ANDROID
|
||||||
log_line_.set_tag(tag);
|
log_line_.set_tag(tag);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -431,7 +431,7 @@ class LogMessageVoidify {
|
|||||||
// This has to be an operator with a precedence lower than << but
|
// This has to be an operator with a precedence lower than << but
|
||||||
// higher than ?:
|
// higher than ?:
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
void operator&(LogStreamer<Ts...>&& streamer) {}
|
void operator&(LogStreamer<Ts...>&& /* streamer */) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace webrtc_logging_impl
|
} // namespace webrtc_logging_impl
|
||||||
|
|||||||
@ -101,7 +101,9 @@ struct RangeCheckImpl {};
|
|||||||
// Dst range always contains the result: nothing to check.
|
// Dst range always contains the result: nothing to check.
|
||||||
template <typename Dst, typename Src, DstSign IsDstSigned, SrcSign IsSrcSigned>
|
template <typename Dst, typename Src, DstSign IsDstSigned, SrcSign IsSrcSigned>
|
||||||
struct RangeCheckImpl<Dst, Src, IsDstSigned, IsSrcSigned, CONTAINS_RANGE> {
|
struct RangeCheckImpl<Dst, Src, IsDstSigned, IsSrcSigned, CONTAINS_RANGE> {
|
||||||
static constexpr RangeCheckResult Check(Src value) { return TYPE_VALID; }
|
static constexpr RangeCheckResult Check(Src /* value */) {
|
||||||
|
return TYPE_VALID;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Signed to signed narrowing.
|
// Signed to signed narrowing.
|
||||||
|
|||||||
@ -56,6 +56,14 @@ static inline void rtc_AsanPoison(const volatile void* ptr,
|
|||||||
size_t num_elements) {
|
size_t num_elements) {
|
||||||
#if RTC_HAS_ASAN
|
#if RTC_HAS_ASAN
|
||||||
ASAN_POISON_MEMORY_REGION(ptr, element_size * num_elements);
|
ASAN_POISON_MEMORY_REGION(ptr, element_size * num_elements);
|
||||||
|
#else
|
||||||
|
// This is to prevent from the compiler raising a warning/error over unused
|
||||||
|
// variables. We cannot use clang's annotation (`[[maybe_unused]]`) because
|
||||||
|
// this file is also included from c files which doesn't support the
|
||||||
|
// annotation till we switch to C23
|
||||||
|
(void)ptr;
|
||||||
|
(void)element_size;
|
||||||
|
(void)num_elements;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,6 +75,10 @@ static inline void rtc_AsanUnpoison(const volatile void* ptr,
|
|||||||
size_t num_elements) {
|
size_t num_elements) {
|
||||||
#if RTC_HAS_ASAN
|
#if RTC_HAS_ASAN
|
||||||
ASAN_UNPOISON_MEMORY_REGION(ptr, element_size * num_elements);
|
ASAN_UNPOISON_MEMORY_REGION(ptr, element_size * num_elements);
|
||||||
|
#else
|
||||||
|
(void)ptr;
|
||||||
|
(void)element_size;
|
||||||
|
(void)num_elements;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,6 +89,10 @@ static inline void rtc_MsanMarkUninitialized(const volatile void* ptr,
|
|||||||
size_t num_elements) {
|
size_t num_elements) {
|
||||||
#if RTC_HAS_MSAN
|
#if RTC_HAS_MSAN
|
||||||
__msan_poison(ptr, element_size * num_elements);
|
__msan_poison(ptr, element_size * num_elements);
|
||||||
|
#else
|
||||||
|
(void)ptr;
|
||||||
|
(void)element_size;
|
||||||
|
(void)num_elements;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,6 +104,10 @@ static inline void rtc_MsanCheckInitialized(const volatile void* ptr,
|
|||||||
size_t num_elements) {
|
size_t num_elements) {
|
||||||
#if RTC_HAS_MSAN
|
#if RTC_HAS_MSAN
|
||||||
__msan_check_mem_is_initialized(ptr, element_size * num_elements);
|
__msan_check_mem_is_initialized(ptr, element_size * num_elements);
|
||||||
|
#else
|
||||||
|
(void)ptr;
|
||||||
|
(void)element_size;
|
||||||
|
(void)num_elements;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -113,10 +113,10 @@ class RTC_EXPORT Socket {
|
|||||||
// `timestamp` is in units of microseconds.
|
// `timestamp` is in units of microseconds.
|
||||||
virtual int Recv(void* pv, size_t cb, int64_t* timestamp) = 0;
|
virtual int Recv(void* pv, size_t cb, int64_t* timestamp) = 0;
|
||||||
// TODO(webrtc:15368): Deprecate and remove.
|
// TODO(webrtc:15368): Deprecate and remove.
|
||||||
virtual int RecvFrom(void* pv,
|
virtual int RecvFrom(void* /* pv */,
|
||||||
size_t cb,
|
size_t /* cb */,
|
||||||
SocketAddress* paddr,
|
SocketAddress* /* paddr */,
|
||||||
int64_t* timestamp) {
|
int64_t* /* timestamp */) {
|
||||||
// Not implemented. Use RecvFrom(ReceiveBuffer& buffer).
|
// Not implemented. Use RecvFrom(ReceiveBuffer& buffer).
|
||||||
RTC_CHECK_NOTREACHED();
|
RTC_CHECK_NOTREACHED();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,7 +92,7 @@ StringToNumber(absl::string_view str, int base = 10) {
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
typename std::enable_if<std::is_floating_point<T>::value,
|
typename std::enable_if<std::is_floating_point<T>::value,
|
||||||
std::optional<T>>::type
|
std::optional<T>>::type
|
||||||
StringToNumber(absl::string_view str, int base = 10) {
|
StringToNumber(absl::string_view str, int /* base */ = 10) {
|
||||||
static_assert(
|
static_assert(
|
||||||
std::numeric_limits<T>::max() <= std::numeric_limits<long double>::max(),
|
std::numeric_limits<T>::max() <= std::numeric_limits<long double>::max(),
|
||||||
"StringToNumber only supports floating-point numbers as large "
|
"StringToNumber only supports floating-point numbers as large "
|
||||||
|
|||||||
@ -59,8 +59,8 @@ class RTC_EXPORT SequenceCheckerImpl {
|
|||||||
// right version for your build configuration.
|
// right version for your build configuration.
|
||||||
class SequenceCheckerDoNothing {
|
class SequenceCheckerDoNothing {
|
||||||
public:
|
public:
|
||||||
explicit SequenceCheckerDoNothing(bool attach_to_current_thread) {}
|
explicit SequenceCheckerDoNothing(bool /* attach_to_current_thread */) {}
|
||||||
explicit SequenceCheckerDoNothing(TaskQueueBase* attached_queue) {}
|
explicit SequenceCheckerDoNothing(TaskQueueBase* /* attached_queue */) {}
|
||||||
bool IsCurrent() const { return true; }
|
bool IsCurrent() const { return true; }
|
||||||
void Detach() {}
|
void Detach() {}
|
||||||
};
|
};
|
||||||
@ -68,7 +68,7 @@ class SequenceCheckerDoNothing {
|
|||||||
template <typename ThreadLikeObject>
|
template <typename ThreadLikeObject>
|
||||||
std::enable_if_t<std::is_base_of_v<SequenceCheckerImpl, ThreadLikeObject>,
|
std::enable_if_t<std::is_base_of_v<SequenceCheckerImpl, ThreadLikeObject>,
|
||||||
std::string>
|
std::string>
|
||||||
ExpectationToString(const ThreadLikeObject* checker) {
|
ExpectationToString([[maybe_unused]] const ThreadLikeObject* checker) {
|
||||||
#if RTC_DCHECK_IS_ON
|
#if RTC_DCHECK_IS_ON
|
||||||
return checker->ExpectationToString();
|
return checker->ExpectationToString();
|
||||||
#else
|
#else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user