From 8fb336148fb34474c67fbc6e0354daa4512a22fb Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Wed, 18 Aug 2004 01:09:31 +0000 Subject: Const policed pointer arguments to functions, part 3 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4999 a1c6a512-1295-4272-9138-f99709370657 --- apps/tree.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'apps/tree.c') diff --git a/apps/tree.c b/apps/tree.c index 017e9877f1..c9249caa7d 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -118,7 +118,7 @@ static int boot_cluster; static bool boot_changed = false; static bool start_wps = false; -static bool dirbrowse(char *root, int *dirfilter); +static bool dirbrowse(const char *root, const int *dirfilter); void browse_root(void) { @@ -293,7 +293,7 @@ static int compare(const void* p1, const void* p2) return 0; /* never reached */ } -static void showfileline(int line, int direntry, bool scroll, int *dirfilter) +static void showfileline(int line, int direntry, bool scroll, const int *dirfilter) { char* name = dircache[direntry].name; int xpos = LINE_X; @@ -331,7 +331,7 @@ static void showfileline(int line, int direntry, bool scroll, int *dirfilter) } /* load sorted directory into dircache. returns NULL on failure. */ -struct entry* load_and_sort_directory(char *dirname, int *dirfilter, +struct entry* load_and_sort_directory(const char *dirname, const int *dirfilter, int *num_files, bool *buffer_full) { int i; @@ -453,7 +453,7 @@ static int recalc_screen_height(void) } #endif -static int showdir(char *path, int start, int *dirfilter) +static int showdir(const char *path, int start, const int *dirfilter) { int i; int tree_max_on_screen; @@ -652,7 +652,7 @@ static bool ask_resume(bool ask_once) } /* load tracks from specified directory to resume play */ -void resume_directory(char *dir) +void resume_directory(const char *dir) { bool buffer_full; @@ -753,7 +753,8 @@ void set_current_file(char *path) } #ifdef BUTTON_ON -static bool handle_on(int *ds, int *dc, int numentries, int tree_max_on_screen, int *dirfilter) +static bool handle_on(int *ds, int *dc, int numentries, int tree_max_on_screen, + const int *dirfilter) { bool exit = false; bool used = false; @@ -878,7 +879,7 @@ static bool handle_on(int *ds, int *dc, int numentries, int tree_max_on_screen, } #endif -static bool dirbrowse(char *root, int *dirfilter) +static bool dirbrowse(const char *root, const int *dirfilter) { int numentries=0; char buf[MAX_PATH]; @@ -1643,7 +1644,7 @@ bool create_playlist(void) return true; } -bool rockbox_browse(char *root, int dirfilter) +bool rockbox_browse(const char *root, int dirfilter) { bool rc; int dircursor_save = dircursor; -- cgit v1.2.3