diff --git a/src/filelist.c b/src/filelist.c
index 5138fdbcee86f25d65eb8e0941eb43a6ef2dc172..a5b7a136468874e3db6460ed3c7e78e18aa04e23 100644 (file)
--- a/src/filelist.c
+++ b/src/filelist.c
void
filelist_free(struct filelist *filelist)
{
- guint i;
-
- for (i = 0; i < filelist_length(filelist); ++i) {
+ for (unsigned i = 0; i < filelist_length(filelist); ++i) {
struct filelist_entry *entry = filelist_get(filelist, i);
if (entry->entity)
void
filelist_move(struct filelist *filelist, struct filelist *from)
{
- guint i;
-
- for (i = 0; i < filelist_length(from); ++i)
+ for (unsigned i = 0; i < filelist_length(from); ++i)
g_ptr_array_add(filelist->entries,
g_ptr_array_index(from->entries, i));
gconstpointer filelist_entry2)
{
const struct mpd_entity *e1, *e2;
- int n = 0;
e1 = ((const struct filelist_entry *)filelist_entry1)->entity;
e2 = ((const struct filelist_entry *)filelist_entry2)->entity;
+ int n = 0;
if (e1 != NULL && e2 != NULL &&
mpd_entity_get_type(e1) == mpd_entity_get_type(e2)) {
switch (mpd_entity_get_type(e1)) {
void
filelist_sort_dir_play(struct filelist *filelist, GCompareFunc compare_func)
{
- unsigned first, last;
const struct mpd_entity *iter;
assert(filelist && filelist->entries);
/* If the first entry is NULL, skip it, because NULL stands for "[..]" */
iter = ((struct filelist_entry*) g_ptr_array_index(filelist->entries, 0))->entity;
- first = (iter == NULL)? 1 : 0;
+ unsigned first = iter == NULL ? 1 : 0, last;
/* find the last directory entry */
for (last = first+1; last < filelist->entries->len; last++) {
}
int
-filelist_find_song(struct filelist *fl, const struct mpd_song *song)
+filelist_find_song(const struct filelist *fl, const struct mpd_song *song)
{
- guint i;
-
assert(song != NULL);
- for (i = 0; i < filelist_length(fl); ++i) {
+ for (unsigned i = 0; i < filelist_length(fl); ++i) {
struct filelist_entry *entry = filelist_get(fl, i);
const struct mpd_entity *entity = entry->entity;
}
int
-filelist_find_directory(struct filelist *filelist, const char *name)
+filelist_find_directory(const struct filelist *filelist, const char *name)
{
- guint i;
-
assert(name != NULL);
- for (i = 0; i < filelist_length(filelist); ++i) {
+ for (unsigned i = 0; i < filelist_length(filelist); ++i) {
struct filelist_entry *entry = filelist_get(filelist, i);
const struct mpd_entity *entity = entry->entity;