diff options
| author | Steve Bavin <pondlife@pondlife.me> | 2008-05-13 09:57:56 +0000 |
|---|---|---|
| committer | Steve Bavin <pondlife@pondlife.me> | 2008-05-13 09:57:56 +0000 |
| commit | 652657781805d9cc10d744a49fb23eb17019fbbf (patch) | |
| tree | 2d1a6ae597a17531f726b57fd9f8cbaa2a46a07f /apps/plugins/properties.c | |
| parent | a94e40d5153ab698fa8a1b6b57d91fcb6acc905e (diff) | |
| download | rockbox-652657781805d9cc10d744a49fb23eb17019fbbf.zip rockbox-652657781805d9cc10d744a49fb23eb17019fbbf.tar.gz rockbox-652657781805d9cc10d744a49fb23eb17019fbbf.tar.bz2 rockbox-652657781805d9cc10d744a49fb23eb17019fbbf.tar.xz | |
Plugin parameters should be const.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17492 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/properties.c')
| -rw-r--r-- | apps/plugins/properties.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/apps/plugins/properties.c b/apps/plugins/properties.c index 2780515..05d05a7 100644 --- a/apps/plugins/properties.c +++ b/apps/plugins/properties.c @@ -20,7 +20,7 @@ PLUGIN_HEADER -static struct plugin_api* rb; +static const struct plugin_api* rb; MEM_FUNCTION_WRAPPERS(rb); @@ -252,21 +252,23 @@ char * get_props(int selected_item, void* data, char *buffer, size_t buffer_len) return buffer; } -enum plugin_status plugin_start(struct plugin_api* api, void* file) +enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) { rb = api; struct gui_synclist properties_lists; int button; bool prev_show_statusbar; bool quit = false; + char file[MAX_PATH]; + rb->strcpy(file, (const char *) parameter); /* determine if it's a file or a directory */ bool found = false; DIR* dir; struct dirent* entry; - char* ptr = rb->strrchr((char*)file, '/') + 1; - int dirlen = (ptr - (char*)file); - rb->strncpy(str_dirname, (char*)file, dirlen); + char* ptr = rb->strrchr(file, '/') + 1; + int dirlen = (ptr - file); + rb->strncpy(str_dirname, file, dirlen); str_dirname[dirlen] = 0; dir = rb->opendir(str_dirname); @@ -288,13 +290,13 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file) if(!found) { /* weird: we couldn't find the entry. This Should Never Happen (TM) */ - rb->splash(0, "File/Dir not found: %s", (char*)file); + rb->splash(0, "File/Dir not found: %s", file); rb->action_userabort(TIMEOUT_BLOCK); return PLUGIN_OK; } /* get the info depending on its_a_dir */ - if(!(its_a_dir ? dir_properties((char*)file):file_properties((char*)file))) + if(!(its_a_dir ? dir_properties(file) : file_properties(file))) { /* something went wrong (to do: tell user what it was (nesting,...) */ rb->splash(0, "Failed to gather information"); |