[epiphany] Purge g_return from lib/
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Purge g_return from lib/
- Date: Wed, 13 Sep 2017 14:46:36 +0000 (UTC)
commit 489df78bc80e477f3d833921e58956d61a6a8f13
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Wed Sep 13 09:21:24 2017 -0500
Purge g_return from lib/
lib/ephy-debug.c | 4 +-
lib/ephy-file-helpers.c | 16 +++---
lib/ephy-langs.c | 2 +-
lib/ephy-notification-container.c | 4 +-
lib/ephy-notification.c | 2 +-
lib/ephy-signal-accumulator.c | 4 +-
lib/ephy-snapshot-service.c | 24 ++++----
lib/ephy-string.c | 2 +-
lib/ephy-sync-utils.c | 12 ++--
lib/ephy-time-helpers.c | 2 +-
lib/ephy-web-app-utils.c | 8 ++--
lib/history/ephy-history-service-urls-table.c | 4 +-
lib/history/ephy-history-service.c | 70 ++++++++++++------------
lib/sync/debug/ephy-sync-debug.c | 18 +++---
lib/sync/ephy-history-record.c | 16 +++---
lib/sync/ephy-open-tabs-manager.c | 6 +-
lib/sync/ephy-open-tabs-record.c | 12 ++--
lib/sync/ephy-password-manager.c | 36 ++++++------
lib/sync/ephy-password-record.c | 18 +++---
lib/sync/ephy-sync-crypto.c | 70 ++++++++++++------------
lib/sync/ephy-sync-service.c | 36 ++++++------
lib/sync/ephy-synchronizable-manager.c | 28 +++++-----
lib/sync/ephy-synchronizable.c | 20 ++++----
lib/sync/ephy-tabs-catalog.c | 4 +-
lib/widgets/ephy-certificate-dialog.c | 4 +-
lib/widgets/ephy-download-widget.c | 4 +-
lib/widgets/ephy-file-chooser.c | 4 +-
lib/widgets/ephy-location-entry.c | 16 +++---
lib/widgets/ephy-security-popover.c | 2 +-
lib/widgets/ephy-title-box.c | 8 ++--
lib/widgets/ephy-title-widget.c | 16 +++---
31 files changed, 236 insertions(+), 236 deletions(-)
---
diff --git a/lib/ephy-debug.c b/lib/ephy-debug.c
index 2f9ba52..3509f37 100644
--- a/lib/ephy-debug.c
+++ b/lib/ephy-debug.c
@@ -182,7 +182,7 @@ ephy_profiler_dump (EphyProfiler *profiler)
{
double seconds;
- g_return_if_fail (profiler != NULL);
+ g_assert (profiler != NULL);
seconds = g_timer_elapsed (profiler->timer, NULL);
@@ -194,7 +194,7 @@ ephy_profiler_dump (EphyProfiler *profiler)
static void
ephy_profiler_free (EphyProfiler *profiler)
{
- g_return_if_fail (profiler != NULL);
+ g_assert (profiler != NULL);
g_timer_destroy (profiler->timer);
g_free (profiler->name);
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index 99e85fb..7c18753 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -539,7 +539,7 @@ load_mime_from_xml (void)
GBytes *bytes;
EphyMimePermission permission = EPHY_MIME_PERMISSION_UNKNOWN;
- g_return_if_fail (mime_table == NULL);
+ g_assert (mime_table == NULL);
mime_table = g_hash_table_new_full (g_str_hash, g_str_equal,
xmlFree, NULL);
@@ -594,7 +594,7 @@ ephy_file_check_mime (const char *mime_type)
EphyMimePermission permission;
gpointer tmp;
- g_return_val_if_fail (mime_type != NULL, EPHY_MIME_PERMISSION_UNKNOWN);
+ g_assert (mime_type != NULL);
if (mime_table == NULL) {
load_mime_from_xml ();
@@ -695,7 +695,7 @@ ephy_file_launcher_get_app_info_for_file (GFile *file,
{
GAppInfo *app = NULL;
- g_return_val_if_fail (file || mime_type, FALSE);
+ g_assert (file || mime_type);
if (mime_type != NULL) {
app = g_app_info_get_default_for_type (mime_type,
@@ -744,7 +744,7 @@ ephy_file_launch_handler (const char *mime_type,
GAppInfo *app = NULL;
gboolean ret = FALSE;
- g_return_val_if_fail (file != NULL, FALSE);
+ g_assert (file != NULL);
app = ephy_file_launcher_get_app_info_for_file (file, mime_type);
@@ -882,7 +882,7 @@ ephy_file_delete_uri (const char *uri)
GFile *file;
gboolean ret;
- g_return_if_fail (uri);
+ g_assert (uri);
file = g_file_new_for_uri (uri);
@@ -912,7 +912,7 @@ ephy_file_move_uri (const char *source_uri, const char *dest_uri)
GFile *dest;
gboolean ret;
- g_return_val_if_fail (source_uri && dest_uri, FALSE);
+ g_assert (source_uri && dest_uri);
src = g_file_new_for_uri (source_uri);
dest = g_file_new_for_uri (dest_uri);
@@ -952,7 +952,7 @@ ephy_file_create_data_uri_for_filename (const char *filename,
gchar *uri = NULL;
GFileInfo *file_info = NULL;
- g_return_val_if_fail (filename != NULL, NULL);
+ g_assert (filename != NULL);
if (!g_file_get_contents (filename, &data, &data_length, NULL))
return NULL;
@@ -998,7 +998,7 @@ ephy_file_create_data_uri_for_filename (const char *filename,
char *
ephy_sanitize_filename (char *filename)
{
- g_return_val_if_fail (filename != NULL, NULL);
+ g_assert (filename != NULL);
return g_strdelimit (filename, G_DIR_SEPARATOR_S, '_');
}
diff --git a/lib/ephy-langs.c b/lib/ephy-langs.c
index 1fdc90c..37516d7 100644
--- a/lib/ephy-langs.c
+++ b/lib/ephy-langs.c
@@ -99,7 +99,7 @@ ephy_langs_append_languages (GArray *array)
int i;
languages = g_get_language_names ();
- g_return_if_fail (languages != NULL);
+ g_assert (languages != NULL);
/* FIXME: maybe just use the first, instead of all of them? */
for (i = 0; languages[i] != NULL; i++) {
diff --git a/lib/ephy-notification-container.c b/lib/ephy-notification-container.c
index 1fdce67..8b7fa42 100644
--- a/lib/ephy-notification-container.c
+++ b/lib/ephy-notification-container.c
@@ -72,8 +72,8 @@ void
ephy_notification_container_add_notification (EphyNotificationContainer *self,
GtkWidget *notification)
{
- g_return_if_fail (EPHY_IS_NOTIFICATION_CONTAINER (self));
- g_return_if_fail (GTK_IS_WIDGET (notification));
+ g_assert (EPHY_IS_NOTIFICATION_CONTAINER (self));
+ g_assert (GTK_IS_WIDGET (notification));
gtk_container_add (GTK_CONTAINER (self->grid), notification);
gtk_widget_show_all (GTK_WIDGET (self));
diff --git a/lib/ephy-notification.c b/lib/ephy-notification.c
index 68d45c4..ce60bb0 100644
--- a/lib/ephy-notification.c
+++ b/lib/ephy-notification.c
@@ -201,7 +201,7 @@ ephy_notification_new (const char *head,
void
ephy_notification_show (EphyNotification *self)
{
- g_return_if_fail (EPHY_IS_NOTIFICATION (self));
+ g_assert (EPHY_IS_NOTIFICATION (self));
ephy_notification_container_add_notification (ephy_notification_container_get_default (),
GTK_WIDGET (self));
diff --git a/lib/ephy-signal-accumulator.c b/lib/ephy-signal-accumulator.c
index bde1a8c..2aa4ae5 100644
--- a/lib/ephy-signal-accumulator.c
+++ b/lib/ephy-signal-accumulator.c
@@ -39,8 +39,8 @@ ephy_signal_accumulator_object (GSignalInvocationHint *ihint,
g_value_set_object (return_accu, object);
return FALSE;
- } else if (object != NULL) {
- g_return_val_if_reached (TRUE);
+ } else {
+ g_assert (object == NULL);
}
return TRUE;
diff --git a/lib/ephy-snapshot-service.c b/lib/ephy-snapshot-service.c
index c61d9c3..5c4a91b 100644
--- a/lib/ephy-snapshot-service.c
+++ b/lib/ephy-snapshot-service.c
@@ -290,9 +290,9 @@ ephy_snapshot_service_save_snapshot_async (EphySnapshotService *service,
{
GTask *task;
- g_return_if_fail (EPHY_IS_SNAPSHOT_SERVICE (service));
- g_return_if_fail (GDK_IS_PIXBUF (snapshot));
- g_return_if_fail (url != NULL);
+ g_assert (EPHY_IS_SNAPSHOT_SERVICE (service));
+ g_assert (GDK_IS_PIXBUF (snapshot));
+ g_assert (url != NULL);
task = g_task_new (service, cancellable, callback, user_data);
g_task_set_priority (task, G_PRIORITY_LOW);
@@ -308,7 +308,7 @@ ephy_snapshot_service_save_snapshot_finish (EphySnapshotService *service,
GAsyncResult *result,
GError **error)
{
- g_return_val_if_fail (g_task_is_valid (result, service), NULL);
+ g_assert (g_task_is_valid (result, service));
return g_task_propagate_pointer (G_TASK (result), error);
}
@@ -497,7 +497,7 @@ ephy_snapshot_service_lookup_cached_snapshot_path (EphySnapshotService *service,
{
SnapshotPathCachedData *data;
- g_return_val_if_fail (EPHY_IS_SNAPSHOT_SERVICE (service), NULL);
+ g_assert (EPHY_IS_SNAPSHOT_SERVICE (service));
data = g_hash_table_lookup (service->cache, url);
@@ -548,8 +548,8 @@ ephy_snapshot_service_get_snapshot_path_for_url_async (EphySnapshotService *serv
GTask *task;
const char *path;
- g_return_if_fail (EPHY_IS_SNAPSHOT_SERVICE (service));
- g_return_if_fail (url != NULL);
+ g_assert (EPHY_IS_SNAPSHOT_SERVICE (service));
+ g_assert (url != NULL);
task = g_task_new (service, cancellable, callback, user_data);
@@ -590,7 +590,7 @@ ephy_snapshot_service_get_snapshot_path_for_url_finish (EphySnapshotService *ser
GAsyncResult *result,
GError **error)
{
- g_return_val_if_fail (g_task_is_valid (result, service), NULL);
+ g_assert (g_task_is_valid (result, service));
return g_task_propagate_pointer (G_TASK (result), error);
}
@@ -625,9 +625,9 @@ ephy_snapshot_service_get_snapshot_path_async (EphySnapshotService *service,
const char *uri;
const char *path;
- g_return_if_fail (EPHY_IS_SNAPSHOT_SERVICE (service));
- g_return_if_fail (WEBKIT_IS_WEB_VIEW (web_view));
- g_return_if_fail (webkit_web_view_get_uri (web_view));
+ g_assert (EPHY_IS_SNAPSHOT_SERVICE (service));
+ g_assert (WEBKIT_IS_WEB_VIEW (web_view));
+ g_assert (webkit_web_view_get_uri (web_view));
task = g_task_new (service, cancellable, callback, user_data);
@@ -655,7 +655,7 @@ ephy_snapshot_service_get_snapshot_path_finish (EphySnapshotService *service,
GAsyncResult *result,
GError **error)
{
- g_return_val_if_fail (g_task_is_valid (result, service), NULL);
+ g_assert (g_task_is_valid (result, service));
return g_task_propagate_pointer (G_TASK (result), error);
}
diff --git a/lib/ephy-string.c b/lib/ephy-string.c
index b83c34f..497c7f8 100644
--- a/lib/ephy-string.c
+++ b/lib/ephy-string.c
@@ -98,7 +98,7 @@ ephy_string_shorten (char *str,
glong actual_length;
gulong bytes;
- g_return_val_if_fail (target_length > 0, NULL);
+ g_assert (target_length > 0);
if (!str)
return NULL;
diff --git a/lib/ephy-sync-utils.c b/lib/ephy-sync-utils.c
index 6e6e892..140ff53 100644
--- a/lib/ephy-sync-utils.c
+++ b/lib/ephy-sync-utils.c
@@ -51,7 +51,7 @@ ephy_sync_utils_encode_hex (const guint8 *data,
{
char *encoded;
- g_return_val_if_fail (data, NULL);
+ g_assert (data);
encoded = g_malloc (data_len * 2 + 1);
for (gsize i = 0; i < data_len; i++) {
@@ -70,7 +70,7 @@ ephy_sync_utils_decode_hex (const char *hex)
{
guint8 *decoded;
- g_return_val_if_fail (hex, NULL);
+ g_assert (hex);
decoded = g_malloc (strlen (hex) / 2);
for (gsize i = 0, j = 0; i < strlen (hex); i += 2, j++)
@@ -102,7 +102,7 @@ ephy_sync_utils_base64_urlsafe_encode (const guint8 *data,
gsize start = 0;
gssize end;
- g_return_val_if_fail (data, NULL);
+ g_assert (data);
base64 = g_base64_encode (data, data_len);
end = strlen (base64) - 1;
@@ -143,8 +143,8 @@ ephy_sync_utils_base64_urlsafe_decode (const char *text,
char *to_decode;
char *suffix = NULL;
- g_return_val_if_fail (text, NULL);
- g_return_val_if_fail (out_len, NULL);
+ g_assert (text);
+ g_assert (out_len);
/* Fill the text with trailing '=' characters up to the proper length. */
if (should_fill)
@@ -190,7 +190,7 @@ ephy_sync_utils_get_audience (const char *url)
char *audience;
char *port;
- g_return_val_if_fail (url, NULL);
+ g_assert (url);
uri = soup_uri_new (url);
scheme = soup_uri_get_scheme (uri);
diff --git a/lib/ephy-time-helpers.c b/lib/ephy-time-helpers.c
index a162a37..ff3147b 100644
--- a/lib/ephy-time-helpers.c
+++ b/lib/ephy-time-helpers.c
@@ -76,7 +76,7 @@ eel_strdup_strftime (const char *format, struct tm *time_pieces)
/* Format could be translated, and contain UTF-8 chars,
* so convert to locale encoding which strftime uses */
converted = g_locale_from_utf8 (format, -1, NULL, NULL, NULL);
- g_return_val_if_fail (converted != NULL, NULL);
+ g_assert (converted != NULL);
string = g_string_new ("");
remainder = converted;
diff --git a/lib/ephy-web-app-utils.c b/lib/ephy-web-app-utils.c
index 4e3b471..9a35887 100644
--- a/lib/ephy-web-app-utils.c
+++ b/lib/ephy-web-app-utils.c
@@ -129,7 +129,7 @@ ephy_web_application_delete (const char *name)
GFile *launcher = NULL;
gboolean return_value = FALSE;
- g_return_val_if_fail (name, FALSE);
+ g_assert (name);
profile_dir = ephy_web_application_get_profile_directory (name);
if (!profile_dir)
@@ -188,7 +188,7 @@ create_desktop_file (const char *address,
GFile *link;
GError *error = NULL;
- g_return_val_if_fail (profile_dir, NULL);
+ g_assert (profile_dir);
wm_class = get_wm_class_from_app_title (title);
filename = desktop_filename_from_wm_class (wm_class);
@@ -348,7 +348,7 @@ ephy_web_application_setup_from_profile_directory (const char *profile_directory
char *desktop_filename;
GDesktopAppInfo *desktop_info;
- g_return_if_fail (profile_directory != NULL);
+ g_assert (profile_directory != NULL);
app_name = g_strrstr (profile_directory, EPHY_WEB_APP_PREFIX);
if (!app_name) {
@@ -391,7 +391,7 @@ ephy_web_application_setup_from_desktop_file (GDesktopAppInfo *desktop_info)
const char *wm_class;
GIcon *icon;
- g_return_if_fail (G_IS_DESKTOP_APP_INFO (desktop_info));
+ g_assert (G_IS_DESKTOP_APP_INFO (desktop_info));
app_info = G_APP_INFO (desktop_info);
g_set_prgname (g_app_info_get_name (app_info));
diff --git a/lib/history/ephy-history-service-urls-table.c b/lib/history/ephy-history-service-urls-table.c
index fa16806..6749b27 100644
--- a/lib/history/ephy-history-service-urls-table.c
+++ b/lib/history/ephy-history-service-urls-table.c
@@ -64,7 +64,7 @@ ephy_history_service_get_url_row (EphyHistoryService *self, const char *url_stri
if (url_string == NULL && url != NULL)
url_string = url->url;
- g_return_val_if_fail (url_string || url->id != -1, NULL);
+ g_assert (url_string || url->id != -1);
if (url != NULL && url->id != -1) {
statement = ephy_sqlite_connection_create_statement (self->history_database,
@@ -400,7 +400,7 @@ ephy_history_service_delete_url (EphyHistoryService *self, EphyHistoryURL *url)
g_assert (self->history_thread == g_thread_self ());
g_assert (self->history_database != NULL);
- g_return_if_fail (url->id != -1 || url->url);
+ g_assert (url->id != -1 || url->url);
if (url->id != -1)
sql_statement = "DELETE FROM urls WHERE id=?";
diff --git a/lib/history/ephy-history-service.c b/lib/history/ephy-history-service.c
index 27b562a..be43f26 100644
--- a/lib/history/ephy-history-service.c
+++ b/lib/history/ephy-history-service.c
@@ -691,8 +691,8 @@ ephy_history_service_add_visit (EphyHistoryService *self, EphyHistoryPageVisit *
{
EphyHistoryServiceMessage *message;
- g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
- g_return_if_fail (visit != NULL);
+ g_assert (EPHY_IS_HISTORY_SERVICE (self));
+ g_assert (visit != NULL);
message = ephy_history_service_message_new (self, ADD_VISIT,
ephy_history_page_visit_copy (visit),
@@ -706,8 +706,8 @@ ephy_history_service_add_visits (EphyHistoryService *self, GList *visits, GCance
{
EphyHistoryServiceMessage *message;
- g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
- g_return_if_fail (visits != NULL);
+ g_assert (EPHY_IS_HISTORY_SERVICE (self));
+ g_assert (visits != NULL);
message = ephy_history_service_message_new (self, ADD_VISITS,
ephy_history_page_visit_list_copy (visits),
@@ -721,7 +721,7 @@ ephy_history_service_find_visits_in_time (EphyHistoryService *self, gint64 from,
{
EphyHistoryQuery *query;
- g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
+ g_assert (EPHY_IS_HISTORY_SERVICE (self));
query = ephy_history_query_new ();
query->from = from;
@@ -736,8 +736,8 @@ ephy_history_service_query_visits (EphyHistoryService *self, EphyHistoryQuery *q
{
EphyHistoryServiceMessage *message;
- g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
- g_return_if_fail (query != NULL);
+ g_assert (EPHY_IS_HISTORY_SERVICE (self));
+ g_assert (query != NULL);
message = ephy_history_service_message_new (self, QUERY_VISITS,
ephy_history_query_copy (query),
(GDestroyNotify)ephy_history_query_free, cancellable, callback, user_data);
@@ -759,8 +759,8 @@ ephy_history_service_query_urls (EphyHistoryService *self, EphyHistoryQuery *que
{
EphyHistoryServiceMessage *message;
- g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
- g_return_if_fail (query != NULL);
+ g_assert (EPHY_IS_HISTORY_SERVICE (self));
+ g_assert (query != NULL);
message = ephy_history_service_message_new (self, QUERY_URLS,
ephy_history_query_copy (query),
(GDestroyNotify)ephy_history_query_free,
@@ -776,7 +776,7 @@ ephy_history_service_get_hosts (EphyHistoryService *self,
{
EphyHistoryServiceMessage *message;
- g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
+ g_assert (EPHY_IS_HISTORY_SERVICE (self));
message = ephy_history_service_message_new (self, GET_HOSTS,
NULL, NULL, cancellable,
@@ -793,7 +793,7 @@ ephy_history_service_query_hosts (EphyHistoryService *self,
{
EphyHistoryServiceMessage *message;
- g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
+ g_assert (EPHY_IS_HISTORY_SERVICE (self));
message = ephy_history_service_message_new (self, QUERY_HOSTS,
ephy_history_query_copy (query),
@@ -854,10 +854,10 @@ ephy_history_service_set_url_title (EphyHistoryService *self,
EphyHistoryURL *url;
EphyHistoryServiceMessage *message;
- g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
- g_return_if_fail (orig_url != NULL);
- g_return_if_fail (title != NULL);
- g_return_if_fail (*title != '\0');
+ g_assert (EPHY_IS_HISTORY_SERVICE (self));
+ g_assert (orig_url != NULL);
+ g_assert (title != NULL);
+ g_assert (*title != '\0');
url = ephy_history_url_new (orig_url, title, 0, 0, 0);
message = ephy_history_service_message_new (self, SET_URL_TITLE,
@@ -883,7 +883,7 @@ ephy_history_service_execute_set_url_zoom_level (EphyHistoryService *self,
host = ephy_history_service_get_host_row_from_url (self, url_string);
g_free (url_string);
- g_return_val_if_fail (host != NULL, FALSE);
+ g_assert (host != NULL);
host->zoom_level = zoom_level;
ephy_history_service_update_host_row (self, host);
@@ -902,8 +902,8 @@ ephy_history_service_set_url_zoom_level (EphyHistoryService *self,
EphyHistoryServiceMessage *message;
GVariant *variant;
- g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
- g_return_if_fail (url != NULL);
+ g_assert (EPHY_IS_HISTORY_SERVICE (self));
+ g_assert (url != NULL);
variant = g_variant_new ("(sd)", url, zoom_level);
@@ -946,8 +946,8 @@ ephy_history_service_set_url_hidden (EphyHistoryService *self,
EphyHistoryServiceMessage *message;
EphyHistoryURL *url;
- g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
- g_return_if_fail (orig_url != NULL);
+ g_assert (EPHY_IS_HISTORY_SERVICE (self));
+ g_assert (orig_url != NULL);
url = ephy_history_url_new (orig_url, NULL, 0, 0, 0);
url->hidden = hidden;
@@ -990,8 +990,8 @@ ephy_history_service_set_url_thumbnail_time (EphyHistoryService *self,
EphyHistoryURL *url;
EphyHistoryServiceMessage *message;
- g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
- g_return_if_fail (orig_url != NULL);
+ g_assert (EPHY_IS_HISTORY_SERVICE (self));
+ g_assert (orig_url != NULL);
url = ephy_history_url_new (orig_url, NULL, 0, 0, 0);
url->thumbnail_time = thumbnail_time;
@@ -1024,8 +1024,8 @@ ephy_history_service_get_url (EphyHistoryService *self,
{
EphyHistoryServiceMessage *message;
- g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
- g_return_if_fail (url != NULL);
+ g_assert (EPHY_IS_HISTORY_SERVICE (self));
+ g_assert (url != NULL);
message = ephy_history_service_message_new (self, GET_URL,
g_strdup (url), g_free,
@@ -1041,7 +1041,7 @@ ephy_history_service_execute_get_host_for_url (EphyHistoryService *self,
EphyHistoryHost *host;
host = ephy_history_service_get_host_row_from_url (self, url);
- g_return_val_if_fail (host != NULL, FALSE);
+ g_assert (host != NULL);
*result = host;
@@ -1057,8 +1057,8 @@ ephy_history_service_get_host_for_url (EphyHistoryService *self,
{
EphyHistoryServiceMessage *message;
- g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
- g_return_if_fail (url != NULL);
+ g_assert (EPHY_IS_HISTORY_SERVICE (self));
+ g_assert (url != NULL);
message = ephy_history_service_message_new (self, GET_HOST_FOR_URL,
g_strdup (url), g_free,
@@ -1177,8 +1177,8 @@ ephy_history_service_delete_urls (EphyHistoryService *self,
{
EphyHistoryServiceMessage *message;
- g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
- g_return_if_fail (urls != NULL);
+ g_assert (EPHY_IS_HISTORY_SERVICE (self));
+ g_assert (urls != NULL);
message = ephy_history_service_message_new (self, DELETE_URLS,
ephy_history_url_list_copy (urls),
(GDestroyNotify)ephy_history_url_list_free,
@@ -1208,7 +1208,7 @@ ephy_history_service_clear (EphyHistoryService *self,
{
EphyHistoryServiceMessage *message;
- g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
+ g_assert (EPHY_IS_HISTORY_SERVICE (self));
message = ephy_history_service_message_new (self, CLEAR,
NULL, NULL,
@@ -1299,7 +1299,7 @@ ephy_history_service_find_urls (EphyHistoryService *self,
{
EphyHistoryQuery *query;
- g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
+ g_assert (EPHY_IS_HISTORY_SERVICE (self));
query = ephy_history_query_new ();
query->from = from;
@@ -1327,9 +1327,9 @@ ephy_history_service_visit_url (EphyHistoryService *self,
{
EphyHistoryPageVisit *visit;
- g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
- g_return_if_fail (url != NULL);
- g_return_if_fail (visit_time > 0);
+ g_assert (EPHY_IS_HISTORY_SERVICE (self));
+ g_assert (url != NULL);
+ g_assert (visit_time > 0);
visit = ephy_history_page_visit_new (url, visit_time, visit_type);
visit->url->sync_id = g_strdup (sync_id);
@@ -1349,7 +1349,7 @@ ephy_history_service_find_hosts (EphyHistoryService *self,
{
EphyHistoryQuery *query;
- g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
+ g_assert (EPHY_IS_HISTORY_SERVICE (self));
query = ephy_history_query_new ();
diff --git a/lib/sync/debug/ephy-sync-debug.c b/lib/sync/debug/ephy-sync-debug.c
index 702683c..cd76562 100644
--- a/lib/sync/debug/ephy-sync-debug.c
+++ b/lib/sync/debug/ephy-sync-debug.c
@@ -500,7 +500,7 @@ ephy_sync_debug_view_collection (const char *collection,
char *endpoint;
char *response;
- g_return_if_fail (collection);
+ g_assert (collection);
endpoint = g_strdup_printf ("storage/%s?full=true", collection);
response = ephy_sync_debug_send_request (endpoint, "GET", NULL);
@@ -567,8 +567,8 @@ ephy_sync_debug_view_record (const char *collection,
char *record;
const char *payload;
- g_return_if_fail (collection);
- g_return_if_fail (id);
+ g_assert (collection);
+ g_assert (id);
id_safe = soup_uri_encode (id, NULL);
endpoint = g_strdup_printf ("storage/%s/%s", collection, id_safe);
@@ -629,7 +629,7 @@ ephy_sync_debug_delete_collection (const char *collection)
char *endpoint;
char *response;
- g_return_if_fail (collection);
+ g_assert (collection);
endpoint = g_strdup_printf ("storage/%s", collection);
response = ephy_sync_debug_send_request (endpoint, "GET", NULL);
@@ -691,8 +691,8 @@ ephy_sync_debug_delete_record (const char *collection,
char *body;
char *response;
- g_return_if_fail (collection);
- g_return_if_fail (id);
+ g_assert (collection);
+ g_assert (id);
bundle = ephy_sync_debug_get_bundle_for_collection (collection);
if (!bundle)
@@ -730,7 +730,7 @@ ephy_sync_debug_erase_collection (const char *collection)
char *endpoint;
char *response;
- g_return_if_fail (collection);
+ g_assert (collection);
endpoint = g_strdup_printf ("storage/%s", collection);
response = ephy_sync_debug_send_request (endpoint, "DELETE", NULL);
@@ -762,8 +762,8 @@ ephy_sync_debug_erase_record (const char *collection,
char *endpoint;
char *response;
- g_return_if_fail (collection);
- g_return_if_fail (id);
+ g_assert (collection);
+ g_assert (id);
id_safe = soup_uri_encode (id, NULL);
endpoint = g_strdup_printf ("storage/%s/%s", collection, id_safe);
diff --git a/lib/sync/ephy-history-record.c b/lib/sync/ephy-history-record.c
index ae69863..1d2385c 100644
--- a/lib/sync/ephy-history-record.c
+++ b/lib/sync/ephy-history-record.c
@@ -230,8 +230,8 @@ void
ephy_history_record_set_id (EphyHistoryRecord *self,
const char *id)
{
- g_return_if_fail (EPHY_IS_HISTORY_RECORD (self));
- g_return_if_fail (id);
+ g_assert (EPHY_IS_HISTORY_RECORD (self));
+ g_assert (id);
g_free (self->id);
self->id = g_strdup (id);
@@ -240,7 +240,7 @@ ephy_history_record_set_id (EphyHistoryRecord *self,
const char *
ephy_history_record_get_id (EphyHistoryRecord *self)
{
- g_return_val_if_fail (EPHY_IS_HISTORY_RECORD (self), NULL);
+ g_assert (EPHY_IS_HISTORY_RECORD (self));
return self->id;
}
@@ -248,7 +248,7 @@ ephy_history_record_get_id (EphyHistoryRecord *self)
const char *
ephy_history_record_get_title (EphyHistoryRecord *self)
{
- g_return_val_if_fail (EPHY_IS_HISTORY_RECORD (self), NULL);
+ g_assert (EPHY_IS_HISTORY_RECORD (self));
return self->title;
}
@@ -256,7 +256,7 @@ ephy_history_record_get_title (EphyHistoryRecord *self)
const char *
ephy_history_record_get_uri (EphyHistoryRecord *self)
{
- g_return_val_if_fail (EPHY_IS_HISTORY_RECORD (self), NULL);
+ g_assert (EPHY_IS_HISTORY_RECORD (self));
return self->uri;
}
@@ -266,8 +266,8 @@ ephy_history_record_get_last_visit_time (EphyHistoryRecord *self)
{
EphyHistoryRecordVisit *visit;
- g_return_val_if_fail (EPHY_IS_HISTORY_RECORD (self), -1);
- g_return_val_if_fail (self->visits, -1);
+ g_assert (EPHY_IS_HISTORY_RECORD (self));
+ g_assert (self->visits);
if (g_sequence_is_empty (self->visits))
return -1;
@@ -284,7 +284,7 @@ ephy_history_record_add_visit_time (EphyHistoryRecord *self,
{
EphyHistoryRecordVisit *visit;
- g_return_val_if_fail (EPHY_IS_HISTORY_RECORD (self), FALSE);
+ g_assert (EPHY_IS_HISTORY_RECORD (self));
visit = ephy_history_record_visit_new (visit_time, EPHY_PAGE_VISIT_LINK);
if (g_sequence_lookup (self->visits, visit,
diff --git a/lib/sync/ephy-open-tabs-manager.c b/lib/sync/ephy-open-tabs-manager.c
index 3baf067..32ee9a6 100644
--- a/lib/sync/ephy-open-tabs-manager.c
+++ b/lib/sync/ephy-open-tabs-manager.c
@@ -147,7 +147,7 @@ ephy_open_tabs_manager_get_local_tabs (EphyOpenTabsManager *self)
char *id;
char *name;
- g_return_val_if_fail (EPHY_IS_OPEN_TABS_MANAGER (self), NULL);
+ g_assert (EPHY_IS_OPEN_TABS_MANAGER (self));
id = ephy_sync_utils_get_device_id ();
name = ephy_sync_utils_get_device_name ();
@@ -169,7 +169,7 @@ ephy_open_tabs_manager_get_local_tabs (EphyOpenTabsManager *self)
GList *
ephy_open_tabs_manager_get_remote_tabs (EphyOpenTabsManager *self)
{
- g_return_val_if_fail (EPHY_IS_OPEN_TABS_MANAGER (self), NULL);
+ g_assert (EPHY_IS_OPEN_TABS_MANAGER (self));
return self->remote_records;
}
@@ -177,7 +177,7 @@ ephy_open_tabs_manager_get_remote_tabs (EphyOpenTabsManager *self)
void
ephy_open_tabs_manager_clear_cache (EphyOpenTabsManager *self)
{
- g_return_if_fail (EPHY_IS_OPEN_TABS_MANAGER (self));
+ g_assert (EPHY_IS_OPEN_TABS_MANAGER (self));
g_list_free_full (self->remote_records, g_object_unref);
self->remote_records = NULL;
diff --git a/lib/sync/ephy-open-tabs-record.c b/lib/sync/ephy-open-tabs-record.c
index 5620d9e..755c846 100644
--- a/lib/sync/ephy-open-tabs-record.c
+++ b/lib/sync/ephy-open-tabs-record.c
@@ -168,7 +168,7 @@ ephy_open_tabs_record_new (const char *id,
const char *
ephy_open_tabs_record_get_id (EphyOpenTabsRecord *self)
{
- g_return_val_if_fail (EPHY_IS_OPEN_TABS_RECORD (self), NULL);
+ g_assert (EPHY_IS_OPEN_TABS_RECORD (self));
return self->id;
}
@@ -176,7 +176,7 @@ ephy_open_tabs_record_get_id (EphyOpenTabsRecord *self)
const char *
ephy_open_tabs_record_get_client_name (EphyOpenTabsRecord *self)
{
- g_return_val_if_fail (EPHY_IS_OPEN_TABS_RECORD (self), NULL);
+ g_assert (EPHY_IS_OPEN_TABS_RECORD (self));
return self->client_name;
}
@@ -184,7 +184,7 @@ ephy_open_tabs_record_get_client_name (EphyOpenTabsRecord *self)
GList *
ephy_open_tabs_record_get_tabs (EphyOpenTabsRecord *self)
{
- g_return_val_if_fail (EPHY_IS_OPEN_TABS_RECORD (self), NULL);
+ g_assert (EPHY_IS_OPEN_TABS_RECORD (self));
return self->tabs;
}
@@ -198,9 +198,9 @@ ephy_open_tabs_record_add_tab (EphyOpenTabsRecord *self,
JsonObject *tab;
JsonArray *url_history;
- g_return_if_fail (EPHY_IS_OPEN_TABS_RECORD (self));
- g_return_if_fail (title);
- g_return_if_fail (url);
+ g_assert (EPHY_IS_OPEN_TABS_RECORD (self));
+ g_assert (title);
+ g_assert (url);
tab = json_object_new ();
json_object_set_string_member (tab, "title", title);
diff --git a/lib/sync/ephy-password-manager.c b/lib/sync/ephy-password-manager.c
index fa1cd52..437ee22 100644
--- a/lib/sync/ephy-password-manager.c
+++ b/lib/sync/ephy-password-manager.c
@@ -343,8 +343,8 @@ GList *
ephy_password_manager_get_cached_users (EphyPasswordManager *self,
const char *origin)
{
- g_return_val_if_fail (EPHY_IS_PASSWORD_MANAGER (self), NULL);
- g_return_val_if_fail (origin, NULL);
+ g_assert (EPHY_IS_PASSWORD_MANAGER (self));
+ g_assert (origin);
return g_hash_table_lookup (self->cache, origin);
}
@@ -472,12 +472,12 @@ ephy_password_manager_save (EphyPasswordManager *self,
char *id;
gint64 timestamp;
- g_return_if_fail (EPHY_IS_PASSWORD_MANAGER (self));
- g_return_if_fail (origin);
- g_return_if_fail (target_origin);
- g_return_if_fail (password);
- g_return_if_fail (!username_field || username);
- g_return_if_fail (!password_field || password);
+ g_assert (EPHY_IS_PASSWORD_MANAGER (self));
+ g_assert (origin);
+ g_assert (target_origin);
+ g_assert (password);
+ g_assert (!username_field || username);
+ g_assert (!password_field || password);
if (!is_new) {
LOG ("Updating password for (%s, %s, %s, %s, %s)",
@@ -580,7 +580,7 @@ ephy_password_manager_query (EphyPasswordManager *self,
QueryAsyncData *data;
GHashTable *attributes;
- g_return_if_fail (EPHY_IS_PASSWORD_MANAGER (self));
+ g_assert (EPHY_IS_PASSWORD_MANAGER (self));
LOG ("Querying password records for (%s, %s, %s, %s)",
origin, username, username_field, password_field);
@@ -611,10 +611,10 @@ ephy_password_manager_store_raw (const char *origin,
{
GHashTable *attributes;
- g_return_if_fail (origin);
- g_return_if_fail (password);
- g_return_if_fail (!username_field || username);
- g_return_if_fail (!password_field || password);
+ g_assert (origin);
+ g_assert (password);
+ g_assert (!username_field || username);
+ g_assert (!password_field || password);
attributes = get_attributes_table (NULL, origin, origin, username,
username_field, password_field, -1);
@@ -627,8 +627,8 @@ gboolean
ephy_password_manager_store_finish (GAsyncResult *result,
GError **error)
{
- g_return_val_if_fail (!error || !(*error), FALSE);
- g_return_val_if_fail (g_task_is_valid (result, NULL), FALSE);
+ g_assert (!error || !(*error));
+ g_assert (g_task_is_valid (result, NULL));
return g_task_propagate_boolean (G_TASK (result), error);
}
@@ -710,8 +710,8 @@ void
ephy_password_manager_forget (EphyPasswordManager *self,
const char *id)
{
- g_return_if_fail (EPHY_IS_PASSWORD_MANAGER (self));
- g_return_if_fail (id);
+ g_assert (EPHY_IS_PASSWORD_MANAGER (self));
+ g_assert (id);
/* synchronizable-deleted signal needs an EphySynchronizable object,
* therefore we need to obtain the password record first and then emit
@@ -744,7 +744,7 @@ forget_all_cb (GList *records,
void
ephy_password_manager_forget_all (EphyPasswordManager *self)
{
- g_return_if_fail (EPHY_IS_PASSWORD_MANAGER (self));
+ g_assert (EPHY_IS_PASSWORD_MANAGER (self));
/* synchronizable-deleted signal needs an EphySynchronizable object, therefore
* we need to obtain the password records first and emit the signal for each
diff --git a/lib/sync/ephy-password-record.c b/lib/sync/ephy-password-record.c
index 4c7e731..0df8bbc 100644
--- a/lib/sync/ephy-password-record.c
+++ b/lib/sync/ephy-password-record.c
@@ -284,7 +284,7 @@ ephy_password_record_new (const char *id,
const char *
ephy_password_record_get_id (EphyPasswordRecord *self)
{
- g_return_val_if_fail (EPHY_IS_PASSWORD_RECORD (self), NULL);
+ g_assert (EPHY_IS_PASSWORD_RECORD (self));
return self->id;
}
@@ -292,7 +292,7 @@ ephy_password_record_get_id (EphyPasswordRecord *self)
const char *
ephy_password_record_get_origin (EphyPasswordRecord *self)
{
- g_return_val_if_fail (EPHY_IS_PASSWORD_RECORD (self), NULL);
+ g_assert (EPHY_IS_PASSWORD_RECORD (self));
return self->origin;
}
@@ -300,7 +300,7 @@ ephy_password_record_get_origin (EphyPasswordRecord *self)
const char *
ephy_password_record_get_target_origin (EphyPasswordRecord *self)
{
- g_return_val_if_fail (EPHY_IS_PASSWORD_RECORD (self), NULL);
+ g_assert (EPHY_IS_PASSWORD_RECORD (self));
return self->target_origin;
}
@@ -308,7 +308,7 @@ ephy_password_record_get_target_origin (EphyPasswordRecord *self)
const char *
ephy_password_record_get_username (EphyPasswordRecord *self)
{
- g_return_val_if_fail (EPHY_IS_PASSWORD_RECORD (self), NULL);
+ g_assert (EPHY_IS_PASSWORD_RECORD (self));
return self->username;
}
@@ -316,7 +316,7 @@ ephy_password_record_get_username (EphyPasswordRecord *self)
const char *
ephy_password_record_get_password (EphyPasswordRecord *self)
{
- g_return_val_if_fail (EPHY_IS_PASSWORD_RECORD (self), NULL);
+ g_assert (EPHY_IS_PASSWORD_RECORD (self));
return self->password;
}
@@ -325,7 +325,7 @@ void
ephy_password_record_set_password (EphyPasswordRecord *self,
const char *password)
{
- g_return_if_fail (EPHY_IS_PASSWORD_RECORD (self));
+ g_assert (EPHY_IS_PASSWORD_RECORD (self));
g_free (self->password);
self->password = g_strdup (password);
@@ -334,7 +334,7 @@ ephy_password_record_set_password (EphyPasswordRecord *self,
const char *
ephy_password_record_get_username_field (EphyPasswordRecord *self)
{
- g_return_val_if_fail (EPHY_IS_PASSWORD_RECORD (self), NULL);
+ g_assert (EPHY_IS_PASSWORD_RECORD (self));
return self->username_field;
}
@@ -342,7 +342,7 @@ ephy_password_record_get_username_field (EphyPasswordRecord *self)
const char *
ephy_password_record_get_password_field (EphyPasswordRecord *self)
{
- g_return_val_if_fail (EPHY_IS_PASSWORD_RECORD (self), NULL);
+ g_assert (EPHY_IS_PASSWORD_RECORD (self));
return self->password_field;
}
@@ -350,7 +350,7 @@ ephy_password_record_get_password_field (EphyPasswordRecord *self)
guint64
ephy_password_record_get_time_password_changed (EphyPasswordRecord *self)
{
- g_return_val_if_fail (EPHY_IS_PASSWORD_RECORD (self), 0);
+ g_assert (EPHY_IS_PASSWORD_RECORD (self));
return self->time_password_changed;
}
diff --git a/lib/sync/ephy-sync-crypto.c b/lib/sync/ephy-sync-crypto.c
index 38fea5b..e837aec 100644
--- a/lib/sync/ephy-sync-crypto.c
+++ b/lib/sync/ephy-sync-crypto.c
@@ -66,7 +66,7 @@ ephy_sync_crypto_hawk_options_new (const char *app,
void
ephy_sync_crypto_hawk_options_free (SyncCryptoHawkOptions *options)
{
- g_return_if_fail (options);
+ g_assert (options);
g_free (options->app);
g_free (options->dlg);
@@ -291,10 +291,10 @@ ephy_sync_crypto_hawk_header_new (const char *url,
guint8 *bytes;
gint64 ts;
- g_return_val_if_fail (url, NULL);
- g_return_val_if_fail (method, NULL);
- g_return_val_if_fail (id, NULL);
- g_return_val_if_fail (key, NULL);
+ g_assert (url);
+ g_assert (method);
+ g_assert (id);
+ g_assert (key);
ts = g_get_real_time () / 1000000;
hash = options ? g_strdup (options->hash) : NULL;
@@ -396,7 +396,7 @@ ephy_sync_crypto_hawk_header_new (const char *url,
void
ephy_sync_crypto_hawk_header_free (SyncCryptoHawkHeader *header)
{
- g_return_if_fail (header);
+ g_assert (header);
g_free (header->header);
ephy_sync_crypto_hawk_artifacts_free (header->artifacts);
@@ -435,7 +435,7 @@ ephy_sync_crypto_rsa_key_pair_new (void)
void
ephy_sync_crypto_rsa_key_pair_free (SyncCryptoRSAKeyPair *key_pair)
{
- g_return_if_fail (key_pair);
+ g_assert (key_pair);
rsa_public_key_clear (&key_pair->public);
rsa_private_key_clear (&key_pair->private);
@@ -453,13 +453,13 @@ ephy_sync_crypto_key_bundle_new (const char *aes_key_b64,
gsize aes_key_len;
gsize hmac_key_len;
- g_return_val_if_fail (aes_key_b64, NULL);
- g_return_val_if_fail (hmac_key_b64, NULL);
+ g_assert (aes_key_b64);
+ g_assert (hmac_key_b64);
aes_key = g_base64_decode (aes_key_b64, &aes_key_len);
- g_return_val_if_fail (aes_key_len == 32, NULL);
+ g_assert (aes_key_len == 32);
hmac_key = g_base64_decode (hmac_key_b64, &hmac_key_len);
- g_return_val_if_fail (hmac_key_len == 32, NULL);
+ g_assert (hmac_key_len == 32);
bundle = g_slice_new (SyncCryptoKeyBundle);
bundle->aes_key_hex = ephy_sync_utils_encode_hex (aes_key, aes_key_len);
@@ -474,7 +474,7 @@ ephy_sync_crypto_key_bundle_new (const char *aes_key_b64,
void
ephy_sync_crypto_key_bundle_free (SyncCryptoKeyBundle *bundle)
{
- g_return_if_fail (bundle);
+ g_assert (bundle);
g_free (bundle->aes_key_hex);
g_free (bundle->hmac_key_hex);
@@ -612,10 +612,10 @@ ephy_sync_crypto_derive_session_token (const char *session_token,
char *info;
gsize len = 32; /* sessionToken is always 32 bytes. */
- g_return_if_fail (session_token);
- g_return_if_fail (token_id);
- g_return_if_fail (req_hmac_key);
- g_return_if_fail (request_key);
+ g_assert (session_token);
+ g_assert (token_id);
+ g_assert (req_hmac_key);
+ g_assert (request_key);
token = ephy_sync_utils_decode_hex (session_token);
info = ephy_sync_crypto_kw ("sessionToken");
@@ -654,11 +654,11 @@ ephy_sync_crypto_derive_key_fetch_token (const char *key_fetch_token,
char *info_keys;
gsize len = 32; /* keyFetchToken is always 32 bytes. */
- g_return_if_fail (key_fetch_token);
- g_return_if_fail (token_id);
- g_return_if_fail (req_hmac_key);
- g_return_if_fail (resp_hmac_key);
- g_return_if_fail (resp_xor_key);
+ g_assert (key_fetch_token);
+ g_assert (token_id);
+ g_assert (req_hmac_key);
+ g_assert (resp_hmac_key);
+ g_assert (resp_xor_key);
kft = ephy_sync_utils_decode_hex (key_fetch_token);
info_kft = ephy_sync_crypto_kw ("keyFetchToken");
@@ -748,12 +748,12 @@ ephy_sync_crypto_derive_master_keys (const char *bundle_hex,
gboolean retval = TRUE;
gsize len = 32; /* The master sync keys are always 32 bytes. */
- g_return_val_if_fail (bundle_hex, FALSE);
- g_return_val_if_fail (resp_hmac_key, FALSE);
- g_return_val_if_fail (resp_xor_key, FALSE);
- g_return_val_if_fail (unwrap_kb, FALSE);
- g_return_val_if_fail (ka, FALSE);
- g_return_val_if_fail (kb, FALSE);
+ g_assert (bundle_hex);
+ g_assert (resp_hmac_key);
+ g_assert (resp_xor_key);
+ g_assert (unwrap_kb);
+ g_assert (ka);
+ g_assert (kb);
bundle = ephy_sync_utils_decode_hex (bundle_hex);
ciphertext = g_malloc (2 * len);
@@ -809,7 +809,7 @@ ephy_sync_crypto_derive_master_bundle (const guint8 *key)
const char *info = "identity.mozilla.com/picl/v1/oldsync";
gsize len = 32; /* kB is always 32 bytes. */
- g_return_val_if_fail (key, NULL);
+ g_assert (key);
/* Perform a two step HKDF with an all-zeros salt.
* T(1) will represent the AES key, T(2) will represent the HMAC key.
@@ -913,9 +913,9 @@ ephy_sync_crypto_create_assertion (const char *certificate,
gsize count;
int success;
- g_return_val_if_fail (certificate, NULL);
- g_return_val_if_fail (audience, NULL);
- g_return_val_if_fail (key_pair, NULL);
+ g_assert (certificate);
+ g_assert (audience);
+ g_assert (key_pair);
/* Encode the header and body to base64 url safe and join them. */
expires_at = g_get_real_time () / 1000 + seconds * 1000;
@@ -1023,8 +1023,8 @@ ephy_sync_crypto_encrypt_record (const char *cleartext,
guint8 *iv;
gsize ciphertext_len;
- g_return_val_if_fail (cleartext, NULL);
- g_return_val_if_fail (bundle, NULL);
+ g_assert (cleartext);
+ g_assert (bundle);
/* Get the encryption key and the HMAC key. */
aes_key = ephy_sync_utils_decode_hex (bundle->aes_key_hex);
@@ -1151,8 +1151,8 @@ ephy_sync_crypto_decrypt_record (const char *payload,
gsize ciphertext_len;
gsize iv_len;
- g_return_val_if_fail (payload, NULL);
- g_return_val_if_fail (bundle, NULL);
+ g_assert (payload);
+ g_assert (bundle);
/* Extract ciphertext, iv and hmac from payload. */
node = json_from_string (payload, &error);
diff --git a/lib/sync/ephy-sync-service.c b/lib/sync/ephy-sync-service.c
index b922491..02f25de 100644
--- a/lib/sync/ephy-sync-service.c
+++ b/lib/sync/ephy-sync-service.c
@@ -642,7 +642,7 @@ ephy_sync_service_forget_secrets (EphySyncService *self)
g_assert (self->secrets);
user = ephy_sync_utils_get_sync_user ();
- g_return_if_fail (user);
+ g_assert (user);
attributes = secret_attributes_build (EPHY_SYNC_SECRET_SCHEMA,
ACCOUNT_KEY, user,
@@ -2142,12 +2142,12 @@ ephy_sync_service_sign_in (EphySyncService *self,
guint8 *resp_xor_key;
char *token_id_hex;
- g_return_if_fail (EPHY_IS_SYNC_SERVICE (self));
- g_return_if_fail (email);
- g_return_if_fail (uid);
- g_return_if_fail (session_token);
- g_return_if_fail (key_fetch_token);
- g_return_if_fail (unwrap_kb);
+ g_assert (EPHY_IS_SYNC_SERVICE (self));
+ g_assert (email);
+ g_assert (uid);
+ g_assert (session_token);
+ g_assert (key_fetch_token);
+ g_assert (unwrap_kb);
self->is_signing_in = TRUE;
@@ -2214,8 +2214,8 @@ void
ephy_sync_service_register_manager (EphySyncService *self,
EphySynchronizableManager *manager)
{
- g_return_if_fail (EPHY_IS_SYNC_SERVICE (self));
- g_return_if_fail (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
+ g_assert (EPHY_IS_SYNC_SERVICE (self));
+ g_assert (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
if (!g_slist_find (self->managers, manager)) {
self->managers = g_slist_prepend (self->managers, manager);
@@ -2231,8 +2231,8 @@ void
ephy_sync_service_unregister_manager (EphySyncService *self,
EphySynchronizableManager *manager)
{
- g_return_if_fail (EPHY_IS_SYNC_SERVICE (self));
- g_return_if_fail (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
+ g_assert (EPHY_IS_SYNC_SERVICE (self));
+ g_assert (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
self->managers = g_slist_remove (self->managers, manager);
@@ -2277,7 +2277,7 @@ ephy_sync_service_register_device (EphySyncService *self,
char *body;
char *endpoint;
- g_return_if_fail (EPHY_IS_SYNC_SERVICE (self));
+ g_assert (EPHY_IS_SYNC_SERVICE (self));
/* Make protocol. */
protocol = g_strdup_printf ("1.%d", EPHY_STORAGE_VERSION);
@@ -2398,7 +2398,7 @@ void
ephy_sync_service_sign_out (EphySyncService *self,
gboolean unregister_device)
{
- g_return_if_fail (EPHY_IS_SYNC_SERVICE (self));
+ g_assert (EPHY_IS_SYNC_SERVICE (self));
/* If we sign out without unregistering the device, then the current id of
* the device should not be cleared, but preserved for further use (Ephy will
@@ -2434,8 +2434,8 @@ ephy_sync_service_sign_out (EphySyncService *self,
void
ephy_sync_service_sync (EphySyncService *self)
{
- g_return_if_fail (EPHY_IS_SYNC_SERVICE (self));
- g_return_if_fail (ephy_sync_utils_user_is_signed_in ());
+ g_assert (EPHY_IS_SYNC_SERVICE (self));
+ g_assert (ephy_sync_utils_user_is_signed_in ());
ephy_sync_service_sync_internal (self);
}
@@ -2443,9 +2443,9 @@ ephy_sync_service_sync (EphySyncService *self)
void
ephy_sync_service_start_sync (EphySyncService *self)
{
- g_return_if_fail (EPHY_IS_SYNC_SERVICE (self));
- g_return_if_fail (ephy_sync_utils_user_is_signed_in ());
- g_return_if_fail (self->sync_periodically);
+ g_assert (EPHY_IS_SYNC_SERVICE (self));
+ g_assert (ephy_sync_utils_user_is_signed_in ());
+ g_assert (self->sync_periodically);
ephy_sync_service_sync_internal (self);
ephy_sync_service_schedule_periodical_sync (self);
diff --git a/lib/sync/ephy-synchronizable-manager.c b/lib/sync/ephy-synchronizable-manager.c
index 7abd710..fb34211 100644
--- a/lib/sync/ephy-synchronizable-manager.c
+++ b/lib/sync/ephy-synchronizable-manager.c
@@ -76,7 +76,7 @@ ephy_synchronizable_manager_get_collection_name (EphySynchronizableManager *mana
{
EphySynchronizableManagerInterface *iface;
- g_return_val_if_fail (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager), NULL);
+ g_assert (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
iface = EPHY_SYNCHRONIZABLE_MANAGER_GET_IFACE (manager);
return iface->get_collection_name (manager);
@@ -95,7 +95,7 @@ ephy_synchronizable_manager_get_synchronizable_type (EphySynchronizableManager *
{
EphySynchronizableManagerInterface *iface;
- g_return_val_if_fail (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager), 0);
+ g_assert (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
iface = EPHY_SYNCHRONIZABLE_MANAGER_GET_IFACE (manager);
return iface->get_synchronizable_type (manager);
@@ -115,7 +115,7 @@ ephy_synchronizable_manager_is_initial_sync (EphySynchronizableManager *manager)
{
EphySynchronizableManagerInterface *iface;
- g_return_val_if_fail (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager), FALSE);
+ g_assert (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
iface = EPHY_SYNCHRONIZABLE_MANAGER_GET_IFACE (manager);
return iface->is_initial_sync (manager);
@@ -135,7 +135,7 @@ ephy_synchronizable_manager_set_is_initial_sync (EphySynchronizableManager *mana
{
EphySynchronizableManagerInterface *iface;
- g_return_if_fail (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
+ g_assert (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
iface = EPHY_SYNCHRONIZABLE_MANAGER_GET_IFACE (manager);
iface->set_is_initial_sync (manager, is_initial);
@@ -155,7 +155,7 @@ ephy_synchronizable_manager_get_sync_time (EphySynchronizableManager *manager)
{
EphySynchronizableManagerInterface *iface;
- g_return_val_if_fail (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager), 0);
+ g_assert (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
iface = EPHY_SYNCHRONIZABLE_MANAGER_GET_IFACE (manager);
return iface->get_sync_time (manager);
@@ -174,7 +174,7 @@ ephy_synchronizable_manager_set_sync_time (EphySynchronizableManager *manager,
{
EphySynchronizableManagerInterface *iface;
- g_return_if_fail (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
+ g_assert (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
iface = EPHY_SYNCHRONIZABLE_MANAGER_GET_IFACE (manager);
iface->set_sync_time (manager, sync_time);
@@ -193,8 +193,8 @@ ephy_synchronizable_manager_add (EphySynchronizableManager *manager,
{
EphySynchronizableManagerInterface *iface;
- g_return_if_fail (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
- g_return_if_fail (EPHY_IS_SYNCHRONIZABLE (synchronizable));
+ g_assert (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
+ g_assert (EPHY_IS_SYNCHRONIZABLE (synchronizable));
iface = EPHY_SYNCHRONIZABLE_MANAGER_GET_IFACE (manager);
iface->add (manager, synchronizable);
@@ -213,8 +213,8 @@ ephy_synchronizable_manager_remove (EphySynchronizableManager *manager,
{
EphySynchronizableManagerInterface *iface;
- g_return_if_fail (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
- g_return_if_fail (EPHY_IS_SYNCHRONIZABLE (synchronizable));
+ g_assert (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
+ g_assert (EPHY_IS_SYNCHRONIZABLE (synchronizable));
iface = EPHY_SYNCHRONIZABLE_MANAGER_GET_IFACE (manager);
iface->remove (manager, synchronizable);
@@ -239,8 +239,8 @@ ephy_synchronizable_manager_save (EphySynchronizableManager *manager,
{
EphySynchronizableManagerInterface *iface;
- g_return_if_fail (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
- g_return_if_fail (EPHY_IS_SYNCHRONIZABLE (synchronizable));
+ g_assert (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
+ g_assert (EPHY_IS_SYNCHRONIZABLE (synchronizable));
iface = EPHY_SYNCHRONIZABLE_MANAGER_GET_IFACE (manager);
iface->save (manager, synchronizable);
@@ -274,8 +274,8 @@ ephy_synchronizable_manager_merge (EphySynchronizableManager *manag
{
EphySynchronizableManagerInterface *iface;
- g_return_if_fail (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
- g_return_if_fail (callback);
+ g_assert (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
+ g_assert (callback);
iface = EPHY_SYNCHRONIZABLE_MANAGER_GET_IFACE (manager);
iface->merge (manager, is_initial, remotes_deleted, remotes_updated, callback, user_data);
diff --git a/lib/sync/ephy-synchronizable.c b/lib/sync/ephy-synchronizable.c
index 07b66f2..77cb8be 100644
--- a/lib/sync/ephy-synchronizable.c
+++ b/lib/sync/ephy-synchronizable.c
@@ -45,7 +45,7 @@ ephy_synchronizable_get_id (EphySynchronizable *synchronizable)
{
EphySynchronizableInterface *iface;
- g_return_val_if_fail (EPHY_IS_SYNCHRONIZABLE (synchronizable), NULL);
+ g_assert (EPHY_IS_SYNCHRONIZABLE (synchronizable));
iface = EPHY_SYNCHRONIZABLE_GET_IFACE (synchronizable);
return iface->get_id (synchronizable);
@@ -64,7 +64,7 @@ ephy_synchronizable_get_server_time_modified (EphySynchronizable *synchronizable
{
EphySynchronizableInterface *iface;
- g_return_val_if_fail (EPHY_IS_SYNCHRONIZABLE (synchronizable), 0);
+ g_assert (EPHY_IS_SYNCHRONIZABLE (synchronizable));
iface = EPHY_SYNCHRONIZABLE_GET_IFACE (synchronizable);
return iface->get_server_time_modified (synchronizable);
@@ -83,7 +83,7 @@ ephy_synchronizable_set_server_time_modified (EphySynchronizable *synchronizable
{
EphySynchronizableInterface *iface;
- g_return_if_fail (EPHY_IS_SYNCHRONIZABLE (synchronizable));
+ g_assert (EPHY_IS_SYNCHRONIZABLE (synchronizable));
iface = EPHY_SYNCHRONIZABLE_GET_IFACE (synchronizable);
iface->set_server_time_modified (synchronizable, server_time_modified);
@@ -109,8 +109,8 @@ ephy_synchronizable_to_bso (EphySynchronizable *synchronizable,
{
EphySynchronizableInterface *iface;
- g_return_val_if_fail (EPHY_IS_SYNCHRONIZABLE (synchronizable), NULL);
- g_return_val_if_fail (bundle, NULL);
+ g_assert (EPHY_IS_SYNCHRONIZABLE (synchronizable));
+ g_assert (bundle);
iface = EPHY_SYNCHRONIZABLE_GET_IFACE (synchronizable);
return iface->to_bso (synchronizable, bundle);
@@ -151,9 +151,9 @@ ephy_synchronizable_from_bso (JsonNode *bso,
const char *payload = NULL;
double server_time_modified;
- g_return_val_if_fail (bso, NULL);
- g_return_val_if_fail (bundle, NULL);
- g_return_val_if_fail (is_deleted, NULL);
+ g_assert (bso);
+ g_assert (bundle);
+ g_assert (is_deleted);
json = json_node_get_object (bso);
if (!json) {
@@ -227,8 +227,8 @@ ephy_synchronizable_default_to_bso (EphySynchronizable *synchronizable,
char *serialized;
char *payload;
- g_return_val_if_fail (EPHY_IS_SYNCHRONIZABLE (synchronizable), NULL);
- g_return_val_if_fail (bundle, NULL);
+ g_assert (EPHY_IS_SYNCHRONIZABLE (synchronizable));
+ g_assert (bundle);
serialized = json_gobject_to_data (G_OBJECT (synchronizable), NULL);
payload = ephy_sync_crypto_encrypt_record (serialized, bundle);
diff --git a/lib/sync/ephy-tabs-catalog.c b/lib/sync/ephy-tabs-catalog.c
index 795a6cd..98a75bc 100644
--- a/lib/sync/ephy-tabs-catalog.c
+++ b/lib/sync/ephy-tabs-catalog.c
@@ -42,7 +42,7 @@ ephy_tabs_catalog_get_tabs_info (EphyTabsCatalog *catalog)
{
EphyTabsCatalogInterface *iface;
- g_return_val_if_fail (EPHY_IS_TABS_CATALOG (catalog), NULL);
+ g_assert (EPHY_IS_TABS_CATALOG (catalog));
iface = EPHY_TABS_CATALOG_GET_IFACE (catalog);
return iface->get_tabs_info (catalog);
@@ -66,7 +66,7 @@ ephy_tab_info_new (const char *title,
void
ephy_tab_info_free (EphyTabInfo *info)
{
- g_return_if_fail (info);
+ g_assert (info);
g_free (info->title);
g_free (info->url);
diff --git a/lib/widgets/ephy-certificate-dialog.c b/lib/widgets/ephy-certificate-dialog.c
index 8c564a0..a8df188 100644
--- a/lib/widgets/ephy-certificate-dialog.c
+++ b/lib/widgets/ephy-certificate-dialog.c
@@ -336,8 +336,8 @@ ephy_certificate_dialog_new (GtkWindow *parent,
{
GtkWidget *dialog;
- g_return_val_if_fail (address != NULL, NULL);
- g_return_val_if_fail (G_IS_TLS_CERTIFICATE (certificate), NULL);
+ g_assert (address != NULL);
+ g_assert (G_IS_TLS_CERTIFICATE (certificate));
dialog = GTK_WIDGET (g_object_new (EPHY_TYPE_CERTIFICATE_DIALOG,
"address", address,
diff --git a/lib/widgets/ephy-download-widget.c b/lib/widgets/ephy-download-widget.c
index 3631273..1dc47d9 100644
--- a/lib/widgets/ephy-download-widget.c
+++ b/lib/widgets/ephy-download-widget.c
@@ -486,7 +486,7 @@ ephy_download_widget_init (EphyDownloadWidget *widget)
EphyDownload *
ephy_download_widget_get_download (EphyDownloadWidget *widget)
{
- g_return_val_if_fail (EPHY_IS_DOWNLOAD_WIDGET (widget), NULL);
+ g_assert (EPHY_IS_DOWNLOAD_WIDGET (widget));
return widget->download;
}
@@ -504,7 +504,7 @@ ephy_download_widget_new (EphyDownload *ephy_download)
{
EphyDownloadWidget *widget;
- g_return_val_if_fail (EPHY_IS_DOWNLOAD (ephy_download), NULL);
+ g_assert (EPHY_IS_DOWNLOAD (ephy_download));
widget = g_object_new (EPHY_TYPE_DOWNLOAD_WIDGET,
"download", ephy_download, NULL);
diff --git a/lib/widgets/ephy-file-chooser.c b/lib/widgets/ephy-file-chooser.c
index aeec06d..a0a53b7 100644
--- a/lib/widgets/ephy-file-chooser.c
+++ b/lib/widgets/ephy-file-chooser.c
@@ -99,8 +99,8 @@ ephy_create_file_chooser (const char *title,
GtkFileFilter *filter[EPHY_FILE_FILTER_LAST];
char *downloads_dir;
- g_return_val_if_fail (GTK_IS_WINDOW (parent), NULL);
- g_return_val_if_fail (default_filter >= 0 && default_filter <= EPHY_FILE_FILTER_LAST, NULL);
+ g_assert (GTK_IS_WINDOW (parent));
+ g_assert (default_filter >= 0 && default_filter <= EPHY_FILE_FILTER_LAST);
dialog = GTK_FILE_CHOOSER (gtk_file_chooser_native_new (title,
GTK_WINDOW (parent),
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index 5d220d1..472d0ab 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -135,7 +135,7 @@ ephy_location_entry_title_widget_get_address (EphyTitleWidget *widget)
{
EphyLocationEntry *entry = EPHY_LOCATION_ENTRY (widget);
- g_return_val_if_fail (entry, NULL);
+ g_assert (entry);
return gtk_entry_get_text (GTK_ENTRY (widget));
}
@@ -150,7 +150,7 @@ ephy_location_entry_title_widget_set_address (EphyTitleWidget *widget,
char *effective_text = NULL, *selection = NULL;
int start, end;
- g_return_if_fail (widget);
+ g_assert (widget);
/* Setting a new text will clear the clipboard. This makes it impossible
* to copy&paste from the location entry of one tab into another tab, see
@@ -160,7 +160,7 @@ ephy_location_entry_title_widget_set_address (EphyTitleWidget *widget,
if (gtk_widget_get_realized (GTK_WIDGET (entry))) {
clipboard = gtk_widget_get_clipboard (GTK_WIDGET (entry),
GDK_SELECTION_PRIMARY);
- g_return_if_fail (clipboard != NULL);
+ g_assert (clipboard != NULL);
if (gtk_clipboard_get_owner (clipboard) == G_OBJECT (entry) &&
gtk_editable_get_selection_bounds (GTK_EDITABLE (entry),
@@ -206,7 +206,7 @@ ephy_location_entry_title_widget_get_security_level (EphyTitleWidget *widget)
{
EphyLocationEntry *entry = EPHY_LOCATION_ENTRY (widget);
- g_return_val_if_fail (entry, EPHY_SECURITY_LEVEL_TO_BE_DETERMINED);
+ g_assert (entry);
return entry->security_level;
}
@@ -219,7 +219,7 @@ ephy_location_entry_title_widget_set_security_level (EphyTitleWidget *widget,
EphyLocationEntry *entry = EPHY_LOCATION_ENTRY (widget);
const char *icon_name;
- g_return_if_fail (entry);
+ g_assert (entry);
icon_name = ephy_security_level_to_icon_name (security_level);
gtk_entry_set_icon_from_icon_name (GTK_ENTRY (widget),
@@ -889,7 +889,7 @@ ephy_location_entry_set_bookmark_icon_state (EphyLocationEntry
{
GtkStyleContext *context;
- g_return_if_fail (EPHY_IS_LOCATION_ENTRY (entry));
+ g_assert (EPHY_IS_LOCATION_ENTRY (entry));
context = gtk_widget_get_style_context (GTK_WIDGET (entry));
@@ -941,8 +941,8 @@ void
ephy_location_entry_set_add_bookmark_popover (EphyLocationEntry *entry,
GtkPopover *popover)
{
- g_return_if_fail (EPHY_IS_LOCATION_ENTRY (entry));
- g_return_if_fail (GTK_IS_POPOVER (popover));
+ g_assert (EPHY_IS_LOCATION_ENTRY (entry));
+ g_assert (GTK_IS_POPOVER (popover));
entry->add_bookmark_popover = popover;
}
diff --git a/lib/widgets/ephy-security-popover.c b/lib/widgets/ephy-security-popover.c
index 2f5151c..ff7dc23 100644
--- a/lib/widgets/ephy-security-popover.c
+++ b/lib/widgets/ephy-security-popover.c
@@ -348,7 +348,7 @@ GtkWidget *ephy_security_popover_new (GtkWidget *relative_to,
GTlsCertificateFlags tls_errors,
EphySecurityLevel security_level)
{
- g_return_val_if_fail (address != NULL, NULL);
+ g_assert (address != NULL);
return GTK_WIDGET (g_object_new (EPHY_TYPE_SECURITY_POPOVER,
"address", address,
diff --git a/lib/widgets/ephy-title-box.c b/lib/widgets/ephy-title-box.c
index 6446245..a471590 100644
--- a/lib/widgets/ephy-title-box.c
+++ b/lib/widgets/ephy-title-box.c
@@ -134,7 +134,7 @@ ephy_title_box_title_widget_get_address (EphyTitleWidget *widget)
{
EphyTitleBox *title_box = EPHY_TITLE_BOX (widget);
- g_return_val_if_fail (title_box, NULL);
+ g_assert (title_box);
return gtk_label_get_text (GTK_LABEL (title_box->subtitle));
}
@@ -145,7 +145,7 @@ ephy_title_box_title_widget_set_address (EphyTitleWidget *widget,
{
EphyTitleBox *title_box = EPHY_TITLE_BOX (widget);
- g_return_if_fail (title_box);
+ g_assert (title_box);
if (address && *address)
gtk_label_set_text (GTK_LABEL (title_box->subtitle), address);
@@ -156,7 +156,7 @@ ephy_title_box_title_widget_get_security_level (EphyTitleWidget *widget)
{
EphyTitleBox *title_box = EPHY_TITLE_BOX (widget);
- g_return_val_if_fail (title_box, EPHY_SECURITY_LEVEL_TO_BE_DETERMINED);
+ g_assert (title_box);
return title_box->security_level;
}
@@ -168,7 +168,7 @@ ephy_title_box_title_widget_set_security_level (EphyTitleWidget *widget,
EphyTitleBox *title_box = EPHY_TITLE_BOX (widget);
const char *icon_name;
- g_return_if_fail (title_box);
+ g_assert (title_box);
icon_name = ephy_security_level_to_icon_name (security_level);
diff --git a/lib/widgets/ephy-title-widget.c b/lib/widgets/ephy-title-widget.c
index f0615ff..1b1d4e8 100644
--- a/lib/widgets/ephy-title-widget.c
+++ b/lib/widgets/ephy-title-widget.c
@@ -56,11 +56,11 @@ ephy_title_widget_get_address (EphyTitleWidget *widget)
{
EphyTitleWidgetInterface *iface;
- g_return_val_if_fail (EPHY_IS_TITLE_WIDGET (widget), NULL);
+ g_assert (EPHY_IS_TITLE_WIDGET (widget));
iface = EPHY_TITLE_WIDGET_GET_IFACE (widget);
- g_return_val_if_fail (iface->get_address, NULL);
+ g_assert (iface->get_address);
return iface->get_address (widget);
}
@@ -70,11 +70,11 @@ ephy_title_widget_set_address (EphyTitleWidget *widget,
{
EphyTitleWidgetInterface *iface;
- g_return_if_fail (EPHY_IS_TITLE_WIDGET (widget));
+ g_assert (EPHY_IS_TITLE_WIDGET (widget));
iface = EPHY_TITLE_WIDGET_GET_IFACE (widget);
- g_return_if_fail (iface->set_address);
+ g_assert (iface->set_address);
iface->set_address (widget, address);
}
@@ -83,11 +83,11 @@ ephy_title_widget_get_security_level (EphyTitleWidget *widget)
{
EphyTitleWidgetInterface *iface;
- g_return_val_if_fail (EPHY_IS_TITLE_WIDGET (widget), EPHY_SECURITY_LEVEL_TO_BE_DETERMINED);
+ g_assert (EPHY_IS_TITLE_WIDGET (widget));
iface = EPHY_TITLE_WIDGET_GET_IFACE (widget);
- g_return_val_if_fail (iface->get_security_level, EPHY_SECURITY_LEVEL_TO_BE_DETERMINED);
+ g_assert (iface->get_security_level);
return iface->get_security_level (widget);
}
@@ -97,10 +97,10 @@ ephy_title_widget_set_security_level (EphyTitleWidget *widget,
{
EphyTitleWidgetInterface *iface;
- g_return_if_fail (EPHY_IS_TITLE_WIDGET (widget));
+ g_assert (EPHY_IS_TITLE_WIDGET (widget));
iface = EPHY_TITLE_WIDGET_GET_IFACE (widget);
- g_return_if_fail (iface->set_security_level);
+ g_assert (iface->set_security_level);
iface->set_security_level (widget, security_level);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]