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:
@@ -54,7 +54,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
|
||||
|
||||
if (errorCode) {
|
||||
delete job;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
|
||||
|
||||
NoiseCurve noiseLCurve;
|
||||
NoiseCurve noiseCCurve;
|
||||
Imagefloat *calclum = NULL ;
|
||||
Imagefloat *calclum = nullptr ;
|
||||
params.dirpyrDenoise.getCurves(noiseLCurve, noiseCCurve);
|
||||
float autoNR = (float) settings->nrauto;//
|
||||
float autoNRmax = (float) settings->nrautomax;//
|
||||
@@ -754,7 +754,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
|
||||
}
|
||||
|
||||
// update blurmap
|
||||
SHMap* shmap = NULL;
|
||||
SHMap* shmap = nullptr;
|
||||
|
||||
if (params.sh.enabled) {
|
||||
shmap = new SHMap (fw, fh, true);
|
||||
@@ -858,7 +858,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
|
||||
DCPProfile::ApplyState as;
|
||||
DCPProfile *dcpProf = imgsrc->getDCP(params.icm, currWB, as);
|
||||
|
||||
ipf.rgbProc (baseImg, labView, NULL, curve1, curve2, curve, shmap, params.toneCurve.saturation, rCurve, gCurve, bCurve, satLimit , satLimitOpacity, ctColorCurve, ctOpacityCurve, opautili, clToningcurve, cl2Toningcurve, customToneCurve1, customToneCurve2, customToneCurvebw1, customToneCurvebw2, rrm, ggm, bbm, autor, autog, autob, expcomp, hlcompr, hlcomprthresh, dcpProf, as);
|
||||
ipf.rgbProc (baseImg, labView, nullptr, curve1, curve2, curve, shmap, params.toneCurve.saturation, rCurve, gCurve, bCurve, satLimit , satLimitOpacity, ctColorCurve, ctOpacityCurve, opautili, clToningcurve, cl2Toningcurve, customToneCurve1, customToneCurve2, customToneCurvebw1, customToneCurvebw2, rrm, ggm, bbm, autor, autog, autob, expcomp, hlcompr, hlcomprthresh, dcpProf, as);
|
||||
|
||||
if (settings->verbose) {
|
||||
printf("Output image / Auto B&W coefs: R=%.2f G=%.2f B=%.2f\n", autor, autog, autob);
|
||||
@@ -881,13 +881,13 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
|
||||
|
||||
// Freeing baseImg because not used anymore
|
||||
delete baseImg;
|
||||
baseImg = NULL;
|
||||
baseImg = nullptr;
|
||||
|
||||
if (shmap) {
|
||||
delete shmap;
|
||||
}
|
||||
|
||||
shmap = NULL;
|
||||
shmap = nullptr;
|
||||
|
||||
if (pl) {
|
||||
pl->setProgress (0.55);
|
||||
@@ -933,7 +933,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
|
||||
CurveFactory::complexsgnCurve (autili, butili, ccutili, cclutili, params.labCurve.acurve, params.labCurve.bcurve, params.labCurve.cccurve,
|
||||
params.labCurve.lccurve, curve1, curve2, satcurve, lhskcurve, 1);
|
||||
|
||||
ipf.chromiLuminanceCurve (NULL, 1, labView, labView, curve1, curve2, satcurve, lhskcurve, clcurve, lumacurve, utili, autili, butili, ccutili, cclutili, clcutili, dummy, dummy);
|
||||
ipf.chromiLuminanceCurve (nullptr, 1, labView, labView, curve1, curve2, satcurve, lhskcurve, clcurve, lumacurve, utili, autili, butili, ccutili, cclutili, clcutili, dummy, dummy);
|
||||
|
||||
if((params.colorappearance.enabled && !params.colorappearance.tonecie) || (!params.colorappearance.enabled)) {
|
||||
ipf.EPDToneMap(labView, 5, 1);
|
||||
@@ -1071,7 +1071,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
|
||||
}
|
||||
|
||||
delete cieView;
|
||||
cieView = NULL;
|
||||
cieView = nullptr;
|
||||
|
||||
|
||||
|
||||
@@ -1147,8 +1147,8 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
|
||||
}
|
||||
}
|
||||
|
||||
Image16* readyImg = NULL;
|
||||
cmsHPROFILE jprof = NULL;
|
||||
Image16* readyImg = nullptr;
|
||||
cmsHPROFILE jprof = nullptr;
|
||||
bool customGamma = false;
|
||||
bool useLCMS = false;
|
||||
|
||||
@@ -1249,14 +1249,14 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
|
||||
|
||||
jprof = iccStore->getProfile(outProfile); //get output profile
|
||||
|
||||
if (jprof == NULL) {
|
||||
if (jprof == nullptr) {
|
||||
useLCMS = true;
|
||||
|
||||
if (settings->verbose) {
|
||||
printf("\"%s\" ICC output profile not found!\n", outProfile.c_str());
|
||||
}
|
||||
} else {
|
||||
cmsToneCurve* GammaTRC[3] = { NULL, NULL, NULL };
|
||||
cmsToneCurve* GammaTRC[3] = { nullptr, nullptr, nullptr };
|
||||
|
||||
cmsFloat64Number Parameters[7];
|
||||
|
||||
@@ -1279,7 +1279,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
|
||||
|
||||
|
||||
// instruction with //ICC are used for generate icc profile
|
||||
if (DescriptionMLU == NULL) {
|
||||
if (DescriptionMLU == nullptr) {
|
||||
printf("Description error\n");
|
||||
}
|
||||
|
||||
@@ -1331,7 +1331,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
|
||||
// cmsWriteTag(jprof, cmsSigDeviceModelDescTag, DmddMLU);
|
||||
|
||||
// Calculate output profile's rTRC bTRC gTRC
|
||||
GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildParametricToneCurve(NULL, 5, Parameters);
|
||||
GammaTRC[0] = GammaTRC[1] = GammaTRC[2] = cmsBuildParametricToneCurve(nullptr, 5, Parameters);
|
||||
cmsWriteTag(jprof, cmsSigGreenTRCTag, (void*)GammaTRC[1] );
|
||||
cmsWriteTag(jprof, cmsSigRedTRCTag, (void*)GammaTRC[0] );
|
||||
cmsWriteTag(jprof, cmsSigBlueTRCTag, (void*)GammaTRC[2] );
|
||||
@@ -1365,7 +1365,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
|
||||
}
|
||||
|
||||
delete labView;
|
||||
labView = NULL;
|
||||
labView = nullptr;
|
||||
|
||||
|
||||
|
||||
@@ -1426,7 +1426,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
|
||||
// if iccStore->getProfile send back an object, then iccStore->getContent will do too
|
||||
cmsHPROFILE jprof = iccStore->getProfile(outputProfile); //get outProfile
|
||||
|
||||
if (jprof == NULL) {
|
||||
if (jprof == nullptr) {
|
||||
if (settings->verbose) {
|
||||
printf("\"%s\" ICC output profile not found!\n - use LCMS2 substitution\n", outputProfile.c_str());
|
||||
}
|
||||
@@ -1440,7 +1440,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
|
||||
}
|
||||
} else {
|
||||
// No ICM
|
||||
readyImg->setOutputProfile (NULL, 0);
|
||||
readyImg->setOutputProfile (nullptr, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1483,13 +1483,13 @@ void batchProcessingThread (ProcessingJob* job, BatchProcessingListener* bpl, bo
|
||||
|
||||
if (errorCode) {
|
||||
bpl->error (M("MAIN_MSG_CANNOTLOAD"));
|
||||
currentJob = NULL;
|
||||
currentJob = nullptr;
|
||||
} else {
|
||||
try {
|
||||
currentJob = bpl->imageReady (img);
|
||||
} catch (Glib::Exception& ex) {
|
||||
bpl->error (ex.what());
|
||||
currentJob = NULL;
|
||||
currentJob = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user