From 41fc34c5c6fa5c1672ba99deb19d9c5709eb94e8 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Wed, 31 Jul 2019 20:21:16 +0200 Subject: [PATCH] Do not assign empty strings on creation of std::string or Glib::ustring --- rtengine/procparams.cc | 2 +- rtengine/profilestore.cc | 2 +- rtengine/rtlensfun.cc | 2 +- rtgui/batchqueue.cc | 4 ++-- rtgui/batchqueueentry.cc | 1 - rtgui/coordinateadjuster.cc | 2 +- rtgui/curveeditorgroup.cc | 2 +- rtgui/exifpanel.cc | 2 +- rtgui/favoritbrowser.cc | 2 +- rtgui/filecatalog.cc | 2 -- rtgui/flatfield.cc | 1 - rtgui/icmpanel.cc | 4 +--- rtgui/main-cli.cc | 4 ++-- rtgui/profilepanel.cc | 2 +- 14 files changed, 13 insertions(+), 19 deletions(-) diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 2118213d5..10d03270f 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -65,7 +65,7 @@ Glib::ustring relativePathIfInside(const Glib::ustring &procparams_fname, bool f return embedded_fname; } - Glib::ustring prefix = ""; + Glib::ustring prefix; if (embedded_fname.length() > 5 && embedded_fname.substr(0, 5) == "file:") { embedded_fname = embedded_fname.substr(5); diff --git a/rtengine/profilestore.cc b/rtengine/profilestore.cc index 437ef6ec6..82074053f 100644 --- a/rtengine/profilestore.cc +++ b/rtengine/profilestore.cc @@ -535,7 +535,7 @@ PartialProfile *ProfileStore::loadDynamicProfile (const FramesMetaData *im) return ret; } -ProfileStoreEntry::ProfileStoreEntry() : label (""), type (PSET_FOLDER), parentFolderId (0), folderId (0) {} +ProfileStoreEntry::ProfileStoreEntry() : type (PSET_FOLDER), parentFolderId (0), folderId (0) {} ProfileStoreEntry::ProfileStoreEntry (Glib::ustring label, PSEType type, unsigned short parentFolder, unsigned short folder) : label (label), type (type), parentFolderId (parentFolder), folderId (folder) {} diff --git a/rtengine/rtlensfun.cc b/rtengine/rtlensfun.cc index 3cea8c484..5f0ffdd91 100644 --- a/rtengine/rtlensfun.cc +++ b/rtengine/rtlensfun.cc @@ -132,7 +132,7 @@ Glib::ustring LFModifier::getDisplayString() const return "NONE"; } else { Glib::ustring ret; - Glib::ustring sep = ""; + Glib::ustring sep; if (flags_ & LF_MODIFY_DISTORTION) { ret += "distortion"; sep = ", "; diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index 239057b87..3fb2cd438 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -811,7 +811,7 @@ Glib::ustring BatchQueue::calcAutoFileNameBase (const Glib::ustring& origFileNam break; } - Glib::ustring tok = ""; + Glib::ustring tok; while ((i < origFileName.size()) && !(origFileName[i] == '\\' || origFileName[i] == '/')) { tok = tok + origFileName[i++]; @@ -857,7 +857,7 @@ Glib::ustring BatchQueue::calcAutoFileNameBase (const Glib::ustring& origFileNam // constructing full output path // printf ("path=|%s|\n", options.savePath.c_str()); - Glib::ustring path = ""; + Glib::ustring path; if (options.saveUsePathTemplate) { unsigned int ix = 0; diff --git a/rtgui/batchqueueentry.cc b/rtgui/batchqueueentry.cc index 23982095c..78e3991c7 100644 --- a/rtgui/batchqueueentry.cc +++ b/rtgui/batchqueueentry.cc @@ -40,7 +40,6 @@ BatchQueueEntry::BatchQueueEntry (rtengine::ProcessingJob* pjob, const rtengine: job(pjob), params(new rtengine::procparams::ProcParams(pparams)), progress(0), - outFileName(""), sequence(0), forceFormatOpts(false), fast_pipeline(job->fastPipeline()), diff --git a/rtgui/coordinateadjuster.cc b/rtgui/coordinateadjuster.cc index 2525a07e5..5065606d9 100644 --- a/rtgui/coordinateadjuster.cc +++ b/rtgui/coordinateadjuster.cc @@ -23,7 +23,7 @@ #include "curveeditorgroup.h" Axis::Axis() - : label(""), decimal(5), increment(0.001), pageIncrement(0.01), rangeLowerBound(0.), rangeUpperBound(1.) + : decimal(5), increment(0.001), pageIncrement(0.01), rangeLowerBound(0.), rangeUpperBound(1.) {} Axis::Axis(Glib::ustring label, unsigned int decimal, double increment, double pageIncrement, double valMin = 0.0, double valMax = 1.0) diff --git a/rtgui/curveeditorgroup.cc b/rtgui/curveeditorgroup.cc index 10aff907c..495e4324b 100644 --- a/rtgui/curveeditorgroup.cc +++ b/rtgui/curveeditorgroup.cc @@ -397,7 +397,7 @@ void CurveEditorGroup::setUnChanged (bool uc, CurveEditor* ce) } } -CurveEditorSubGroup::CurveEditorSubGroup(Glib::ustring& curveDir) : curveDir(curveDir), lastFilename(""), valLinear(0), valUnchanged(0), parent(nullptr) +CurveEditorSubGroup::CurveEditorSubGroup(Glib::ustring& curveDir) : curveDir(curveDir), valLinear(0), valUnchanged(0), parent(nullptr) { leftBar = nullptr; bottomBar = nullptr; diff --git a/rtgui/exifpanel.cc b/rtgui/exifpanel.cc index 6c196e575..f9324e90c 100644 --- a/rtgui/exifpanel.cc +++ b/rtgui/exifpanel.cc @@ -632,7 +632,7 @@ Glib::ustring ExifPanel::getSelection (bool onlyeditable) Gtk::TreeModel::iterator iter = exifTreeModel->get_iter (rows[0]); - Glib::ustring ret = ""; + Glib::ustring ret; bool first = true; bool editable = false; diff --git a/rtgui/favoritbrowser.cc b/rtgui/favoritbrowser.cc index 0e1b4490b..09deacfab 100644 --- a/rtgui/favoritbrowser.cc +++ b/rtgui/favoritbrowser.cc @@ -20,7 +20,7 @@ #include "multilangmgr.h" #include "rtimage.h" -FavoritBrowser::FavoritBrowser () : listener (NULL), lastSelectedDir ("") +FavoritBrowser::FavoritBrowser () : listener (NULL) { scrollw = Gtk::manage (new Gtk::ScrolledWindow ()); diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index dbe540cb4..98e805d3a 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -457,8 +457,6 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb, FilePanel* filepanel) : hScrollPos[i] = 0; vScrollPos[i] = 0; } - - selectedDirectory = ""; } FileCatalog::~FileCatalog() diff --git a/rtgui/flatfield.cc b/rtgui/flatfield.cc index 25482909e..f69b90170 100644 --- a/rtgui/flatfield.cc +++ b/rtgui/flatfield.cc @@ -86,7 +86,6 @@ FlatField::FlatField () : FoldableToolPanel(this, "flatfield", M("TP_FLATFIELD_L flatFieldFileReset->signal_clicked().connect( sigc::mem_fun(*this, &FlatField::flatFieldFile_Reset), true ); flatFieldAutoSelectconn = flatFieldAutoSelect->signal_toggled().connect ( sigc::mem_fun(*this, &FlatField::flatFieldAutoSelectChanged), true); flatFieldBlurTypeconn = flatFieldBlurType->signal_changed().connect( sigc::mem_fun(*this, &FlatField::flatFieldBlurTypeChanged) ); - lastShortcutPath = ""; // Set filename filters b_filter_asCurrent = false; diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc index c0944eef6..a6857eaa9 100644 --- a/rtgui/icmpanel.cc +++ b/rtgui/icmpanel.cc @@ -34,7 +34,7 @@ using namespace rtengine::procparams; extern Options options; -ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iunchanged(nullptr), icmplistener(nullptr), lastRefFilename(""), camName("") +ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iunchanged(nullptr), icmplistener(nullptr) { auto m = ProcEventMapper::getInstance(); EvICMprimariMethod = m->newEvent(GAMMA, "HISTORY_MSG_ICM_OUTPUT_PRIMARIES"); @@ -304,8 +304,6 @@ ICMPanel::ICMPanel() : FoldableToolPanel(this, "icm", M("TP_ICM_LABEL")), iuncha ipDialog->set_show_hidden(true); // ProgramData is hidden on Windows #endif - oldip = ""; - wprofnamesconn = wProfNames->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::wpChanged)); oprofnamesconn = oProfNames->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::opChanged)); orendintentconn = oRendIntent->signal_changed().connect(sigc::mem_fun(*this, &ICMPanel::oiChanged)); diff --git a/rtgui/main-cli.cc b/rtgui/main-cli.cc index cbea1d477..f71d7099d 100644 --- a/rtgui/main-cli.cc +++ b/rtgui/main-cli.cc @@ -256,7 +256,7 @@ int processLineParams ( int argc, char **argv ) { rtengine::procparams::PartialProfile *rawParams = nullptr, *imgParams = nullptr; std::vector inputFiles; - Glib::ustring outputPath = ""; + Glib::ustring outputPath; std::vector processingParams; bool outputDirectory = false; bool leaveUntouched = false; @@ -271,7 +271,7 @@ int processLineParams ( int argc, char **argv ) int subsampling = 3; int bits = -1; bool isFloat = false; - std::string outputType = ""; + std::string outputType; unsigned errors = 0; for ( int iArg = 1; iArg < argc; iArg++) { diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index af39695fa..c969d13c0 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -42,7 +42,7 @@ void ProfilePanel::cleanup () delete partialProfileDlg; } -ProfilePanel::ProfilePanel () : storedPProfile(nullptr), lastFilename(""), imagePath(""), lastSavedPSE(nullptr), customPSE(nullptr) +ProfilePanel::ProfilePanel () : storedPProfile(nullptr), lastSavedPSE(nullptr), customPSE(nullptr) { tpc = nullptr;