aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-01-26 12:46:30 +0000
committerEric Wong <normalperson@yhbt.net>2008-01-26 12:46:30 +0000
commit0659d359513107e3ed4b66a471f3cb3939a09521 (patch)
tree96bd7379db0604e1aa5474916567b6e1d2a63c80
parent07eaad301af56995f5c6a541c06ef9483d9fa9ec (diff)
downloadmpd-0659d359513107e3ed4b66a471f3cb3939a09521.tar.gz
mpd-0659d359513107e3ed4b66a471f3cb3939a09521.tar.xz
mpd-0659d359513107e3ed4b66a471f3cb3939a09521.zip
fix -Waggregate-return
Signed-off-by: Eric Wong <normalperson@yhbt.net> git-svn-id: https://svn.musicpd.org/mpd/trunk@7145 09075e82-0dd4-0310-85a5-a0d7c8717e4f
-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);