aboutsummaryrefslogtreecommitdiffstats
path: root/src/archive/Iso9660ArchivePlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-29 23:20:19 +0100
committerMax Kellermann <max@duempel.org>2013-01-29 23:20:19 +0100
commitba51045d9e85b8e48afed629d6d87ac3338acd46 (patch)
tree01449b65415f9cd93212ad4c673d783b01b36ba2 /src/archive/Iso9660ArchivePlugin.cxx
parentfa34dd7bd3e0222811010dda6d1b40c4e3b3291b (diff)
downloadmpd-ba51045d9e85b8e48afed629d6d87ac3338acd46.tar.gz
mpd-ba51045d9e85b8e48afed629d6d87ac3338acd46.tar.xz
mpd-ba51045d9e85b8e48afed629d6d87ac3338acd46.zip
refcount: convert to C++
Diffstat (limited to 'src/archive/Iso9660ArchivePlugin.cxx')
-rw-r--r--src/archive/Iso9660ArchivePlugin.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/archive/Iso9660ArchivePlugin.cxx b/src/archive/Iso9660ArchivePlugin.cxx
index 895087efc..344cdac6a 100644
--- a/src/archive/Iso9660ArchivePlugin.cxx
+++ b/src/archive/Iso9660ArchivePlugin.cxx
@@ -29,7 +29,7 @@
#include "InputInternal.hxx"
#include "InputStream.hxx"
#include "InputPlugin.hxx"
-#include "refcount.h"
+#include "util/RefCount.hxx"
#include <cdio/cdio.h>
#include <cdio/iso9660.h>
@@ -44,14 +44,13 @@
struct Iso9660ArchiveFile {
struct archive_file base;
- struct refcount ref;
+ RefCount ref;
iso9660_t *iso;
Iso9660ArchiveFile(iso9660_t *_iso)
:iso(_iso) {
archive_file_init(&base, &iso9660_archive_plugin);
- refcount_init(&ref);
}
~Iso9660ArchiveFile() {
@@ -59,7 +58,7 @@ struct Iso9660ArchiveFile {
}
void Unref() {
- if (refcount_dec(&ref))
+ if (ref.Decrement())
delete this;
}
@@ -161,7 +160,7 @@ struct Iso9660InputStream {
base.ready = true;
base.size = statbuf->size;
- refcount_inc(&archive->ref);
+ archive->ref.Increment();
}
~Iso9660InputStream() {