diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-04-20 00:50:22 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-04-20 00:50:22 +0000 |
| commit | 3505201f3333c937b5b870d70019d400c722a69f (patch) | |
| tree | def64ac6be50375e43da5e3e91eb443dd4c171fc /src/FileAllocationMan.cc | |
| parent | 99733a84e2102739ee7c9de08ffae9e9216b6003 (diff) | |
2008-04-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Rewritten SharedHandle. Now copy constructor taking raw pointer
has
keyword explicit and SharedHandle's default constructor
initializes
its internal obj to null, old implementation initializes it
using
obj's default constructor.
To assign null, write SharedHandle<T> x(...); x.reset();
TODO: test/SharedHandleTest.cc needs more tests.
* src/SharedHandle.h
Diffstat (limited to 'src/FileAllocationMan.cc')
| -rw-r--r-- | src/FileAllocationMan.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/FileAllocationMan.cc b/src/FileAllocationMan.cc index b62f0164..478f2afb 100644 --- a/src/FileAllocationMan.cc +++ b/src/FileAllocationMan.cc @@ -37,7 +37,7 @@ namespace aria2 { -FileAllocationMan::FileAllocationMan():_currentFileAllocationEntry(0) {} +FileAllocationMan::FileAllocationMan() {} FileAllocationMan::~FileAllocationMan() {} @@ -53,7 +53,7 @@ FileAllocationEntryHandle FileAllocationMan::getCurrentFileAllocationEntry() void FileAllocationMan::markCurrentFileAllocationEntryDone() { - _currentFileAllocationEntry = 0; + _currentFileAllocationEntry.reset(); } bool FileAllocationMan::nextFileAllocationEntryExists() const @@ -64,7 +64,7 @@ bool FileAllocationMan::nextFileAllocationEntryExists() const FileAllocationEntryHandle FileAllocationMan::popNextFileAllocationEntry() { if(!nextFileAllocationEntryExists()) { - return 0; + return SharedHandle<FileAllocationEntry>(); } FileAllocationEntryHandle entry = _fileAllocationEntries.front(); _fileAllocationEntries.pop_front(); |
