Commit 489df78b authored by Michael Catanzaro's avatar Michael Catanzaro

Purge g_return from lib/

parent beaba05a
......@@ -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);
......
......@@ -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, '_');
}
......
......@@ -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++) {
......
......@@ -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));
......
......@@ -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));
......
......@@ -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;
......
......@@ -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);
}
......@@ -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;
......
......@@ -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);
......
......@@ -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;
......
......@@ -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));
......
......@@ -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=?";
......
......@@ -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 ();
......
......@@ -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);
......
......@@ -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,
......
......@@ -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;
......
......@@ -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);
......
......@@ -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_