Replace all uses of auto_ptr with unique_ptr
This commit is contained in:
parent
0be698965a
commit
89fef06d6b
7 changed files with 11 additions and 11 deletions
|
@ -300,7 +300,7 @@ void AssFile::InsertAttachment(wxString filename) {
|
||||||
if (ext == ".ttf" || ext == ".ttc" || ext == ".pfb")
|
if (ext == ".ttf" || ext == ".ttc" || ext == ".pfb")
|
||||||
group = "[Fonts]";
|
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);
|
newAttach->Import(filename);
|
||||||
|
|
||||||
InsertAttachment(newAttach.release());
|
InsertAttachment(newAttach.release());
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
AssParser::AssParser(AssFile *target, int version)
|
AssParser::AssParser(AssFile *target, int version)
|
||||||
: target(target)
|
: target(target)
|
||||||
, version(version)
|
, version(version)
|
||||||
, attach(0)
|
, attach(nullptr)
|
||||||
, state(&AssParser::ParseScriptInfoLine)
|
, state(&AssParser::ParseScriptInfoLine)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ class AssFile;
|
||||||
class AssParser {
|
class AssParser {
|
||||||
AssFile *target;
|
AssFile *target;
|
||||||
int version;
|
int version;
|
||||||
std::auto_ptr<AssAttachment> attach;
|
std::unique_ptr<AssAttachment> attach;
|
||||||
void (AssParser::*state)(wxString const&);
|
void (AssParser::*state)(wxString const&);
|
||||||
|
|
||||||
void ParseAttachmentLine(wxString const& data);
|
void ParseAttachmentLine(wxString const& data);
|
||||||
|
|
|
@ -437,7 +437,7 @@ namespace menu {
|
||||||
void GetMenuBar(std::string const& name, wxFrame *window, agi::Context *c) {
|
void GetMenuBar(std::string const& name, wxFrame *window, agi::Context *c) {
|
||||||
menu_items const& items = get_menu(name);
|
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) {
|
for (auto const& item : items) {
|
||||||
std::string submenu, disp;
|
std::string submenu, disp;
|
||||||
read_entry(item, "submenu", &submenu);
|
read_entry(item, "submenu", &submenu);
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
/// @class TextFileReader
|
/// @class TextFileReader
|
||||||
/// @brief A line-based text file reader
|
/// @brief A line-based text file reader
|
||||||
class TextFileReader {
|
class TextFileReader {
|
||||||
std::auto_ptr<std::ifstream> file;
|
std::unique_ptr<std::ifstream> file;
|
||||||
bool trim;
|
bool trim;
|
||||||
agi::line_iterator<wxString> iter;
|
agi::line_iterator<wxString> iter;
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ void *ThreadedFrameSource::Entry() {
|
||||||
while (!TestDestroy()) {
|
while (!TestDestroy()) {
|
||||||
double time;
|
double time;
|
||||||
int frameNum;
|
int frameNum;
|
||||||
std::auto_ptr<AssFile> newSubs;
|
std::unique_ptr<AssFile> newSubs;
|
||||||
{
|
{
|
||||||
wxMutexLocker jobLocker(jobMutex);
|
wxMutexLocker jobLocker(jobMutex);
|
||||||
|
|
||||||
|
@ -152,12 +152,12 @@ void *ThreadedFrameSource::Entry() {
|
||||||
time = nextTime;
|
time = nextTime;
|
||||||
frameNum = nextFrame;
|
frameNum = nextFrame;
|
||||||
nextTime = -1.;
|
nextTime = -1.;
|
||||||
newSubs = nextSubs;
|
newSubs = move(nextSubs);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newSubs.get()) {
|
if (newSubs) {
|
||||||
wxMutexLocker fileLocker(fileMutex);
|
wxMutexLocker fileLocker(fileMutex);
|
||||||
subs = newSubs;
|
subs = move(newSubs);
|
||||||
singleFrame = -1;
|
singleFrame = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,10 +60,10 @@ class ThreadedFrameSource : public wxThread {
|
||||||
|
|
||||||
int nextFrame; ///< Next queued frame, or -1 for none
|
int nextFrame; ///< Next queued frame, or -1 for none
|
||||||
double nextTime; ///< Next queued time
|
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
|
/// 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
|
/// If subs is set and this is not -1, frame which subs was limited to when
|
||||||
/// it was last sent to the subtitle provider
|
/// it was last sent to the subtitle provider
|
||||||
int singleFrame;
|
int singleFrame;
|
||||||
|
|
Loading…
Reference in a new issue