summaryrefslogtreecommitdiff
path: root/apps/plugins/disktidy.c
diff options
context:
space:
mode:
authorAlexander Levin <al.le@rockbox.org>2010-12-25 21:11:40 +0000
committerAlexander Levin <al.le@rockbox.org>2010-12-25 21:11:40 +0000
commit82daaae45513184df5e34b428391d869d9cf12e1 (patch)
tree97b5deaa5c39a88ba1a9080406e1d30a2fe79f43 /apps/plugins/disktidy.c
parentfb7c0df483ed877616b2180114cc66adb0c8414c (diff)
downloadrockbox-82daaae45513184df5e34b428391d869d9cf12e1.zip
rockbox-82daaae45513184df5e34b428391d869d9cf12e1.tar.gz
rockbox-82daaae45513184df5e34b428391d869d9cf12e1.tar.bz2
rockbox-82daaae45513184df5e34b428391d869d9cf12e1.tar.xz
Disktidy: introduce a local variable to avoid repeated use of the indexed expression
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28895 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/disktidy.c')
-rw-r--r--apps/plugins/disktidy.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/apps/plugins/disktidy.c b/apps/plugins/disktidy.c
index 41c4394..a85e827 100644
--- a/apps/plugins/disktidy.c
+++ b/apps/plugins/disktidy.c
@@ -46,29 +46,32 @@ bool tidy_loaded_and_changed = false;
#define DEFAULT_FILES PLUGIN_APPS_DIR "/disktidy.config"
#define CUSTOM_FILES PLUGIN_APPS_DIR "/disktidy_custom.config"
+
void add_item(const char* name, int index)
{
char *a;
- rb->strcpy(tidy_types[index].filestring, name);
+ struct tidy_type *entry = tidy_types + index;
+ rb->strcpy(entry->filestring, name);
if (name[rb->strlen(name)-1] == '/')
{
- tidy_types[index].directory = true;
- tidy_types[index].filestring[rb->strlen(name)-1] = '\0';
+ entry->directory = true;
+ entry->filestring[rb->strlen(name)-1] = '\0';
}
else
- tidy_types[index].directory = false;
+ entry->directory = false;
a = rb->strchr(name, '*');
if (a)
{
- tidy_types[index].pre = a - name;
- tidy_types[index].post = rb->strlen(a+1);
+ entry->pre = a - name;
+ entry->post = rb->strlen(a+1);
}
else
{
- tidy_types[index].pre = -1;
- tidy_types[index].post = -1;
+ entry->pre = -1;
+ entry->post = -1;
}
}
+
static int find_file_string(const char *file, char *last_group)
{
char temp[MAX_PATH];