From 0e53172e606f1a8857061cad638bed51fbcc6fb1 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sat, 23 Oct 2004 16:49:18 +0000 Subject: Annotate "if (type == 0)" in get_type functions with G_UNLIKELY, like the 2004-10-23 Christian Persch * embed/downloader-view.c: (downloader_view_get_type): * embed/ephy-command-manager.c: (ephy_command_manager_get_type): * embed/ephy-cookie-manager.c: (ephy_cookie_get_type), (ephy_cookie_manager_get_type): * embed/ephy-download.c: (ephy_download_get_type): * embed/ephy-embed-dialog.c: (ephy_embed_dialog_get_type): * embed/ephy-embed-event.c: (ephy_embed_event_get_type): * embed/ephy-embed-persist.c: (ephy_embed_persist_get_type): * embed/ephy-embed-shell.c: (ephy_embed_shell_get_type): * embed/ephy-embed-single.c: (ephy_embed_single_get_type): * embed/ephy-embed.c: (ephy_embed_get_type): * embed/ephy-encodings.c: (ephy_encodings_get_type): * embed/ephy-favicon-cache.c: (ephy_favicon_cache_get_type): * embed/ephy-history.c: (ephy_history_get_type): * embed/ephy-password-manager.c: (ephy_password_info_get_type), (ephy_password_manager_get_type): * embed/ephy-permission-manager.c: (ephy_permission_info_get_type), (ephy_permission_manager_get_type): * embed/find-dialog.c: (find_dialog_get_type): * embed/mozilla/mozilla-download.cpp: * embed/mozilla/mozilla-embed-event.cpp: * embed/mozilla/mozilla-embed-persist.cpp: * embed/mozilla/mozilla-embed-single.cpp: * embed/mozilla/mozilla-embed.cpp: * lib/egg/egg-editable-toolbar.c: (egg_editable_toolbar_get_type): * lib/egg/egg-toolbar-editor.c: (egg_toolbar_editor_get_type): * lib/egg/egg-toolbars-model.c: (egg_toolbars_model_get_type): * lib/ephy-dialog.c: (ephy_dialog_get_type): * lib/ephy-file-chooser.c: (ephy_file_chooser_get_type): * lib/ephy-loader.c: (ephy_loader_get_type): * lib/ephy-module.c: (ephy_module_get_type): * lib/ephy-node-db.c: (ephy_node_db_get_type): * lib/ephy-node-filter.c: (ephy_node_filter_get_type): * lib/ephy-shlib-loader.c: (ephy_shlib_loader_get_type): * lib/widgets/ephy-location-entry.c: (ephy_location_entry_get_type): * lib/widgets/ephy-node-view.c: (ephy_node_view_get_type): * lib/widgets/ephy-search-entry.c: (ephy_search_entry_get_type): * lib/widgets/ephy-spinner.c: (ephy_spinner_cache_get_type), (ephy_spinner_get_type): * lib/widgets/ephy-tree-model-node.c: (ephy_tree_model_node_get_type): * lib/widgets/ephy-tree-model-sort.c: (ephy_tree_model_sort_get_type): * lib/widgets/ephy-zoom-action.c: (ephy_zoom_action_get_type): * lib/widgets/ephy-zoom-control.c: (ephy_zoom_control_get_type): * src/bookmarks/ephy-bookmark-action.c: (ephy_bookmark_action_get_type): * src/bookmarks/ephy-bookmark-properties.c: (ephy_bookmark_properties_get_type): * src/bookmarks/ephy-bookmarks-editor.c: (ephy_bookmarks_editor_get_type): * src/bookmarks/ephy-bookmarks-menu.c: (ephy_bookmarks_menu_get_type): * src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_get_type): * src/bookmarks/ephy-bookmarksbar-model.c: (ephy_bookmarksbar_model_get_type): * src/bookmarks/ephy-bookmarksbar.c: (ephy_bookmarksbar_get_type): * src/bookmarks/ephy-favorites-menu.c: (ephy_favorites_menu_get_type): * src/bookmarks/ephy-new-bookmark.c: (ephy_new_bookmark_get_type): * src/bookmarks/ephy-topic-action.c: (ephy_topic_action_get_type): * src/bookmarks/ephy-topics-selector.c: (ephy_topics_selector_get_type): * src/ephy-completion-model.c: (ephy_completion_model_get_type): * src/ephy-encoding-dialog.c: (ephy_encoding_dialog_get_type): * src/ephy-encoding-menu.c: (ephy_encoding_menu_get_type): * src/ephy-extension.c: (ephy_extension_get_type): * src/ephy-extensions-manager.c: (ephy_extensions_manager_get_type): * src/ephy-favicon-action.c: (ephy_favicon_action_get_type): * src/ephy-go-action.c: (ephy_go_action_get_type): * src/ephy-history-window.c: (ephy_history_window_get_type): * src/ephy-location-action.c: (ephy_location_action_get_type): * src/ephy-navigation-action.c: (ephy_navigation_action_get_type): * src/ephy-notebook.c: (ephy_notebook_get_type): * src/ephy-session.c: (ephy_session_get_type): * src/ephy-shell.c: (ephy_shell_get_type): * src/ephy-statusbar.c: (ephy_statusbar_get_type): * src/ephy-tab.c: (ephy_tab_get_type): * src/ephy-tabs-menu.c: (ephy_tabs_menu_get_type): * src/ephy-toolbars-model.c: (ephy_toolbars_model_get_type): * src/ephy-window.c: (ephy_window_get_type): * src/pdm-dialog.c: (pdm_dialog_get_type): * src/ppview-toolbar.c: (ppview_toolbar_get_type): * src/prefs-dialog.c: (prefs_dialog_get_type): * src/toolbar.c: (toolbar_get_type): Annotate "if (type == 0)" in get_type functions with G_UNLIKELY, like the G_TYPE_DEFINE macros do. --- ChangeLog | 93 ++++++++++++++++++++++++++++++++ TODO | 12 +++++ embed/downloader-view.c | 12 ++--- embed/ephy-command-manager.c | 2 +- embed/ephy-cookie-manager.c | 4 +- embed/ephy-download.c | 12 ++--- embed/ephy-embed-dialog.c | 12 ++--- embed/ephy-embed-event.c | 2 +- embed/ephy-embed-persist.c | 2 +- embed/ephy-embed-shell.c | 2 +- embed/ephy-embed-single.c | 2 +- embed/ephy-embed.c | 13 +++-- embed/ephy-encodings.c | 12 ++--- embed/ephy-favicon-cache.c | 2 +- embed/ephy-history.c | 2 +- embed/ephy-password-manager.c | 4 +- embed/ephy-permission-manager.c | 4 +- embed/find-dialog.c | 12 ++--- embed/mozilla/mozilla-download.cpp | 22 ++++---- embed/mozilla/mozilla-embed-event.cpp | 2 +- embed/mozilla/mozilla-embed-persist.cpp | 13 +++-- embed/mozilla/mozilla-embed-single.cpp | 2 +- embed/mozilla/mozilla-embed.cpp | 18 +++---- lib/egg/egg-editable-toolbar.c | 12 ++--- lib/egg/egg-toolbar-editor.c | 12 ++--- lib/egg/egg-toolbars-model.c | 2 +- lib/ephy-dialog.c | 2 +- lib/ephy-file-chooser.c | 2 +- lib/ephy-loader.c | 2 +- lib/ephy-module.c | 2 +- lib/ephy-node-db.c | 16 +++--- lib/ephy-node-filter.c | 12 ++--- lib/ephy-shlib-loader.c | 2 +- lib/widgets/ephy-location-entry.c | 12 ++--- lib/widgets/ephy-node-view.c | 12 ++--- lib/widgets/ephy-search-entry.c | 12 ++--- lib/widgets/ephy-spinner.c | 4 +- lib/widgets/ephy-tree-model-node.c | 14 ++--- lib/widgets/ephy-tree-model-sort.c | 14 ++--- lib/widgets/ephy-zoom-action.c | 2 +- lib/widgets/ephy-zoom-control.c | 2 +- src/bookmarks/ephy-bookmark-action.c | 2 +- src/bookmarks/ephy-bookmark-properties.c | 12 ++--- src/bookmarks/ephy-bookmarks-editor.c | 12 ++--- src/bookmarks/ephy-bookmarks-menu.c | 2 +- src/bookmarks/ephy-bookmarks.c | 2 +- src/bookmarks/ephy-bookmarksbar-model.c | 2 +- src/bookmarks/ephy-bookmarksbar.c | 2 +- src/bookmarks/ephy-favorites-menu.c | 12 ++--- src/bookmarks/ephy-new-bookmark.c | 12 ++--- src/bookmarks/ephy-topic-action.c | 2 +- src/bookmarks/ephy-topics-selector.c | 2 +- src/ephy-completion-model.c | 14 ++--- src/ephy-encoding-dialog.c | 2 +- src/ephy-encoding-menu.c | 12 ++--- src/ephy-extension.c | 2 +- src/ephy-extensions-manager.c | 2 +- src/ephy-favicon-action.c | 2 +- src/ephy-go-action.c | 2 +- src/ephy-history-window.c | 12 ++--- src/ephy-location-action.c | 3 +- src/ephy-navigation-action.c | 2 +- src/ephy-notebook.c | 12 ++--- src/ephy-session.c | 2 +- src/ephy-shell.c | 2 +- src/ephy-statusbar.c | 2 +- src/ephy-tab.c | 12 ++--- src/ephy-tabs-menu.c | 12 ++--- src/ephy-toolbars-model.c | 2 +- src/ephy-window.c | 2 +- src/pdm-dialog.c | 2 +- src/ppview-toolbar.c | 2 +- src/prefs-dialog.c | 2 +- src/toolbar.c | 13 +++-- 74 files changed, 339 insertions(+), 238 deletions(-) diff --git a/ChangeLog b/ChangeLog index 064d14617..1c0a0ed06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,96 @@ +2004-10-23 Christian Persch + + * embed/downloader-view.c: (downloader_view_get_type): + * embed/ephy-command-manager.c: (ephy_command_manager_get_type): + * embed/ephy-cookie-manager.c: (ephy_cookie_get_type), + (ephy_cookie_manager_get_type): + * embed/ephy-download.c: (ephy_download_get_type): + * embed/ephy-embed-dialog.c: (ephy_embed_dialog_get_type): + * embed/ephy-embed-event.c: (ephy_embed_event_get_type): + * embed/ephy-embed-persist.c: (ephy_embed_persist_get_type): + * embed/ephy-embed-shell.c: (ephy_embed_shell_get_type): + * embed/ephy-embed-single.c: (ephy_embed_single_get_type): + * embed/ephy-embed.c: (ephy_embed_get_type): + * embed/ephy-encodings.c: (ephy_encodings_get_type): + * embed/ephy-favicon-cache.c: (ephy_favicon_cache_get_type): + * embed/ephy-history.c: (ephy_history_get_type): + * embed/ephy-password-manager.c: (ephy_password_info_get_type), + (ephy_password_manager_get_type): + * embed/ephy-permission-manager.c: (ephy_permission_info_get_type), + (ephy_permission_manager_get_type): + * embed/find-dialog.c: (find_dialog_get_type): + * embed/mozilla/mozilla-download.cpp: + * embed/mozilla/mozilla-embed-event.cpp: + * embed/mozilla/mozilla-embed-persist.cpp: + * embed/mozilla/mozilla-embed-single.cpp: + * embed/mozilla/mozilla-embed.cpp: + * lib/egg/egg-editable-toolbar.c: (egg_editable_toolbar_get_type): + * lib/egg/egg-toolbar-editor.c: (egg_toolbar_editor_get_type): + * lib/egg/egg-toolbars-model.c: (egg_toolbars_model_get_type): + * lib/ephy-dialog.c: (ephy_dialog_get_type): + * lib/ephy-file-chooser.c: (ephy_file_chooser_get_type): + * lib/ephy-loader.c: (ephy_loader_get_type): + * lib/ephy-module.c: (ephy_module_get_type): + * lib/ephy-node-db.c: (ephy_node_db_get_type): + * lib/ephy-node-filter.c: (ephy_node_filter_get_type): + * lib/ephy-shlib-loader.c: (ephy_shlib_loader_get_type): + * lib/widgets/ephy-location-entry.c: + (ephy_location_entry_get_type): + * lib/widgets/ephy-node-view.c: (ephy_node_view_get_type): + * lib/widgets/ephy-search-entry.c: (ephy_search_entry_get_type): + * lib/widgets/ephy-spinner.c: (ephy_spinner_cache_get_type), + (ephy_spinner_get_type): + * lib/widgets/ephy-tree-model-node.c: + (ephy_tree_model_node_get_type): + * lib/widgets/ephy-tree-model-sort.c: + (ephy_tree_model_sort_get_type): + * lib/widgets/ephy-zoom-action.c: (ephy_zoom_action_get_type): + * lib/widgets/ephy-zoom-control.c: (ephy_zoom_control_get_type): + * src/bookmarks/ephy-bookmark-action.c: + (ephy_bookmark_action_get_type): + * src/bookmarks/ephy-bookmark-properties.c: + (ephy_bookmark_properties_get_type): + * src/bookmarks/ephy-bookmarks-editor.c: + (ephy_bookmarks_editor_get_type): + * src/bookmarks/ephy-bookmarks-menu.c: + (ephy_bookmarks_menu_get_type): + * src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_get_type): + * src/bookmarks/ephy-bookmarksbar-model.c: + (ephy_bookmarksbar_model_get_type): + * src/bookmarks/ephy-bookmarksbar.c: (ephy_bookmarksbar_get_type): + * src/bookmarks/ephy-favorites-menu.c: + (ephy_favorites_menu_get_type): + * src/bookmarks/ephy-new-bookmark.c: (ephy_new_bookmark_get_type): + * src/bookmarks/ephy-topic-action.c: (ephy_topic_action_get_type): + * src/bookmarks/ephy-topics-selector.c: + (ephy_topics_selector_get_type): + * src/ephy-completion-model.c: (ephy_completion_model_get_type): + * src/ephy-encoding-dialog.c: (ephy_encoding_dialog_get_type): + * src/ephy-encoding-menu.c: (ephy_encoding_menu_get_type): + * src/ephy-extension.c: (ephy_extension_get_type): + * src/ephy-extensions-manager.c: + (ephy_extensions_manager_get_type): + * src/ephy-favicon-action.c: (ephy_favicon_action_get_type): + * src/ephy-go-action.c: (ephy_go_action_get_type): + * src/ephy-history-window.c: (ephy_history_window_get_type): + * src/ephy-location-action.c: (ephy_location_action_get_type): + * src/ephy-navigation-action.c: (ephy_navigation_action_get_type): + * src/ephy-notebook.c: (ephy_notebook_get_type): + * src/ephy-session.c: (ephy_session_get_type): + * src/ephy-shell.c: (ephy_shell_get_type): + * src/ephy-statusbar.c: (ephy_statusbar_get_type): + * src/ephy-tab.c: (ephy_tab_get_type): + * src/ephy-tabs-menu.c: (ephy_tabs_menu_get_type): + * src/ephy-toolbars-model.c: (ephy_toolbars_model_get_type): + * src/ephy-window.c: (ephy_window_get_type): + * src/pdm-dialog.c: (pdm_dialog_get_type): + * src/ppview-toolbar.c: (ppview_toolbar_get_type): + * src/prefs-dialog.c: (prefs_dialog_get_type): + * src/toolbar.c: (toolbar_get_type): + + Annotate "if (type == 0)" in get_type functions with G_UNLIKELY, + like the G_TYPE_DEFINE macros do. + 2004-10-23 Christian Persch * lib/widgets/ephy-node-view.c: (drag_data_received_cb): diff --git a/TODO b/TODO index a7cf6500e..e71968283 100644 --- a/TODO +++ b/TODO @@ -1 +1,13 @@ - Check that filtering is not done more than one time on bookmarks dialogs init + +- Annotate "if (type == 0)" in *_get_type() with G_UNLIKELY + + +Stuff to port to new glib/gtk+ APIs: + +- port egg-toolbar-editor to GtkIconView as soon as it supports DND (bug #150270) +- port to GOption +- port to new gtk+ uri-list DND APIs +- port Downloads directory button in prefs to GtkFileChooserButton + (but wait for bugs #154388, #154390, #154392, #154394) + diff --git a/embed/downloader-view.c b/embed/downloader-view.c index 56abd15c6..785a491ad 100644 --- a/embed/downloader-view.c +++ b/embed/downloader-view.c @@ -129,9 +129,9 @@ static GObjectClass *parent_class = NULL; GType downloader_view_get_type (void) { - static GType downloader_view_type = 0; + static GType type = 0; - if (downloader_view_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -146,12 +146,12 @@ downloader_view_get_type (void) (GInstanceInitFunc) downloader_view_init }; - downloader_view_type = g_type_register_static (EPHY_TYPE_DIALOG, - "DownloaderView", - &our_info, 0); + type = g_type_register_static (EPHY_TYPE_DIALOG, + "DownloaderView", + &our_info, 0); } - return downloader_view_type; + return type; } static void diff --git a/embed/ephy-command-manager.c b/embed/ephy-command-manager.c index 9161b7a8c..d2142710f 100644 --- a/embed/ephy-command-manager.c +++ b/embed/ephy-command-manager.c @@ -32,7 +32,7 @@ ephy_command_manager_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/embed/ephy-cookie-manager.c b/embed/ephy-cookie-manager.c index fe0e26f83..ca2f093cf 100644 --- a/embed/ephy-cookie-manager.c +++ b/embed/ephy-cookie-manager.c @@ -30,7 +30,7 @@ ephy_cookie_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { type = g_boxed_type_register_static ("EphyCookie", (GBoxedCopyFunc) ephy_cookie_copy, @@ -105,7 +105,7 @@ ephy_cookie_manager_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/embed/ephy-download.c b/embed/ephy-download.c index b78fef143..612a506a4 100644 --- a/embed/ephy-download.c +++ b/embed/ephy-download.c @@ -54,9 +54,9 @@ static guint ephy_download_signals[LAST_SIGNAL] = { 0 }; GType ephy_download_get_type (void) { - static GType ephy_download_type = 0; + static GType type = 0; - if (ephy_download_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -71,12 +71,12 @@ ephy_download_get_type (void) (GInstanceInitFunc) ephy_download_init }; - ephy_download_type = g_type_register_static (G_TYPE_OBJECT, - "EphyDownload", - &our_info, 0); + type = g_type_register_static (G_TYPE_OBJECT, + "EphyDownload", + &our_info, 0); } - return ephy_download_type; + return type; } static void diff --git a/embed/ephy-embed-dialog.c b/embed/ephy-embed-dialog.c index 79c9a8836..85e7069ea 100644 --- a/embed/ephy-embed-dialog.c +++ b/embed/ephy-embed-dialog.c @@ -59,9 +59,9 @@ static GObjectClass *parent_class = NULL; GType ephy_embed_dialog_get_type (void) { - static GType ephy_embed_dialog_type = 0; + static GType type = 0; - if (ephy_embed_dialog_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -76,12 +76,12 @@ ephy_embed_dialog_get_type (void) (GInstanceInitFunc) ephy_embed_dialog_init }; - ephy_embed_dialog_type = g_type_register_static (EPHY_TYPE_DIALOG, - "EphyEmbedDialog", - &our_info, 0); + type = g_type_register_static (EPHY_TYPE_DIALOG, + "EphyEmbedDialog", + &our_info, 0); } - return ephy_embed_dialog_type; + return type; } static void diff --git a/embed/ephy-embed-event.c b/embed/ephy-embed-event.c index d0243a111..cde54eb84 100644 --- a/embed/ephy-embed-event.c +++ b/embed/ephy-embed-event.c @@ -34,7 +34,7 @@ ephy_embed_event_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/embed/ephy-embed-persist.c b/embed/ephy-embed-persist.c index 48eeb2a30..aeee7584d 100644 --- a/embed/ephy-embed-persist.c +++ b/embed/ephy-embed-persist.c @@ -65,7 +65,7 @@ ephy_embed_persist_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c index 1bb7c637d..8ff0c9c2a 100644 --- a/embed/ephy-embed-shell.c +++ b/embed/ephy-embed-shell.c @@ -61,7 +61,7 @@ ephy_embed_shell_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/embed/ephy-embed-single.c b/embed/ephy-embed-single.c index 22765f738..75defacb8 100644 --- a/embed/ephy-embed-single.c +++ b/embed/ephy-embed-single.c @@ -32,7 +32,7 @@ ephy_embed_single_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c index 76e8ea0c8..6d3cce0fb 100644 --- a/embed/ephy-embed.c +++ b/embed/ephy-embed.c @@ -55,9 +55,9 @@ ephy_embed_chrome_get_type (void) GType ephy_embed_get_type (void) { - static GType ephy_embed_type = 0; + static GType type = 0; - if (ephy_embed_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -66,13 +66,12 @@ ephy_embed_get_type (void) NULL, }; - ephy_embed_type = g_type_register_static (G_TYPE_INTERFACE, - "EphyEmbed", - &our_info, - (GTypeFlags)0); + type = g_type_register_static (G_TYPE_INTERFACE, + "EphyEmbed", + &our_info, (GTypeFlags)0); } - return ephy_embed_type; + return type; } static void diff --git a/embed/ephy-encodings.c b/embed/ephy-encodings.c index 868391c29..bfe640417 100644 --- a/embed/ephy-encodings.c +++ b/embed/ephy-encodings.c @@ -174,9 +174,9 @@ static GObjectClass *parent_class = NULL; GType ephy_encodings_get_type (void) { - static GType ephy_encodings_type = 0; + static GType type = 0; - if (ephy_encodings_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -191,12 +191,12 @@ ephy_encodings_get_type (void) (GInstanceInitFunc) ephy_encodings_init }; - ephy_encodings_type = g_type_register_static (G_TYPE_OBJECT, - "EphyEncodings", - &our_info, 0); + type = g_type_register_static (G_TYPE_OBJECT, + "EphyEncodings", + &our_info, 0); } - return ephy_encodings_type; + return type; } static void diff --git a/embed/ephy-favicon-cache.c b/embed/ephy-favicon-cache.c index 29d41d2fb..d381afae8 100644 --- a/embed/ephy-favicon-cache.c +++ b/embed/ephy-favicon-cache.c @@ -82,7 +82,7 @@ ephy_favicon_cache_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/embed/ephy-history.c b/embed/ephy-history.c index 3b19776cf..9a28af8e3 100644 --- a/embed/ephy-history.c +++ b/embed/ephy-history.c @@ -88,7 +88,7 @@ ephy_history_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/embed/ephy-password-manager.c b/embed/ephy-password-manager.c index c0f1e7838..6a8c3e34e 100644 --- a/embed/ephy-password-manager.c +++ b/embed/ephy-password-manager.c @@ -34,7 +34,7 @@ ephy_password_info_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { type = g_boxed_type_register_static ("EphyPasswordInfo", (GBoxedCopyFunc) ephy_password_info_copy, @@ -113,7 +113,7 @@ ephy_password_manager_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/embed/ephy-permission-manager.c b/embed/ephy-permission-manager.c index 7d7626cb7..c06f11107 100644 --- a/embed/ephy-permission-manager.c +++ b/embed/ephy-permission-manager.c @@ -34,7 +34,7 @@ ephy_permission_info_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { type = g_boxed_type_register_static ("EphyPermissionInfo", (GBoxedCopyFunc) ephy_permission_info_copy, @@ -109,7 +109,7 @@ ephy_permission_manager_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/embed/find-dialog.c b/embed/find-dialog.c index 861372e47..1c9624da3 100755 --- a/embed/find-dialog.c +++ b/embed/find-dialog.c @@ -82,9 +82,9 @@ EphyDialogProperty properties [] = GType find_dialog_get_type (void) { - static GType find_dialog_type = 0; + static GType type = 0; - if (find_dialog_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -99,12 +99,12 @@ find_dialog_get_type (void) (GInstanceInitFunc) find_dialog_init }; - find_dialog_type = g_type_register_static (EPHY_TYPE_EMBED_DIALOG, - "FindDialog", - &our_info, 0); + type = g_type_register_static (EPHY_TYPE_EMBED_DIALOG, + "FindDialog", + &our_info, 0); } - return find_dialog_type; + return type; } diff --git a/embed/mozilla/mozilla-download.cpp b/embed/mozilla/mozilla-download.cpp index 9360de066..48d05ecb2 100644 --- a/embed/mozilla/mozilla-download.cpp +++ b/embed/mozilla/mozilla-download.cpp @@ -31,12 +31,9 @@ #include #include -static void -mozilla_download_class_init (MozillaDownloadClass *klass); -static void -mozilla_download_init (MozillaDownload *ges); -static void -mozilla_download_finalize (GObject *object); +static void mozilla_download_class_init (MozillaDownloadClass *klass); +static void mozilla_download_init (MozillaDownload *ges); +static void mozilla_download_finalize (GObject *object); enum { @@ -56,9 +53,9 @@ static GObjectClass *parent_class = NULL; GType mozilla_download_get_type (void) { - static GType mozilla_download_type = 0; + static GType type = 0; - if (mozilla_download_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -73,13 +70,12 @@ mozilla_download_get_type (void) (GInstanceInitFunc) mozilla_download_init }; - mozilla_download_type = - g_type_register_static (EPHY_TYPE_DOWNLOAD, - "MozillaDownload", - &our_info, (GTypeFlags)0); + type = g_type_register_static (EPHY_TYPE_DOWNLOAD, + "MozillaDownload", + &our_info, (GTypeFlags)0); } - return mozilla_download_type; + return type; } static char * diff --git a/embed/mozilla/mozilla-embed-event.cpp b/embed/mozilla/mozilla-embed-event.cpp index bca81e286..d7a4b685c 100644 --- a/embed/mozilla/mozilla-embed-event.cpp +++ b/embed/mozilla/mozilla-embed-event.cpp @@ -54,7 +54,7 @@ mozilla_embed_event_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/embed/mozilla/mozilla-embed-persist.cpp b/embed/mozilla/mozilla-embed-persist.cpp index fff6b88e9..4a375abd9 100644 --- a/embed/mozilla/mozilla-embed-persist.cpp +++ b/embed/mozilla/mozilla-embed-persist.cpp @@ -62,9 +62,9 @@ static GObjectClass *parent_class = NULL; GType mozilla_embed_persist_get_type (void) { - static GType mozilla_embed_persist_type = 0; + static GType type = 0; - if (mozilla_embed_persist_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -79,13 +79,12 @@ mozilla_embed_persist_get_type (void) (GInstanceInitFunc) mozilla_embed_persist_init }; - mozilla_embed_persist_type = - g_type_register_static (EPHY_TYPE_EMBED_PERSIST, - "MozillaEmbedPersist", - &our_info, (GTypeFlags)0); + type = g_type_register_static (EPHY_TYPE_EMBED_PERSIST, + "MozillaEmbedPersist", + &our_info, (GTypeFlags) 0); } - return mozilla_embed_persist_type; + return type; } static void diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index 756c3c4b5..94cba3dee 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -119,7 +119,7 @@ mozilla_embed_single_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp index bf71f361e..f5652be5c 100644 --- a/embed/mozilla/mozilla-embed.cpp +++ b/embed/mozilla/mozilla-embed.cpp @@ -128,9 +128,9 @@ ephy_command_manager_iface_init (EphyCommandManagerIface *iface) GType mozilla_embed_get_type (void) { - static GType mozilla_embed_type = 0; + static GType type = 0; - if (mozilla_embed_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -159,19 +159,19 @@ mozilla_embed_get_type (void) NULL }; - mozilla_embed_type = g_type_register_static (GTK_TYPE_MOZ_EMBED, - "MozillaEmbed", - &our_info, - (GTypeFlags)0); - g_type_add_interface_static (mozilla_embed_type, + type = g_type_register_static (GTK_TYPE_MOZ_EMBED, + "MozillaEmbed", + &our_info, + (GTypeFlags)0); + g_type_add_interface_static (type, EPHY_TYPE_EMBED, &embed_info); - g_type_add_interface_static (mozilla_embed_type, + g_type_add_interface_static (type, EPHY_TYPE_COMMAND_MANAGER, &ephy_command_manager_info); } - return mozilla_embed_type; + return type; } static gboolean diff --git a/lib/egg/egg-editable-toolbar.c b/lib/egg/egg-editable-toolbar.c index 02791ee86..0e7bc7d5e 100755 --- a/lib/egg/egg-editable-toolbar.c +++ b/lib/egg/egg-editable-toolbar.c @@ -90,9 +90,9 @@ struct EggEditableToolbarPrivate GType egg_editable_toolbar_get_type (void) { - static GType egg_editable_toolbar_type = 0; + static GType type = 0; - if (egg_editable_toolbar_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { sizeof (EggEditableToolbarClass), @@ -106,12 +106,12 @@ egg_editable_toolbar_get_type (void) (GInstanceInitFunc) egg_editable_toolbar_init }; - egg_editable_toolbar_type = g_type_register_static (GTK_TYPE_VBOX, - "EggEditableToolbar", - &our_info, 0); + type = g_type_register_static (GTK_TYPE_VBOX, + "EggEditableToolbar", + &our_info, 0); } - return egg_editable_toolbar_type; + return type; } static int diff --git a/lib/egg/egg-toolbar-editor.c b/lib/egg/egg-toolbar-editor.c index f3ba1e94d..0187188ff 100755 --- a/lib/egg/egg-toolbar-editor.c +++ b/lib/egg/egg-toolbar-editor.c @@ -75,9 +75,9 @@ struct EggToolbarEditorPrivate GType egg_toolbar_editor_get_type (void) { - static GType egg_toolbar_editor_type = 0; + static GType type = 0; - if (egg_toolbar_editor_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { sizeof (EggToolbarEditorClass), @@ -91,12 +91,12 @@ egg_toolbar_editor_get_type (void) (GInstanceInitFunc) egg_toolbar_editor_init }; - egg_toolbar_editor_type = g_type_register_static (GTK_TYPE_VBOX, - "EggToolbarEditor", - &our_info, 0); + type = g_type_register_static (GTK_TYPE_VBOX, + "EggToolbarEditor", + &our_info, 0); } - return egg_toolbar_editor_type; + return type; } static gint diff --git a/lib/egg/egg-toolbars-model.c b/lib/egg/egg-toolbars-model.c index 8da9908cd..0d91878e7 100755 --- a/lib/egg/egg-toolbars-model.c +++ b/lib/egg/egg-toolbars-model.c @@ -77,7 +77,7 @@ egg_toolbars_model_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { sizeof (EggToolbarsModelClass), diff --git a/lib/ephy-dialog.c b/lib/ephy-dialog.c index 234680c4b..60136c082 100644 --- a/lib/ephy-dialog.c +++ b/lib/ephy-dialog.c @@ -112,7 +112,7 @@ ephy_dialog_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/lib/ephy-file-chooser.c b/lib/ephy-file-chooser.c index 156937509..fc0fcf7fa 100644 --- a/lib/ephy-file-chooser.c +++ b/lib/ephy-file-chooser.c @@ -56,7 +56,7 @@ ephy_file_chooser_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/lib/ephy-loader.c b/lib/ephy-loader.c index cbd19fce9..d4b1a0375 100644 --- a/lib/ephy-loader.c +++ b/lib/ephy-loader.c @@ -30,7 +30,7 @@ ephy_loader_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/lib/ephy-module.c b/lib/ephy-module.c index 60c96f1f2..95f9a587e 100644 --- a/lib/ephy-module.c +++ b/lib/ephy-module.c @@ -58,7 +58,7 @@ ephy_module_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo type_info = { diff --git a/lib/ephy-node-db.c b/lib/ephy-node-db.c index 0eaf92755..27e27073b 100644 --- a/lib/ephy-node-db.c +++ b/lib/ephy-node-db.c @@ -67,10 +67,12 @@ static GObjectClass *parent_class = NULL; GType ephy_node_db_get_type (void) { - static GType ephy_node_db_type = 0; + static GType type = 0; - if (ephy_node_db_type == 0) { - static const GTypeInfo our_info = { + if (G_UNLIKELY (type == 0)) + { + static const GTypeInfo our_info = + { sizeof (EphyNodeDbClass), NULL, NULL, @@ -82,12 +84,12 @@ ephy_node_db_get_type (void) (GInstanceInitFunc) ephy_node_db_init }; - ephy_node_db_type = g_type_register_static (G_TYPE_OBJECT, - "EphyNodeDb", - &our_info, 0); + type = g_type_register_static (G_TYPE_OBJECT, + "EphyNodeDb", + &our_info, 0); } - return ephy_node_db_type; + return type; } static void diff --git a/lib/ephy-node-filter.c b/lib/ephy-node-filter.c index 229f99ad7..fd270b636 100644 --- a/lib/ephy-node-filter.c +++ b/lib/ephy-node-filter.c @@ -81,9 +81,9 @@ static guint ephy_node_filter_signals[LAST_SIGNAL] = { 0 }; GType ephy_node_filter_get_type (void) { - static GType ephy_node_filter_type = 0; + static GType type = 0; - if (ephy_node_filter_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -98,12 +98,12 @@ ephy_node_filter_get_type (void) (GInstanceInitFunc) ephy_node_filter_init }; - ephy_node_filter_type = g_type_register_static (G_TYPE_OBJECT, - "EphyNodeFilter", - &our_info, 0); + type = g_type_register_static (G_TYPE_OBJECT, + "EphyNodeFilter", + &our_info, 0); } - return ephy_node_filter_type; + return type; } static void diff --git a/lib/ephy-shlib-loader.c b/lib/ephy-shlib-loader.c index 68276bb67..8c6db15b0 100644 --- a/lib/ephy-shlib-loader.c +++ b/lib/ephy-shlib-loader.c @@ -58,7 +58,7 @@ ephy_shlib_loader_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c index 08d591bf7..2ff40840d 100644 --- a/lib/widgets/ephy-location-entry.c +++ b/lib/widgets/ephy-location-entry.c @@ -93,9 +93,9 @@ enum GType ephy_location_entry_get_type (void) { - static GType ephy_location_entry_type = 0; + static GType type = 0; - if (ephy_location_entry_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -110,12 +110,12 @@ ephy_location_entry_get_type (void) (GInstanceInitFunc) ephy_location_entry_init }; - ephy_location_entry_type = g_type_register_static (GTK_TYPE_TOOL_ITEM, - "EphyLocationEntry", - &our_info, 0); + type = g_type_register_static (GTK_TYPE_TOOL_ITEM, + "EphyLocationEntry", + &our_info, 0); } - return ephy_location_entry_type; + return type; } static gboolean diff --git a/lib/widgets/ephy-node-view.c b/lib/widgets/ephy-node-view.c index e71b648b0..a67709e9b 100644 --- a/lib/widgets/ephy-node-view.c +++ b/lib/widgets/ephy-node-view.c @@ -111,9 +111,9 @@ static guint ephy_node_view_signals[LAST_SIGNAL] = { 0 }; GType ephy_node_view_get_type (void) { - static GType ephy_node_view_type = 0; + static GType type = 0; - if (ephy_node_view_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -128,12 +128,12 @@ ephy_node_view_get_type (void) (GInstanceInitFunc) ephy_node_view_init }; - ephy_node_view_type = g_type_register_static (GTK_TYPE_TREE_VIEW, - "EphyNodeView", - &our_info, 0); + type = g_type_register_static (GTK_TYPE_TREE_VIEW, + "EphyNodeView", + &our_info, 0); } - return ephy_node_view_type; + return type; } static void diff --git a/lib/widgets/ephy-search-entry.c b/lib/widgets/ephy-search-entry.c index 2d0318774..bb84a323c 100644 --- a/lib/widgets/ephy-search-entry.c +++ b/lib/widgets/ephy-search-entry.c @@ -53,9 +53,9 @@ static guint ephy_search_entry_signals[LAST_SIGNAL] = { 0 }; GType ephy_search_entry_get_type (void) { - static GType ephy_search_entry_type = 0; + static GType type = 0; - if (ephy_search_entry_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -70,12 +70,12 @@ ephy_search_entry_get_type (void) (GInstanceInitFunc) ephy_search_entry_init }; - ephy_search_entry_type = g_type_register_static (GTK_TYPE_ENTRY, - "EphySearchEntry", - &our_info, 0); + type = g_type_register_static (GTK_TYPE_ENTRY, + "EphySearchEntry", + &our_info, 0); } - return ephy_search_entry_type; + return type; } static void diff --git a/lib/widgets/ephy-spinner.c b/lib/widgets/ephy-spinner.c index d2b09bd37..ab98dc4cb 100644 --- a/lib/widgets/ephy-spinner.c +++ b/lib/widgets/ephy-spinner.c @@ -95,7 +95,7 @@ ephy_spinner_cache_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -474,7 +474,7 @@ ephy_spinner_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/lib/widgets/ephy-tree-model-node.c b/lib/widgets/ephy-tree-model-node.c index 62377c664..60355eaf7 100644 --- a/lib/widgets/ephy-tree-model-node.c +++ b/lib/widgets/ephy-tree-model-node.c @@ -67,9 +67,9 @@ static GObjectClass *parent_class = NULL; GType ephy_tree_model_node_get_type (void) { - static GType ephy_tree_model_node_type = 0; + static GType type = 0; - if (ephy_tree_model_node_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -91,16 +91,16 @@ ephy_tree_model_node_get_type (void) NULL }; - ephy_tree_model_node_type = g_type_register_static (G_TYPE_OBJECT, - "EphyTreeModelNode", - &our_info, 0); + type = g_type_register_static (G_TYPE_OBJECT, + "EphyTreeModelNode", + &our_info, 0); - g_type_add_interface_static (ephy_tree_model_node_type, + g_type_add_interface_static (type, GTK_TYPE_TREE_MODEL, &tree_model_info); } - return ephy_tree_model_node_type; + return type; } static void diff --git a/lib/widgets/ephy-tree-model-sort.c b/lib/widgets/ephy-tree-model-sort.c index 6803be38e..df5f9533c 100644 --- a/lib/widgets/ephy-tree-model-sort.c +++ b/lib/widgets/ephy-tree-model-sort.c @@ -58,9 +58,9 @@ static GObjectClass *parent_class = NULL; GType ephy_tree_model_sort_get_type (void) { - static GType ephy_tree_model_sort_type = 0; + static GType type = 0; - if (ephy_tree_model_sort_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -81,16 +81,16 @@ ephy_tree_model_sort_get_type (void) NULL }; - ephy_tree_model_sort_type = g_type_register_static (GTK_TYPE_TREE_MODEL_SORT, - "EphyTreeModelSort", - &our_info, 0); + type = g_type_register_static (GTK_TYPE_TREE_MODEL_SORT, + "EphyTreeModelSort", + &our_info, 0); - g_type_add_interface_static (ephy_tree_model_sort_type, + g_type_add_interface_static (type, EGG_TYPE_TREE_MULTI_DRAG_SOURCE, &multi_drag_source_info); } - return ephy_tree_model_sort_type; + return type; } static void diff --git a/lib/widgets/ephy-zoom-action.c b/lib/widgets/ephy-zoom-action.c index 5a55f60b0..fcda19f2f 100644 --- a/lib/widgets/ephy-zoom-action.c +++ b/lib/widgets/ephy-zoom-action.c @@ -66,7 +66,7 @@ ephy_zoom_action_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/lib/widgets/ephy-zoom-control.c b/lib/widgets/ephy-zoom-control.c index c9c3bfaff..15d7bcda3 100644 --- a/lib/widgets/ephy-zoom-control.c +++ b/lib/widgets/ephy-zoom-control.c @@ -65,7 +65,7 @@ ephy_zoom_control_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c index 6a3f2dc02..5cc97b949 100644 --- a/src/bookmarks/ephy-bookmark-action.c +++ b/src/bookmarks/ephy-bookmark-action.c @@ -94,7 +94,7 @@ ephy_bookmark_action_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo type_info = { diff --git a/src/bookmarks/ephy-bookmark-properties.c b/src/bookmarks/ephy-bookmark-properties.c index 65ef5044b..d95f2412b 100644 --- a/src/bookmarks/ephy-bookmark-properties.c +++ b/src/bookmarks/ephy-bookmark-properties.c @@ -79,9 +79,9 @@ static GObjectClass *parent_class = NULL; GType ephy_bookmark_properties_get_type (void) { - static GType ephy_bookmark_properties_type = 0; + static GType type = 0; - if (ephy_bookmark_properties_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -96,12 +96,12 @@ ephy_bookmark_properties_get_type (void) (GInstanceInitFunc) ephy_bookmark_properties_init }; - ephy_bookmark_properties_type = g_type_register_static (GTK_TYPE_DIALOG, - "EphyBookmarkProperties", - &our_info, 0); + type = g_type_register_static (GTK_TYPE_DIALOG, + "EphyBookmarkProperties", + &our_info, 0); } - return ephy_bookmark_properties_type; + return type; } static void diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c index c447cb65b..be69f1dfd 100644 --- a/src/bookmarks/ephy-bookmarks-editor.c +++ b/src/bookmarks/ephy-bookmarks-editor.c @@ -849,9 +849,9 @@ cmd_view_columns (GtkAction *action, GType ephy_bookmarks_editor_get_type (void) { - static GType ephy_bookmarks_editor_type = 0; + static GType type = 0; - if (ephy_bookmarks_editor_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -866,12 +866,12 @@ ephy_bookmarks_editor_get_type (void) (GInstanceInitFunc) ephy_bookmarks_editor_init }; - ephy_bookmarks_editor_type = g_type_register_static (GTK_TYPE_WINDOW, - "EphyBookmarksEditor", - &our_info, 0); + type = g_type_register_static (GTK_TYPE_WINDOW, + "EphyBookmarksEditor", + &our_info, 0); } - return ephy_bookmarks_editor_type; + return type; } static void diff --git a/src/bookmarks/ephy-bookmarks-menu.c b/src/bookmarks/ephy-bookmarks-menu.c index 62adeb395..ee76e5f98 100644 --- a/src/bookmarks/ephy-bookmarks-menu.c +++ b/src/bookmarks/ephy-bookmarks-menu.c @@ -88,7 +88,7 @@ ephy_bookmarks_menu_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c index ff351272d..2e6c0ca9a 100644 --- a/src/bookmarks/ephy-bookmarks.c +++ b/src/bookmarks/ephy-bookmarks.c @@ -122,7 +122,7 @@ ephy_bookmarks_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/src/bookmarks/ephy-bookmarksbar-model.c b/src/bookmarks/ephy-bookmarksbar-model.c index 0bbcad7c5..abe7dd16f 100755 --- a/src/bookmarks/ephy-bookmarksbar-model.c +++ b/src/bookmarks/ephy-bookmarksbar-model.c @@ -70,7 +70,7 @@ ephy_bookmarksbar_model_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { sizeof (EphyBookmarksBarModelClass), diff --git a/src/bookmarks/ephy-bookmarksbar.c b/src/bookmarks/ephy-bookmarksbar.c index 519244ecb..91026bd71 100644 --- a/src/bookmarks/ephy-bookmarksbar.c +++ b/src/bookmarks/ephy-bookmarksbar.c @@ -74,7 +74,7 @@ ephy_bookmarksbar_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/src/bookmarks/ephy-favorites-menu.c b/src/bookmarks/ephy-favorites-menu.c index 7a30f46a0..6dedfde1b 100644 --- a/src/bookmarks/ephy-favorites-menu.c +++ b/src/bookmarks/ephy-favorites-menu.c @@ -57,9 +57,9 @@ static gpointer parent_class; GType ephy_favorites_menu_get_type (void) { - static GType ephy_favorites_menu_type = 0; + static GType type = 0; - if (ephy_favorites_menu_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -74,11 +74,11 @@ ephy_favorites_menu_get_type (void) (GInstanceInitFunc) ephy_favorites_menu_init }; - ephy_favorites_menu_type = g_type_register_static (G_TYPE_OBJECT, - "EphyFavoritesMenu", - &our_info, 0); + type = g_type_register_static (G_TYPE_OBJECT, + "EphyFavoritesMenu", + &our_info, 0); } - return ephy_favorites_menu_type; + return type; } static void diff --git a/src/bookmarks/ephy-new-bookmark.c b/src/bookmarks/ephy-new-bookmark.c index 142a2505d..9592f686e 100644 --- a/src/bookmarks/ephy-new-bookmark.c +++ b/src/bookmarks/ephy-new-bookmark.c @@ -83,9 +83,9 @@ static GObjectClass *parent_class = NULL; GType ephy_new_bookmark_get_type (void) { - static GType ephy_new_bookmark_type = 0; + static GType type = 0; - if (ephy_new_bookmark_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -100,12 +100,12 @@ ephy_new_bookmark_get_type (void) (GInstanceInitFunc) ephy_new_bookmark_init }; - ephy_new_bookmark_type = g_type_register_static (GTK_TYPE_DIALOG, - "EphyNewBookmark", - &our_info, 0); + type = g_type_register_static (GTK_TYPE_DIALOG, + "EphyNewBookmark", + &our_info, 0); } - return ephy_new_bookmark_type; + return type; } static void diff --git a/src/bookmarks/ephy-topic-action.c b/src/bookmarks/ephy-topic-action.c index 601bd11f8..c002377f5 100644 --- a/src/bookmarks/ephy-topic-action.c +++ b/src/bookmarks/ephy-topic-action.c @@ -84,7 +84,7 @@ ephy_topic_action_get_type (void) { static GType type = 0; - if (!type) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo type_info = { diff --git a/src/bookmarks/ephy-topics-selector.c b/src/bookmarks/ephy-topics-selector.c index 561fd9799..01aca9a41 100644 --- a/src/bookmarks/ephy-topics-selector.c +++ b/src/bookmarks/ephy-topics-selector.c @@ -54,7 +54,7 @@ ephy_topics_selector_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/src/ephy-completion-model.c b/src/ephy-completion-model.c index 6b839aaed..6a0966ba6 100644 --- a/src/ephy-completion-model.c +++ b/src/ephy-completion-model.c @@ -51,9 +51,9 @@ static GObjectClass *parent_class = NULL; GType ephy_completion_model_get_type (void) { - static GType ephy_completion_model_type = 0; + static GType type = 0; - if (ephy_completion_model_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -75,16 +75,16 @@ ephy_completion_model_get_type (void) NULL }; - ephy_completion_model_type = g_type_register_static (G_TYPE_OBJECT, - "EphyCompletionModel", - &our_info, 0); + type = g_type_register_static (G_TYPE_OBJECT, + "EphyCompletionModel", + &our_info, 0); - g_type_add_interface_static (ephy_completion_model_type, + g_type_add_interface_static (type, GTK_TYPE_TREE_MODEL, &tree_model_info); } - return ephy_completion_model_type; + return type; } static void diff --git a/src/ephy-encoding-dialog.c b/src/ephy-encoding-dialog.c index 3f6cae00b..dbc43262a 100644 --- a/src/ephy-encoding-dialog.c +++ b/src/ephy-encoding-dialog.c @@ -86,7 +86,7 @@ ephy_encoding_dialog_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/src/ephy-encoding-menu.c b/src/ephy-encoding-menu.c index dc2197278..e2a10a014 100644 --- a/src/ephy-encoding-menu.c +++ b/src/ephy-encoding-menu.c @@ -70,9 +70,9 @@ static GObjectClass *parent_class = NULL; GType ephy_encoding_menu_get_type (void) { - static GType ephy_encoding_menu_type = 0; + static GType type = 0; - if (ephy_encoding_menu_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -87,12 +87,12 @@ ephy_encoding_menu_get_type (void) (GInstanceInitFunc) ephy_encoding_menu_init }; - ephy_encoding_menu_type = g_type_register_static (G_TYPE_OBJECT, - "EphyEncodingMenu", - &our_info, 0); + type = g_type_register_static (G_TYPE_OBJECT, + "EphyEncodingMenu", + &our_info, 0); } - return ephy_encoding_menu_type; + return type; } static void diff --git a/src/ephy-extension.c b/src/ephy-extension.c index 144104eee..15f27d5cf 100644 --- a/src/ephy-extension.c +++ b/src/ephy-extension.c @@ -30,7 +30,7 @@ ephy_extension_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/src/ephy-extensions-manager.c b/src/ephy-extensions-manager.c index c68d90dde..f39283abe 100644 --- a/src/ephy-extensions-manager.c +++ b/src/ephy-extensions-manager.c @@ -103,7 +103,7 @@ ephy_extensions_manager_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/src/ephy-favicon-action.c b/src/ephy-favicon-action.c index 1952fd6f7..0951b1ede 100644 --- a/src/ephy-favicon-action.c +++ b/src/ephy-favicon-action.c @@ -71,7 +71,7 @@ ephy_favicon_action_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo type_info = { diff --git a/src/ephy-go-action.c b/src/ephy-go-action.c index 449b85367..74fc2fdb5 100644 --- a/src/ephy-go-action.c +++ b/src/ephy-go-action.c @@ -39,7 +39,7 @@ ephy_go_action_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo type_info = { diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c index cdf89af1a..bfcb06a50 100644 --- a/src/ephy-history-window.c +++ b/src/ephy-history-window.c @@ -598,9 +598,9 @@ cmd_view_columns (GtkAction *action, GType ephy_history_window_get_type (void) { - static GType ephy_history_window_type = 0; + static GType type = 0; - if (ephy_history_window_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -615,12 +615,12 @@ ephy_history_window_get_type (void) (GInstanceInitFunc) ephy_history_window_init }; - ephy_history_window_type = g_type_register_static (GTK_TYPE_WINDOW, - "EphyHistoryWindow", - &our_info, 0); + type = g_type_register_static (GTK_TYPE_WINDOW, + "EphyHistoryWindow", + &our_info, 0); } - return ephy_history_window_type; + return type; } static void diff --git a/src/ephy-location-action.c b/src/ephy-location-action.c index ef7c31eb8..bfb3440bf 100644 --- a/src/ephy-location-action.c +++ b/src/ephy-location-action.c @@ -74,7 +74,7 @@ ephy_location_action_get_type (void) { static GType type = 0; - if (!type) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo type_info = { @@ -93,6 +93,7 @@ ephy_location_action_get_type (void) "EphyLocationAction", &type_info, 0); } + return type; } diff --git a/src/ephy-navigation-action.c b/src/ephy-navigation-action.c index 77ac1acbb..c49e4b78b 100644 --- a/src/ephy-navigation-action.c +++ b/src/ephy-navigation-action.c @@ -68,7 +68,7 @@ ephy_navigation_action_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo type_info = { diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c index 049eda9ab..f3f39011c 100644 --- a/src/ephy-notebook.c +++ b/src/ephy-notebook.c @@ -106,9 +106,9 @@ static GObjectClass *parent_class = NULL; GType ephy_notebook_get_type (void) { - static GType ephy_notebook_type = 0; + static GType type = 0; - if (ephy_notebook_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -123,12 +123,12 @@ ephy_notebook_get_type (void) (GInstanceInitFunc) ephy_notebook_init }; - ephy_notebook_type = g_type_register_static (GTK_TYPE_NOTEBOOK, - "EphyNotebook", - &our_info, 0); + type = g_type_register_static (GTK_TYPE_NOTEBOOK, + "EphyNotebook", + &our_info, 0); } - return ephy_notebook_type; + return type; } static void diff --git a/src/ephy-session.c b/src/ephy-session.c index c82dccb96..468aae087 100644 --- a/src/ephy-session.c +++ b/src/ephy-session.c @@ -80,7 +80,7 @@ ephy_session_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/src/ephy-shell.c b/src/ephy-shell.c index 1e049bb3b..9703ac719 100644 --- a/src/ephy-shell.c +++ b/src/ephy-shell.c @@ -101,7 +101,7 @@ ephy_shell_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/src/ephy-statusbar.c b/src/ephy-statusbar.c index 697af416d..033a1d28c 100755 --- a/src/ephy-statusbar.c +++ b/src/ephy-statusbar.c @@ -59,7 +59,7 @@ ephy_statusbar_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/src/ephy-tab.c b/src/ephy-tab.c index 6095d526a..aba0f8f40 100644 --- a/src/ephy-tab.c +++ b/src/ephy-tab.c @@ -148,9 +148,9 @@ static void ephy_tab_set_popups_allowed (EphyTab *tab, GType ephy_tab_get_type (void) { - static GType ephy_tab_type = 0; + static GType type = 0; - if (ephy_tab_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -165,12 +165,12 @@ ephy_tab_get_type (void) (GInstanceInitFunc) ephy_tab_init }; - ephy_tab_type = g_type_register_static (GTK_TYPE_BIN, - "EphyTab", - &our_info, 0); + type = g_type_register_static (GTK_TYPE_BIN, + "EphyTab", + &our_info, 0); } - return ephy_tab_type; + return type; } static void diff --git a/src/ephy-tabs-menu.c b/src/ephy-tabs-menu.c index 6d59d2ba8..d59ecfc45 100644 --- a/src/ephy-tabs-menu.c +++ b/src/ephy-tabs-menu.c @@ -62,9 +62,9 @@ enum GType ephy_tabs_menu_get_type (void) { - static GType ephy_tabs_menu_type = 0; + static GType type = 0; - if (ephy_tabs_menu_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -79,12 +79,12 @@ ephy_tabs_menu_get_type (void) (GInstanceInitFunc) ephy_tabs_menu_init }; - ephy_tabs_menu_type = g_type_register_static (G_TYPE_OBJECT, - "EphyTabsMenu", - &our_info, 0); + type = g_type_register_static (G_TYPE_OBJECT, + "EphyTabsMenu", + &our_info, 0); } - return ephy_tabs_menu_type; + return type; } static void diff --git a/src/ephy-toolbars-model.c b/src/ephy-toolbars-model.c index 96cecdc6f..48561fc2d 100755 --- a/src/ephy-toolbars-model.c +++ b/src/ephy-toolbars-model.c @@ -50,7 +50,7 @@ ephy_toolbars_model_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { sizeof (EphyToolbarsModelClass), diff --git a/src/ephy-window.c b/src/ephy-window.c index e3733c1a4..4bf2f37e9 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -388,7 +388,7 @@ ephy_window_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/src/pdm-dialog.c b/src/pdm-dialog.c index 7a45aabbe..1432c637e 100755 --- a/src/pdm-dialog.c +++ b/src/pdm-dialog.c @@ -145,7 +145,7 @@ pdm_dialog_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/src/ppview-toolbar.c b/src/ppview-toolbar.c index 31cb156b6..219e163b1 100755 --- a/src/ppview-toolbar.c +++ b/src/ppview-toolbar.c @@ -126,7 +126,7 @@ ppview_toolbar_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c index e5e8004e0..56f1369c7 100644 --- a/src/prefs-dialog.c +++ b/src/prefs-dialog.c @@ -345,7 +345,7 @@ prefs_dialog_get_type (void) { static GType type = 0; - if (type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { diff --git a/src/toolbar.c b/src/toolbar.c index 60e003a11..67f7edb4f 100755 --- a/src/toolbar.c +++ b/src/toolbar.c @@ -81,9 +81,9 @@ struct ToolbarPrivate GType toolbar_get_type (void) { - static GType toolbar_type = 0; + static GType type = 0; - if (toolbar_type == 0) + if (G_UNLIKELY (type == 0)) { static const GTypeInfo our_info = { @@ -98,13 +98,12 @@ toolbar_get_type (void) (GInstanceInitFunc) toolbar_init }; - toolbar_type = g_type_register_static (EGG_TYPE_EDITABLE_TOOLBAR, - "Toolbar", - &our_info, 0); + type = g_type_register_static (EGG_TYPE_EDITABLE_TOOLBAR, + "Toolbar", + &our_info, 0); } - return toolbar_type; - + return type; } static void -- cgit v1.2.3