aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/tagTracker.c14
-rw-r--r--src/tree.c4
-rw-r--r--src/tree.h2
3 files changed, 10 insertions, 10 deletions
diff --git a/src/tagTracker.c b/src/tagTracker.c
index 9fc7fa840..7509c775a 100644
--- a/src/tagTracker.c
+++ b/src/tagTracker.c
@@ -44,8 +44,8 @@ char *getTagItemString(int type, char *string)
if (FindInTree(tagTrees[type], string, &iter))
{
- ((TagTrackerItem *)GetTreeKeyData(&iter).data)->count++;
- return (char *)GetTreeKeyData(&iter).key;
+ ((TagTrackerItem *)GetTreeKeyData(&iter)->data)->count++;
+ return (char *)GetTreeKeyData(&iter)->key;
}
else
{
@@ -71,7 +71,7 @@ void removeTagItemString(int type, char *string)
if (FindInTree(tagTrees[type], string, &iter))
{
TagTrackerItem * item =
- (TagTrackerItem *)GetTreeKeyData(&iter).data;
+ (TagTrackerItem *)GetTreeKeyData(&iter)->data;
item->count--;
if (item->count <= 0)
RemoveFromTreeByIterator(tagTrees[type], &iter);
@@ -103,7 +103,7 @@ void resetVisitedFlagsInTagTracker(int type)
!IsTreeIteratorAtEnd(&iter);
IncrementTreeIterator(&iter))
{
- ((TagTrackerItem *)GetTreeKeyData(&iter).data)->visited = 0;
+ ((TagTrackerItem *)GetTreeKeyData(&iter)->data)->visited = 0;
}
}
@@ -117,7 +117,7 @@ void visitInTagTracker(int type, char *str)
if (!FindInTree(tagTrees[type], str, &iter))
return;
- ((TagTrackerItem *)GetTreeKeyData(&iter).data)->visited = 1;
+ ((TagTrackerItem *)GetTreeKeyData(&iter)->data)->visited = 1;
}
void printVisitedInTagTracker(int fd, int type)
@@ -132,14 +132,14 @@ void printVisitedInTagTracker(int fd, int type)
!IsTreeIteratorAtEnd(&iter);
IncrementTreeIterator(&iter))
{
- item = ((TagTrackerItem *)GetTreeKeyData(&iter).data);
+ item = ((TagTrackerItem *)GetTreeKeyData(&iter)->data);
if (item->visited)
{
fdprintf(fd,
"%s: %s\n",
mpdTagItemKeys[type],
- (char *)GetTreeKeyData(&iter).key);
+ (char *)GetTreeKeyData(&iter)->key);
}
}
}
diff --git a/src/tree.c b/src/tree.c
index 26b58845c..4b212cca6 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -630,13 +630,13 @@ void IncrementTreeIterator(TreeIterator * iter)
}
}
-TreeKeyData
+const TreeKeyData *
GetTreeKeyData(TreeIterator * iter)
{
assert(iter->node &&
iter->which > 0 &&
iter->which <= iter->node->count);
- return iter->node->keyData[iter->which-1];
+ return &iter->node->keyData[iter->which-1];
}
int
diff --git a/src/tree.h b/src/tree.h
index 76a980cd2..4d30e0106 100644
--- a/src/tree.h
+++ b/src/tree.h
@@ -51,7 +51,7 @@ void SetTreeIteratorToBegin(Tree * tree, TreeIterator * iter);
int IsTreeIteratorAtEnd(const TreeIterator * iter);
void IncrementTreeIterator(TreeIterator * iter);
-TreeKeyData GetTreeKeyData(TreeIterator * iter);
+const TreeKeyData *GetTreeKeyData(TreeIterator * iter);
int InsertInTree(Tree * tree, void * key, void * data);
int RemoveFromTreeByKey(Tree * tree, void * key);