diff options
author | Hubert Figuière <hub@figuiere.net> | 2016-01-30 13:20:24 -0500 |
---|---|---|
committer | Hubert Figuière <hub@figuiere.net> | 2016-01-30 13:20:24 -0500 |
commit | c3a8c2b8b61f55c51b325d36e4e1e0065d46d1af (patch) | |
tree | 24b599c72fb5666f75760a5a0c001a3fa9977471 /XMPFiles/source/FormatSupport/XMPScanner.cpp | |
parent | 1dbaa10e842cbb7adb827a565cd27b8cca22ae46 (diff) |
Replace auto_ptr<> with unique_ptr<>
Diffstat (limited to 'XMPFiles/source/FormatSupport/XMPScanner.cpp')
-rw-r--r-- | XMPFiles/source/FormatSupport/XMPScanner.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/XMPFiles/source/FormatSupport/XMPScanner.cpp b/XMPFiles/source/FormatSupport/XMPScanner.cpp index 6d8fe82..a771c25 100644 --- a/XMPFiles/source/FormatSupport/XMPScanner.cpp +++ b/XMPFiles/source/FormatSupport/XMPScanner.cpp @@ -987,7 +987,7 @@ XMPScanner::InternalSnip::InternalSnip ( XMP_Int64 offset, XMP_Int64 length ) XMPScanner::InternalSnip::InternalSnip ( const InternalSnip & rhs ) : fInfo ( rhs.fInfo ), - fMachine ( NULL ) + fMachine ( nullptr ) { assert ( rhs.fMachine.get() == NULL ); // Don't copy a snip with a machine. @@ -1255,13 +1255,13 @@ XMPScanner::Scan ( const void * bufferOrigin, XMP_Int64 bufferOffset, XMP_Int64 } else { // *** snipPos->fMachine.reset ( new PacketMachine ( bufferOffset, bufferOrigin, bufferLength ) ); VC++ lacks reset #if 0 - snipPos->fMachine = auto_ptr<PacketMachine> ( new PacketMachine ( bufferOffset, bufferOrigin, bufferLength ) ); + snipPos->fMachine = unique_ptr<PacketMachine> ( new PacketMachine ( bufferOffset, bufferOrigin, bufferLength ) ); #else { // Some versions of gcc complain about the assignment operator above. This avoids the gcc bug. PacketMachine * pm = new PacketMachine ( bufferOffset, bufferOrigin, bufferLength ); - auto_ptr<PacketMachine> ap ( pm ); - snipPos->fMachine = ap; + unique_ptr<PacketMachine> ap ( pm ); + snipPos->fMachine = std::move(ap); } #endif thisMachine = snipPos->fMachine.get(); @@ -1280,12 +1280,12 @@ XMPScanner::Scan ( const void * bufferOrigin, XMP_Int64 bufferOffset, XMP_Int64 snipPos->fInfo.fState = eRawInputSnip; #if 0 - snipPos->fMachine = auto_ptr<PacketMachine>(); // *** snipPos->fMachine.reset(); VC++ lacks reset + snipPos->fMachine = unique_ptr<PacketMachine>(); // *** snipPos->fMachine.reset(); VC++ lacks reset #else { // Some versions of gcc complain about the assignment operator above. This avoids the gcc bug. - auto_ptr<PacketMachine> ap ( 0 ); - snipPos->fMachine = ap; + unique_ptr<PacketMachine> ap (nullptr); + snipPos->fMachine = std::move(ap); } #endif bufferDone = true; @@ -1373,12 +1373,12 @@ XMPScanner::Scan ( const void * bufferOrigin, XMP_Int64 bufferOffset, XMP_Int64 // This packet ends exactly at the end of the current snip. #if 0 - snipPos->fMachine = auto_ptr<PacketMachine>(); // *** snipPos->fMachine.reset(); VC++ lacks reset + snipPos->fMachine = unique_ptr<PacketMachine>(); // *** snipPos->fMachine.reset(); VC++ lacks reset #else { // Some versions of gcc complain about the assignment operator above. This avoids the gcc bug. - auto_ptr<PacketMachine> ap ( 0 ); - snipPos->fMachine = ap; + unique_ptr<PacketMachine> ap ( nullptr ); + snipPos->fMachine = std::move(ap); } #endif bufferDone = true; @@ -1390,7 +1390,7 @@ XMPScanner::Scan ( const void * bufferOrigin, XMP_Int64 bufferOffset, XMP_Int64 InternalSnipIterator tailPos = NextSnip ( snipPos ); - tailPos->fMachine = snipPos->fMachine; // auto_ptr assignment - taking ownership + tailPos->fMachine = std::move(snipPos->fMachine); // unique_ptr assignment - taking ownership thisMachine->ResetMachine (); snipPos = tailPos; |