Fix sparse warnings

These were listed in bug 623955
This commit is contained in:
Matthias Clasen 2010-07-10 17:21:32 -04:00
parent 41f4aba2d2
commit 5f1490e94a
9 changed files with 20 additions and 17 deletions

View File

@ -584,7 +584,7 @@ g_converter_output_stream_flush (GOutputStream *stream,
/* Any other error, including PARTIAL_INPUT can't be fixed by now
and is an error */
g_propagate_error (error, my_error);
return -1;
return FALSE;
}
}

View File

@ -359,8 +359,8 @@ keyring_lookup_entry (const gchar *cookie_context,
guint n;
gchar **lines;
g_return_val_if_fail (cookie_context != NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
g_return_val_if_fail (cookie_context != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
ret = NULL;
path = NULL;

View File

@ -4802,7 +4802,7 @@ g_dbus_connection_call_finish (GDBusConnection *connection,
simple = G_SIMPLE_ASYNC_RESULT (res);
if (g_simple_async_result_propagate_error (simple, error))
return FALSE;
return NULL;
return g_variant_ref (g_simple_async_result_get_op_res_gpointer (simple));
}

View File

@ -793,8 +793,8 @@ g_file_info_set_attribute_status (GFileInfo *info,
{
GFileAttributeValue *val;
g_return_val_if_fail (G_IS_FILE_INFO (info), 0);
g_return_val_if_fail (attribute != NULL && *attribute != '\0', 0);
g_return_val_if_fail (G_IS_FILE_INFO (info), FALSE);
g_return_val_if_fail (attribute != NULL && *attribute != '\0', FALSE);
val = g_file_info_find_value_by_name (info, attribute);
if (val)

View File

@ -166,7 +166,7 @@ g_inet_socket_address_to_native (GSocketAddress *address,
GInetSocketAddress *addr;
GSocketFamily family;
g_return_val_if_fail (G_IS_INET_SOCKET_ADDRESS (address), 0);
g_return_val_if_fail (G_IS_INET_SOCKET_ADDRESS (address), FALSE);
addr = G_INET_SOCKET_ADDRESS (address);
family = g_inet_address_get_family (addr->priv->address);

View File

@ -812,14 +812,14 @@ g_mount_guess_content_type_finish (GMount *mount,
{
GMountIface *iface;
g_return_val_if_fail (G_IS_MOUNT (mount), FALSE);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
g_return_val_if_fail (G_IS_MOUNT (mount), NULL);
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), NULL);
if (G_IS_SIMPLE_ASYNC_RESULT (result))
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
if (g_simple_async_result_propagate_error (simple, error))
return FALSE;
return NULL;
}
iface = G_MOUNT_GET_IFACE (mount);

View File

@ -1575,18 +1575,18 @@ parse_gschema_files (gchar **files,
&state, NULL);
if (!g_file_get_contents (filename, &contents, &size, error))
return FALSE;
return NULL;
if (!g_markup_parse_context_parse (context, contents, size, error))
{
g_prefix_error (error, "%s: ", filename);
return FALSE;
return NULL;
}
if (!g_markup_parse_context_end_parse (context, error))
{
g_prefix_error (error, "%s: ", filename);
return FALSE;
return NULL;
}
g_markup_parse_context_free (context);

View File

@ -285,7 +285,7 @@ gint *
g_unix_fd_message_steal_fds (GUnixFDMessage *message,
gint *length)
{
g_return_val_if_fail (G_UNIX_FD_MESSAGE (message), FALSE);
g_return_val_if_fail (G_UNIX_FD_MESSAGE (message), NULL);
return g_unix_fd_list_steal_fds (message->priv->list, length);
}

View File

@ -344,7 +344,8 @@ lookup_by_name_finish (GResolver *resolver,
GUnixResolverRequest *req;
GList *addresses;
g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (resolver), lookup_by_name_async), FALSE);
g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (resolver), lookup_by_name_async), NULL);
simple = G_SIMPLE_ASYNC_RESULT (result);
if (g_simple_async_result_propagate_error (simple, error))
@ -418,7 +419,8 @@ lookup_by_address_finish (GResolver *resolver,
GUnixResolverRequest *req;
gchar *name;
g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (resolver), lookup_by_address_async), FALSE);
g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (resolver), lookup_by_address_async), NULL);
simple = G_SIMPLE_ASYNC_RESULT (result);
if (g_simple_async_result_propagate_error (simple, error))
@ -491,7 +493,8 @@ lookup_service_finish (GResolver *resolver,
GUnixResolverRequest *req;
GList *targets;
g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (resolver), lookup_service_async), FALSE);
g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (resolver), lookup_service_async), NULL);
simple = G_SIMPLE_ASYNC_RESULT (result);
if (g_simple_async_result_propagate_error (simple, error))