directory_save: pass const pointer to _save()

This commit is contained in:
Max Kellermann 2011-09-10 07:41:14 +02:00
parent d54075197f
commit 4af6362751
2 changed files with 4 additions and 4 deletions

View File

@ -42,9 +42,8 @@ directory_quark(void)
}
void
directory_save(FILE *fp, struct directory *directory)
directory_save(FILE *fp, const struct directory *directory)
{
struct dirvec *children = &directory->children;
size_t i;
if (!directory_is_root(directory)) {
@ -55,8 +54,9 @@ directory_save(FILE *fp, struct directory *directory)
directory_get_path(directory));
}
const struct dirvec *children = &directory->children;
for (i = 0; i < children->nr; ++i) {
struct directory *cur = children->base[i];
const struct directory *cur = children->base[i];
char *base = g_path_get_basename(cur->path);
fprintf(fp, DIRECTORY_DIR "%s\n", base);

View File

@ -28,7 +28,7 @@
struct directory;
void
directory_save(FILE *fp, struct directory *directory);
directory_save(FILE *fp, const struct directory *directory);
bool
directory_load(FILE *fp, struct directory *directory,