Use backticks not vertical bars to denote variables in comments for /system_wrappers
Bug: webrtc:12338
Change-Id: Ibd6a1b11fae9927be6f3122499d8e33ebeb82388
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227026
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34560}
diff --git a/system_wrappers/include/metrics.h b/system_wrappers/include/metrics.h
index 8e0f084..e540b70 100644
--- a/system_wrappers/include/metrics.h
+++ b/system_wrappers/include/metrics.h
@@ -163,7 +163,7 @@
RTC_HISTOGRAM_ENUMERATION_SPARSE(name, sample, 2)
// Histogram for enumerators (evenly spaced buckets).
-// |boundary| should be above the max enumerator sample.
+// `boundary` should be above the max enumerator sample.
//
// TODO(qingsi): Refactor the default implementation given by RtcHistogram,
// which is already sparse, and remove the boundary argument from the macro.
@@ -181,7 +181,7 @@
RTC_HISTOGRAM_ENUMERATION(name, sample, 2)
// Histogram for enumerators (evenly spaced buckets).
-// |boundary| should be above the max enumerator sample.
+// `boundary` should be above the max enumerator sample.
#define RTC_HISTOGRAM_ENUMERATION(name, sample, boundary) \
RTC_HISTOGRAM_COMMON_BLOCK_SLOW( \
name, sample, \
@@ -223,7 +223,7 @@
// Helper macros.
// Macros for calling a histogram with varying name (e.g. when using a metric
// in different modes such as real-time vs screenshare). Fast, because pointer
-// is cached. |index| should be different for different names. Allowed |index|
+// is cached. `index` should be different for different names. Allowed `index`
// values are 0, 1, and 2.
#define RTC_HISTOGRAMS_COUNTS_100(index, name, sample) \
RTC_HISTOGRAMS_COMMON(index, name, sample, \
@@ -383,16 +383,16 @@
int bucket_count);
// Get histogram for enumerators.
-// |boundary| should be above the max enumerator sample.
+// `boundary` should be above the max enumerator sample.
Histogram* HistogramFactoryGetEnumeration(const std::string& name,
int boundary);
// Get sparse histogram for enumerators.
-// |boundary| should be above the max enumerator sample.
+// `boundary` should be above the max enumerator sample.
Histogram* SparseHistogramFactoryGetEnumeration(const std::string& name,
int boundary);
-// Function for adding a |sample| to a histogram.
+// Function for adding a `sample` to a histogram.
void HistogramAdd(Histogram* histogram_pointer, int sample);
struct SampleInfo {
@@ -419,7 +419,7 @@
// Clears all samples.
void Reset();
-// Returns the number of times the |sample| has been added to the histogram.
+// Returns the number of times the `sample` has been added to the histogram.
int NumEvents(const std::string& name, int sample);
// Returns the total number of added samples to the histogram.
diff --git a/system_wrappers/include/ntp_time.h b/system_wrappers/include/ntp_time.h
index 332f8f4..cb58018 100644
--- a/system_wrappers/include/ntp_time.h
+++ b/system_wrappers/include/ntp_time.h
@@ -62,7 +62,7 @@
return !(n1 == n2);
}
-// Converts |int64_t| milliseconds to Q32.32-formatted fixed-point seconds.
+// Converts `int64_t` milliseconds to Q32.32-formatted fixed-point seconds.
// Performs clamping if the result overflows or underflows.
inline int64_t Int64MsToQ32x32(int64_t milliseconds) {
// TODO(bugs.webrtc.org/10893): Change to use |rtc::saturated_cast| once the
@@ -85,7 +85,7 @@
return rtc::dchecked_cast<int64_t>(result);
}
-// Converts |int64_t| milliseconds to UQ32.32-formatted fixed-point seconds.
+// Converts `int64_t` milliseconds to UQ32.32-formatted fixed-point seconds.
// Performs clamping if the result overflows or underflows.
inline uint64_t Int64MsToUQ32x32(int64_t milliseconds) {
// TODO(bugs.webrtc.org/10893): Change to use |rtc::saturated_cast| once the
@@ -108,13 +108,13 @@
return rtc::dchecked_cast<uint64_t>(result);
}
-// Converts Q32.32-formatted fixed-point seconds to |int64_t| milliseconds.
+// Converts Q32.32-formatted fixed-point seconds to `int64_t` milliseconds.
inline int64_t Q32x32ToInt64Ms(int64_t q32x32) {
return rtc::dchecked_cast<int64_t>(
std::round(q32x32 * (1000.0 / NtpTime::kFractionsPerSecond)));
}
-// Converts UQ32.32-formatted fixed-point seconds to |int64_t| milliseconds.
+// Converts UQ32.32-formatted fixed-point seconds to `int64_t` milliseconds.
inline int64_t UQ32x32ToInt64Ms(uint64_t q32x32) {
return rtc::dchecked_cast<int64_t>(
std::round(q32x32 * (1000.0 / NtpTime::kFractionsPerSecond)));
diff --git a/system_wrappers/include/rtp_to_ntp_estimator.h b/system_wrappers/include/rtp_to_ntp_estimator.h
index d5c50a3..1750633 100644
--- a/system_wrappers/include/rtp_to_ntp_estimator.h
+++ b/system_wrappers/include/rtp_to_ntp_estimator.h
@@ -41,7 +41,7 @@
int64_t unwrapped_rtp_timestamp;
};
- // Estimated parameters from RTP and NTP timestamp pairs in |measurements_|.
+ // Estimated parameters from RTP and NTP timestamp pairs in `measurements_`.
struct Parameters {
Parameters() : frequency_khz(0.0), offset_ms(0.0) {}
@@ -53,7 +53,7 @@
};
// Updates measurements with RTP/NTP timestamp pair from a RTCP sender report.
- // |new_rtcp_sr| is set to true if a new report is added.
+ // `new_rtcp_sr` is set to true if a new report is added.
bool UpdateMeasurements(uint32_t ntp_secs,
uint32_t ntp_frac,
uint32_t rtp_timestamp,
diff --git a/system_wrappers/source/clock.cc b/system_wrappers/source/clock.cc
index 77c1d36..1764bf2 100644
--- a/system_wrappers/source/clock.cc
+++ b/system_wrappers/source/clock.cc
@@ -94,8 +94,8 @@
}
NtpTime ConvertTimestampToNtpTime(Timestamp timestamp) override {
- // This method does not check |use_system_independent_ntp_time_| because
- // all callers never used the old behavior of |CurrentNtpTime|.
+ // This method does not check `use_system_independent_ntp_time_` because
+ // all callers never used the old behavior of `CurrentNtpTime`.
return TimeMicrosToNtp(timestamp.us());
}
diff --git a/system_wrappers/source/cpu_features.cc b/system_wrappers/source/cpu_features.cc
index 0f81212..23e0629 100644
--- a/system_wrappers/source/cpu_features.cc
+++ b/system_wrappers/source/cpu_features.cc
@@ -30,7 +30,7 @@
#if defined(WEBRTC_ENABLE_AVX2)
// xgetbv returns the value of an Intel Extended Control Register (XCR).
-// Currently only XCR0 is defined by Intel so |xcr| should always be zero.
+// Currently only XCR0 is defined by Intel so `xcr` should always be zero.
static uint64_t xgetbv(uint32_t xcr) {
#if defined(_MSC_VER)
return _xgetbv(xcr);
diff --git a/system_wrappers/source/metrics.cc b/system_wrappers/source/metrics.cc
index d428336..b14eef4 100644
--- a/system_wrappers/source/metrics.cc
+++ b/system_wrappers/source/metrics.cc
@@ -265,7 +265,7 @@
return HistogramFactoryGetEnumeration(name, boundary);
}
-// Fast path. Adds |sample| to cached |histogram_pointer|.
+// Fast path. Adds `sample` to cached `histogram_pointer`.
void HistogramAdd(Histogram* histogram_pointer, int sample) {
RtcHistogram* ptr = reinterpret_cast<RtcHistogram*>(histogram_pointer);
ptr->Add(sample);
diff --git a/system_wrappers/source/rtp_to_ntp_estimator.cc b/system_wrappers/source/rtp_to_ntp_estimator.cc
index b26115f..d0b0ad4 100644
--- a/system_wrappers/source/rtp_to_ntp_estimator.cc
+++ b/system_wrappers/source/rtp_to_ntp_estimator.cc
@@ -88,7 +88,7 @@
bool RtpToNtpEstimator::RtcpMeasurement::IsEqual(
const RtcpMeasurement& other) const {
// Use || since two equal timestamps will result in zero frequency and in
- // RtpToNtpMs, |rtp_timestamp_ms| is estimated by dividing by the frequency.
+ // RtpToNtpMs, `rtp_timestamp_ms` is estimated by dividing by the frequency.
return (ntp_time == other.ntp_time) ||
(unwrapped_rtp_timestamp == other.unwrapped_rtp_timestamp);
}