Replace all uses of auto_ptr with unique_ptr

This commit is contained in:
Thomas Goyne 2012-11-15 15:46:56 -08:00
parent 0be698965a
commit 89fef06d6b
7 changed files with 11 additions and 11 deletions

View File

@ -300,7 +300,7 @@ void AssFile::InsertAttachment(wxString filename) {
if (ext == ".ttf" || ext == ".ttc" || ext == ".pfb")
group = "[Fonts]";
std::auto_ptr<AssAttachment> newAttach(new AssAttachment(wxFileName(filename).GetFullName(), group));
std::unique_ptr<AssAttachment> newAttach(new AssAttachment(wxFileName(filename).GetFullName(), group));
newAttach->Import(filename);
InsertAttachment(newAttach.release());

View File

@ -29,7 +29,7 @@
AssParser::AssParser(AssFile *target, int version)
: target(target)
, version(version)
, attach(0)
, attach(nullptr)
, state(&AssParser::ParseScriptInfoLine)
{
}

View File

@ -24,7 +24,7 @@ class AssFile;
class AssParser {
AssFile *target;
int version;
std::auto_ptr<AssAttachment> attach;
std::unique_ptr<AssAttachment> attach;
void (AssParser::*state)(wxString const&);
void ParseAttachmentLine(wxString const& data);

View File

@ -437,7 +437,7 @@ namespace menu {
void GetMenuBar(std::string const& name, wxFrame *window, agi::Context *c) {
menu_items const& items = get_menu(name);
std::auto_ptr<CommandMenuBar> menu(new CommandMenuBar(c));
std::unique_ptr<CommandMenuBar> menu(new CommandMenuBar(c));
for (auto const& item : items) {
std::string submenu, disp;
read_entry(item, "submenu", &submenu);

View File

@ -47,7 +47,7 @@
/// @class TextFileReader
/// @brief A line-based text file reader
class TextFileReader {
std::auto_ptr<std::ifstream> file;
std::unique_ptr<std::ifstream> file;
bool trim;
agi::line_iterator<wxString> iter;

View File

@ -137,7 +137,7 @@ void *ThreadedFrameSource::Entry() {
while (!TestDestroy()) {
double time;
int frameNum;
std::auto_ptr<AssFile> newSubs;
std::unique_ptr<AssFile> newSubs;
{
wxMutexLocker jobLocker(jobMutex);
@ -152,12 +152,12 @@ void *ThreadedFrameSource::Entry() {
time = nextTime;
frameNum = nextFrame;
nextTime = -1.;
newSubs = nextSubs;
newSubs = move(nextSubs);
}
if (newSubs.get()) {
if (newSubs) {
wxMutexLocker fileLocker(fileMutex);
subs = newSubs;
subs = move(newSubs);
singleFrame = -1;
}

View File

@ -60,10 +60,10 @@ class ThreadedFrameSource : public wxThread {
int nextFrame; ///< Next queued frame, or -1 for none
double nextTime; ///< Next queued time
std::auto_ptr<AssFile> nextSubs; ///< Next queued AssFile
std::unique_ptr<AssFile> nextSubs; ///< Next queued AssFile
/// Subtitles to be loaded the next time a frame is requested
std::auto_ptr<AssFile> subs;
std::unique_ptr<AssFile> subs;
/// If subs is set and this is not -1, frame which subs was limited to when
/// it was last sent to the subtitle provider
int singleFrame;