summaryrefslogtreecommitdiff
path: root/modules/video_coding
diff options
context:
space:
mode:
authorpbos@webrtc.org <pbos@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2014-03-07 15:23:34 +0000
committerpbos@webrtc.org <pbos@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2014-03-07 15:23:34 +0000
commitbcf0a1019f34cac346bd8349c2206f9d06adbe4e (patch)
treea50e0081e8ed193295573de4b941d5e1be2cd37b /modules/video_coding
parent52db76a4671d26cdef4bb8a8ddf09f1899a46c29 (diff)
downloadwebrtc-bcf0a1019f34cac346bd8349c2206f9d06adbe4e.tar.gz
Remove std:: prefixes from C functions in webrtc/.
std::memcpy -> memcpy for instance. This change was motivated by a compile report complaining that std::rand() was used instead of rand(), probably with a stdlib.h include instead of cstdlib. Use of C functions without the std:: prefix is a lot more common, so removing std:: to address this. BUG= R=tommi@webrtc.org Review URL: https://webrtc-codereview.appspot.com/9549004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@5658 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'modules/video_coding')
-rw-r--r--modules/video_coding/codecs/test/packet_manipulator.cc2
-rw-r--r--modules/video_coding/codecs/test_framework/test.h2
-rw-r--r--modules/video_coding/main/test/jitter_estimate_test.h11
-rw-r--r--modules/video_coding/main/test/test_callbacks.cc2
4 files changed, 9 insertions, 8 deletions
diff --git a/modules/video_coding/codecs/test/packet_manipulator.cc b/modules/video_coding/codecs/test/packet_manipulator.cc
index 0583e9ef..f4ca92a9 100644
--- a/modules/video_coding/codecs/test/packet_manipulator.cc
+++ b/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/modules/video_coding/codecs/test_framework/test.h b/modules/video_coding/codecs/test_framework/test.h
index 890d0cb5..7558abe6 100644
--- a/modules/video_coding/codecs/test_framework/test.h
+++ b/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/modules/video_coding/main/test/jitter_estimate_test.h b/modules/video_coding/main/test/jitter_estimate_test.h
index 9318a491..dd349b2e 100644
--- a/modules/video_coding/main/test/jitter_estimate_test.h
+++ b/modules/video_coding/main/test/jitter_estimate_test.h
@@ -17,7 +17,7 @@
#include <stdlib.h>
#include <math.h>
-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/modules/video_coding/main/test/test_callbacks.cc b/modules/video_coding/main/test/test_callbacks.cc
index 8e967763..710a06ea 100644
--- a/modules/video_coding/main/test/test_callbacks.cc
+++ b/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;
}