On Sat, 27 Feb 2010, Enlightenment SVN wrote:
> Log:
> Get rid of g_free
do you know that g_malloc / g_free are not equivalent to malloc / free ?
glib uses specific allocators. I would use them in a program using glib
Vincent
>
> Author: rui
> Date: 2010-02-27 14:52:16 -0800 (Sat, 27 Feb 2010)
> New Revision: 46626
>
> Modified:
> trunk/elmdentica/src/curl.c trunk/elmdentica/src/elmdentica.c
> trunk/elmdentica/src/settings.c trunk/elmdentica/src/twitter.c
>
> Modified: trunk/elmdentica/src/curl.c
> ===================================================================
> --- trunk/elmdentica/src/curl.c 2010-02-27 22:51:19 UTC (rev 46625)
> +++ trunk/elmdentica/src/curl.c 2010-02-27 22:52:16 UTC (rev 46626)
> @@ -207,7 +207,7 @@
>
> res = curl_easy_perform(ua);
>
> - g_free(userpwd);
> + free(userpwd);
>
> curl_easy_getinfo(ua, CURLINFO_CONTENT_LENGTH_DOWNLOAD,
> &content_length);
> if((res == 18 && content_length != -1) || res != 0) {
> @@ -248,7 +248,7 @@
>
> res = curl_easy_perform(ua);
>
> - g_free(userpwd);
> + free(userpwd);
>
> curl_easy_getinfo(ua, CURLINFO_CONTENT_LENGTH_DOWNLOAD,
> &content_length);
> if((res == 18 && content_length != -1) || res != 0) {
>
> Modified: trunk/elmdentica/src/elmdentica.c
> ===================================================================
> --- trunk/elmdentica/src/elmdentica.c 2010-02-27 22:51:19 UTC (rev 46625)
> +++ trunk/elmdentica/src/elmdentica.c 2010-02-27 22:52:16 UTC (rev 46626)
> @@ -151,7 +151,7 @@
> exit(sqlite_res);
> }
> chmod(db_path, S_IRUSR|S_IWUSR);
> - g_free(db_path);
> + free(db_path);
>
> query = "CREATE TABLE IF NOT EXISTS accounts (id INTEGER PRIMARY KEY,
> enabled INTEGER, name TEXT, password TEXT, type INTEGER, proto TEXT, domain
> TEXT, port INTEGER, base_url TEXT, receive INTEGER, send INTEGER );";
> sqlite_res = sqlite3_exec(ed_DB, query, NULL, NULL, &db_err);
> @@ -277,7 +277,7 @@
>
> static void url_win_del(void *data, Evas_Object *obj, void *event_info) {
> if(data)
> - g_free(data);
> + free(data);
> evas_object_del(url_win);
> }
>
> @@ -346,7 +346,7 @@
> elm_entry_editable_set(entry, FALSE);
> url2 = g_strndup(url+1,strlen(url)-2);
> elm_entry_entry_set(entry, url2);
> - g_free(url2);
> + free(url2);
> evas_object_show(entry);
> elm_frame_content_set(frame, entry);
> elm_box_pack_end(box, frame);
> @@ -580,7 +580,7 @@
> //status_message = g_regex_replace(re, tmp, -1, 0, "<a
> href='\\1'>\\1</a>\\2", 0, &err);
> status_message = g_regex_replace(re, tmp, -1, 0, "<a
> href='\\1'>[link]</a>\\2", 0, &err);
> g_regex_unref(re);
> - g_free(tmp);
> + free(tmp);
>
> elm_anchorblock_text_set(message, status_message);
> evas_object_smart_callback_add(message, "anchor,clicked",
> on_message_anchor_clicked, bubble);
> @@ -654,15 +654,14 @@
> }
>
> void del_status(gpointer data, gpointer user_data) {
> -
> ub_Status * status=(ub_Status*)data;
>
> - g_free(status->id_str);
> - g_free(status->screen_name);
> - g_free(status->name);
> - g_free(status->text);
> - g_free(status->created_at_str);
> - g_free(status);
> + free(status->id_str);
> + free(status->screen_name);
> + free(status->name);
> + free(status->text);
> + free(status->created_at_str);
> + free(status);
>
> }
>
> @@ -730,7 +729,7 @@
> printf("Can't run %s: %d => %s\n", query, sqlite_res,
> db_err);
> }
> sqlite3_free(db_err);
> - g_free(query);
> + free(query);
> }
> }
>
> @@ -820,7 +819,7 @@
> }
> }
>
> - g_free(msg);
> + free(msg);
>
> return(0);
> }
>
> Modified: trunk/elmdentica/src/settings.c
> ===================================================================
> --- trunk/elmdentica/src/settings.c 2010-02-27 22:51:19 UTC (rev 46625)
> +++ trunk/elmdentica/src/settings.c 2010-02-27 22:52:16 UTC (rev 46626)
> @@ -214,7 +214,7 @@
> sqlite3_free(db_err);
> free(query);
>
> - g_free(id);
> + free(id);
> id = calloc(1, sizeof(int));
> get_account_id(screen_name, domain, id);
>
>
> Modified: trunk/elmdentica/src/twitter.c
> ===================================================================
> --- trunk/elmdentica/src/twitter.c 2010-02-27 22:51:19 UTC (rev 46625)
> +++ trunk/elmdentica/src/twitter.c 2010-02-27 22:52:16 UTC (rev 46626)
> @@ -316,7 +316,7 @@
> statuses->state = HASH;
> } else if(strlen((char*)name) == 2 && strncmp((char*)name, "id", 2) ==
> 0 && statuses->state == FT_ID) {
> statuses->current->id = atoll(statuses->current->id_str);
> - g_free(statuses->current->id_str);
> + free(statuses->current->id_str);
> statuses->state = FT_STATUS;
> } else if(strncmp((char*)name, "status", 6) == 0 && strlen((char*)name)
> == 6) {
> statuses->list = g_list_append(statuses->list,
> (gpointer)statuses->current);
> @@ -332,7 +332,7 @@
> statuses->state = FT_USER;
> else if(statuses->state == FT_CREATED_AT && strncmp((char*)name,
> "created_at", 10) == 0) {
> statuses->current->created_at =
> curl_getdate(statuses->current->created_at_str, NULL);
> - g_free(statuses->current->created_at_str);
> + free(statuses->current->created_at_str);
> statuses->state = FT_STATUS;
> } else if(strncmp((char*)name, "text", 4) == 0)
> statuses->state = FT_STATUS;
>
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> enlightenment-svn mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
>
>
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel