Skip to content

Commit

Permalink
fix auto_ptr warning when compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
s2x committed Nov 28, 2014
1 parent 5a055d4 commit 6e41024
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/include/ccframework/yaml-cpp/emitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ namespace YAML
bool CanEmitNewline() const;

private:
std::auto_ptr<EmitterState> m_pState;
std::unique_ptr<EmitterState> m_pState;
ostream_wrapper m_stream;
};

Expand Down
4 changes: 2 additions & 2 deletions src/include/ccframework/yaml-cpp/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ namespace YAML
void HandleTagDirective(const Token& token);

private:
std::auto_ptr<Scanner> m_pScanner;
std::auto_ptr<Directives> m_pDirectives;
std::unique_ptr<Scanner> m_pScanner;
std::unique_ptr<Directives> m_pDirectives;
};
}

Expand Down
6 changes: 3 additions & 3 deletions src/vendor/yaml-cpp/emitterstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ namespace YAML
const int lastGroupIndent = (m_groups.empty() ? 0 : m_groups.top().indent);
m_curIndent += lastGroupIndent;

std::auto_ptr<Group> pGroup(new Group(type));
std::unique_ptr<Group> pGroup(new Group(type));

// transfer settings (which last until this group is done)
pGroup->modifiedSettings = m_modifiedSettings;
Expand All @@ -150,7 +150,7 @@ namespace YAML
pGroup->flowType = FlowType::Flow;
pGroup->indent = GetIndent();

m_groups.push(pGroup);
m_groups.push(std::move(pGroup));
}

void EmitterState::EndedGroup(GroupType::value type)
Expand All @@ -164,7 +164,7 @@ namespace YAML

// get rid of the current group
{
std::auto_ptr<Group> pFinishedGroup = m_groups.pop();
std::unique_ptr<Group> pFinishedGroup = m_groups.pop();
if(pFinishedGroup->type != type)
return SetError(ErrorMsg::UNMATCHED_GROUP_TAG);
}
Expand Down
6 changes: 3 additions & 3 deletions src/vendor/yaml-cpp/ptr_stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ class ptr_stack: private YAML::noncopyable
std::size_t size() const { return m_data.size(); }
bool empty() const { return m_data.empty(); }

void push(std::auto_ptr<T> t) {
void push(std::unique_ptr<T> t) {
m_data.push_back(NULL);
m_data.back() = t.release();
}
std::auto_ptr<T> pop() {
std::auto_ptr<T> t(m_data.back());
std::unique_ptr<T> pop() {
std::unique_ptr<T> t(m_data.back());
m_data.pop_back();
return t;
}
Expand Down
2 changes: 1 addition & 1 deletion src/vendor/yaml-cpp/ptr_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace YAML {
std::size_t size() const { return m_data.size(); }
bool empty() const { return m_data.empty(); }

void push_back(std::auto_ptr<T> t) {
void push_back(std::unique_ptr<T> t) {
m_data.push_back(NULL);
m_data.back() = t.release();
}
Expand Down
8 changes: 4 additions & 4 deletions src/vendor/yaml-cpp/scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ namespace YAML
{
m_startedStream = true;
m_simpleKeyAllowed = true;
std::auto_ptr<IndentMarker> pIndent(new IndentMarker(-1, IndentMarker::NONE));
m_indentRefs.push_back(pIndent);
std::unique_ptr<IndentMarker> pIndent(new IndentMarker(-1, IndentMarker::NONE));
m_indentRefs.push_back(std::move(pIndent));
m_indents.push(&m_indentRefs.back());
}

Expand Down Expand Up @@ -288,7 +288,7 @@ namespace YAML
if(InFlowContext())
return 0;

std::auto_ptr<IndentMarker> pIndent(new IndentMarker(column, type));
std::unique_ptr<IndentMarker> pIndent(new IndentMarker(column, type));
IndentMarker& indent = *pIndent;
const IndentMarker& lastIndent = *m_indents.top();

Expand All @@ -303,7 +303,7 @@ namespace YAML

// and then the indent
m_indents.push(&indent);
m_indentRefs.push_back(pIndent);
m_indentRefs.push_back(std::move(pIndent));
return &m_indentRefs.back();
}

Expand Down
10 changes: 5 additions & 5 deletions src/vendor/yaml-cpp/setting.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace YAML
Setting(): m_value() {}

const T get() const { return m_value; }
std::auto_ptr <SettingChangeBase> set(const T& value);
std::unique_ptr <SettingChangeBase> set(const T& value);
void restore(const Setting<T>& oldSetting) {
m_value = oldSetting.get();
}
Expand Down Expand Up @@ -56,8 +56,8 @@ namespace YAML
};

template <typename T>
inline std::auto_ptr <SettingChangeBase> Setting<T>::set(const T& value) {
std::auto_ptr <SettingChangeBase> pChange(new SettingChange<T> (this));
inline std::unique_ptr <SettingChangeBase> Setting<T>::set(const T& value) {
std::unique_ptr <SettingChangeBase> pChange(new SettingChange<T> (this));
m_value = value;
return pChange;
}
Expand All @@ -81,11 +81,11 @@ namespace YAML
(*it)->pop();
}

void push(std::auto_ptr <SettingChangeBase> pSettingChange) {
void push(std::unique_ptr <SettingChangeBase> pSettingChange) {
m_settingChanges.push_back(pSettingChange.release());
}

// like std::auto_ptr - assignment is transfer of ownership
// like std::unique_ptr - assignment is transfer of ownership
SettingChanges& operator = (SettingChanges& rhs) {
if(this == &rhs)
return *this;
Expand Down
2 changes: 1 addition & 1 deletion src/vendor/yaml-cpp/singledocparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace YAML
private:
Scanner& m_scanner;
const Directives& m_directives;
std::auto_ptr<CollectionStack> m_pCollectionStack;
std::unique_ptr<CollectionStack> m_pCollectionStack;

typedef std::map<std::string, anchor_t> Anchors;
Anchors m_anchors;
Expand Down

0 comments on commit 6e41024

Please sign in to comment.