Add gcc-style annotations for printf-like functions.

Bug: None
Change-Id: I37a553d254cb61a882b98b14274c0fdfba039992
Reviewed-on: https://webrtc-review.googlesource.com/33002
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21281}
This commit is contained in:
Niels Möller
2017-12-14 13:30:46 +01:00
committed by Commit Bot
parent 6f772d26ce
commit 00f934abc4
4 changed files with 19 additions and 4 deletions

View File

@ -277,6 +277,10 @@ class Logging {
void SetGlobalContext(const char* name);
void SetGlobalEnable(bool enabled);
#if defined(__GNUC__)
// Note: Implicit |this| argument counts as the first argument.
__attribute__((__format__(__printf__, 2, 3)))
#endif
void Log(const char format[], ...);
void Plot(int figure, const std::string& name, double value);
void Plot(int figure,

View File

@ -10,6 +10,8 @@
#include "modules/remote_bitrate_estimator/test/metric_recorder.h"
#include <inttypes.h>
#include <algorithm>
#include "modules/remote_bitrate_estimator/test/packet_sender.h"
@ -321,10 +323,12 @@ void MetricRecorder::PlotDelayHistogram(const std::string& title,
// Log added latency, disregard baseline path delay.
BWE_TEST_LOGGING_LOG1("RESULTS >>> " + bwe_name + " Delay average : ",
"%lf ms", average_delay_ms - one_way_path_delay_ms);
BWE_TEST_LOGGING_LOG1("RESULTS >>> " + bwe_name + " Delay 5th percentile : ",
"%ld ms", percentile_5_ms - one_way_path_delay_ms);
BWE_TEST_LOGGING_LOG1("RESULTS >>> " + bwe_name + " Delay 95th percentile : ",
"%ld ms", percentile_95_ms - one_way_path_delay_ms);
BWE_TEST_LOGGING_LOG1(
"RESULTS >>> " + bwe_name + " Delay 5th percentile : ", "%" PRId64 " ms",
percentile_5_ms - one_way_path_delay_ms);
BWE_TEST_LOGGING_LOG1(
"RESULTS >>> " + bwe_name + " Delay 95th percentile : ", "%" PRId64 " ms",
percentile_95_ms - one_way_path_delay_ms);
RTC_UNUSED(average_delay_ms);
RTC_UNUSED(percentile_5_ms);