THRIFT-4762: Applied some C++11 refactorings to the runtime library and compiler (#1719)
* make use of C++11 override keyword
* added const specifier to TTransport::getOrigin()
* added more const correctness to the compiler
* make use of auto keyword
* replaced usage of NULL with nullptr
* make use of explicitly-defaulted function definition
* extended changelog
diff --git a/lib/cpp/test/Benchmark.cpp b/lib/cpp/test/Benchmark.cpp
index 5ff77aa..56adac0 100644
--- a/lib/cpp/test/Benchmark.cpp
+++ b/lib/cpp/test/Benchmark.cpp
@@ -36,12 +36,12 @@
public:
timeval vStart;
- Timer() { THRIFT_GETTIMEOFDAY(&vStart, 0); }
- void start() { THRIFT_GETTIMEOFDAY(&vStart, 0); }
+ Timer() { THRIFT_GETTIMEOFDAY(&vStart, nullptr); }
+ void start() { THRIFT_GETTIMEOFDAY(&vStart, nullptr); }
double frame() {
timeval vEnd;
- THRIFT_GETTIMEOFDAY(&vEnd, 0);
+ THRIFT_GETTIMEOFDAY(&vEnd, nullptr);
double dstart = vStart.tv_sec + ((double)vStart.tv_usec / 1000000.0);
double dend = vEnd.tv_sec + ((double)vEnd.tv_usec / 1000000.0);
return dend - dstart;
@@ -70,7 +70,7 @@
int num = 100000;
std::shared_ptr<TMemoryBuffer> buf(new TMemoryBuffer(num*1000));
- uint8_t* data = NULL;
+ uint8_t* data = nullptr;
uint32_t datasize = 0;
{
@@ -157,7 +157,7 @@
}
- data = NULL;
+ data = nullptr;
datasize = 0;
num = 10000000;