From b5f3029302ec4b85340b286390c298e7cc54a5c3 Mon Sep 17 00:00:00 2001 From: "pbos@webrtc.org" Date: Thu, 13 Mar 2014 08:53:39 +0000 Subject: [PATCH] Replace labs with std::abs. Resolves clang 3.5 warnings on OS X for -Wabsolute-value. BUG=chromium:351479 R=andrew@webrtc.org, thakis@chromium.org Review URL: https://webrtc-codereview.appspot.com/9869004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5692 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/video_coding/main/source/receiver.cc | 4 ++-- webrtc/video/call_perf_tests.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/webrtc/modules/video_coding/main/source/receiver.cc b/webrtc/modules/video_coding/main/source/receiver.cc index e3fc0ceac..261c51e4e 100644 --- a/webrtc/modules/video_coding/main/source/receiver.cc +++ b/webrtc/modules/video_coding/main/source/receiver.cc @@ -156,12 +156,12 @@ VCMEncodedFrame* VCMReceiver::FrameForDecoding( // Assume that render timing errors are due to changes in the video stream. if (next_render_time_ms < 0) { timing_error = true; - } else if (labs(next_render_time_ms - now_ms) > max_video_delay_ms_) { + } else if (std::abs(next_render_time_ms - now_ms) > max_video_delay_ms_) { WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideoCoding, VCMId(vcm_id_, receiver_id_), "This frame is out of our delay bounds, resetting jitter " "buffer: %d > %d", - static_cast(labs(next_render_time_ms - now_ms)), + static_cast(std::abs(next_render_time_ms - now_ms)), max_video_delay_ms_); timing_error = true; } else if (static_cast(timing_->TargetVideoDelay()) > diff --git a/webrtc/video/call_perf_tests.cc b/webrtc/video/call_perf_tests.cc index 59f119a85..4c0f5ed21 100644 --- a/webrtc/video/call_perf_tests.cc +++ b/webrtc/video/call_perf_tests.cc @@ -196,7 +196,7 @@ class VideoRtcpAndSyncObserver : public SyncRtcpObserver, public VideoRenderer { // estimated as being synchronized. We don't want to trigger on those. if (time_since_creation < kStartupTimeMs) return; - if (labs(latest_audio_ntp - latest_video_ntp) < kInSyncThresholdMs) { + if (std::abs(latest_audio_ntp - latest_video_ntp) < kInSyncThresholdMs) { if (first_time_in_sync_ == -1) { first_time_in_sync_ = now_ms; webrtc::test::PrintResult("sync_convergence_time",