[odb-api] 15/21: Add unique_ptr.patch
Alastair McKinstry
mckinstry at moszumanska.debian.org
Wed Aug 30 06:42:56 UTC 2017
This is an automated email from the git hooks/post-receive script.
mckinstry pushed a commit to branch debian/master
in repository odb-api.
commit 447b7fbdca7239494995972904fcf86a7f99dac5
Author: Alastair McKinstry <mckinstry at debian.org>
Date: Tue Aug 29 16:55:42 2017 +0100
Add unique_ptr.patch
---
debian/patches/series | 1 +
debian/patches/unique_ptr.patch | 419 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 420 insertions(+)
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..96a4cb9
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+unique_ptr.patch
diff --git a/debian/patches/unique_ptr.patch b/debian/patches/unique_ptr.patch
new file mode 100644
index 0000000..7b16b50
--- /dev/null
+++ b/debian/patches/unique_ptr.patch
@@ -0,0 +1,419 @@
+Description: Replace auto_ptr with unique_ptr
+ auto_ptr is deprecated with C++11 onwards.
+Author: Alastair McKinstry <mckinstry at debian.org>
+Forwarded: no
+Last-Update: 2017-08-29
+
+--- odb-api-0.17.1.orig/eckit/src/eckit/io/DataHandle.cc
++++ odb-api-0.17.1/eckit/src/eckit/io/DataHandle.cc
+@@ -212,7 +212,7 @@ Length DataHandle::saveInto(DataHandle&
+
+ Length DataHandle::saveInto(const PathName& path,TransferWatcher& w, bool dblBufferOK)
+ {
+- std::auto_ptr<DataHandle> file(path.fileHandle());
++ std::unique_ptr<DataHandle> file(path.fileHandle());
+ return saveInto(*file,w,dblBufferOK);
+ }
+
+--- odb-api-0.17.1.orig/eckit/src/eckit/io/FileHandle.h
++++ odb-api-0.17.1/eckit/src/eckit/io/FileHandle.h
+@@ -87,7 +87,7 @@ private:
+ bool overwrite_;
+ FILE* file_;
+ bool read_;
+- std::auto_ptr<Buffer> buffer_;
++ std::unique_ptr<Buffer> buffer_;
+
+ // -- Methods
+
+--- odb-api-0.17.1.orig/eckit/src/eckit/io/MarsFSHandle.cc
++++ odb-api-0.17.1/eckit/src/eckit/io/MarsFSHandle.cc
+@@ -63,7 +63,7 @@ Length MarsFSHandle::openForRead()
+ read_ = true;
+ position_ = 0;
+ if(!file_.get())
+- file_ = std::auto_ptr<MarsFSFile>(new MarsFSFile(path_));
++ file_ = std::unique_ptr<MarsFSFile>(new MarsFSFile(path_));
+ length_ = file_->open("r");
+ return length_;
+ }
+@@ -74,7 +74,7 @@ void MarsFSHandle::openForWrite(const Le
+ length_ = length;
+ position_ = 0;
+ if(!file_.get())
+- file_ = std::auto_ptr<MarsFSFile>(new MarsFSFile(path_));
++ file_ = std::unique_ptr<MarsFSFile>(new MarsFSFile(path_));
+ file_->open("w", overwrite_);
+ }
+
+@@ -108,7 +108,7 @@ void MarsFSHandle::close()
+ {
+ if(file_.get()) {
+ file_->close();
+- file_ = std::auto_ptr<MarsFSFile>(0);
++ file_ = std::unique_ptr<MarsFSFile>(0);
+ }
+ }
+
+--- odb-api-0.17.1.orig/eckit/src/eckit/io/MarsFSHandle.h
++++ odb-api-0.17.1/eckit/src/eckit/io/MarsFSHandle.h
+@@ -87,7 +87,7 @@ private:
+ Offset position_;
+ bool overwrite_;
+
+- std::auto_ptr<MarsFSFile> file_;
++ std::unique_ptr<MarsFSFile> file_;
+
+ // -- Methods
+
+--- odb-api-0.17.1.orig/eckit/src/eckit/io/MoverHandle.h
++++ odb-api-0.17.1/eckit/src/eckit/io/MoverHandle.h
+@@ -81,7 +81,7 @@ private:
+
+ // -- Members
+
+- std::auto_ptr<DataHandle> handle_;
++ std::unique_ptr<DataHandle> handle_;
+ TCPSocket data_;
+ bool fail_;
+ std::string error_;
+--- odb-api-0.17.1.orig/eckit/src/eckit/transaction/TxnLog.cc
++++ odb-api-0.17.1/eckit/src/eckit/transaction/TxnLog.cc
+@@ -284,7 +284,7 @@ void TxnLog<T>::find(TxnFinder<T>& r)
+ {
+ try {
+ FileStream log(active[j],"r");
+- std::auto_ptr<T> task(Reanimator<T>::reanimate(log));
++ std::unique_ptr<T> task(Reanimator<T>::reanimate(log));
+ if(task.get())
+ if(!r.found(*task))
+ return;
+@@ -327,7 +327,7 @@ void TxnLog<T>::find(TxnFinder<T>& r)
+ T *task = 0;
+ while( (task = Reanimator<T>::reanimate(log)) )
+ {
+- if(!r.found(*(std::auto_ptr<T>(task))))
++ if(!r.found(*(std::unique_ptr<T>(task))))
+ return;
+ }
+ }
+--- odb-api-0.17.1.orig/eckit/src/eckit/value/Expression.h
++++ odb-api-0.17.1/eckit/src/eckit/value/Expression.h
+@@ -55,7 +55,7 @@ public:
+ template<class T, class U>
+ class CondUnary : public Expression<U> {
+
+- auto_ptr<Expression<U> > cond_;
++ unique_ptr<Expression<U> > cond_;
+
+ virtual void print(std::ostream& s) const
+ { s << opname(T()) << '(' << *cond_ << ')'; }
+@@ -69,8 +69,8 @@ public:
+ template<class T, class U>
+ class CondBinary : public Expression<U> {
+
+- auto_ptr<Expression<U> > left_;
+- auto_ptr<Expression<U> > right_;
++ unique_ptr<Expression<U> > left_;
++ unique_ptr<Expression<U> > right_;
+
+ virtual void print(std::ostream& s) const
+ { s << '(' << *left_ << ' ' << opname(T()) << ' ' << *right_ << ')'; }
+--- odb-api-0.17.1.orig/metkit/src/metkit/ClientTask.cc
++++ odb-api-0.17.1/metkit/src/metkit/ClientTask.cc
+@@ -29,7 +29,7 @@ ClientTask::ClientTask(const MarsRequest
+ | (ull(::pthread_self()) << 16)
+ | (ull(::time(0)) & ull(0xffff));
+
+- handle_ = std::auto_ptr<eckit::DataHandle>(new MarsHandle(host_, port_, metkitID_));
++ handle_ = std::unique_ptr<eckit::DataHandle>(new MarsHandle(host_, port_, metkitID_));
+ }
+
+
+--- odb-api-0.17.1.orig/metkit/src/metkit/ClientTask.h
++++ odb-api-0.17.1/metkit/src/metkit/ClientTask.h
+@@ -158,7 +158,7 @@ private:
+ unsigned long long metkitID_;
+ int port_;
+ std::string host_;
+- std::auto_ptr<eckit::DataHandle> handle_;
++ std::unique_ptr<eckit::DataHandle> handle_;
+ std::string checksum_;
+
+ // Not sent over streams
+--- odb-api-0.17.1.orig/metkit/src/metkit/DHSProtocol.cc
++++ odb-api-0.17.1/metkit/src/metkit/DHSProtocol.cc
+@@ -43,7 +43,7 @@ eckit::Length DHSProtocol::retrieve(cons
+
+ eckit::Log::info() << "DHSProtocol: call back on " << host << ":" << port << std::endl;
+
+- task_ = std::auto_ptr<ClientTask>(new ClientTask(request, RequestEnvironment::instance().request(), host, port));
++ task_ = std::unique_ptr<ClientTask>(new ClientTask(request, RequestEnvironment::instance().request(), host, port));
+
+ eckit::TCPStream s(eckit::TCPClient().connect(host_, port_));
+
+@@ -68,7 +68,7 @@ void DHSProtocol::archive(const MarsRequ
+ eckit::Log::info() << "DHSProtocol::archive " << size << std::endl;
+ eckit::Log::info() << "DHSProtocol: call back on " << host << ":" << port << std::endl;
+
+- task_ = std::auto_ptr<ClientTask>(new ClientTask(request, RequestEnvironment::instance().request(), host, port));
++ task_ = std::unique_ptr<ClientTask>(new ClientTask(request, RequestEnvironment::instance().request(), host, port));
+
+ eckit::TCPStream s(eckit::TCPClient().connect(host_, port_));
+
+--- odb-api-0.17.1.orig/metkit/src/metkit/DHSProtocol.h
++++ odb-api-0.17.1/metkit/src/metkit/DHSProtocol.h
+@@ -42,7 +42,7 @@ private:
+ bool done_;
+ bool error_;
+ bool sending_;
+- std::auto_ptr<ClientTask> task_;
++ std::unique_ptr<ClientTask> task_;
+ bool foreward_;
+
+ // -- Methods
+--- odb-api-0.17.1.orig/metkit/src/metkit/MarsRequestHandle.h
++++ odb-api-0.17.1/metkit/src/metkit/MarsRequestHandle.h
+@@ -29,7 +29,7 @@ public:
+
+ private:
+ metkit::MarsRequest request_;
+- std::auto_ptr<BaseProtocol> protocol_;
++ std::unique_ptr<BaseProtocol> protocol_;
+
+ // -- Overridden methods
+ // From data handle
+--- odb-api-0.17.1.orig/odb_api/src/ecml/data/DataHandleFactory.cc
++++ odb-api-0.17.1/odb_api/src/ecml/data/DataHandleFactory.cc
+@@ -92,7 +92,7 @@ DataHandle* DataHandleFactory::openForRe
+ {
+ registerFactories();
+ std::pair<std::string,std::string> p (splitPrefix(s));
+- std::auto_ptr<DataHandle> d (makeHandle(p.first, p.second));
++ std::unique_ptr<DataHandle> d (makeHandle(p.first, p.second));
+ d->openForRead();
+ return d.release();
+ }
+@@ -101,7 +101,7 @@ DataHandle* DataHandleFactory::openForWr
+ {
+ registerFactories();
+ std::pair<std::string,std::string> p (splitPrefix(s));
+- std::auto_ptr<DataHandle> d (makeHandle(p.first, p.second));
++ std::unique_ptr<DataHandle> d (makeHandle(p.first, p.second));
+ d->openForWrite(length);
+ return d.release();
+ }
+--- odb-api-0.17.1.orig/odb_api/src/ecml/prelude/TryHandler.cc
++++ odb-api-0.17.1/odb_api/src/ecml/prelude/TryHandler.cc
+@@ -36,16 +36,16 @@ TryHandler::TryHandler(const string& nam
+ // finally = (println,values=bye)
+ Request TryHandler::handle(const Request request, ExecutionContext& context)
+ {
+- auto_ptr<Cell> body (request->valueOrDefault("do", 0));
+- auto_ptr<Cell> _catch (request->valueOrDefault("catch", 0));
+- auto_ptr<Cell> finally (request->valueOrDefault("finally", 0));
++ unique_ptr<Cell> body (request->valueOrDefault("do", 0));
++ unique_ptr<Cell> _catch (request->valueOrDefault("catch", 0));
++ unique_ptr<Cell> finally (request->valueOrDefault("finally", 0));
+
+ if (! body.get()) throw eckit::UserError("No 'do' passed to 'try'");
+
+ bool exceptionThrown (false);
+ string what;
+
+- auto_ptr<Cell> value (0);
++ unique_ptr<Cell> value (0);
+ if (! _catch.get() && ! finally.get())
+ value.reset(context.interpreter().eval(body.get(), context));
+ else
+--- odb-api-0.17.1.orig/odb_api/src/odb_api/DataSelect.h
++++ odb-api-0.17.1/odb_api/src/odb_api/DataSelect.h
+@@ -83,7 +83,7 @@ private:
+ const std::string statement_;
+ const DataSet* const dataset_;
+ const DataTable* const table_;
+- std::auto_ptr<internal::DataSelectIterator> begin_;
++ std::unique_ptr<internal::DataSelectIterator> begin_;
+ DataColumns columns_;
+ ecml::ExecutionContext* context_;
+
+--- odb-api-0.17.1.orig/odb_api/src/odb_api/FastODA2Request.cc
++++ odb-api-0.17.1/odb_api/src/odb_api/FastODA2Request.cc
+@@ -83,7 +83,7 @@ bool FastODA2Request<T>::scanFile(const
+ MDR mdReader(fileName);
+ MDR::iterator it = mdReader.begin(), end = mdReader.end();
+
+- std::auto_ptr<MetaData> currentMD(it->columns().clone());
++ std::unique_ptr<MetaData> currentMD(it->columns().clone());
+ rowsNumber_ = currentMD->rowsNumber();
+
+ values_ = std::vector<std::set<std::string> >(currentMD->size(), std::set<std::string>());
+--- odb-api-0.17.1.orig/odb_api/src/odb_api/FunctionRLIKE.h
++++ odb-api-0.17.1/odb_api/src/odb_api/FunctionRLIKE.h
+@@ -37,7 +37,7 @@ private:
+ // No copy allowed
+ FunctionRLIKE& operator=(const FunctionRLIKE&);
+
+- std::auto_ptr<eckit::Regex> re_;
++ std::unique_ptr<eckit::Regex> re_;
+
+ // -- Overridden methods
+ virtual const odb::sql::type::SQLType* type() const;
+--- odb-api-0.17.1.orig/odb_api/src/odb_api/SQLColumn.cc
++++ odb-api-0.17.1/odb_api/src/odb_api/SQLColumn.cc
+@@ -143,7 +143,7 @@ SQLTable* SQLColumn::table() const
+
+ void SQLColumn::createIndex()
+ {
+- std::auto_ptr<SQLIndex> index(new SQLIndex(*this));
++ std::unique_ptr<SQLIndex> index(new SQLIndex(*this));
+ indexing_ = index;
+ indexing_->update();
+ }
+--- odb-api-0.17.1.orig/odb_api/src/odb_api/SQLColumn.h
++++ odb-api-0.17.1/odb_api/src/odb_api/SQLColumn.h
+@@ -85,7 +85,7 @@ protected:
+ long long position_;
+ SQLIterator* iterator_;
+
+- std::auto_ptr<SQLIndex> indexing_;
++ std::unique_ptr<SQLIndex> indexing_;
+
+ bool hasMissingValue_;
+ double missingValue_;
+--- odb-api-0.17.1.orig/odb_api/src/odb_api/SQLDistinctOutput.h
++++ odb-api-0.17.1/odb_api/src/odb_api/SQLDistinctOutput.h
+@@ -35,7 +35,7 @@ private:
+ virtual const SQLOutputConfig& config();
+ virtual void config(SQLOutputConfig&);
+ // -- Members
+- std::auto_ptr<SQLOutput> output_;
++ std::unique_ptr<SQLOutput> output_;
+ std::set<std::vector<double> > seen_;
+ std::vector<double> tmp_;
+ // -- Overridden methods
+--- odb-api-0.17.1.orig/odb_api/src/odb_api/SQLIndex.cc
++++ odb-api-0.17.1/odb_api/src/odb_api/SQLIndex.cc
+@@ -63,7 +63,7 @@ void SQLIndex::update()
+ }
+ }
+
+- auto_ptr<BeDB> db(new BeDB(path,false));
++ unique_ptr<BeDB> db(new BeDB(path,false));
+ db_ = db;
+ #endif
+ }
+--- odb-api-0.17.1.orig/odb_api/src/odb_api/SQLIndex.h
++++ odb-api-0.17.1/odb_api/src/odb_api/SQLIndex.h
+@@ -86,7 +86,7 @@ private:
+
+ SQLColumn& owner_;
+ #if 0
+- auto_ptr<BeDB> db_;
++ unique_ptr<BeDB> db_;
+ #endif
+ double* value_;
+
+--- odb-api-0.17.1.orig/odb_api/src/odb_api/SQLOrderOutput.h
++++ odb-api-0.17.1/odb_api/src/odb_api/SQLOrderOutput.h
+@@ -37,7 +37,7 @@ private:
+ SQLOrderOutput& operator=(const SQLOrderOutput&);
+
+ // -- Members
+- std::auto_ptr<SQLOutput> output_;
++ std::unique_ptr<SQLOutput> output_;
+ std::pair<Expressions,std::vector<bool> > by_;
+
+ typedef std::map<OrderByExpressions, VectorOfExpressions> SortedResults;
+--- odb-api-0.17.1.orig/odb_api/src/odb_api/SQLSelect.h
++++ odb-api-0.17.1/odb_api/src/odb_api/SQLSelect.h
+@@ -88,12 +88,12 @@ private:
+ std::vector<SQLTable*> tables_;
+ SortedTables sortedTables_;
+
+- std::auto_ptr<odb::sql::expression::SQLExpression> where_;
++ std::unique_ptr<odb::sql::expression::SQLExpression> where_;
+ odb::sql::expression::SQLExpression* simplifiedWhere_;
+
+ Stack env;
+
+- std::auto_ptr<SQLOutput> output_;
++ std::unique_ptr<SQLOutput> output_;
+ Expressions results_;
+
+ typedef std::map<std::vector<std::pair<double,bool> >, expression::Expressions*> AggregatedResults;
+--- odb-api-0.17.1.orig/odb_api/src/odb_api/ecml_verbs/ArchiveHandler.cc
++++ odb-api-0.17.1/odb_api/src/odb_api/ecml_verbs/ArchiveHandler.cc
+@@ -140,7 +140,7 @@ void ArchiveHandler::archive(const eckit
+
+ stringstream ss;
+ ss << protocol << request;
+- auto_ptr<eckit::DataHandle> mars (DataHandleFactory::openForWrite(ss.str(), eckit::Length(Archiver::fileSize(source))));
++ unique_ptr<eckit::DataHandle> mars (DataHandleFactory::openForWrite(ss.str(), eckit::Length(Archiver::fileSize(source))));
+
+ input.saveInto(*mars);
+ }
+--- odb-api-0.17.1.orig/odb_api/src/odb_api/tools/LSTool.cc
++++ odb-api-0.17.1/odb_api/src/odb_api/tools/LSTool.cc
+@@ -81,7 +81,7 @@ void LSTool::run()
+
+ std::string db = parameters(1);
+
+- std::auto_ptr<std::ofstream> foutPtr;
++ std::unique_ptr<std::ofstream> foutPtr;
+ if (optionIsSet("-o"))
+ foutPtr.reset(new std::ofstream(optionArgument("-o", std::string("")).c_str()));
+ std::ostream& out = optionIsSet("-o") ? *foutPtr : std::cout;
+--- odb-api-0.17.1.orig/odb_api/src/odb_api/tools/MDSetTool.cc
++++ odb-api-0.17.1/odb_api/src/odb_api/tools/MDSetTool.cc
+@@ -40,7 +40,7 @@ void MDSetTool::run()
+ }
+
+ PathName inFile = parameters(2), outFile = parameters(3);
+- std::auto_ptr<DataHandle> outHandle(ODBAPISettings::instance().writeToFile(outFile));
++ std::unique_ptr<DataHandle> outHandle(ODBAPISettings::instance().writeToFile(outFile));
+
+ std::vector<std::string> columns, types, values;
+ std::vector<BitfieldDef> bitfieldDefs;
+--- odb-api-0.17.1.orig/odb_api/src/odb_api/tools/SQLTool.cc
++++ odb-api-0.17.1/odb_api/src/odb_api/tools/SQLTool.cc
+@@ -82,7 +82,7 @@ void SQLTool::run()
+ ? StringTools::join(" ", params) + ";"
+ // FIXME:
+ : StringTool::readFile(params[0] == "-" ? "/dev/tty" : params[0]) + ";");
+- std::auto_ptr<std::ofstream> foutPtr(optionIsSet("-o")
++ std::unique_ptr<std::ofstream> foutPtr(optionIsSet("-o")
+ ? new std::ofstream(optionArgument("-o", std::string("")).c_str())
+ : 0);
+ std::ostream& out(foutPtr.get() ? *foutPtr : std::cout);
+--- odb-api-0.17.1.orig/odb_api/src/odb_api/tools/TestRunner.cc
++++ odb-api-0.17.1/odb_api/src/odb_api/tools/TestRunner.cc
+@@ -50,8 +50,8 @@ void TestRunner::run()
+ ASSERT(getenv("ODB_API_TEST_DATA_PATH") && "ODB_API_TEST_DATA_PATH must be set");
+
+ stringstream totalRunningTime;
+- auto_ptr<Timer> allTestsTimer(new Timer("Total", totalRunningTime));
+- auto_ptr<TestCases> tests(0);
++ unique_ptr<Timer> allTestsTimer(new Timer("Total", totalRunningTime));
++ unique_ptr<TestCases> tests(0);
+
+ failed_.clear();
+
+@@ -73,7 +73,7 @@ void TestRunner::run()
+ string suiteName = clp_.parameters()[i];
+ ASSERT("Suite does not exist" && suites_.find(suiteName) != suites_.end());
+ vector<string>& suite = suites_[suiteName];
+- auto_ptr<vector<TestCase*> > tsts(AbstractToolFactory::testCases(suite));
++ unique_ptr<vector<TestCase*> > tsts(AbstractToolFactory::testCases(suite));
+
+ runTests(*tsts);
+ tests->insert(tests->end(), tsts->begin(), tsts->end());
+@@ -126,7 +126,7 @@ void TestRunner::runTests(const TestCase
+ smslabel(name);
+
+ stringstream runningTime;
+- auto_ptr<Timer> timer(new Timer(name, runningTime));
++ unique_ptr<Timer> timer(new Timer(name, runningTime));
+ try {
+ tst->setUp();
+ tst->test();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/odb-api.git
More information about the debian-science-commits
mailing list