forked from len0rd/rockbox
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
This commit is contained in:
parent
fb7c0df483
commit
82daaae455
1 changed files with 11 additions and 8 deletions
|
|
@ -46,29 +46,32 @@ bool tidy_loaded_and_changed = false;
|
||||||
|
|
||||||
#define DEFAULT_FILES PLUGIN_APPS_DIR "/disktidy.config"
|
#define DEFAULT_FILES PLUGIN_APPS_DIR "/disktidy.config"
|
||||||
#define CUSTOM_FILES PLUGIN_APPS_DIR "/disktidy_custom.config"
|
#define CUSTOM_FILES PLUGIN_APPS_DIR "/disktidy_custom.config"
|
||||||
|
|
||||||
void add_item(const char* name, int index)
|
void add_item(const char* name, int index)
|
||||||
{
|
{
|
||||||
char *a;
|
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] == '/')
|
if (name[rb->strlen(name)-1] == '/')
|
||||||
{
|
{
|
||||||
tidy_types[index].directory = true;
|
entry->directory = true;
|
||||||
tidy_types[index].filestring[rb->strlen(name)-1] = '\0';
|
entry->filestring[rb->strlen(name)-1] = '\0';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
tidy_types[index].directory = false;
|
entry->directory = false;
|
||||||
a = rb->strchr(name, '*');
|
a = rb->strchr(name, '*');
|
||||||
if (a)
|
if (a)
|
||||||
{
|
{
|
||||||
tidy_types[index].pre = a - name;
|
entry->pre = a - name;
|
||||||
tidy_types[index].post = rb->strlen(a+1);
|
entry->post = rb->strlen(a+1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tidy_types[index].pre = -1;
|
entry->pre = -1;
|
||||||
tidy_types[index].post = -1;
|
entry->post = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int find_file_string(const char *file, char *last_group)
|
static int find_file_string(const char *file, char *last_group)
|
||||||
{
|
{
|
||||||
char temp[MAX_PATH];
|
char temp[MAX_PATH];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue