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
This commit is contained in:
parent
07eaad301a
commit
0659d35951
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue