From 91a73fb8e63636143c98bab962f36b349eac1421 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 15 Apr 2022 17:31:28 +0100 Subject: Fix shadowing --- Jamroot.jam | 1 + slicer/db/sqlInsertSerializer.cpp | 6 +++--- slicer/db/sqlTablePatchSerializer.cpp | 4 ++-- slicer/db/sqlUpdateSerializer.cpp | 6 +++--- slicer/slicer/modelPartsTypes.cpp | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Jamroot.jam b/Jamroot.jam index 206829a..a143671 100644 --- a/Jamroot.jam +++ b/Jamroot.jam @@ -28,6 +28,7 @@ project debug:-Wnull-dereference debug:-Wdouble-promotion debug:-Wformat=2 + debug:-Wshadow gcc,debug:-Wduplicated-cond gcc,debug:-Wduplicated-branches gcc,debug:-Wlogical-op diff --git a/slicer/db/sqlInsertSerializer.cpp b/slicer/db/sqlInsertSerializer.cpp index c45b028..58e30e2 100644 --- a/slicer/db/sqlInsertSerializer.cpp +++ b/slicer/db/sqlInsertSerializer.cpp @@ -102,10 +102,10 @@ namespace Slicer { }; void - SqlFetchIdInsertSerializer::bindObjectAndExecute(const Slicer::ModelPartPtr & cmp, DB::ModifyCommand * ins) const + SqlFetchIdInsertSerializer::bindObjectAndExecute(const Slicer::ModelPartPtr & mp, DB::ModifyCommand * ins) const { - SqlAutoIdInsertSerializer::bindObjectAndExecute(cmp, ins); - cmp->OnEachChild([this](const std::string &, const ModelPartPtr & cmp, const HookCommon * h) { + SqlAutoIdInsertSerializer::bindObjectAndExecute(mp, ins); + mp->OnEachChild([this](const std::string &, const ModelPartPtr & cmp, const HookCommon * h) { if (isAuto(h)) { cmp->SetValue(IdSave(connection)); } diff --git a/slicer/db/sqlTablePatchSerializer.cpp b/slicer/db/sqlTablePatchSerializer.cpp index b95aeff..3b73f05 100644 --- a/slicer/db/sqlTablePatchSerializer.cpp +++ b/slicer/db/sqlTablePatchSerializer.cpp @@ -11,8 +11,8 @@ namespace Slicer { AdHocFormatter(ttname, "slicer_tmp_%?"); - SqlTablePatchSerializer::SqlTablePatchSerializer(DB::Connection * const db, DB::TablePatch & tp) : - db(db), tablePatch(tp) + SqlTablePatchSerializer::SqlTablePatchSerializer(DB::Connection * const d, DB::TablePatch & tp) : + db(d), tablePatch(tp) { tablePatch.src = ttname::get(this); } diff --git a/slicer/db/sqlUpdateSerializer.cpp b/slicer/db/sqlUpdateSerializer.cpp index 0cd3c02..038f28e 100644 --- a/slicer/db/sqlUpdateSerializer.cpp +++ b/slicer/db/sqlUpdateSerializer.cpp @@ -56,10 +56,10 @@ namespace Slicer { } void - SqlUpdateSerializer::bindObjectAndExecute(const Slicer::ModelPartPtr & cmp, DB::ModifyCommand * upd) + SqlUpdateSerializer::bindObjectAndExecute(const Slicer::ModelPartPtr & mp, DB::ModifyCommand * upd) { unsigned int paramNo = 0; - cmp->OnEachChild([&upd, ¶mNo](const std::string &, const ModelPartPtr & cmp, const HookCommon * h) { + mp->OnEachChild([&upd, ¶mNo](const std::string &, const ModelPartPtr & cmp, const HookCommon * h) { if (isValue(h)) { if (!cmp->GetValue(SqlBinder(*upd, paramNo))) { upd->bindNull(paramNo); @@ -67,7 +67,7 @@ namespace Slicer { paramNo++; } }); - cmp->OnEachChild([&upd, ¶mNo](const std::string &, const ModelPartPtr & cmp, const HookCommon * h) { + mp->OnEachChild([&upd, ¶mNo](const std::string &, const ModelPartPtr & cmp, const HookCommon * h) { if (isPKey(h)) { cmp->GetValue(SqlBinder(*upd, paramNo++)); } diff --git a/slicer/slicer/modelPartsTypes.cpp b/slicer/slicer/modelPartsTypes.cpp index f69c96c..47543a6 100644 --- a/slicer/slicer/modelPartsTypes.cpp +++ b/slicer/slicer/modelPartsTypes.cpp @@ -413,7 +413,7 @@ namespace Slicer { return true; } // Stream Roots - ModelPartForStreamRootBase::ModelPartForStreamRootBase(const ModelPartPtr & mp) : ModelPartForRootBase(mp) { } + ModelPartForStreamRootBase::ModelPartForStreamRootBase(const ModelPartPtr & m) : ModelPartForRootBase(m) { } // NOLINTNEXTLINE(hicpp-no-array-decay) void ModelPartForStreamRootBase::Write(Ice::OutputStream &) const -- cgit v1.2.3