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:
@@ -59,7 +59,7 @@ InspectorBuffer::~InspectorBuffer() {
|
||||
int InspectorBuffer::infoFromImage (const Glib::ustring& fname)
|
||||
{
|
||||
|
||||
rtengine::ImageMetaData* idata = rtengine::ImageMetaData::fromFile (fname, NULL);
|
||||
rtengine::ImageMetaData* idata = rtengine::ImageMetaData::fromFile (fname, nullptr);
|
||||
|
||||
if (!idata) {
|
||||
return 0;
|
||||
@@ -81,7 +81,7 @@ int InspectorBuffer::infoFromImage (const Glib::ustring& fname)
|
||||
return deg;
|
||||
}
|
||||
|
||||
Inspector::Inspector () : currImage(NULL), zoom(0.0), active(false) {}
|
||||
Inspector::Inspector () : currImage(nullptr), zoom(0.0), active(false) {}
|
||||
|
||||
Inspector::~Inspector()
|
||||
{
|
||||
@@ -207,7 +207,7 @@ void Inspector::switchImage (const Glib::ustring &fullPath)
|
||||
// deleting the last entries
|
||||
for (size_t i = images.size() - 1; i > size_t(options.maxInspectorBuffers - 1); --i) {
|
||||
delete images.at(i);
|
||||
images.at(i) = NULL;
|
||||
images.at(i) = nullptr;
|
||||
}
|
||||
|
||||
// resizing down
|
||||
@@ -215,14 +215,14 @@ void Inspector::switchImage (const Glib::ustring &fullPath)
|
||||
}
|
||||
|
||||
if (fullPath.empty()) {
|
||||
currImage = NULL;
|
||||
currImage = nullptr;
|
||||
queue_draw();
|
||||
return;
|
||||
} else {
|
||||
bool found = false;
|
||||
|
||||
for (size_t i = 0; i < images.size(); ++i) {
|
||||
if (images.at(i) != NULL && images.at(i)->imgPath == fullPath) {
|
||||
if (images.at(i) != nullptr && images.at(i)->imgPath == fullPath) {
|
||||
currImage = images.at(i);
|
||||
|
||||
// rolling the list 1 step to the beginning
|
||||
@@ -251,7 +251,7 @@ void Inspector::switchImage (const Glib::ustring &fullPath)
|
||||
images.push_back(iBuffer);
|
||||
currImage = images.at(images.size() - 1);
|
||||
} else {
|
||||
currImage = NULL;
|
||||
currImage = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -260,14 +260,14 @@ void Inspector::switchImage (const Glib::ustring &fullPath)
|
||||
void Inspector::deleteBuffers ()
|
||||
{
|
||||
for (size_t i = 0; i < images.size(); ++i) {
|
||||
if (images.at(i) != NULL) {
|
||||
if (images.at(i) != nullptr) {
|
||||
delete images.at(i);
|
||||
images.at(i) = NULL;
|
||||
images.at(i) = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
images.resize(0);
|
||||
currImage = NULL;
|
||||
currImage = nullptr;
|
||||
}
|
||||
|
||||
void Inspector::flushBuffers ()
|
||||
|
Reference in New Issue
Block a user