Commit cc3de68e authored by 15:08:59  Tim Janik's avatar 15:08:59 Tim Janik Committed by Tim Janik

http://mail.gnome.org/archives/gtk-devel-list/2007-October/msg00089.html

2007-12-10 15:08:59  Tim Janik  <timj@imendio.com>

        * let g_warn_if_fail replace g_assert as discussed here:
          http://mail.gnome.org/archives/gtk-devel-list/2007-October/msg00089.html

        * fix bug #502498: Test framework assertion failures should follow
        gcc error format.

        * gmessages.h, gmessages.c: deprecated g_assert_warning() which is
        unused now. removed g_assert*() definitions whcih are provided by 
        gtestutils.h now. added g_warn_if_reached() and g_warn_if_fail()  
        which are recommended as g_assert/g_assert_not_reached replacements
        for non-test programs.
        added g_warn_message() to implement g_warn_*() macros.
        use emacs-next-error friendly formatting for file:line: for warnings.

        * gtestutils.h, gtestutils.c: use emacs-next-error friendly formatting.
        implement g_assert_not_reached() with g_assertion_message() and
        g_assert() in terms of g_assertion_message_expr() so we'll be able to
        provide assertion messages in test logs.

        * gkeyfile.c, gbookmarkfile.c: changed g_assert*() to g_warn_if_fail()
        or g_return_if_fail() where suitable.

        * gio/: changed g_assert to g_warn_if_fail.



