Fix compiler warnings by initializing some variables & using evas_stringshare.

SVN revision: 31472
This commit is contained in:
Christopher Michael 2007-08-23 10:26:36 +00:00
parent dddbaba999
commit fc94c55d57
1 changed files with 9 additions and 8 deletions

View File

@ -767,7 +767,7 @@ _ilist_files_add(E_Config_Dialog_Data *cfdata, const char *header, const char *d
DIR *d = NULL; DIR *d = NULL;
struct dirent *dentry = NULL; struct dirent *dentry = NULL;
Evas_List *themefiles = NULL; Evas_List *themefiles = NULL;
int count; int count = 0;
char themename[1024]; char themename[1024];
char *tmp; char *tmp;
Evas_Object *o; Evas_Object *o;
@ -930,14 +930,14 @@ _cb_adv_btn_assign(void *data1, void *data2)
for (themes = cfdata->theme_list; themes; themes = themes->next) for (themes = cfdata->theme_list; themes; themes = themes->next)
{ {
char * filename; const char *filename = NULL;
t = themes->data; t = themes->data;
if (!strcmp(t->category, newtheme->category)) if (!strcmp(t->category, newtheme->category))
{ {
if ((t->file) && (strcmp(t->file, newtheme->file))) if ((t->file) && (strcmp(t->file, newtheme->file)))
{ {
filename = strdup(t->file); filename = evas_stringshare_add(t->file);
free((void *)(t->file)); free((void *)(t->file));
t->file = NULL; t->file = NULL;
if (!_theme_file_used(cfdata->theme_list, filename)) if (!_theme_file_used(cfdata->theme_list, filename))
@ -946,16 +946,16 @@ _cb_adv_btn_assign(void *data1, void *data2)
if (!strcmp(filename, _files_ilist_nth_label_to_file(cfdata, n))) if (!strcmp(filename, _files_ilist_nth_label_to_file(cfdata, n)))
e_widget_ilist_nth_icon_set(of, n, NULL); e_widget_ilist_nth_icon_set(of, n, NULL);
} }
free(filename);
} }
t->file = strdup(newtheme->file); t->file = strdup(newtheme->file);
if (filename) evas_stringshare_del(filename);
break; break;
} }
} }
if (!themes) if (!themes)
cfdata->theme_list = evas_list_append(cfdata->theme_list, newtheme); cfdata->theme_list = evas_list_append(cfdata->theme_list, newtheme);
else else
free(newtheme); free(newtheme);
return; return;
} }
@ -969,7 +969,7 @@ _cb_adv_btn_clear(void *data1, void *data2)
Evas_Object *oc = NULL, *of = NULL; Evas_Object *oc = NULL, *of = NULL;
char cat[1024]; char cat[1024];
const char *label; const char *label;
const char *filename; const char *filename = NULL;
int n; int n;
cfdata = data1; cfdata = data1;
@ -993,7 +993,7 @@ _cb_adv_btn_clear(void *data1, void *data2)
{ {
if (t->file) if (t->file)
{ {
filename = strdup(t->file); filename = evas_stringshare_add(t->file);
free((void *)(t->file)); free((void *)(t->file));
t->file = NULL; t->file = NULL;
} }
@ -1006,6 +1006,7 @@ _cb_adv_btn_clear(void *data1, void *data2)
for (n = 0; n < e_widget_ilist_count(of); n++) for (n = 0; n < e_widget_ilist_count(of); n++)
if (!strcmp(filename, _files_ilist_nth_label_to_file(cfdata, n))) if (!strcmp(filename, _files_ilist_nth_label_to_file(cfdata, n)))
e_widget_ilist_nth_icon_set(of, n, NULL); e_widget_ilist_nth_icon_set(of, n, NULL);
evas_stringshare_del(filename);
} }
return; return;