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:
Flössie
2016-10-12 17:48:40 +02:00
parent 29d5329f3f
commit 0731975ff0
218 changed files with 2406 additions and 2406 deletions

View File

@@ -45,7 +45,7 @@ inline dfInfo& dfInfo::operator =(const dfInfo &o)
if( ri ) {
delete ri;
ri = NULL;
ri = nullptr;
}
return *this;
@@ -138,7 +138,7 @@ void dfInfo::updateRawImage()
if( ri->loadRaw(true)) {
delete ri;
ri = NULL;
ri = nullptr;
} else {
int H = ri->get_height();
int W = ri->get_width();
@@ -200,7 +200,7 @@ void dfInfo::updateRawImage()
if( ri->loadRaw(true)) {
delete ri;
ri = NULL;
ri = nullptr;
} else {
ri->compress_image();
}
@@ -332,11 +332,11 @@ dfInfo* DFManager::addFileInfo (const Glib::ustring& filename, bool pool)
auto file = Gio::File::create_for_path (filename);
if (!file) {
return 0;
return nullptr;
}
if (!file->query_exists ()) {
return 0;
return nullptr;
}
try {
@@ -344,11 +344,11 @@ dfInfo* DFManager::addFileInfo (const Glib::ustring& filename, bool pool)
auto info = file->query_info ();
if (!info && info->get_file_type () == Gio::FILE_TYPE_DIRECTORY) {
return 0;
return nullptr;
}
if (!options.fbShowHidden && info->is_hidden ()) {
return 0;
return nullptr;
}
Glib::ustring ext;
@@ -359,14 +359,14 @@ dfInfo* DFManager::addFileInfo (const Glib::ustring& filename, bool pool)
}
if (!options.is_extention_enabled (ext)) {
return 0;
return nullptr;
}
RawImage ri (filename);
int res = ri.loadRaw (false); // Read informations about shot
if (res != 0) {
return 0;
return nullptr;
}
dfList_t::iterator iter;
@@ -406,7 +406,7 @@ dfInfo* DFManager::addFileInfo (const Glib::ustring& filename, bool pool)
} catch(Gio::Error&) {}
return 0;
return nullptr;
}
void DFManager::getStat( int &totFiles, int &totTemplates)
@@ -433,7 +433,7 @@ void DFManager::getStat( int &totFiles, int &totTemplates)
dfInfo* DFManager::find( const std::string &mak, const std::string &mod, int isospeed, double shut, time_t t )
{
if( dfList.empty() ) {
return 0;
return nullptr;
}
std::string key( dfInfo::key(mak, mod, isospeed, shut) );
@@ -467,7 +467,7 @@ dfInfo* DFManager::find( const std::string &mak, const std::string &mod, int iso
}
}
return bestD != INFINITY ? &(bestMatch->second) : 0 ;
return bestD != INFINITY ? &(bestMatch->second) : nullptr ;
}
}
@@ -478,7 +478,7 @@ RawImage* DFManager::searchDarkFrame( const std::string &mak, const std::string
if( df ) {
return df->getRawImage();
} else {
return 0;
return nullptr;
}
}
@@ -496,7 +496,7 @@ RawImage* DFManager::searchDarkFrame( const Glib::ustring filename )
return df->getRawImage();
}
return 0;
return nullptr;
}
std::vector<badPix> *DFManager::getHotPixels ( const Glib::ustring filename )
{
@@ -506,7 +506,7 @@ std::vector<badPix> *DFManager::getHotPixels ( const Glib::ustring filename )
}
}
return 0;
return nullptr;
}
std::vector<badPix> *DFManager::getHotPixels ( const std::string &mak, const std::string &mod, int iso, double shut, time_t t )
{
@@ -525,7 +525,7 @@ std::vector<badPix> *DFManager::getHotPixels ( const std::string &mak, const std
return &df->getHotPixels();
} else {
return 0;
return nullptr;
}
}
@@ -624,7 +624,7 @@ std::vector<badPix> *DFManager::getBadPixels ( const std::string &mak, const std
}
if(!found) {
return 0;
return nullptr;
} else {
return &(iter->second);
}