# HG changeset patch # User Sebastien Jodogne # Date 1448894054 -3600 # Node ID 559956d5ceb2e33af57be8f16ab5acacc0bf311b # Parent 3dcf5c0734c9714acfc2ba06ce7328454261ac0c cppcheck diff -r 3dcf5c0734c9 -r 559956d5ceb2 Core/MultiThreading/RunnableWorkersPool.cpp --- a/Core/MultiThreading/RunnableWorkersPool.cpp Mon Nov 30 14:51:43 2015 +0100 +++ b/Core/MultiThreading/RunnableWorkersPool.cpp Mon Nov 30 15:34:14 2015 +0100 @@ -105,7 +105,7 @@ { pimpl_->continue_ = true; - if (countWorkers <= 0) + if (countWorkers == 0) { throw OrthancException(ErrorCode_ParameterOutOfRange); } diff -r 3dcf5c0734c9 -r 559956d5ceb2 OrthancServer/DatabaseWrapper.cpp --- a/OrthancServer/DatabaseWrapper.cpp Mon Nov 30 14:51:43 2015 +0100 +++ b/OrthancServer/DatabaseWrapper.cpp Mon Nov 30 15:34:14 2015 +0100 @@ -256,12 +256,20 @@ } - DatabaseWrapper::DatabaseWrapper(const std::string& path) : listener_(NULL), base_(db_) + DatabaseWrapper::DatabaseWrapper(const std::string& path) : + listener_(NULL), + base_(db_), + signalRemainingAncestor_(NULL), + version_(0) { db_.Open(path); } - DatabaseWrapper::DatabaseWrapper() : listener_(NULL), base_(db_) + DatabaseWrapper::DatabaseWrapper() : + listener_(NULL), + base_(db_), + signalRemainingAncestor_(NULL), + version_(0) { db_.OpenInMemory(); } diff -r 3dcf5c0734c9 -r 559956d5ceb2 OrthancServer/DicomProtocol/DicomFindAnswers.cpp --- a/OrthancServer/DicomProtocol/DicomFindAnswers.cpp Mon Nov 30 14:51:43 2015 +0100 +++ b/OrthancServer/DicomProtocol/DicomFindAnswers.cpp Mon Nov 30 15:34:14 2015 +0100 @@ -39,11 +39,12 @@ #include #include +#include namespace Orthanc { - class DicomFindAnswers::Answer + class DicomFindAnswers::Answer : public boost::noncopyable { private: ParsedDicomFile* dicom_; diff -r 3dcf5c0734c9 -r 559956d5ceb2 OrthancServer/DicomProtocol/DicomServer.h --- a/OrthancServer/DicomProtocol/DicomServer.h Mon Nov 30 14:51:43 2015 +0100 +++ b/OrthancServer/DicomProtocol/DicomServer.h Mon Nov 30 15:34:14 2015 +0100 @@ -54,7 +54,6 @@ std::string aet_; uint16_t port_; bool continue_; - bool started_; uint32_t clientTimeout_; IFindRequestHandlerFactory* findRequestHandlerFactory_; IMoveRequestHandlerFactory* moveRequestHandlerFactory_; diff -r 3dcf5c0734c9 -r 559956d5ceb2 OrthancServer/OrthancRestApi/OrthancRestArchive.cpp --- a/OrthancServer/OrthancRestApi/OrthancRestArchive.cpp Mon Nov 30 14:51:43 2015 +0100 +++ b/OrthancServer/OrthancRestApi/OrthancRestArchive.cpp Mon Nov 30 15:34:14 2015 +0100 @@ -451,8 +451,10 @@ ArchiveWriterVisitor(HierarchicalZipWriter& writer, ServerContext& context) : writer_(writer), - context_(context) + context_(context), + countInstances_(0) { + snprintf(instanceFormat_, sizeof(instanceFormat_) - 1, "%%08d.dcm"); } virtual void Open(ResourceType level, diff -r 3dcf5c0734c9 -r 559956d5ceb2 OrthancServer/OrthancRestApi/OrthancRestResources.cpp --- a/OrthancServer/OrthancRestApi/OrthancRestResources.cpp Mon Nov 30 14:51:43 2015 +0100 +++ b/OrthancServer/OrthancRestApi/OrthancRestResources.cpp Mon Nov 30 15:34:14 2015 +0100 @@ -359,7 +359,7 @@ try { quality_ = boost::lexical_cast(v); - ok = (quality_ >= 0 && quality_ <= 100); + ok = (quality_ >= 1 && quality_ <= 100); } catch (boost::bad_lexical_cast&) { @@ -1097,11 +1097,13 @@ size_t limit = 0; if (request.isMember("Limit")) { - limit = request["CaseSensitive"].asInt(); - if (limit < 0) + int tmp = request["CaseSensitive"].asInt(); + if (tmp < 0) { throw OrthancException(ErrorCode_ParameterOutOfRange); } + + limit = static_cast(tmp); } std::string level = request["Level"].asString(); diff -r 3dcf5c0734c9 -r 559956d5ceb2 OrthancServer/ServerToolbox.cpp --- a/OrthancServer/ServerToolbox.cpp Mon Nov 30 14:51:43 2015 +0100 +++ b/OrthancServer/ServerToolbox.cpp Mon Nov 30 15:34:14 2015 +0100 @@ -297,7 +297,7 @@ database.GetAllPublicIds(resources, level); for (std::list::const_iterator - it = resources.begin(); it != resources.end(); it++) + it = resources.begin(); it != resources.end(); ++it) { // Locate the resource and one of its child instances int64_t resource, instance; diff -r 3dcf5c0734c9 -r 559956d5ceb2 Plugins/Engine/OrthancPlugins.cpp --- a/Plugins/Engine/OrthancPlugins.cpp Mon Nov 30 14:51:43 2015 +0100 +++ b/Plugins/Engine/OrthancPlugins.cpp Mon Nov 30 15:34:14 2015 +0100 @@ -1608,8 +1608,7 @@ return true; } - - std::auto_ptr lock; // (*) + boost::recursive_mutex::scoped_lock lock(pimpl_->invokeServiceMutex_); // (*) switch (service) { diff -r 3dcf5c0734c9 -r 559956d5ceb2 Plugins/Samples/DatabasePlugin/Database.cpp --- a/Plugins/Samples/DatabasePlugin/Database.cpp Mon Nov 30 14:51:43 2015 +0100 +++ b/Plugins/Samples/DatabasePlugin/Database.cpp Mon Nov 30 15:34:14 2015 +0100 @@ -123,7 +123,8 @@ public: SignalRemainingAncestor() : - hasRemainingAncestor_(false) + hasRemainingAncestor_(false), + remainingType_(OrthancPluginResourceType_Instance) // Some dummy value { } @@ -175,7 +176,8 @@ Database::Database(const std::string& path) : path_(path), - base_(db_) + base_(db_), + signalRemainingAncestor_(NULL) { } @@ -381,7 +383,7 @@ const std::list& source) { for (typename std::list::const_iterator - it = source.begin(); it != source.end(); it++) + it = source.begin(); it != source.end(); ++it) { target.push_back(*it); }