diff options
author | Michele Calgaro <[email protected]> | 2024-01-23 12:47:15 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2024-02-07 00:06:53 +0900 |
commit | 12c95f5db577785d29c51643f20fe2c8700af7cb (patch) | |
tree | 8845a757afbec274baf0ed3c677df1b43b52459a /languages/cpp | |
parent | c8d7b46522918fbb19e77e7a12d7c1d0ed9ae390 (diff) | |
download | tdevelop-12c95f5db577785d29c51643f20fe2c8700af7cb.tar.gz tdevelop-12c95f5db577785d29c51643f20fe2c8700af7cb.zip |
Replace auto_ptr
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'languages/cpp')
-rw-r--r-- | languages/cpp/debugger/gdbcontroller.cpp | 4 | ||||
-rw-r--r-- | languages/cpp/debugger/gdbcontroller.h | 2 | ||||
-rw-r--r-- | languages/cpp/debugger/mi/miparser.cpp | 10 | ||||
-rw-r--r-- | languages/cpp/doc/cppannotations.toc | 1 |
4 files changed, 8 insertions, 9 deletions
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<GDBMI::Record> r(mi_parser_.parse(&file)); + std::unique_ptr<GDBMI::Record> 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<GDBMI::ResultRecord> last_stop_result; + std::unique_ptr<GDBMI::ResultRecord> 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<StreamRecord> stream(new StreamRecord); + std::unique_ptr<StreamRecord> 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<ResultRecord> res(new ResultRecord); + std::unique_ptr<ResultRecord> 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<Result> res(new Result); + std::unique_ptr<Result> res(new Result); res->variable = variable; if (lex->lookAhead() != '=') @@ -207,7 +207,7 @@ bool MIParser::parseList(Value *&value) { ADVANCE('['); - std::auto_ptr<ListValue> lst(new ListValue); + std::unique_ptr<ListValue> 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<TupleValue> tuple(new TupleValue); + std::unique_ptr<TupleValue> 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 @@ <tocsect3 name="18.3.4: Pointing to a newly allocated object" url="cplusplus18.html#l324"/> <tocsect3 name="18.3.5: Operators and members" url="cplusplus18.html#l325"/> <tocsect3 name="18.3.6: Using `unique_ptr' objects for arrays" url="cplusplus18.html#l326"/> - <tocsect3 name="18.3.7: The legacy class 'auto_ptr' (deprecated)" url="cplusplus18.html#l327"/> </tocsect2> <tocsect2 name="18.4: The class 'shared_ptr'" url="cplusplus18.html#l328"> <tocsect3 name="18.4.1: Defining `shared_ptr' objects" url="cplusplus18.html#l329"/> |