# HG changeset patch # User Sebastien Jodogne # Date 1423584197 -3600 # Node ID 7b6925b0890d12b4f6b89a97e7b797766d655be5 # Parent bba8a47922d15c3a572011f2daea998d7c3f9122 cppcheck diff -r bba8a47922d1 -r 7b6925b0890d OrthancServer/Scheduler/ServerCommandInstance.cpp --- a/OrthancServer/Scheduler/ServerCommandInstance.cpp Tue Feb 10 16:47:24 2015 +0100 +++ b/OrthancServer/Scheduler/ServerCommandInstance.cpp Tue Feb 10 17:03:17 2015 +0100 @@ -60,10 +60,10 @@ } for (std::list::iterator - it = next_.begin(); it != next_.end(); it++) + it = next_.begin(); it != next_.end(); ++it) { for (ListOfStrings::const_iterator - output = outputs.begin(); output != outputs.end(); output++) + output = outputs.begin(); output != outputs.end(); ++output) { (*it)->AddInput(*output); } diff -r bba8a47922d1 -r 7b6925b0890d OrthancServer/Scheduler/ServerJob.cpp --- a/OrthancServer/Scheduler/ServerJob.cpp Tue Feb 10 16:47:24 2015 +0100 +++ b/OrthancServer/Scheduler/ServerJob.cpp Tue Feb 10 17:03:17 2015 +0100 @@ -44,18 +44,18 @@ unsigned int count = 0; for (std::list::const_iterator - it = filters_.begin(); it != filters_.end(); it++) + it = filters_.begin(); it != filters_.end(); ++it) { index[*it] = count++; } for (std::list::const_iterator - it = filters_.begin(); it != filters_.end(); it++) + it = filters_.begin(); it != filters_.end(); ++it) { const std::list& nextCommands = (*it)->GetNextCommands(); for (std::list::const_iterator - next = nextCommands.begin(); next != nextCommands.end(); next++) + next = nextCommands.begin(); next != nextCommands.end(); ++next) { if (index.find(*next) == index.end() || index[*next] <= index[*it]) @@ -82,7 +82,7 @@ size_t size = filters_.size(); for (std::list::iterator - it = filters_.begin(); it != filters_.end(); it++) + it = filters_.begin(); it != filters_.end(); ++it) { target.Enqueue(*it); } @@ -94,24 +94,24 @@ } - ServerJob::ServerJob() + ServerJob::ServerJob() : + jobId_(Toolbox::GenerateUuid()), + submitted_(false), + description_("no description") { - jobId_ = Toolbox::GenerateUuid(); - submitted_ = false; - description_ = "no description"; } ServerJob::~ServerJob() { for (std::list::iterator - it = filters_.begin(); it != filters_.end(); it++) + it = filters_.begin(); it != filters_.end(); ++it) { delete *it; } for (std::list::iterator - it = payloads_.begin(); it != payloads_.end(); it++) + it = payloads_.begin(); it != payloads_.end(); ++it) { delete *it; } diff -r bba8a47922d1 -r 7b6925b0890d OrthancServer/Scheduler/ServerScheduler.cpp --- a/OrthancServer/Scheduler/ServerScheduler.cpp Tue Feb 10 16:47:24 2015 +0100 +++ b/OrthancServer/Scheduler/ServerScheduler.cpp Tue Feb 10 17:03:17 2015 +0100 @@ -55,7 +55,7 @@ const ListOfStrings& inputs) { for (ListOfStrings::const_iterator - it = inputs.begin(); it != inputs.end(); it++) + it = inputs.begin(); it != inputs.end(); ++it) { target_.push_back(*it); } @@ -232,7 +232,7 @@ ServerCommandInstance& sink = job.AddCommand(new Sink(outputs)); for (std::list::iterator - it = job.filters_.begin(); it != job.filters_.end(); it++) + it = job.filters_.begin(); it != job.filters_.end(); ++it) { if ((*it) != &sink && (*it)->IsConnectedToSink()) @@ -328,7 +328,7 @@ jobs.clear(); for (Jobs::const_iterator - it = jobs_.begin(); it != jobs_.end(); it++) + it = jobs_.begin(); it != jobs_.end(); ++it) { jobs.push_back(it->first); } diff -r bba8a47922d1 -r 7b6925b0890d OrthancServer/ServerContext.cpp --- a/OrthancServer/ServerContext.cpp Tue Feb 10 16:47:24 2015 +0100 +++ b/OrthancServer/ServerContext.cpp Tue Feb 10 17:03:17 2015 +0100 @@ -320,7 +320,7 @@ dicom.GetMetadata().clear(); for (InstanceMetadata::const_iterator it = instanceMetadata.begin(); - it != instanceMetadata.end(); it++) + it != instanceMetadata.end(); ++it) { dicom.GetMetadata().insert(std::make_pair(std::make_pair(ResourceType_Instance, it->first), it->second)); diff -r bba8a47922d1 -r 7b6925b0890d OrthancServer/ServerIndex.cpp --- a/OrthancServer/ServerIndex.cpp Tue Feb 10 16:47:24 2015 +0100 +++ b/OrthancServer/ServerIndex.cpp Tue Feb 10 17:03:17 2015 +0100 @@ -139,7 +139,7 @@ { for (std::list::const_iterator it = pendingChanges_.begin(); - it != pendingChanges_.end(); it++) + it != pendingChanges_.end(); ++it) { context_.SignalChange(*it); } @@ -1077,7 +1077,7 @@ target = Json::arrayValue; for (std::list::const_iterator - it = lst.begin(); it != lst.end(); it++) + it = lst.begin(); it != lst.end(); ++it) { target.append(*it); } @@ -1093,7 +1093,7 @@ { Json::Value items = Json::arrayValue; for (typename std::list::const_iterator - it = log.begin(); it != log.end(); it++) + it = log.begin(); it != log.end(); ++it) { Json::Value item; it->Format(item); @@ -2006,7 +2006,7 @@ db_.ListAvailableMetadata(metadata, id); for (std::list::const_iterator - it = metadata.begin(); it != metadata.end(); it++) + it = metadata.begin(); it != metadata.end(); ++it) { std::string key = EnumerationToString(*it); diff -r bba8a47922d1 -r 7b6925b0890d Plugins/Engine/PluginsManager.cpp --- a/Plugins/Engine/PluginsManager.cpp Tue Feb 10 16:47:24 2015 +0100 +++ b/Plugins/Engine/PluginsManager.cpp Tue Feb 10 17:03:17 2015 +0100 @@ -312,7 +312,7 @@ result.clear(); for (Plugins::const_iterator it = plugins_.begin(); - it != plugins_.end(); it++) + it != plugins_.end(); ++it) { result.push_back(it->first); } diff -r bba8a47922d1 -r 7b6925b0890d Plugins/Samples/StorageArea/Plugin.cpp --- a/Plugins/Samples/StorageArea/Plugin.cpp Tue Feb 10 16:47:24 2015 +0100 +++ b/Plugins/Samples/StorageArea/Plugin.cpp Tue Feb 10 17:03:17 2015 +0100 @@ -96,7 +96,7 @@ else { *content = malloc(*size); - if (content == NULL || + if (*content == NULL || fread(*content, *size, 1, fp) != 1) { ok = false; @@ -121,14 +121,13 @@ { ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* c) { - char info[1024]; - context = c; OrthancPluginLogWarning(context, "Storage plugin is initializing"); /* Check the version of the Orthanc core */ if (OrthancPluginCheckVersion(c) == 0) { + char info[1024]; sprintf(info, "Your version of Orthanc (%s) must be above %d.%d.%d to run this plugin", c->orthancVersion, ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER, diff -r bba8a47922d1 -r 7b6925b0890d UnitTestsSources/DicomMapTests.cpp --- a/UnitTestsSources/DicomMapTests.cpp Tue Feb 10 16:47:24 2015 +0100 +++ b/UnitTestsSources/DicomMapTests.cpp Tue Feb 10 17:03:17 2015 +0100 @@ -141,7 +141,7 @@ DicomMap::GetMainDicomTags(main, level); // The main dicom tags are a subset of the module - for (std::set::const_iterator it = main.begin(); it != main.end(); it++) + for (std::set::const_iterator it = main.begin(); it != main.end(); ++it) { bool ok = moduleTags.find(*it) != moduleTags.end(); diff -r bba8a47922d1 -r 7b6925b0890d UnitTestsSources/MultiThreadingTests.cpp --- a/UnitTestsSources/MultiThreadingTests.cpp Tue Feb 10 16:47:24 2015 +0100 +++ b/UnitTestsSources/MultiThreadingTests.cpp Tue Feb 10 17:03:17 2015 +0100 @@ -291,7 +291,7 @@ const ListOfStrings& inputs) { for (ListOfStrings::const_iterator - it = inputs.begin(); it != inputs.end(); it++) + it = inputs.begin(); it != inputs.end(); ++it) { int a = boost::lexical_cast(*it); int b = factor_ * a; @@ -318,8 +318,10 @@ { ListOfStrings l; s->GetListOfJobs(l); - for (ListOfStrings::iterator i = l.begin(); i != l.end(); i++) - printf(">> %s: %0.1f\n", i->c_str(), 100.0f * s->GetProgress(*i)); + for (ListOfStrings::iterator it = l.begin(); it != l.end(); ++it) + { + printf(">> %s: %0.1f\n", it->c_str(), 100.0f * s->GetProgress(*it)); + } Toolbox::USleep(10000); } }