From fc94c55d57aee41762c7a17542fdee017e686ee3 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Thu, 23 Aug 2007 10:26:36 +0000 Subject: [PATCH] Fix compiler warnings by initializing some variables & using evas_stringshare. SVN revision: 31472 --- src/modules/conf_theme/e_int_config_theme.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/modules/conf_theme/e_int_config_theme.c b/src/modules/conf_theme/e_int_config_theme.c index b1dd085b2..0a35bcc5a 100644 --- a/src/modules/conf_theme/e_int_config_theme.c +++ b/src/modules/conf_theme/e_int_config_theme.c @@ -767,7 +767,7 @@ _ilist_files_add(E_Config_Dialog_Data *cfdata, const char *header, const char *d DIR *d = NULL; struct dirent *dentry = NULL; Evas_List *themefiles = NULL; - int count; + int count = 0; char themename[1024]; char *tmp; Evas_Object *o; @@ -930,14 +930,14 @@ _cb_adv_btn_assign(void *data1, void *data2) for (themes = cfdata->theme_list; themes; themes = themes->next) { - char * filename; + const char *filename = NULL; t = themes->data; if (!strcmp(t->category, newtheme->category)) { if ((t->file) && (strcmp(t->file, newtheme->file))) { - filename = strdup(t->file); + filename = evas_stringshare_add(t->file); free((void *)(t->file)); t->file = NULL; 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))) e_widget_ilist_nth_icon_set(of, n, NULL); } - free(filename); } t->file = strdup(newtheme->file); + if (filename) evas_stringshare_del(filename); break; } } if (!themes) - cfdata->theme_list = evas_list_append(cfdata->theme_list, newtheme); + cfdata->theme_list = evas_list_append(cfdata->theme_list, newtheme); else - free(newtheme); + free(newtheme); return; } @@ -969,7 +969,7 @@ _cb_adv_btn_clear(void *data1, void *data2) Evas_Object *oc = NULL, *of = NULL; char cat[1024]; const char *label; - const char *filename; + const char *filename = NULL; int n; cfdata = data1; @@ -993,7 +993,7 @@ _cb_adv_btn_clear(void *data1, void *data2) { if (t->file) { - filename = strdup(t->file); + filename = evas_stringshare_add(t->file); free((void *)(t->file)); 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++) if (!strcmp(filename, _files_ilist_nth_label_to_file(cfdata, n))) e_widget_ilist_nth_icon_set(of, n, NULL); + evas_stringshare_del(filename); } return;