From 3e6501a37b5b34abf6807ae968fcf7e2823d810c Mon Sep 17 00:00:00 2001 From: stffrdhrn Date: Thu, 2 Mar 2006 13:10:20 +0000 Subject: [PATCH] More compiler cleanups: * clean up for e_lib * fix places where evas_stringshare vars were freed SVN revision: 20918 --- src/bin/e_ipc_handlers.h | 28 +++++++++++++++------------- src/lib/E_Lib.h | 23 +++++++++++------------ src/lib/e_main.c | 1 - 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/bin/e_ipc_handlers.h b/src/bin/e_ipc_handlers.h index 0e44987f5..8c7fe9d87 100644 --- a/src/bin/e_ipc_handlers.h +++ b/src/bin/e_ipc_handlers.h @@ -426,9 +426,9 @@ free(data); END_INT3_STRING3_LIST_START() #define END_INT3_STRING3_LIST_ITERATE(__v) \ - free(__v->str1); \ - free(__v->str2); \ - free(__v->str3); \ + evas_stringshare_del(__v->str1); \ + evas_stringshare_del(__v->str2); \ + evas_stringshare_del(__v->str3); \ free(__v); \ } #define END_INT3_STRING3_LIST_START() \ @@ -489,8 +489,8 @@ free(data); END_INT4_STRING2_LIST_START() #define END_INT4_STRING2_LIST_ITERATE(__v) \ - free(__v->str1); \ - free(__v->str2); \ + evas_stringshare_del(__v->str1); \ + evas_stringshare_del(__v->str2); \ free(__v); \ } \ evas_list_free(dat); @@ -613,10 +613,10 @@ free(data); END_INT3_STRING4_LIST_START() #define END_INT3_STRING4_LIST_ITERATE(__v) \ - free(__v->str1); \ - free(__v->str2); \ - free(__v->str3); \ - free(__v->str4); \ + evas_stringshare_del(__v->str1); \ + evas_stringshare_del(__v->str2); \ + evas_stringshare_del(__v->str3); \ + evas_stringshare_del(__v->str4); \ free(__v); \ } \ evas_list_free(dat); @@ -1598,7 +1598,7 @@ break; LIST(); DECODE(e_ipc_codec_str_list_dec) { int count; - char *type; + char * type; int res; RESPONSE(r, E_Response_Dirs_List); @@ -1607,6 +1607,8 @@ break; r->dirs = malloc(sizeof(char *) * count); r->count = count - 1; /* leave off the "type" */ + type = NULL; + res = 0; count = 0; FOR(dat) { if (dat == l) @@ -1626,7 +1628,7 @@ break; else if (!strcmp(type, "themes")) res = E_RESPONSE_THEME_DIRS_LIST; else if (!strcmp(type, "init")) - res = E_RESPONSE_START_DIRS_LIST; + res = E_RESPONSE_INIT_DIRS_LIST; else if (!strcmp(type, "icons")) res = E_RESPONSE_ICON_DIRS_LIST; else if (!strcmp(type, "modules")) @@ -5996,8 +5998,8 @@ break; d = malloc(sizeof(E_Response_Binding_Signal_Data)); d->ctx = v->val1; - d->signal = v->str1; - d->source = v->str2; + d->signal = ((v->str1) ? evas_stringshare_add(v->str1) : NULL); + d->source = ((v->str2) ? evas_stringshare_add(v->str2) : NULL); d->mod = v->val2; d->any_mod = v->val3; d->action = ((v->str3) ? evas_stringshare_add(v->str3) : NULL); diff --git a/src/lib/E_Lib.h b/src/lib/E_Lib.h index 98a2adf08..0fb7ef8ac 100644 --- a/src/lib/E_Lib.h +++ b/src/lib/E_Lib.h @@ -106,11 +106,11 @@ struct _E_Response_Binding_Key_List struct _E_Response_Binding_Key_Data { E_Lib_Binding_Context ctx; - char *key; + const char *key; E_Lib_Binding_Modifier mod; unsigned char any_mod : 1; - char *action; - char *params; + const char *action; + const char *params; }; struct _E_Response_Binding_Mouse_List @@ -125,8 +125,8 @@ struct _E_Response_Binding_Mouse_Data int button; E_Lib_Binding_Modifier mod; unsigned char any_mod : 1; - char *action; - char *params; + const char *action; + const char *params; }; struct _E_Response_Binding_Signal_List @@ -138,12 +138,12 @@ struct _E_Response_Binding_Signal_List struct _E_Response_Binding_Signal_Data { E_Lib_Binding_Context ctx; - char *signal; - char *source; + const char *signal; + const char *source; E_Lib_Binding_Modifier mod; unsigned char any_mod : 1; - char *action; - char *params; + const char *action; + const char *params; }; struct _E_Response_Binding_Wheel_List @@ -159,8 +159,8 @@ struct _E_Response_Binding_Wheel_Data int z; E_Lib_Binding_Modifier mod; unsigned char any_mod : 1; - char *action; - char *params; + const char *action; + const char *params; }; @@ -177,7 +177,6 @@ extern EAPI int E_RESPONSE_INIT_DIRS_LIST; extern EAPI int E_RESPONSE_ICON_DIRS_LIST; extern EAPI int E_RESPONSE_MODULE_DIRS_LIST; extern EAPI int E_RESPONSE_BACKGROUND_DIRS_LIST; -extern EAPI int E_RESPONSE_START_DIRS_LIST; extern EAPI int E_RESPONSE_BINDING_KEY_LIST; extern EAPI int E_RESPONSE_BINDING_MOUSE_LIST; diff --git a/src/lib/e_main.c b/src/lib/e_main.c index 5aa1db113..bd98762fd 100644 --- a/src/lib/e_main.c +++ b/src/lib/e_main.c @@ -71,7 +71,6 @@ EAPI int E_RESPONSE_INIT_DIRS_LIST = 0; EAPI int E_RESPONSE_ICON_DIRS_LIST = 0; EAPI int E_RESPONSE_MODULE_DIRS_LIST = 0; EAPI int E_RESPONSE_BACKGROUND_DIRS_LIST = 0; -EAPI int E_RESPONSE_START_DIRS_LIST = 0; EAPI int E_RESPONSE_BINDING_KEY_LIST = 0; EAPI int E_RESPONSE_BINDING_MOUSE_LIST = 0;