summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-03-30 11:52:49 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2019-03-30 11:52:49 +0000
commit76fc8a4052a961ebff0e493385738d13190a4f8d (patch)
tree78505c250e696ba5058f3c3bcff10d0b4e91c110
parentClang tidy our own generated code (diff)
downloadslicer-1.9.1.tar.bz2
slicer-1.9.1.tar.xz
slicer-1.9.1.zip
Tidy fixes for latest clangslicer-1.9.1
-rw-r--r--slicer/db/sqlInsertSerializer.cpp4
-rw-r--r--slicer/db/sqlSelectDeserializer.cpp2
-rw-r--r--slicer/db/sqlUpdateSerializer.cpp10
-rw-r--r--slicer/json/serializer.cpp2
-rw-r--r--slicer/slicer/metadata.cpp1
-rw-r--r--slicer/xml/serializer.cpp2
6 files changed, 11 insertions, 10 deletions
diff --git a/slicer/db/sqlInsertSerializer.cpp b/slicer/db/sqlInsertSerializer.cpp
index 8890cc3..17d33b2 100644
--- a/slicer/db/sqlInsertSerializer.cpp
+++ b/slicer/db/sqlInsertSerializer.cpp
@@ -44,7 +44,7 @@ namespace Slicer {
SqlInsertSerializer::SerializeSequence(const Slicer::ModelPartPtr & mp) const
{
auto ins = createInsert(mp->GetContainedModelPart());
- mp->OnEachChild([&ins, this](const std::string &, ModelPartPtr cmp, const HookCommon *) {
+ mp->OnEachChild([&ins, this](const std::string &, const ModelPartPtr & cmp, const HookCommon *) {
bindObjectAndExecute(cmp, ins.get());
});
}
@@ -90,7 +90,7 @@ namespace Slicer {
SqlFetchIdInsertSerializer::bindObjectAndExecute(const Slicer::ModelPartPtr & cmp, DB::ModifyCommand * ins) const
{
SqlAutoIdInsertSerializer::bindObjectAndExecute(cmp, ins);
- cmp->OnEachChild([this](const std::string &, ModelPartPtr cmp, const HookCommon * h) {
+ cmp->OnEachChild([this](const std::string &, const ModelPartPtr & cmp, const HookCommon * h) {
if (isAuto(h)) {
cmp->SetValue(IdSave(connection));
}
diff --git a/slicer/db/sqlSelectDeserializer.cpp b/slicer/db/sqlSelectDeserializer.cpp
index d56c7f2..ff16c43 100644
--- a/slicer/db/sqlSelectDeserializer.cpp
+++ b/slicer/db/sqlSelectDeserializer.cpp
@@ -93,7 +93,7 @@ namespace Slicer {
rmp = rmp->GetSubclassModelPart(subclass);
}
rmp->Create();
- for (auto col = 0u; col < columnCount; col += 1) {
+ for (auto col = 0U; col < columnCount; col += 1) {
const DB::Column & c = (*cmd)[col];
if (!c.isNull()) {
auto fmpr = rmp->GetChildRef(c.name, nullptr, false);
diff --git a/slicer/db/sqlUpdateSerializer.cpp b/slicer/db/sqlUpdateSerializer.cpp
index bf690dc..3ed7c2b 100644
--- a/slicer/db/sqlUpdateSerializer.cpp
+++ b/slicer/db/sqlUpdateSerializer.cpp
@@ -43,7 +43,7 @@ namespace Slicer {
SqlUpdateSerializer::SerializeSequence(const Slicer::ModelPartPtr & mp) const
{
auto ins = createUpdate(mp->GetContainedModelPart());
- mp->OnEachChild([&ins](const std::string &, ModelPartPtr cmp, const HookCommon *) {
+ mp->OnEachChild([&ins](const std::string &, const ModelPartPtr & cmp, const HookCommon *) {
bindObjectAndExecute(cmp, ins.get());
});
}
@@ -52,7 +52,7 @@ namespace Slicer {
SqlUpdateSerializer::bindObjectAndExecute(const Slicer::ModelPartPtr & cmp, DB::ModifyCommand * upd)
{
int paramNo = 0;
- cmp->OnEachChild([&upd, &paramNo](const std::string &, ModelPartPtr cmp, const HookCommon * h) {
+ cmp->OnEachChild([&upd, &paramNo](const std::string &, const ModelPartPtr & cmp, const HookCommon * h) {
if (isValue(h)) {
if (!cmp->GetValue(SqlBinder(*upd, paramNo))) {
upd->bindNull(paramNo);
@@ -60,7 +60,7 @@ namespace Slicer {
paramNo++;
}
});
- cmp->OnEachChild([&upd, &paramNo](const std::string &, ModelPartPtr cmp, const HookCommon * h) {
+ cmp->OnEachChild([&upd, &paramNo](const std::string &, const ModelPartPtr & cmp, const HookCommon * h) {
if (isPKey(h)) {
cmp->GetValue(SqlBinder(*upd, paramNo++));
}
@@ -76,7 +76,7 @@ namespace Slicer {
AdHoc::Buffer update;
update.appendbf("UPDATE %s SET ", tableName);
int fieldNo = 0;
- mp->OnEachChild([&update, &fieldNo]( const std::string & name, ModelPartPtr, const HookCommon * h) {
+ mp->OnEachChild([&update, &fieldNo]( const std::string & name, const ModelPartPtr &, const HookCommon * h) {
if (isValue(h)) {
if (fieldNo++) {
update.append(", ");
@@ -86,7 +86,7 @@ namespace Slicer {
});
update.append(" WHERE ", AdHoc::Buffer::Use);
fieldNo = 0;
- mp->OnEachChild([&update, &fieldNo]( const std::string & name, ModelPartPtr, const HookCommon * h) {
+ mp->OnEachChild([&update, &fieldNo]( const std::string & name, const ModelPartPtr &, const HookCommon * h) {
if (isPKey(h)) {
if (fieldNo++) {
update.append(" AND ");
diff --git a/slicer/json/serializer.cpp b/slicer/json/serializer.cpp
index e921573..3a8be0a 100644
--- a/slicer/json/serializer.cpp
+++ b/slicer/json/serializer.cpp
@@ -70,7 +70,7 @@ namespace Slicer {
v = std::get<json::String>(value);
}
- protected:
+ private:
const json::Value & value;
};
diff --git a/slicer/slicer/metadata.cpp b/slicer/slicer/metadata.cpp
index 8658be6..4f794fc 100644
--- a/slicer/slicer/metadata.cpp
+++ b/slicer/slicer/metadata.cpp
@@ -31,6 +31,7 @@ std::vector<std::string>
Slicer::metaDataSplit(const std::string & metadata)
{
std::vector<std::string> parts;
+ // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
boost::algorithm::split(parts, metadata, boost::algorithm::is_any_of(":"), boost::algorithm::token_compress_off);
return parts;
}
diff --git a/slicer/xml/serializer.cpp b/slicer/xml/serializer.cpp
index 6d9a60d..36605e6 100644
--- a/slicer/xml/serializer.cpp
+++ b/slicer/xml/serializer.cpp
@@ -79,7 +79,7 @@ namespace Slicer {
v = value.raw();
}
- protected:
+ private:
const Glib::ustring value;
};