svn path=/trunk/; revision=6086
parent 0dbfa89b
2007-12-10 15:08:59 Tim Janik <timj@imendio.com>
* let g_warn_if_fail replace g_assert as discussed here:
http://mail.gnome.org/archives/gtk-devel-list/2007-October/msg00089.html
* fix bug #502498: Test framework assertion failures should follow
gcc error format.
* gmessages.h, gmessages.c: deprecated g_assert_warning() which is
unused now. removed g_assert*() definitions whcih are provided by
gtestutils.h now. added g_warn_if_reached() and g_warn_if_fail()
which are recommended as g_assert/g_assert_not_reached replacements
for non-test programs.
added g_warn_message() to implement g_warn_*() macros.
use emacs-next-error friendly formatting for file:line: for warnings.
* gtestutils.h, gtestutils.c: use emacs-next-error friendly formatting.
implement g_assert_not_reached() with g_assertion_message() and
g_assert() in terms of g_assertion_message_expr() so we'll be able to
provide assertion messages in test logs.
* gkeyfile.c, gbookmarkfile.c: changed g_assert*() to g_warn_if_fail()
or g_return_if_fail() where suitable.
* gio/: changed g_assert to g_warn_if_fail.
2007-12-10 13:02:08 Tim Janik <timj@imendio.com>
* glib/gtestutils.c (g_assertion_message_cmpnum): applied patch by Tommi
......
......@@ -111,7 +111,7 @@ fd_source_dispatch (GSource *source,
GFDSourceFunc func = (GFDSourceFunc)callback;
FDSource *fd_source = (FDSource *)source;
g_assert (func != NULL);
g_warn_if_fail (func != NULL);
return (*func) (user_data, fd_source->pollfd.revents, fd_source->pollfd.fd);
}
......
......@@ -983,7 +983,7 @@ g_buffered_input_stream_real_fill_finish (GBufferedInputStream *stream,
gssize nread;
simple = G_SIMPLE_ASYNC_RESULT (result);
g_assert (g_simple_async_result_get_source_tag (simple) == g_buffered_input_stream_real_fill_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_buffered_input_stream_real_fill_async);
nread = g_simple_async_result_get_op_res_gssize (simple);
return nread;
......@@ -1161,7 +1161,7 @@ g_buffered_input_stream_read_finish (GInputStream *stream,
simple = G_SIMPLE_ASYNC_RESULT (result);
g_assert (g_simple_async_result_get_source_tag (simple) == g_buffered_input_stream_read_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_buffered_input_stream_read_async);
data = g_simple_async_result_get_op_res_gpointer (simple);
......@@ -1333,7 +1333,7 @@ g_buffered_input_stream_skip_finish (GInputStream *stream,
simple = G_SIMPLE_ASYNC_RESULT (result);
g_assert (g_simple_async_result_get_source_tag (simple) == g_buffered_input_stream_skip_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_buffered_input_stream_skip_async);
data = g_simple_async_result_get_op_res_gpointer (simple);
......
......@@ -659,7 +659,7 @@ g_buffered_output_stream_write_finish (GOutputStream *stream,
buffered_stream = G_BUFFERED_OUTPUT_STREAM (stream);
priv = buffered_stream->priv;
g_assert (g_simple_async_result_get_source_tag (simple) ==
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) ==
g_buffered_output_stream_write_async);
wdata = g_simple_async_result_get_op_res_gpointer (simple);
......@@ -712,7 +712,7 @@ g_buffered_output_stream_flush_finish (GOutputStream *stream,
simple = G_SIMPLE_ASYNC_RESULT (result);
g_assert (g_simple_async_result_get_source_tag (simple) ==
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) ==
g_buffered_output_stream_flush_async);
return TRUE;
......@@ -754,7 +754,7 @@ g_buffered_output_stream_close_finish (GOutputStream *stream,
simple = G_SIMPLE_ASYNC_RESULT (result);
g_assert (g_simple_async_result_get_source_tag (simple) ==
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) ==
g_buffered_output_stream_flush_async);
return TRUE;
......
......@@ -169,7 +169,7 @@ g_push_current_cancellable (GCancellable *cancellable)
{
GSList *l;
g_assert (cancellable != NULL);
g_return_if_fail (cancellable != NULL);
l = g_static_private_get (&current_cancellable);
l = g_slist_prepend (l, cancellable);
......@@ -190,8 +190,8 @@ g_pop_current_cancellable (GCancellable *cancellable)
l = g_static_private_get (&current_cancellable);
g_assert (l != NULL);
g_assert (l->data == cancellable);
g_return_if_fail (l != NULL);
g_return_if_fail (l->data == cancellable);
l = g_slist_delete_link (l, l);
g_static_private_set (&current_cancellable, l, NULL);
......
......@@ -313,7 +313,7 @@ read_data (GDataInputStream *stream,
res = g_input_stream_read (G_INPUT_STREAM (stream),
buffer, size,
NULL, NULL);
g_assert (res == size);
g_warn_if_fail (res == size);
return TRUE;
}
......@@ -797,7 +797,7 @@ g_data_input_stream_read_line (GDataInputStream *stream,
NULL, NULL);
if (length)
*length = (gsize)found_pos;
g_assert (res == found_pos + newline_len);
g_warn_if_fail (res == found_pos + newline_len);
line[found_pos] = 0;
return line;
......@@ -917,7 +917,7 @@ g_data_input_stream_read_until (GDataInputStream *stream,
NULL, NULL);
if (length)
*length = (gsize)found_pos;
g_assert (res == found_pos + stop_char_len);
g_warn_if_fail (res == found_pos + stop_char_len);
data_until[found_pos] = 0;
return data_until;
......
......@@ -496,7 +496,7 @@ unescape_string (const gchar *escaped_string,
}
*out = '\0';
g_assert (out - result <= strlen (escaped_string));
g_warn_if_fail (out - result <= strlen (escaped_string));
return result;
}
......
......@@ -3291,7 +3291,7 @@ g_file_real_query_info_finish (GFile *file,
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
QueryInfoAsyncData *data;
g_assert (g_simple_async_result_get_source_tag (simple) == g_file_real_query_info_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_query_info_async);
data = g_simple_async_result_get_op_res_gpointer (simple);
if (data->info)
......@@ -3368,7 +3368,7 @@ g_file_real_enumerate_children_finish (GFile *file,
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
EnumerateChildrenAsyncData *data;
g_assert (g_simple_async_result_get_source_tag (simple) == g_file_real_enumerate_children_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_enumerate_children_async);
data = g_simple_async_result_get_op_res_gpointer (simple);
if (data->enumerator)
......@@ -3422,7 +3422,7 @@ g_file_real_read_finish (GFile *file,
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
gpointer op;
g_assert (g_simple_async_result_get_source_tag (simple) == g_file_real_read_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_read_async);
op = g_simple_async_result_get_op_res_gpointer (simple);
if (op)
......@@ -3485,7 +3485,7 @@ g_file_real_append_to_finish (GFile *file,
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
gpointer op;
g_assert (g_simple_async_result_get_source_tag (simple) == g_file_real_append_to_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_append_to_async);
op = g_simple_async_result_get_op_res_gpointer (simple);
if (op)
......@@ -3548,7 +3548,7 @@ g_file_real_create_finish (GFile *file,
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
gpointer op;
g_assert (g_simple_async_result_get_source_tag (simple) == g_file_real_create_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_create_async);
op = g_simple_async_result_get_op_res_gpointer (simple);
if (op)
......@@ -3636,7 +3636,7 @@ g_file_real_replace_finish (GFile *file,
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
ReplaceAsyncData *data;
g_assert (g_simple_async_result_get_source_tag (simple) == g_file_real_replace_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_replace_async);
data = g_simple_async_result_get_op_res_gpointer (simple);
if (data->stream)
......@@ -3710,7 +3710,7 @@ g_file_real_set_display_name_finish (GFile *file,
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
SetDisplayNameAsyncData *data;
g_assert (g_simple_async_result_get_source_tag (simple) == g_file_real_set_display_name_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_set_display_name_async);
data = g_simple_async_result_get_op_res_gpointer (simple);
if (data->file)
......@@ -3785,7 +3785,7 @@ g_file_real_set_attributes_finish (GFile *file,
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
SetInfoAsyncData *data;
g_assert (g_simple_async_result_get_source_tag (simple) == g_file_real_set_attributes_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_real_set_attributes_async);
data = g_simple_async_result_get_op_res_gpointer (simple);
......@@ -4338,7 +4338,7 @@ g_file_load_partial_contents_finish (GFile *file,
if (g_simple_async_result_propagate_error (simple, error))
return FALSE;
g_assert (g_simple_async_result_get_source_tag (simple) == g_file_load_contents_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_load_contents_async);
data = g_simple_async_result_get_op_res_gpointer (simple);
......@@ -4738,7 +4738,7 @@ g_file_replace_contents_finish (GFile *file,
if (g_simple_async_result_propagate_error (simple, error))
return FALSE;
g_assert (g_simple_async_result_get_source_tag (simple) == g_file_replace_contents_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_replace_contents_async);
data = g_simple_async_result_get_op_res_gpointer (simple);
......
......@@ -602,7 +602,7 @@ g_file_enumerator_real_next_files_finish (GFileEnumerator *enumer
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
NextAsyncOp *op;
g_assert (g_simple_async_result_get_source_tag (simple) ==
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) ==
g_file_enumerator_real_next_files_async);
op = g_simple_async_result_get_op_res_gpointer (simple);
......@@ -663,7 +663,7 @@ g_file_enumerator_real_close_finish (GFileEnumerator *enumerator,
GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
g_assert (g_simple_async_result_get_source_tag (simple) ==
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) ==
g_file_enumerator_real_close_async);
return TRUE;
}
......
......@@ -252,7 +252,7 @@ g_file_icon_load_finish (GLoadableIcon *icon,
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
gpointer op;
g_assert (g_simple_async_result_get_source_tag (simple) == g_file_icon_load_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_icon_load_async);
if (type)
*type = NULL;
......
......@@ -477,7 +477,7 @@ g_file_input_stream_real_query_info_finish (GFileInputStream *stream,
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
QueryInfoAsyncData *data;
g_assert (g_simple_async_result_get_source_tag (simple) == g_file_input_stream_real_query_info_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_input_stream_real_query_info_async);
data = g_simple_async_result_get_op_res_gpointer (simple);
if (data->info)
......
......@@ -591,7 +591,7 @@ g_file_output_stream_real_query_info_finish (GFileOutputStream *stream,
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
QueryInfoAsyncData *data;
g_assert (g_simple_async_result_get_source_tag (simple) == g_file_output_stream_real_query_info_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_file_output_stream_real_query_info_async);
data = g_simple_async_result_get_op_res_gpointer (simple);
if (data->info)
......
......@@ -976,7 +976,7 @@ g_input_stream_real_read_finish (GInputStream *stream,
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
ReadData *op;
g_assert (g_simple_async_result_get_source_tag (simple) ==
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) ==
g_input_stream_real_read_async);
op = g_simple_async_result_get_op_res_gpointer (simple);
......@@ -1133,7 +1133,7 @@ g_input_stream_real_skip_finish (GInputStream *stream,
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
SkipData *op;
g_assert (g_simple_async_result_get_source_tag (simple) == g_input_stream_real_skip_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_input_stream_real_skip_async);
op = g_simple_async_result_get_op_res_gpointer (simple);
return op->count_skipped;
}
......@@ -1190,7 +1190,7 @@ g_input_stream_real_close_finish (GInputStream *stream,
GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
g_assert (g_simple_async_result_get_source_tag (simple) == g_input_stream_real_close_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_input_stream_real_close_async);
return TRUE;
}
......
......@@ -261,7 +261,7 @@ g_loadable_icon_real_load_finish (GLoadableIcon *icon,
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
LoadData *data;
g_assert (g_simple_async_result_get_source_tag (simple) == g_loadable_icon_real_load_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_loadable_icon_real_load_async);
data = g_simple_async_result_get_op_res_gpointer (simple);
......
......@@ -102,7 +102,7 @@ g_local_directory_monitor_constructor (GType type,
{
if (strcmp ("dirname", g_param_spec_get_name (construct_properties[i].pspec)) == 0)
{
g_assert (G_VALUE_HOLDS_STRING (construct_properties[i].value));
g_warn_if_fail (G_VALUE_HOLDS_STRING (construct_properties[i].value));
dirname = g_value_get_string (construct_properties[i].value);
break;
}
......
......@@ -728,7 +728,7 @@ set_xattr (char *filename,
}
else
{
g_assert (g_str_has_prefix (escaped_attribute, "xattr_sys:"));
g_warn_if_fail (g_str_has_prefix (escaped_attribute, "xattr_sys:"));
escaped_attribute += 10;
is_user = FALSE;
}
......@@ -991,7 +991,7 @@ make_valid_utf8 (const char *name)
g_string_append (string, remainder);
g_assert (g_utf8_validate (string->str, -1, NULL));
g_warn_if_fail (g_utf8_validate (string->str, -1, NULL));
return g_string_free (string, FALSE);
}
......
......@@ -83,13 +83,13 @@ g_local_file_monitor_constructor (GType type,
{
if (strcmp ("filename", g_param_spec_get_name (construct_properties[i].pspec)) == 0)
{
g_assert (G_VALUE_HOLDS_STRING (construct_properties[i].value));
g_warn_if_fail (G_VALUE_HOLDS_STRING (construct_properties[i].value));
filename = g_value_get_string (construct_properties[i].value);
break;
}
}
g_assert (filename != NULL);
g_warn_if_fail (filename != NULL);
local_monitor->filename = g_strdup (filename);
return obj;
......
......@@ -322,7 +322,7 @@ g_memory_input_stream_read_finish (GInputStream *stream,
gssize nread;
simple = G_SIMPLE_ASYNC_RESULT (result);
g_assert (g_simple_async_result_get_source_tag (simple) == g_memory_input_stream_read_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_memory_input_stream_read_async);
nread = g_simple_async_result_get_op_res_gssize (simple);
return nread;
......@@ -358,7 +358,7 @@ g_memory_input_stream_skip_finish (GInputStream *stream,
gssize nskipped;
simple = G_SIMPLE_ASYNC_RESULT (result);
g_assert (g_simple_async_result_get_source_tag (simple) == g_memory_input_stream_skip_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_memory_input_stream_skip_async);
nskipped = g_simple_async_result_get_op_res_gssize (simple);
return nskipped;
......
......@@ -543,7 +543,7 @@ g_memory_output_stream_write_finish (GOutputStream *stream,
simple = G_SIMPLE_ASYNC_RESULT (result);
g_assert (g_simple_async_result_get_source_tag (simple) ==
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) ==
g_memory_output_stream_write_async);
nwritten = g_simple_async_result_get_op_res_gssize (simple);
......@@ -581,7 +581,7 @@ g_memory_output_stream_close_finish (GOutputStream *stream,
simple = G_SIMPLE_ASYNC_RESULT (result);
g_assert (g_simple_async_result_get_source_tag (simple) ==
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) ==
g_memory_output_stream_close_async);
return TRUE;
......
......@@ -1151,7 +1151,7 @@ g_output_stream_real_write_finish (GOutputStream *stream,
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
WriteData *op;
g_assert (g_simple_async_result_get_source_tag (simple) == g_output_stream_real_write_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_output_stream_real_write_async);
op = g_simple_async_result_get_op_res_gpointer (simple);
return op->count_written;
}
......@@ -1221,7 +1221,7 @@ g_output_stream_real_splice_finish (GOutputStream *stream,
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
SpliceData *op;
g_assert (g_simple_async_result_get_source_tag (simple) == g_output_stream_real_splice_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_output_stream_real_splice_async);
op = g_simple_async_result_get_op_res_gpointer (simple);
return op->bytes_copied;
}
......@@ -1317,7 +1317,7 @@ g_output_stream_real_close_finish (GOutputStream *stream,
GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
g_assert (g_simple_async_result_get_source_tag (simple) == g_output_stream_real_close_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_output_stream_real_close_async);
return TRUE;
}
......
......@@ -354,7 +354,7 @@ g_unix_input_stream_read_finish (GInputStream *stream,
gssize nread;
simple = G_SIMPLE_ASYNC_RESULT (result);
g_assert (g_simple_async_result_get_source_tag (simple) == g_unix_input_stream_read_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_unix_input_stream_read_async);
nread = g_simple_async_result_get_op_res_gssize (simple);
return nread;
......@@ -368,7 +368,7 @@ g_unix_input_stream_skip_async (GInputStream *stream,
GAsyncReadyCallback callback,
gpointer data)
{
g_assert_not_reached ();
g_warn_if_reached ();
/* TODO: Not implemented */
}
......@@ -377,7 +377,7 @@ g_unix_input_stream_skip_finish (GInputStream *stream,
GAsyncResult *result,
GError **error)
{
g_assert_not_reached ();
g_warn_if_reached ();
/* TODO: Not implemented */
}
......
......@@ -345,7 +345,7 @@ g_unix_output_stream_write_finish (GOutputStream *stream,
gssize nwritten;
simple = G_SIMPLE_ASYNC_RESULT (result);
g_assert (g_simple_async_result_get_source_tag (simple) == g_unix_output_stream_write_async);
g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == g_unix_output_stream_write_async);
nwritten = g_simple_async_result_get_op_res_gssize (simple);
return nwritten;
......
......@@ -62,7 +62,7 @@ g_unix_volume_finalize (GObject *object)
if (volume->drive)
_g_unix_drive_unset_volume (volume->drive, volume);
g_assert (volume->drive == NULL);
g_warn_if_fail (volume->drive == NULL);
g_free (volume->name);
g_free (volume->icon);
g_free (volume->mountpoint);
......
......@@ -9,7 +9,7 @@ if ! which readelf 2>/dev/null >/dev/null; then
exit 0
fi
SKIP='\<g_access\|\<g_array_\|\<g_ascii\|\<g_list_\|\<g_assert_warning\|\<g_atomic_int\|\<g_build_filename\|\<g_byte_array\|\<g_child_watch\|\<g_convert\|\<g_dir_\|\<g_error_\|\<g_file_error_quark\|\<g_file_get_contents\|\<g_file_set_contents\|\<g_file_test\|\<g_filename_\|\<g_find_program_in_path\|\<g_free\|\<g_get_\|\<g_getenv\|\<g_hash_table_\|\<g_idle_\|\<g_intern_static_string\|\<g_io_channel_\|\<g_key_file_\|\<g_listenv\|\<g_locale_to_utf8\|\<g_log\|\<g_main_context_wakeup\|\<g_malloc\|\<g_markup_\|\<g_mkdir_\|\<g_mkstemp\|\<g_module_\|\<g_object_\|\<g_once_\|\<g_param_spec_\|\<g_path_\|\<g_printerr\|\<g_propagate_error\|\<g_ptr_array_\|\<g_qsort_\|\<g_quark_\|\<g_queue_\|\<g_realloc\|\<g_return_if_fail\|\<g_set_error\|\<g_shell_\|\<g_signal_\|\<g_slice_\|\<g_slist_\|\<g_snprintf\|\<g_source_\|\<g_spawn_\|\<g_static_\|\<g_str\|\<g_thread_pool_\|\<g_time_val_add\|\<g_timeout_\|\<g_type_\|\<g_unlink\|\<g_uri_\|\<g_utf8_\|\<g_value_\|\<g_enum_\|\<g_flags_\|\<g_checksum'
SKIP='\<g_access\|\<g_array_\|\<g_ascii\|\<g_list_\|\<g_assertion_message\|\<g_warn_message\|\<g_atomic_int\|\<g_build_filename\|\<g_byte_array\|\<g_child_watch\|\<g_convert\|\<g_dir_\|\<g_error_\|\<g_file_error_quark\|\<g_file_get_contents\|\<g_file_set_contents\|\<g_file_test\|\<g_filename_\|\<g_find_program_in_path\|\<g_free\|\<g_get_\|\<g_getenv\|\<g_hash_table_\|\<g_idle_\|\<g_intern_static_string\|\<g_io_channel_\|\<g_key_file_\|\<g_listenv\|\<g_locale_to_utf8\|\<g_log\|\<g_main_context_wakeup\|\<g_malloc\|\<g_markup_\|\<g_mkdir_\|\<g_mkstemp\|\<g_module_\|\<g_object_\|\<g_once_\|\<g_param_spec_\|\<g_path_\|\<g_printerr\|\<g_propagate_error\|\<g_ptr_array_\|\<g_qsort_\|\<g_quark_\|\<g_queue_\|\<g_realloc\|\<g_return_if_fail\|\<g_set_error\|\<g_shell_\|\<g_signal_\|\<g_slice_\|\<g_slist_\|\<g_snprintf\|\<g_source_\|\<g_spawn_\|\<g_static_\|\<g_str\|\<g_thread_pool_\|\<g_time_val_add\|\<g_timeout_\|\<g_type_\|\<g_unlink\|\<g_uri_\|\<g_utf8_\|\<g_value_\|\<g_enum_\|\<g_flags_\|\<g_checksum'
for so in .libs/lib*.so; do
echo Checking $so for local PLT entries
......
......@@ -220,7 +220,7 @@ bookmark_app_info_new (const gchar *name)
{
BookmarkAppInfo *retval;
g_assert (name != NULL);
g_warn_if_fail (name != NULL);
retval = g_slice_new (BookmarkAppInfo);
......@@ -250,7 +250,7 @@ bookmark_app_info_dump (BookmarkAppInfo *app_info)
gchar *retval;
gchar *name, *exec;
g_assert (app_info != NULL);
g_warn_if_fail (app_info != NULL);
if (app_info->count == 0)
return NULL;
......@@ -406,7 +406,7 @@ bookmark_metadata_dump (BookmarkMetadata *metadata)
BookmarkAppInfo *app_info = (BookmarkAppInfo *) l->data;
gchar *app_data;
g_assert (app_info != NULL);
g_warn_if_fail (app_info != NULL);
app_data = bookmark_app_info_dump (app_info);
......@@ -462,7 +462,7 @@ bookmark_item_new (const gchar *uri)
{
BookmarkItem *item;
g_assert (uri != NULL);
g_warn_if_fail (uri != NULL);
item = g_slice_new (BookmarkItem);
item->uri = g_strdup (uri);
......@@ -585,7 +585,7 @@ static BookmarkAppInfo *
bookmark_item_lookup_app_info (BookmarkItem *item,
const gchar *app_name)
{
g_assert (item != NULL && app_name != NULL);
g_warn_if_fail (item != NULL && app_name != NULL);
if (!item->metadata)
return NULL;
......@@ -684,7 +684,7 @@ parse_bookmark_element (GMarkupParseContext *context,
BookmarkItem *item;
GError *add_error;
g_assert ((parse_data != NULL) && (parse_data->state == STATE_BOOKMARK));
g_warn_if_fail ((parse_data != NULL) && (parse_data->state == STATE_BOOKMARK));
i = 0;
uri = added = modified = visited = NULL;
......@@ -719,7 +719,7 @@ parse_bookmark_element (GMarkupParseContext *context,
return;
}
g_assert (parse_data->current_item == NULL);
g_warn_if_fail (parse_data->current_item == NULL);
item = bookmark_item_new (uri);
......@@ -761,7 +761,7 @@ parse_application_element (GMarkupParseContext *context,
BookmarkItem *item;
BookmarkAppInfo *ai;
g_assert ((parse_data != NULL) && (parse_data->state == STATE_APPLICATION));
g_warn_if_fail ((parse_data != NULL) && (parse_data->state == STATE_APPLICATION));
i = 0;
name = exec = count = stamp = NULL;
......@@ -806,7 +806,7 @@ parse_application_element (GMarkupParseContext *context,
return;
}
g_assert (parse_data->current_item != NULL);
g_warn_if_fail (parse_data->current_item != NULL);
item = parse_data->current_item;
ai = bookmark_item_lookup_app_info (item, name);
......@@ -846,7 +846,7 @@ parse_mime_type_element (GMarkupParseContext *context,
gint i;
BookmarkItem *item;
g_assert ((parse_data != NULL) && (parse_data->state == STATE_MIME));
g_warn_if_fail ((parse_data != NULL) && (parse_data->state == STATE_MIME));
i = 0;
type = NULL;
......@@ -868,7 +868,7 @@ parse_mime_type_element (GMarkupParseContext *context,
if (!type)
type = "application/octet-stream";
g_assert (parse_data->current_item != NULL);
g_warn_if_fail (parse_data->current_item != NULL);
item = parse_data->current_item;
if (!item->metadata)
......@@ -890,7 +890,7 @@ parse_icon_element (GMarkupParseContext *context,
gint i;
BookmarkItem *item;
g_assert ((parse_data != NULL) && (parse_data->state == STATE_ICON));
g_warn_if_fail ((parse_data != NULL) && (parse_data->state == STATE_ICON));
i = 0;
href = NULL;
......@@ -925,7 +925,7 @@ parse_icon_element (GMarkupParseContext *context,
if (!type)
type = "application/octet-stream";
g_assert (parse_data->current_item != NULL);
g_warn_if_fail (parse_data->current_item != NULL);
item = parse_data->current_item;
if (!item->metadata)
......@@ -956,7 +956,7 @@ map_namespace_to_name (ParseData *parse_data,
const gchar *attr;
gint i;
g_assert (parse_data != NULL);
g_warn_if_fail (parse_data != NULL);
if (!attribute_names || !attribute_names[0])
return;
......@@ -1002,8 +1002,8 @@ is_element_full (ParseData *parse_data,
const gchar *p, *element_name;
gboolean retval;
g_assert (parse_data != NULL);
g_assert (element_full != NULL);
g_warn_if_fail (parse_data != NULL);
g_warn_if_fail (element_full != NULL);
if (!element)
return FALSE;
......@@ -1253,7 +1253,7 @@ start_element_raw_cb (GMarkupParseContext *context,
XBEL_METADATA_ELEMENT);
break;
default:
g_assert_not_reached ();
g_warn_if_reached ();
break;
}
}
......@@ -1343,7 +1343,7 @@ text_raw_cb (GMarkupParseContext *context,
{
GList *groups;
g_assert (parse_data->current_item != NULL);
g_warn_if_fail (parse_data->current_item != NULL);
if (!parse_data->current_item->metadata)
parse_data->current_item->metadata = bookmark_metadata_new ();
......@@ -1363,7 +1363,7 @@ text_raw_cb (GMarkupParseContext *context,
case STATE_ICON:
break;
default:
g_assert_not_reached ();
g_warn_if_reached ();
break;
}
......@@ -1390,7 +1390,7 @@ g_bookmark_file_parse (GBookmarkFile *bookmark,
GError *parse_error, *end_error;
gboolean retval;
g_assert (bookmark != NULL);
g_warn_if_fail (bookmark != NULL);
if (!buffer)
return FALSE;
......@@ -1958,7 +1958,7 @@ static BookmarkItem *
g_bookmark_file_lookup_item (GBookmarkFile *bookmark,
const gchar *uri)
{
g_assert (bookmark != NULL && uri != NULL);
g_warn_if_fail (bookmark != NULL && uri != NULL);
return g_hash_table_lookup (bookmark->items_by_uri, uri);
}
......@@ -1969,8 +1969,8 @@ g_bookmark_file_add_item (GBookmarkFile *bookmark,
BookmarkItem *item,
GError **error)
{
g_assert (bookmark != NULL);
g_assert (item != NULL);
g_warn_if_fail (bookmark != NULL);
g_warn_if_fail (item != NULL);
/* this should never happen; and if it does, then we are
* screwing up something big time.
......@@ -2090,7 +2090,7 @@ g_bookmark_file_get_uris (GBookmarkFile *bookmark,
{
BookmarkItem *item = (BookmarkItem *) l->data;
g_assert (item != NULL);
g_warn_if_fail (item != NULL);
uris[i++] = g_strdup (item->uri);
}
......@@ -2958,7 +2958,7 @@ g_bookmark_file_get_groups (GBookmarkFile *bookmark,
{
gchar *group_name = (gchar *) l->data;
g_assert (group_name != NULL);
g_warn_if_fail (group_name != NULL);
retval[i++] = g_strdup (group_name);
}
......@@ -3481,8 +3481,8 @@ g_bookmark_file_get_applications (GBookmarkFile *bookmark,
ai = (BookmarkAppInfo *) l->data;
g_assert (ai != NULL);
g_assert (ai->name != NULL);
g_warn_if_fail (ai != NULL);
g_warn_if_fail (ai->name != NULL);
apps[i++] = g_strdup (ai->name);
}
......
......@@ -236,7 +236,7 @@ g_key_file_clear (GKeyFile *key_file)
g_key_file_remove_group_node (key_file, group_node);
}
g_assert (key_file->groups == NULL);
g_warn_if_fail (key_file->groups == NULL);
}
......@@ -778,7 +778,7 @@ g_key_file_parse_comment (GKeyFile *key_file,
if (!(key_file->flags & G_KEY_FILE_KEEP_COMMENTS))
return;
g_assert (key_file->current_group != NULL);
g_warn_if_fail (key_file->current_group != NULL);
pair = g_slice_new (GKeyFileKeyValuePair);
pair->key = NULL;
......@@ -843,7 +843,7 @@ g_key_file_parse_key_value_pair (GKeyFile *key_file,
key_end = value_start = strchr (line, '=');
g_assert (key_end != NULL);
g_warn_if_fail (key_end != NULL);
key_end--;
value_start++;
......@@ -855,7 +855,7 @@ g_key_file_parse_key_value_pair (GKeyFile *key_file,
key_len = key_end - line + 2;
g_assert (key_len <= length);
g_warn_if_fail (key_len <= length);
key = g_strndup (line, key_len - 1);
......@@ -877,7 +877,7 @@ g_key_file_parse_key_value_pair (GKeyFile *key_file,
value = g_strndup (value_start, value_len);
g_assert (key_file->start_group != NULL);
g_warn_if_fail (key_file->start_group != NULL);
if (key_file->current_group
&& key_file->current_group->name
......@@ -1189,7 +1189,11 @@ g_key_file_get_groups (GKeyFile *key_file,