aboutsummaryrefslogtreecommitdiffstats
path: root/src/TagPool.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-07-30 20:11:57 +0200
committerMax Kellermann <max@duempel.org>2013-07-30 20:19:53 +0200
commit06f898cc1240a29b293de0e97ad95a4fdc971254 (patch)
tree001a6d3db039cdc03323f3bfddc13b94bde31ce4 /src/TagPool.cxx
parent6a9ab8bc0e2f5d34803513bb2d94d041a607a58c (diff)
downloadmpd-06f898cc1240a29b293de0e97ad95a4fdc971254.tar.gz
mpd-06f898cc1240a29b293de0e97ad95a4fdc971254.tar.xz
mpd-06f898cc1240a29b293de0e97ad95a4fdc971254.zip
tag: convert to C++
Diffstat (limited to '')
-rw-r--r--src/TagPool.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/TagPool.cxx b/src/TagPool.cxx
index 030f90225..5a0b33c47 100644
--- a/src/TagPool.cxx
+++ b/src/TagPool.cxx
@@ -19,11 +19,12 @@
#include "config.h"
#include "TagPool.hxx"
-#include "tag.h"
+#include "Tag.hxx"
#include <glib.h>
#include <assert.h>
+#include <string.h>
Mutex tag_pool_lock;
@@ -32,7 +33,7 @@ Mutex tag_pool_lock;
struct slot {
struct slot *next;
unsigned char ref;
- struct tag_item item;
+ TagItem item;
} mpd_packed;
static struct slot *slots[NUM_SLOTS];
@@ -64,7 +65,7 @@ calc_hash(enum tag_type type, const char *p)
}
static inline struct slot *
-tag_item_to_slot(struct tag_item *item)
+tag_item_to_slot(TagItem *item)
{
return (struct slot*)(((char*)item) - offsetof(struct slot, item));
}
@@ -85,7 +86,7 @@ static struct slot *slot_alloc(struct slot *next,
return slot;
}
-struct tag_item *
+TagItem *
tag_pool_get_item(enum tag_type type, const char *value, size_t length)
{
struct slot **slot_p, *slot;
@@ -107,7 +108,8 @@ tag_pool_get_item(enum tag_type type, const char *value, size_t length)
return &slot->item;
}
-struct tag_item *tag_pool_dup_item(struct tag_item *item)
+TagItem *
+tag_pool_dup_item(TagItem *item)
{
struct slot *slot = tag_item_to_slot(item);
@@ -130,7 +132,8 @@ struct tag_item *tag_pool_dup_item(struct tag_item *item)
}
}
-void tag_pool_put_item(struct tag_item *item)
+void
+tag_pool_put_item(TagItem *item)
{
struct slot **slot_p, *slot;