From 12c95f5db577785d29c51643f20fe2c8700af7cb Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Tue, 23 Jan 2024 12:47:15 +0900 Subject: Replace auto_ptr Signed-off-by: Michele Calgaro --- languages/cpp/debugger/gdbcontroller.cpp | 4 ++-- languages/cpp/debugger/gdbcontroller.h | 2 +- languages/cpp/debugger/mi/miparser.cpp | 10 +++++----- languages/cpp/doc/cppannotations.toc | 1 - 4 files changed, 8 insertions(+), 9 deletions(-) (limited to 'languages') diff --git a/languages/cpp/debugger/gdbcontroller.cpp b/languages/cpp/debugger/gdbcontroller.cpp index c89eb46b..be796329 100644 --- a/languages/cpp/debugger/gdbcontroller.cpp +++ b/languages/cpp/debugger/gdbcontroller.cpp @@ -1459,9 +1459,9 @@ void GDBController::slotDbgStdout(TDEProcess *, char *buf, int buflen) FileSymbol file; file.contents = reply; - std::auto_ptr r(mi_parser_.parse(&file)); + std::unique_ptr r(mi_parser_.parse(&file)); - if (r.get() == 0) + if (!r) { // FIXME: Issue an error! kdDebug(9012) << "Invalid MI message: " << reply << "\n"; diff --git a/languages/cpp/debugger/gdbcontroller.h b/languages/cpp/debugger/gdbcontroller.h index ef7800b6..f0f6389b 100644 --- a/languages/cpp/debugger/gdbcontroller.h +++ b/languages/cpp/debugger/gdbcontroller.h @@ -330,7 +330,7 @@ private: // After highting current line we need to do something more, // like announcing write watchpoints, and so need to have // access to the stop packet. So store it here. - std::auto_ptr last_stop_result; + std::unique_ptr last_stop_result; // Gdb 6.4 (and 6.3) does not support "character" format with MI, // so the only way it can work is via the "print" command. As gdb diff --git a/languages/cpp/debugger/mi/miparser.cpp b/languages/cpp/debugger/mi/miparser.cpp index e078c04c..e950f2f3 100644 --- a/languages/cpp/debugger/mi/miparser.cpp +++ b/languages/cpp/debugger/mi/miparser.cpp @@ -97,7 +97,7 @@ bool MIParser::parsePrompt(Record *&record) bool MIParser::parseStreamRecord(Record *&record) { - std::auto_ptr stream(new StreamRecord); + std::unique_ptr stream(new StreamRecord); switch (lex->lookAhead()) { case '~': @@ -128,7 +128,7 @@ bool MIParser::parseResultRecord(Record *&record) TQString reason = lex->currentTokenText(); lex->nextToken(); - std::auto_ptr res(new ResultRecord); + std::unique_ptr res(new ResultRecord); res->reason = reason; if (lex->lookAhead() != ',') { @@ -151,7 +151,7 @@ bool MIParser::parseResult(Result *&result) TQString variable = lex->currentTokenText(); lex->nextToken(); - std::auto_ptr res(new Result); + std::unique_ptr res(new Result); res->variable = variable; if (lex->lookAhead() != '=') @@ -207,7 +207,7 @@ bool MIParser::parseList(Value *&value) { ADVANCE('['); - std::auto_ptr lst(new ListValue); + std::unique_ptr lst(new ListValue); // Note: can't use parseCSV here because of nested // "is this Value or Result" guessing. Too lazy to factor @@ -248,7 +248,7 @@ bool MIParser::parseList(Value *&value) bool MIParser::parseCSV(TupleValue** value, char start, char end) { - std::auto_ptr tuple(new TupleValue); + std::unique_ptr tuple(new TupleValue); if (!parseCSV(*tuple, start, end)) return false; diff --git a/languages/cpp/doc/cppannotations.toc b/languages/cpp/doc/cppannotations.toc index 7631c681..15cb3367 100644 --- a/languages/cpp/doc/cppannotations.toc +++ b/languages/cpp/doc/cppannotations.toc @@ -433,7 +433,6 @@ - -- cgit v1.2.1