Skip to content

Commit

Permalink
NWSCRIPT: Replace ScopedPtr/ScopedArray with std::unique_ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Aug 11, 2020
1 parent 814203d commit 59abc61
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/nwscript/decompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
namespace NWScript {

Decompiler::Decompiler(Common::SeekableReadStream &ncs, Aurora::GameID game) {
_ncs.reset(new NCSFile(ncs, game));
_ncs = std::make_unique<NCSFile>(ncs, game);
}

void Decompiler::createNSS(Common::WriteStream &out) {
Expand Down
5 changes: 3 additions & 2 deletions src/nwscript/decompiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
#ifndef NWSCRIPT_DECOMPILER_H
#define NWSCRIPT_DECOMPILER_H

#include "src/common/scopedptr.h"
#include <memory>

#include "src/common/writestream.h"

#include "src/nwscript/ncsfile.h"
Expand All @@ -46,7 +47,7 @@ class Decompiler {
void writeInstruction(Common::WriteStream &out, const Instruction *instruction, size_t indent);
void writeIndent(Common::WriteStream &out, size_t indent);

Common::ScopedPtr<NCSFile> _ncs;
std::unique_ptr<NCSFile> _ncs;
};

} // End of namespace NWScript
Expand Down
2 changes: 1 addition & 1 deletion src/nwscript/disassembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static Common::UString quoteString(const Common::UString &str) {


Disassembler::Disassembler(Common::SeekableReadStream &ncs, Aurora::GameID game) {
_ncs.reset(new NCSFile(ncs, game));
_ncs = std::make_unique<NCSFile>(ncs, game);
}

Disassembler::Disassembler(NCSFile *ncs) : _ncs(ncs) {
Expand Down
4 changes: 2 additions & 2 deletions src/nwscript/disassembler.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
#define NWSCRIPT_DISASSEMBLER_H

#include <vector>
#include <memory>

#include <boost/noncopyable.hpp>

#include "src/common/types.h"
#include "src/common/scopedptr.h"
#include "src/common/ustring.h"

#include "src/aurora/types.h"
Expand Down Expand Up @@ -68,7 +68,7 @@ class Disassembler : boost::noncopyable {


private:
Common::ScopedPtr<NCSFile> _ncs;
std::unique_ptr<NCSFile> _ncs;


void writeInfo (Common::WriteStream &out);
Expand Down

0 comments on commit 59abc61

Please sign in to comment.