Apply modernize-use-nullptr
Setup: - `mkdir tidy; cd tidy` - `cmake .. -DCMAKE_BUILD_TYPE=debug -DPROC_TARGET_NUMBER=1 -DCACHE_NAME_SUFFIX=4 -DBINDIR=. -DDATADIR=. -DBUILD_BUNDLE=ON -DWITH_LTO=OFF -DOPTION_OMP=OFF -DCMAKE_EXPORT_COMPILE_COMMANDS=ON` - `cd ..` - `find -name '*.cc' -exec clang-tidy-3.8 -header-filter=.* -p=tidy -fix-errors -checks=modernize-use-nullptr {} \;`
This commit is contained in:
@@ -82,19 +82,19 @@ private:
|
||||
{
|
||||
if ((ptr) && ((h > y) || (4 * h < y))) {
|
||||
delete[] ptr;
|
||||
ptr = NULL;
|
||||
ptr = nullptr;
|
||||
}
|
||||
|
||||
if ((data) && (((h * w) > (x * y)) || ((h * w) < ((x * y) / 4)))) {
|
||||
delete[] data;
|
||||
data = NULL;
|
||||
data = nullptr;
|
||||
}
|
||||
|
||||
if (ptr == NULL) {
|
||||
if (ptr == nullptr) {
|
||||
ptr = new T*[h];
|
||||
}
|
||||
|
||||
if (data == NULL) {
|
||||
if (data == nullptr) {
|
||||
data = new T[h * w + offset];
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
// use as empty declaration, resize before use!
|
||||
// very useful as a member object
|
||||
array2D() :
|
||||
x(0), y(0), owner(0), ptr(NULL), data(NULL), lock(0)
|
||||
x(0), y(0), owner(0), ptr(nullptr), data(nullptr), lock(0)
|
||||
{
|
||||
//printf("got empty array2D init\n");
|
||||
}
|
||||
@@ -150,7 +150,7 @@ public:
|
||||
if (owner) {
|
||||
data = new T[h * w];
|
||||
} else {
|
||||
data = NULL;
|
||||
data = nullptr;
|
||||
}
|
||||
|
||||
x = w;
|
||||
|
Reference in New Issue
Block a user