diff --git a/webrtc/modules/audio_coding/main/acm2/call_statistics.cc b/webrtc/modules/audio_coding/main/acm2/call_statistics.cc index 9153325af..4c3e9fc39 100644 --- a/webrtc/modules/audio_coding/main/acm2/call_statistics.cc +++ b/webrtc/modules/audio_coding/main/acm2/call_statistics.cc @@ -10,7 +10,7 @@ #include "webrtc/modules/audio_coding/main/acm2/call_statistics.h" -#include +#include namespace webrtc { diff --git a/webrtc/modules/audio_coding/main/acm2/initial_delay_manager_unittest.cc b/webrtc/modules/audio_coding/main/acm2/initial_delay_manager_unittest.cc index 1e129f37e..15e88a539 100644 --- a/webrtc/modules/audio_coding/main/acm2/initial_delay_manager_unittest.cc +++ b/webrtc/modules/audio_coding/main/acm2/initial_delay_manager_unittest.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include +#include #include "gtest/gtest.h" #include "webrtc/modules/audio_coding/main/acm2/initial_delay_manager.h" diff --git a/webrtc/modules/audio_coding/neteq4/neteq_unittest.cc b/webrtc/modules/audio_coding/neteq4/neteq_unittest.cc index b3372766b..32f5bf40b 100644 --- a/webrtc/modules/audio_coding/neteq4/neteq_unittest.cc +++ b/webrtc/modules/audio_coding/neteq4/neteq_unittest.cc @@ -14,10 +14,10 @@ #include "webrtc/modules/audio_coding/neteq4/interface/neteq.h" +#include #include #include // memset -#include #include #include #include diff --git a/webrtc/modules/desktop_capture/mouse_cursor_monitor_null.cc b/webrtc/modules/desktop_capture/mouse_cursor_monitor_null.cc index 94a20e113..3a632cc0d 100644 --- a/webrtc/modules/desktop_capture/mouse_cursor_monitor_null.cc +++ b/webrtc/modules/desktop_capture/mouse_cursor_monitor_null.cc @@ -10,7 +10,7 @@ #include "webrtc/modules/desktop_capture/mouse_cursor_monitor.h" -#include +#include namespace webrtc { diff --git a/webrtc/modules/desktop_capture/window_capturer_x11.cc b/webrtc/modules/desktop_capture/window_capturer_x11.cc index 3d5179417..473231f9c 100755 --- a/webrtc/modules/desktop_capture/window_capturer_x11.cc +++ b/webrtc/modules/desktop_capture/window_capturer_x11.cc @@ -10,13 +10,14 @@ #include "webrtc/modules/desktop_capture/window_capturer.h" +#include #include #include #include #include #include + #include -#include #include "webrtc/modules/desktop_capture/desktop_capture_options.h" #include "webrtc/modules/desktop_capture/desktop_frame.h" diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_baselinefile.cc b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_baselinefile.cc index 30723be99..48b66a440 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_baselinefile.cc +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_baselinefile.cc @@ -10,8 +10,9 @@ #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_baselinefile.h" +#include + #include -#include #include #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_fileutils.h" diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_fileutils.cc b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_fileutils.cc index 4e5d4074a..0d2021ebb 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_fileutils.cc +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_fileutils.cc @@ -15,7 +15,7 @@ #else #include #endif -#include +#include #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h" #include "webrtc/system_wrappers/interface/scoped_ptr.h" diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_fileutils.h b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_fileutils.h index 397a16977..dddbdeeb2 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_fileutils.h +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_fileutils.h @@ -11,7 +11,8 @@ #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_FILEUTILS_H_ #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_FILEUTILS_H_ -#include +#include + #include #include "webrtc/modules/interface/module_common_types.h" diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.cc b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.cc index 86506fb1b..f93b14824 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.cc +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.cc @@ -10,7 +10,8 @@ #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h" -#include +#include + #include namespace webrtc { @@ -83,7 +84,7 @@ int Random::Gaussian(int mean, int standard_deviation) { a_ ^= b_; b_ += a_; return static_cast(mean + standard_deviation * - std::sqrt(-2 * std::log(u1)) * std::cos(2 * kPi * u2)); + sqrt(-2 * log(u1)) * cos(2 * kPi * u2)); } Packet::Packet() diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h index f5bd326a6..8d2bf80a4 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.h @@ -11,9 +11,10 @@ #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_FRAMEWORK_H_ #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_FRAMEWORK_H_ +#include +#include + #include -#include -#include #include #include #include @@ -71,7 +72,7 @@ template class Stats { return variance_; } T GetStdDev() { - return std::sqrt(static_cast(GetVariance())); + return sqrt(static_cast(GetVariance())); } T GetMin() { RefreshMinMax(); diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework_unittest.cc b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework_unittest.cc index 31bb27e38..274dc76e2 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework_unittest.cc +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework_unittest.cc @@ -41,12 +41,12 @@ TEST(BweTestFramework_RandomTest, Gaussian) { } const double kPi = 3.14159265358979323846; - const double kScale = kN / (kStddev * std::sqrt(2.0 * kPi)); + const double kScale = kN / (kStddev * sqrt(2.0 * kPi)); const double kDiv = -2.0 * kStddev * kStddev; double self_corr = 0.0; double bucket_corr = 0.0; for (int n = 0; n < kBuckets; ++n) { - double normal_dist = kScale * std::exp((n - kMean) * (n - kMean) / kDiv); + double normal_dist = kScale * exp((n - kMean) * (n - kMean) / kDiv); self_corr += normal_dist * normal_dist; bucket_corr += normal_dist * buckets[n]; } diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.cc b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.cc index 1a43f09c2..65369fde3 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.cc +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.cc @@ -12,9 +12,10 @@ #if BWE_TEST_LOGGING_COMPILE_TIME_ENABLE +#include +#include + #include -#include -#include #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/thread_wrapper.h" diff --git a/webrtc/modules/video_coding/codecs/test/packet_manipulator.cc b/webrtc/modules/video_coding/codecs/test/packet_manipulator.cc index 0583e9ef1..f4ca92a96 100644 --- a/webrtc/modules/video_coding/codecs/test/packet_manipulator.cc +++ b/webrtc/modules/video_coding/codecs/test/packet_manipulator.cc @@ -90,7 +90,7 @@ inline double PacketManipulatorImpl::RandomUniform() { // get the same behavior as long as we're using a fixed initial seed. critsect_->Enter(); srand(random_seed_); - random_seed_ = std::rand(); + random_seed_ = rand(); critsect_->Leave(); return (random_seed_ + 1.0)/(RAND_MAX + 1.0); } diff --git a/webrtc/modules/video_coding/codecs/test_framework/test.h b/webrtc/modules/video_coding/codecs/test_framework/test.h index 890d0cb50..7558abe6b 100644 --- a/webrtc/modules/video_coding/codecs/test_framework/test.h +++ b/webrtc/modules/video_coding/codecs/test_framework/test.h @@ -41,7 +41,7 @@ protected: virtual void Teardown(); double ActualBitRate(int nFrames); virtual bool PacketLoss(double lossRate, int /*thrown*/); - static double RandUniform() { return (std::rand() + 1.0)/(RAND_MAX + 1.0); } + static double RandUniform() { return (rand() + 1.0)/(RAND_MAX + 1.0); } static void VideoEncodedBufferToEncodedImage( webrtc::VideoFrame& videoBuffer, webrtc::EncodedImage &image); diff --git a/webrtc/modules/video_coding/main/test/jitter_estimate_test.h b/webrtc/modules/video_coding/main/test/jitter_estimate_test.h index 9318a4912..dd349b2e0 100644 --- a/webrtc/modules/video_coding/main/test/jitter_estimate_test.h +++ b/webrtc/modules/video_coding/main/test/jitter_estimate_test.h @@ -17,7 +17,7 @@ #include #include -double const pi = 4*std::atan(1.0); +double const pi = 4 * atan(1.0); class GaussDist { @@ -26,9 +26,10 @@ public: double RandValue() // returns a single normally distributed number { - double r1 = (std::rand() + 1.0)/(RAND_MAX + 1.0); // gives equal distribution in (0, 1] - double r2 = (std::rand() + 1.0)/(RAND_MAX + 1.0); - return _mu + _sigma * sqrt(-2*std::log(r1))*std::cos(2*pi*r2); + double r1 = (rand() + 1.0) / + (RAND_MAX + 1.0); // gives equal distribution in (0, 1] + double r2 = (rand() + 1.0) / (RAND_MAX + 1.0); + return _mu + _sigma * sqrt(-2 * log(r1)) * cos(2 * pi * r2); } double GetAverage() @@ -86,7 +87,7 @@ public: void SetLossRate(double rate); private: - double RandUniform() { return (std::rand() + 1.0)/(RAND_MAX + 1.0); } + double RandUniform() { return (rand() + 1.0)/(RAND_MAX + 1.0); } unsigned int _frameRate; unsigned int _capacity; unsigned int _rate; diff --git a/webrtc/modules/video_coding/main/test/test_callbacks.cc b/webrtc/modules/video_coding/main/test/test_callbacks.cc index 8e9677638..710a06ea1 100644 --- a/webrtc/modules/video_coding/main/test/test_callbacks.cc +++ b/webrtc/modules/video_coding/main/test/test_callbacks.cc @@ -406,7 +406,7 @@ RTPSendCompleteCallback::PacketLoss() bool RTPSendCompleteCallback::UnifomLoss(double lossPct) { - double randVal = (std::rand() + 1.0)/(RAND_MAX + 1.0); + double randVal = (rand() + 1.0) / (RAND_MAX + 1.0); return randVal < lossPct/100; } diff --git a/webrtc/system_wrappers/interface/template_util.h b/webrtc/system_wrappers/interface/template_util.h index 5ae415b5a..410e04cc9 100644 --- a/webrtc/system_wrappers/interface/template_util.h +++ b/webrtc/system_wrappers/interface/template_util.h @@ -13,7 +13,7 @@ #ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_TEMPLATE_UTIL_H_ #define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_TEMPLATE_UTIL_H_ -#include // For size_t. +#include // For size_t. namespace webrtc {