diff options
author | Max Kellermann <max@duempel.org> | 2013-01-29 23:20:19 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-29 23:20:19 +0100 |
commit | ba51045d9e85b8e48afed629d6d87ac3338acd46 (patch) | |
tree | 01449b65415f9cd93212ad4c673d783b01b36ba2 /src/archive/Bzip2ArchivePlugin.cxx | |
parent | fa34dd7bd3e0222811010dda6d1b40c4e3b3291b (diff) | |
download | mpd-ba51045d9e85b8e48afed629d6d87ac3338acd46.tar.gz mpd-ba51045d9e85b8e48afed629d6d87ac3338acd46.tar.xz mpd-ba51045d9e85b8e48afed629d6d87ac3338acd46.zip |
refcount: convert to C++
Diffstat (limited to '')
-rw-r--r-- | src/archive/Bzip2ArchivePlugin.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/archive/Bzip2ArchivePlugin.cxx b/src/archive/Bzip2ArchivePlugin.cxx index be7388d5b..f93718128 100644 --- a/src/archive/Bzip2ArchivePlugin.cxx +++ b/src/archive/Bzip2ArchivePlugin.cxx @@ -29,7 +29,7 @@ #include "InputInternal.hxx" #include "InputStream.hxx" #include "InputPlugin.hxx" -#include "refcount.h" +#include "util/RefCount.hxx" #include <stdint.h> #include <stddef.h> @@ -45,18 +45,17 @@ struct Bzip2ArchiveFile { struct archive_file base; - struct refcount ref; + RefCount ref; char *name; struct input_stream *istream; Bzip2ArchiveFile() { archive_file_init(&base, &bz2_archive_plugin); - refcount_init(&ref); } void Unref() { - if (!refcount_dec(&ref)) + if (!ref.Decrement()) return; g_free(name); @@ -174,7 +173,7 @@ Bzip2InputStream::Bzip2InputStream(Bzip2ArchiveFile &_context, const char *uri, :base(bz2_inputplugin, uri, mutex, cond), archive(&_context), eof(false) { - refcount_inc(&archive->ref); + archive->ref.Increment(); } Bzip2InputStream::~Bzip2InputStream() |