GNOME Bugzilla – Bug 560857
GNOME Goal: Remove deprecated GLib symbols
Last modified: 2009-02-05 12:46:46 UTC
See http://live.gnome.org/GnomeGoals/RemoveDeprecatedSymbols/Glib Here are the files+lines using deprecated GLib symbols in this module: anjuta/tagmanager/tm_tag.c:20:static GMemChunk *s_tag_mem_chunk = NULL; anjuta/tagmanager/tm_tag.c:24: s_tag_mem_chunk = g_mem_chunk_new("TMTag memChunk", sizeof(TMTag), 10000 \ anjuta/tagmanager/tm_tag.c:25: , G_ALLOC_AND_FREE); \ anjuta/tagmanager/tm_tag.c:26: (T) = g_chunk_new0(TMTag, s_tag_mem_chunk);} anjuta/tagmanager/tm_tag.c:28:#define TAG_FREE(T) g_mem_chunk_free(s_tag_mem_chunk, (T)) anjuta/tagmanager/tm_tag.c:731: g_mem_chunk_clean (s_tag_mem_chunk); anjuta/tagmanager/tm_file_entry.c:25:static GMemChunk *file_mem_chunk = NULL; anjuta/tagmanager/tm_file_entry.c:29: file_mem_chunk = g_mem_chunk_new("TMFileEntry MemChunk", sizeof(TMFileEntry), 1024 \ anjuta/tagmanager/tm_file_entry.c:30: , G_ALLOC_AND_FREE); \ anjuta/tagmanager/tm_file_entry.c:31: (T) = g_chunk_new0(TMFileEntry, file_mem_chunk);} anjuta/tagmanager/tm_file_entry.c:33:#define FILE_FREE(T) g_mem_chunk_free(file_mem_chunk, (T)) anjuta/tagmanager/tm_symbol.c:16:static GMemChunk *sym_mem_chunk = NULL; anjuta/tagmanager/tm_symbol.c:20: sym_mem_chunk = g_mem_chunk_new("TMSymbol MemChunk", sizeof(TMSymbol), 1024 \ anjuta/tagmanager/tm_symbol.c:21: , G_ALLOC_AND_FREE); \ anjuta/tagmanager/tm_symbol.c:22: (T) = g_chunk_new0(TMSymbol, sym_mem_chunk);} anjuta/tagmanager/tm_symbol.c:24:#define SYM_FREE(T) g_mem_chunk_free(sym_mem_chunk, (T)) anjuta/plugins/tools/tool.h:96: GMemChunk* data_pool; anjuta/plugins/tools/tool.c:386: tool = g_chunk_new0(ATPUserTool, list->data_pool); anjuta/plugins/tools/tool.c:396: first = g_chunk_new(ATPUserTool, list->data_pool); anjuta/plugins/tools/tool.c:409: tool = g_chunk_new0(ATPUserTool, list->data_pool); anjuta/plugins/tools/tool.c:418: tool = g_chunk_new0(ATPUserTool, list->data_pool); anjuta/plugins/tools/tool.c:437: g_chunk_free (this, this->owner->data_pool); anjuta/plugins/tools/tool.c:804: this->data_pool = g_mem_chunk_new ("tool pool", sizeof (ATPUserTool), STRING_CHUNK_SIZE * sizeof (ATPUserTool) / 4, G_ALLOC_AND_FREE); anjuta/plugins/tools/tool.c:813: g_mem_chunk_destroy (this->data_pool); anjuta/plugins/document-manager/anjuta-docman.c:1547: return (g_strcasecmp (aos.m_label, bos.m_label)); /* need g_utf8_collate() ? */ anjuta/plugins/patch/patch-plugin.c:179: g_string_sprintf (command, "patch --dry-run -d %s -p %d -f -i %s", anjuta/plugins/patch/patch-plugin.c:182: g_string_sprintf (command, "patch -d %s -p %d -f -i %s", anjuta/plugins/project-manager/plugin.c:1240: anjuta_status_push (status, _("Loading project: %s"), g_basename (dirname)); anjuta/plugins/project-manager/plugin.c:1281: anjuta_status_set_default (status, _("Project"), g_basename (dirname)); anjuta/plugins/search/search_preferences.c:321: if (g_strcasecmp(name, BASIC)) anjuta/plugins/search/search_preferences.c:425: if (g_strcasecmp(name, BASIC)) anjuta/plugins/search/search_preferences.c:456: if (g_strcasecmp(name, BASIC)) anjuta/plugins/search/search_preferences.c:469: if (!g_strcasecmp(name, path)) anjuta/plugins/search/search_preferences.c:499: if (g_strcasecmp(name, BASIC)) anjuta/plugins/search/search_preferences.c:574: if (default_pref && g_strcasecmp(default_pref, "") && g_strcasecmp(default_pref, BASIC)) anjuta/plugins/gtodo/libgtodo.c:66: g_date_set_time(item->start, (GTime)item->id); anjuta/plugins/gtodo/libgtodo.c:227: g_date_set_time(today, time(NULL)); anjuta/plugins/gtodo/libgtodo.c:256: g_date_set_time(date, item->last_edited); anjuta/plugins/gtodo/libgtodo.c:354: g_date_set_time(item->stop, time(NULL)); anjuta/plugins/gtodo/todo_db.c:253: g_date_set_time (date, time (NULL)); anjuta/plugins/gtodo/egg-datetime.c:935: g_date_set_time (now, time (NULL)); anjuta/plugins/gtodo/add_edit_item.c:423: g_date_set_time(date, time(NULL)); anjuta/plugins/file-loader/plugin.c:108: g_basename (uri), errmsg); anjuta/plugins/file-loader/plugin.c:186: g_basename(uri), mime_type); anjuta/plugins/project-wizard/property.c:52: GMemChunk* data_pool; anjuta/plugins/project-wizard/property.c:53: GMemChunk* item_pool; anjuta/plugins/project-wizard/property.c:139: this = g_chunk_new0(NPWProperty, owner->data_pool); anjuta/plugins/project-wizard/property.c:581: item = g_chunk_new (NPWItem, this->owner->item_pool); anjuta/plugins/project-wizard/property.c:670: this->data_pool = g_mem_chunk_new ("property pool", sizeof (NPWProperty), STRING_CHUNK_SIZE * sizeof (NPWProperty) / 4, G_ALLOC_ONLY); anjuta/plugins/project-wizard/property.c:671: this->item_pool = g_mem_chunk_new ("item pool", sizeof (NPWItem), STRING_CHUNK_SIZE * sizeof (NPWItem) / 4, G_ALLOC_ONLY); anjuta/plugins/project-wizard/property.c:684: g_mem_chunk_destroy (this->data_pool); anjuta/plugins/project-wizard/property.c:685: g_mem_chunk_destroy (this->item_pool); anjuta/plugins/project-wizard/druid.c:96: GMemChunk* pool; anjuta/plugins/project-wizard/druid.c:269: data = g_chunk_new (NPWDruidAndTextBuffer, this->pool); anjuta/plugins/project-wizard/druid.c:952: this->pool = g_mem_chunk_new ("druid pool", sizeof(NPWDruidStuff), sizeof(NPWDruidStuff) * 20, G_ALLOC_ONLY); anjuta/plugins/project-wizard/druid.c:1021: g_mem_chunk_destroy(this->pool); anjuta/plugins/project-wizard/parser.c:1031: GMemChunk* tag_pool; anjuta/plugins/project-wizard/parser.c:1339: new_child = g_chunk_new (NPWFileTag, parser->tag_pool); anjuta/plugins/project-wizard/parser.c:1365: g_mem_chunk_free (parser->tag_pool, g_queue_pop_head (parser->tag)); anjuta/plugins/project-wizard/parser.c:1398: this->tag_pool = g_mem_chunk_new ("file tag pool", sizeof (NPWFileTag), NPW_FILE_PARSER_DEFAULT_LEVEL * sizeof (NPWFileTag) , G_ALLOC_AND_FREE); anjuta/plugins/project-wizard/parser.c:1422: g_mem_chunk_destroy (this->tag_pool); anjuta/plugins/project-wizard/action.c:46: GMemChunk* data_pool; anjuta/plugins/project-wizard/action.c:69: this = g_chunk_new0(NPWAction, owner->data_pool); anjuta/plugins/project-wizard/action.c:133: this->data_pool = g_mem_chunk_new ("action pool", sizeof (NPWAction), STRING_CHUNK_SIZE * sizeof (NPWAction) / 4, G_ALLOC_ONLY); anjuta/plugins/project-wizard/action.c:145: g_mem_chunk_destroy (this->data_pool); anjuta/plugins/project-wizard/values.c:53: GMemChunk* value_pool; anjuta/plugins/project-wizard/values.c:73: this->value_pool = g_mem_chunk_new ("value pool", sizeof(NPWValue), (STRING_CHUNK_SIZE / 4) * sizeof(NPWValue), G_ALLOC_ONLY); anjuta/plugins/project-wizard/values.c:83: g_mem_chunk_destroy (this->value_pool); anjuta/plugins/project-wizard/values.c:121: node = g_chunk_new (NPWValue, this->value_pool); anjuta/plugins/project-wizard/file.c:42: GMemChunk* data_pool; anjuta/plugins/project-wizard/file.c:71: this = g_chunk_new0(NPWFile, owner->data_pool); anjuta/plugins/project-wizard/file.c:208: this->data_pool = g_mem_chunk_new ("file pool", sizeof (NPWFile), STRING_CHUNK_SIZE * sizeof (NPWFile) / 4, G_ALLOC_ONLY); anjuta/plugins/project-wizard/file.c:220: g_mem_chunk_destroy (this->data_pool); anjuta/plugins/project-wizard/header.c:45: GMemChunk* data_pool; anjuta/plugins/project-wizard/header.c:70: this = g_chunk_new0(NPWHeader, owner->data_pool); anjuta/plugins/project-wizard/header.c:318: this->data_pool = g_mem_chunk_new ("project pool", sizeof (NPWHeader), STRING_CHUNK_SIZE * sizeof (NPWHeader) / 4, G_ALLOC_ONLY); anjuta/plugins/project-wizard/header.c:330: g_mem_chunk_destroy (this->data_pool); anjuta/plugins/valgrind/vgactions.c:302: g_io_channel_close (priv->gio); anjuta/plugins/valgrind/vgrule-list.c:461: g_io_channel_close (list->gio); anjuta/plugins/valgrind/vgrule-list.c:508: g_io_channel_close (list->gio); anjuta/plugins/valgrind/vgrule-list.c:573: g_io_channel_close (list->gio); anjuta/plugins/build-basic-autotools/plugin.c:1779: gchar *dirname = g_dirname (plugin->current_editor_filename); anjuta/plugins/build-basic-autotools/plugin.c:1792: gchar *dirname = g_dirname (plugin->current_editor_filename); anjuta/plugins/build-basic-autotools/plugin.c:1805: gchar *dirname = g_dirname (plugin->current_editor_filename); anjuta/plugins/build-basic-autotools/plugin.c:2245: dirname = g_dirname (bb_plugin->current_editor_filename); anjuta/plugins/build-basic-autotools/plugin.c:2248: module = escape_label (g_basename (dirname)); anjuta/plugins/build-basic-autotools/plugin.c:2249: filename = escape_label (g_basename (bb_plugin->current_editor_filename));
Created attachment 123176 [details] [review] build_basic First patch.
Created attachment 123179 [details] [review] valgrind Second patch.
Created attachment 123181 [details] [review] search Third patch
Created attachment 123182 [details] [review] search v2 Now should be ok.
(In reply to comment #4) > Created an attachment (id=123182) [edit] > search v2 > Now should be ok. Why do you use g_ascii_strncasecmp while g_ascii_strcasecmp exists ? Then, there is one use of g_strcmp0 which seems strange to me.
Created attachment 123330 [details] [review] search v3 You're right, I don't know why I used that func. Now it is fixed. I think the g_strcmp0 logic is ok, I just changed g_strcasecmp to a g_strcmp0 because the compared value is "".
You are really fast... I have committed your 2 first patches. There is an error in the second one though, because g_io_channel_shutdown has 3 arguments instead of one for g_io_channel_close.
(In reply to comment #7) > You are really fast... > > I have committed your 2 first patches. There is an error in the second one > though, because g_io_channel_shutdown has 3 arguments instead of one for > g_io_channel_close. > Sorry, as I do not have enabled the valgrind plugin I didn't test it.
Ok, I have committed your third patch with a small fix. Thanks for your patches.
I have removed the use of g_mem_chunk in the tools plugin.
I'm currently working on the project wizard...
I have searched the whole tree for remaining deprecated symbols, found and fixed a few of them. I have just committed the changes. I think this bug could be closed but I'm using a quite old version of Glib: 2.16. Is there someone, with a more recent version of Glib, that could check that all deprecated symbols have been removed ?
ii libglib2.0-0 2.19.5-0ubuntu3 The GLib library of C routines It builds perfect with: make CFLAGS+="-DG_DISABLE_DEPRECATED" I suppose it will not compile if you have that option enabled, I didn't have a look at the warnings. So if it gives errors instead of warnings there are no more deprecated funcs.
(In reply to comment #13) > ii libglib2.0-0 2.19.5-0ubuntu3 > The GLib library of C routines > > It builds perfect with: make CFLAGS+="-DG_DISABLE_DEPRECATED" > > I suppose it will not compile if you have that option enabled, I didn't have a > look at the warnings. So if it gives errors instead of warnings there are no > more deprecated funcs. I think you can always build but you will get errors when loading the plugin in Anjuta. Could you check that you can load all plugins ?
It seems I cannot run anjuta now, I am getting a crash in the symbol-db plugin. Sorry.
Is it due to my patch ? I haven't changed anything in symbol-db but we could have strange effect sometimes.
Sorry, it is not a bug in symbol-db, the bug report is: http://bugzilla.gnome.org/show_bug.cgi?id=569999 Seems a bug when loading the project. But maybe it is a bug in my unstable glib or something. Can you check it?
Do you still have the problem at start-up?
The bug I meant was this: #560857. Anyway I would close this as fixed.