g_list_append() is evil. Just use prepend().
g_return_if_fail (bc);
g_return_if_fail (shape);
- bc->shapes = g_list_append (bc->shapes, shape);
+ bc->shapes = g_list_prepend (bc->shapes, shape);
}
GList *list = NULL;
for (i=0; backends[i].id != NULL; i++) {
- list = g_list_append (list, g_strdup (gettext (backends[i].name)));
+ list = g_list_prepend (list, g_strdup (gettext (backends[i].name)));
}
- return list;
+ return g_list_reverse (list);
}