mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 15:48:54 +02:00
Silence a bunch of -Wunused-but-set-variable warnings
Signed-off-by: David Zeuthen <davidz@redhat.com>
This commit is contained in:
@@ -258,6 +258,25 @@ is_valid_nonce_tcp (const gchar *address_entry,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nonce_file == NULL)
|
||||||
|
{
|
||||||
|
g_set_error (error,
|
||||||
|
G_IO_ERROR,
|
||||||
|
G_IO_ERROR_INVALID_ARGUMENT,
|
||||||
|
_("Error in address `%s' - missing noncefile attribute"),
|
||||||
|
address_entry);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
if (host == NULL)
|
||||||
|
{
|
||||||
|
g_set_error (error,
|
||||||
|
G_IO_ERROR,
|
||||||
|
G_IO_ERROR_INVALID_ARGUMENT,
|
||||||
|
_("Error in address `%s' - missing host attribute"),
|
||||||
|
address_entry);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
ret= TRUE;
|
ret= TRUE;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
@@ -332,6 +351,16 @@ is_valid_tcp (const gchar *address_entry,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (host == NULL)
|
||||||
|
{
|
||||||
|
g_set_error (error,
|
||||||
|
G_IO_ERROR,
|
||||||
|
G_IO_ERROR_INVALID_ARGUMENT,
|
||||||
|
_("Error in address `%s' - missing host attribute"),
|
||||||
|
address_entry);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
ret= TRUE;
|
ret= TRUE;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
@@ -997,6 +997,7 @@ _g_dbus_auth_run_server (GDBusAuth *auth,
|
|||||||
{
|
{
|
||||||
local_error = NULL;
|
local_error = NULL;
|
||||||
byte = g_data_input_stream_read_byte (dis, cancellable, &local_error);
|
byte = g_data_input_stream_read_byte (dis, cancellable, &local_error);
|
||||||
|
byte = byte; /* To avoid -Wunused-but-set-variable */
|
||||||
if (local_error != NULL)
|
if (local_error != NULL)
|
||||||
{
|
{
|
||||||
g_propagate_error (error, local_error);
|
g_propagate_error (error, local_error);
|
||||||
|
@@ -426,6 +426,7 @@ keyring_lookup_entry (const gchar *cookie_context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
line_when = g_ascii_strtoll (tokens[1], &endp, 10);
|
line_when = g_ascii_strtoll (tokens[1], &endp, 10);
|
||||||
|
line_when = line_when; /* To avoid -Wunused-but-set-variable */
|
||||||
if (*endp != '\0')
|
if (*endp != '\0')
|
||||||
{
|
{
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
@@ -560,6 +561,7 @@ keyring_acquire_lock (const gchar *path,
|
|||||||
goto again;
|
goto again;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
num_create_tries = num_create_tries; /* To avoid -Wunused-but-set-variable */
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
G_IO_ERROR,
|
G_IO_ERROR,
|
||||||
g_io_error_from_errno (errno),
|
g_io_error_from_errno (errno),
|
||||||
@@ -747,6 +749,8 @@ keyring_generate_entry (const gchar *cookie_context,
|
|||||||
g_strfreev (tokens);
|
g_strfreev (tokens);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
line_when = line_when; /* To avoid -Wunused-but-set-variable */
|
||||||
|
|
||||||
|
|
||||||
/* D-Bus spec says:
|
/* D-Bus spec says:
|
||||||
*
|
*
|
||||||
|
@@ -2049,8 +2049,6 @@ on_worker_message_received (GDBusWorker *worker,
|
|||||||
{
|
{
|
||||||
GDBusConnection *connection;
|
GDBusConnection *connection;
|
||||||
FilterCallback *filters;
|
FilterCallback *filters;
|
||||||
gboolean consumed_by_filter;
|
|
||||||
gboolean altered_by_filter;
|
|
||||||
guint num_filters;
|
guint num_filters;
|
||||||
guint n;
|
guint n;
|
||||||
gboolean alive;
|
gboolean alive;
|
||||||
@@ -2086,8 +2084,6 @@ on_worker_message_received (GDBusWorker *worker,
|
|||||||
CONNECTION_UNLOCK (connection);
|
CONNECTION_UNLOCK (connection);
|
||||||
|
|
||||||
/* then call the filters in order (without holding the lock) */
|
/* then call the filters in order (without holding the lock) */
|
||||||
consumed_by_filter = FALSE;
|
|
||||||
altered_by_filter = FALSE;
|
|
||||||
for (n = 0; n < num_filters; n++)
|
for (n = 0; n < num_filters; n++)
|
||||||
{
|
{
|
||||||
message = filters[n].func (connection,
|
message = filters[n].func (connection,
|
||||||
@@ -4065,7 +4061,6 @@ invoke_get_all_properties_in_idle_cb (gpointer _data)
|
|||||||
{
|
{
|
||||||
PropertyGetAllData *data = _data;
|
PropertyGetAllData *data = _data;
|
||||||
GVariantBuilder builder;
|
GVariantBuilder builder;
|
||||||
GError *error;
|
|
||||||
GDBusMessage *reply;
|
GDBusMessage *reply;
|
||||||
guint n;
|
guint n;
|
||||||
|
|
||||||
@@ -4082,8 +4077,6 @@ invoke_get_all_properties_in_idle_cb (gpointer _data)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
error = NULL;
|
|
||||||
|
|
||||||
/* TODO: Right now we never fail this call - we just omit values if
|
/* TODO: Right now we never fail this call - we just omit values if
|
||||||
* a get_property() call is failing.
|
* a get_property() call is failing.
|
||||||
*
|
*
|
||||||
@@ -6061,7 +6054,6 @@ distribute_method_call (GDBusConnection *connection,
|
|||||||
const gchar *object_path;
|
const gchar *object_path;
|
||||||
const gchar *interface_name;
|
const gchar *interface_name;
|
||||||
const gchar *member;
|
const gchar *member;
|
||||||
const gchar *signature;
|
|
||||||
const gchar *path;
|
const gchar *path;
|
||||||
gchar *subtree_path;
|
gchar *subtree_path;
|
||||||
gchar *needle;
|
gchar *needle;
|
||||||
@@ -6070,7 +6062,6 @@ distribute_method_call (GDBusConnection *connection,
|
|||||||
|
|
||||||
interface_name = g_dbus_message_get_interface (message);
|
interface_name = g_dbus_message_get_interface (message);
|
||||||
member = g_dbus_message_get_member (message);
|
member = g_dbus_message_get_member (message);
|
||||||
signature = g_dbus_message_get_signature (message);
|
|
||||||
path = g_dbus_message_get_path (message);
|
path = g_dbus_message_get_path (message);
|
||||||
subtree_path = g_strdup (path);
|
subtree_path = g_strdup (path);
|
||||||
needle = strrchr (subtree_path, '/');
|
needle = strrchr (subtree_path, '/');
|
||||||
@@ -6101,14 +6092,6 @@ distribute_method_call (GDBusConnection *connection,
|
|||||||
_g_dbus_debug_print_unlock ();
|
_g_dbus_debug_print_unlock ();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
g_debug ("interface = `%s'", interface_name);
|
|
||||||
g_debug ("member = `%s'", member);
|
|
||||||
g_debug ("signature = `%s'", signature);
|
|
||||||
g_debug ("path = `%s'", path);
|
|
||||||
g_debug ("subtree_path = `%s'", subtree_path != NULL ? subtree_path : "N/A");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
object_path = g_dbus_message_get_path (message);
|
object_path = g_dbus_message_get_path (message);
|
||||||
g_assert (object_path != NULL);
|
g_assert (object_path != NULL);
|
||||||
|
|
||||||
|
@@ -1525,6 +1525,8 @@ parse_value_from_blob (GMemoryInputStream *mis,
|
|||||||
g_free (s);
|
g_free (s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
is_leaf = is_leaf; /* To avoid -Wunused-but-set-variable */
|
||||||
#endif /* DEBUG_SERIALIZER */
|
#endif /* DEBUG_SERIALIZER */
|
||||||
|
|
||||||
/* sink the reference */
|
/* sink the reference */
|
||||||
@@ -2151,12 +2153,9 @@ append_body_to_blob (GVariant *value,
|
|||||||
GDataOutputStream *dos,
|
GDataOutputStream *dos,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gboolean ret;
|
|
||||||
GVariant *item;
|
GVariant *item;
|
||||||
GVariantIter iter;
|
GVariantIter iter;
|
||||||
|
|
||||||
ret = FALSE;
|
|
||||||
|
|
||||||
if (!g_variant_is_of_type (value, G_VARIANT_TYPE_TUPLE))
|
if (!g_variant_is_of_type (value, G_VARIANT_TYPE_TUPLE))
|
||||||
{
|
{
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
|
@@ -1632,6 +1632,7 @@ _g_dbus_initialize (void)
|
|||||||
const gchar *debug;
|
const gchar *debug;
|
||||||
|
|
||||||
g_dbus_error_domain = G_DBUS_ERROR;
|
g_dbus_error_domain = G_DBUS_ERROR;
|
||||||
|
(g_dbus_error_domain); /* To avoid -Wunused-but-set-variable */
|
||||||
|
|
||||||
debug = g_getenv ("G_DBUS_DEBUG");
|
debug = g_getenv ("G_DBUS_DEBUG");
|
||||||
if (debug != NULL)
|
if (debug != NULL)
|
||||||
|
@@ -643,8 +643,7 @@ g_dbus_proxy_get_cached_property (GDBusProxy *proxy,
|
|||||||
value = g_hash_table_lookup (proxy->priv->properties, property_name);
|
value = g_hash_table_lookup (proxy->priv->properties, property_name);
|
||||||
if (value == NULL)
|
if (value == NULL)
|
||||||
{
|
{
|
||||||
const GDBusPropertyInfo *info;
|
lookup_property_info_or_warn (proxy, property_name);
|
||||||
info = lookup_property_info_or_warn (proxy, property_name);
|
|
||||||
/* no difference */
|
/* no difference */
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@@ -823,7 +822,6 @@ on_properties_changed (GDBusConnection *connection,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GDBusProxy *proxy = G_DBUS_PROXY (user_data);
|
GDBusProxy *proxy = G_DBUS_PROXY (user_data);
|
||||||
GError *error;
|
|
||||||
const gchar *interface_name_for_signal;
|
const gchar *interface_name_for_signal;
|
||||||
GVariant *changed_properties;
|
GVariant *changed_properties;
|
||||||
gchar **invalidated_properties;
|
gchar **invalidated_properties;
|
||||||
@@ -832,7 +830,6 @@ on_properties_changed (GDBusConnection *connection,
|
|||||||
GVariant *value;
|
GVariant *value;
|
||||||
guint n;
|
guint n;
|
||||||
|
|
||||||
error = NULL;
|
|
||||||
changed_properties = NULL;
|
changed_properties = NULL;
|
||||||
invalidated_properties = NULL;
|
invalidated_properties = NULL;
|
||||||
|
|
||||||
|
@@ -773,21 +773,18 @@ try_tcp (GDBusServer *server,
|
|||||||
gboolean ret;
|
gboolean ret;
|
||||||
const gchar *host;
|
const gchar *host;
|
||||||
const gchar *port;
|
const gchar *port;
|
||||||
const gchar *family;
|
|
||||||
gint port_num;
|
gint port_num;
|
||||||
GSocketAddress *address;
|
|
||||||
GResolver *resolver;
|
GResolver *resolver;
|
||||||
GList *resolved_addresses;
|
GList *resolved_addresses;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
address = NULL;
|
|
||||||
resolver = NULL;
|
resolver = NULL;
|
||||||
resolved_addresses = NULL;
|
resolved_addresses = NULL;
|
||||||
|
|
||||||
host = g_hash_table_lookup (key_value_pairs, "host");
|
host = g_hash_table_lookup (key_value_pairs, "host");
|
||||||
port = g_hash_table_lookup (key_value_pairs, "port");
|
port = g_hash_table_lookup (key_value_pairs, "port");
|
||||||
family = g_hash_table_lookup (key_value_pairs, "family");
|
/* family = g_hash_table_lookup (key_value_pairs, "family"); */
|
||||||
if (g_hash_table_lookup (key_value_pairs, "noncefile") != NULL)
|
if (g_hash_table_lookup (key_value_pairs, "noncefile") != NULL)
|
||||||
{
|
{
|
||||||
g_set_error_literal (error,
|
g_set_error_literal (error,
|
||||||
|
@@ -125,7 +125,6 @@ g_dbus_is_name (const gchar *string)
|
|||||||
guint len;
|
guint len;
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
const gchar *s;
|
const gchar *s;
|
||||||
const gchar *end;
|
|
||||||
|
|
||||||
g_return_val_if_fail (string != NULL, FALSE);
|
g_return_val_if_fail (string != NULL, FALSE);
|
||||||
|
|
||||||
@@ -136,7 +135,6 @@ g_dbus_is_name (const gchar *string)
|
|||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
s = string;
|
s = string;
|
||||||
end = s + len;
|
|
||||||
if (*s == ':')
|
if (*s == ':')
|
||||||
{
|
{
|
||||||
/* handle unique name */
|
/* handle unique name */
|
||||||
@@ -248,7 +246,6 @@ g_dbus_is_interface_name (const gchar *string)
|
|||||||
guint len;
|
guint len;
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
const gchar *s;
|
const gchar *s;
|
||||||
const gchar *end;
|
|
||||||
|
|
||||||
g_return_val_if_fail (string != NULL, FALSE);
|
g_return_val_if_fail (string != NULL, FALSE);
|
||||||
|
|
||||||
@@ -259,7 +256,6 @@ g_dbus_is_interface_name (const gchar *string)
|
|||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
s = string;
|
s = string;
|
||||||
end = s + len;
|
|
||||||
if (G_UNLIKELY (*s == '.'))
|
if (G_UNLIKELY (*s == '.'))
|
||||||
{
|
{
|
||||||
/* can't start with a . */
|
/* can't start with a . */
|
||||||
|
@@ -124,7 +124,6 @@ g_icon_equal (GIcon *icon1,
|
|||||||
static gboolean
|
static gboolean
|
||||||
g_icon_to_string_tokenized (GIcon *icon, GString *s)
|
g_icon_to_string_tokenized (GIcon *icon, GString *s)
|
||||||
{
|
{
|
||||||
char *ret;
|
|
||||||
GPtrArray *tokens;
|
GPtrArray *tokens;
|
||||||
gint version;
|
gint version;
|
||||||
GIconIface *icon_iface;
|
GIconIface *icon_iface;
|
||||||
@@ -133,8 +132,6 @@ g_icon_to_string_tokenized (GIcon *icon, GString *s)
|
|||||||
g_return_val_if_fail (icon != NULL, FALSE);
|
g_return_val_if_fail (icon != NULL, FALSE);
|
||||||
g_return_val_if_fail (G_IS_ICON (icon), FALSE);
|
g_return_val_if_fail (G_IS_ICON (icon), FALSE);
|
||||||
|
|
||||||
ret = NULL;
|
|
||||||
|
|
||||||
icon_iface = G_ICON_GET_IFACE (icon);
|
icon_iface = G_ICON_GET_IFACE (icon);
|
||||||
if (icon_iface->to_tokens == NULL)
|
if (icon_iface->to_tokens == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -383,6 +380,7 @@ ensure_builtin_icon_types (void)
|
|||||||
t = g_file_icon_get_type ();
|
t = g_file_icon_get_type ();
|
||||||
t = g_emblemed_icon_get_type ();
|
t = g_emblemed_icon_get_type ();
|
||||||
t = g_emblem_get_type ();
|
t = g_emblem_get_type ();
|
||||||
|
(t); /* To avoid -Wunused-but-set-variable */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -414,6 +414,7 @@ g_inet_address_new_from_string (const gchar *string)
|
|||||||
|
|
||||||
/* Make sure _g_networking_init() has been called */
|
/* Make sure _g_networking_init() has been called */
|
||||||
type = g_inet_address_get_type ();
|
type = g_inet_address_get_type ();
|
||||||
|
(type); /* To avoid -Wunused-but-set-variable */
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
memset (&sa, 0, sizeof (sa));
|
memset (&sa, 0, sizeof (sa));
|
||||||
|
@@ -1442,9 +1442,6 @@ static void
|
|||||||
schema_state_end (SchemaState **state_ptr,
|
schema_state_end (SchemaState **state_ptr,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
SchemaState *state;
|
|
||||||
|
|
||||||
state = *state_ptr;
|
|
||||||
*state_ptr = NULL;
|
*state_ptr = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -90,6 +90,7 @@ g_resolver_class_init (GResolverClass *resolver_class)
|
|||||||
|
|
||||||
/* Make sure _g_networking_init() has been called */
|
/* Make sure _g_networking_init() has been called */
|
||||||
type = g_inet_address_get_type ();
|
type = g_inet_address_get_type ();
|
||||||
|
(type); /* To avoid -Wunused-but-set-variable */
|
||||||
|
|
||||||
/* Initialize _g_resolver_addrinfo_hints */
|
/* Initialize _g_resolver_addrinfo_hints */
|
||||||
#ifdef AI_ADDRCONFIG
|
#ifdef AI_ADDRCONFIG
|
||||||
@@ -858,6 +859,7 @@ _g_resolver_targets_from_res_query (const gchar *rrname,
|
|||||||
GETSHORT (type, p);
|
GETSHORT (type, p);
|
||||||
GETSHORT (qclass, p);
|
GETSHORT (qclass, p);
|
||||||
GETLONG (ttl, p);
|
GETLONG (ttl, p);
|
||||||
|
ttl = ttl; /* To avoid -Wunused-but-set-variable */
|
||||||
GETSHORT (rdlength, p);
|
GETSHORT (rdlength, p);
|
||||||
|
|
||||||
if (type != T_SRV || qclass != C_IN)
|
if (type != T_SRV || qclass != C_IN)
|
||||||
|
@@ -678,6 +678,7 @@ g_socket_class_init (GSocketClass *klass)
|
|||||||
|
|
||||||
/* Make sure winsock has been initialized */
|
/* Make sure winsock has been initialized */
|
||||||
type = g_inet_address_get_type ();
|
type = g_inet_address_get_type ();
|
||||||
|
(type); /* To avoid -Wunused-but-set-variable */
|
||||||
|
|
||||||
#ifdef SIGPIPE
|
#ifdef SIGPIPE
|
||||||
/* There is no portable, thread-safe way to avoid having the process
|
/* There is no portable, thread-safe way to avoid having the process
|
||||||
@@ -3328,12 +3329,7 @@ g_socket_receive_message (GSocket *socket,
|
|||||||
/* decode control messages */
|
/* decode control messages */
|
||||||
{
|
{
|
||||||
GPtrArray *my_messages = NULL;
|
GPtrArray *my_messages = NULL;
|
||||||
const gchar *scm_pointer;
|
|
||||||
struct cmsghdr *cmsg;
|
struct cmsghdr *cmsg;
|
||||||
gsize scm_size;
|
|
||||||
|
|
||||||
scm_pointer = (const gchar *) msg.msg_control;
|
|
||||||
scm_size = msg.msg_controllen;
|
|
||||||
|
|
||||||
for (cmsg = CMSG_FIRSTHDR (&msg); cmsg; cmsg = CMSG_NXTHDR (&msg, cmsg))
|
for (cmsg = CMSG_FIRSTHDR (&msg); cmsg; cmsg = CMSG_NXTHDR (&msg, cmsg))
|
||||||
{
|
{
|
||||||
|
@@ -448,6 +448,7 @@ init_builtin_types (void)
|
|||||||
a_type = g_unix_connection_get_type ();
|
a_type = g_unix_connection_get_type ();
|
||||||
#endif
|
#endif
|
||||||
a_type = g_tcp_connection_get_type ();
|
a_type = g_tcp_connection_get_type ();
|
||||||
|
(a_type); /* To avoid -Wunused-but-set-variable */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -185,6 +185,7 @@ g_socket_control_message_deserialize (int level,
|
|||||||
#ifndef G_OS_WIN32
|
#ifndef G_OS_WIN32
|
||||||
a_type = g_unix_credentials_message_get_type ();
|
a_type = g_unix_credentials_message_get_type ();
|
||||||
a_type = g_unix_fd_message_get_type ();
|
a_type = g_unix_fd_message_get_type ();
|
||||||
|
(a_type); /* To avoid -Wunused-but-set-variable */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
message_types = g_type_children (G_TYPE_SOCKET_CONTROL_MESSAGE, &n_message_types);
|
message_types = g_type_children (G_TYPE_SOCKET_CONTROL_MESSAGE, &n_message_types);
|
||||||
|
@@ -473,6 +473,7 @@ g_unix_connection_receive_credentials (GUnixConnection *connection,
|
|||||||
|
|
||||||
/* ensure the type of GUnixCredentialsMessage has been registered with the type system */
|
/* ensure the type of GUnixCredentialsMessage has been registered with the type system */
|
||||||
credentials_message_gtype = G_TYPE_UNIX_CREDENTIALS_MESSAGE;
|
credentials_message_gtype = G_TYPE_UNIX_CREDENTIALS_MESSAGE;
|
||||||
|
(credentials_message_gtype); /* To avoid -Wunused-but-set-variable */
|
||||||
num_bytes_read = g_socket_receive_message (socket,
|
num_bytes_read = g_socket_receive_message (socket,
|
||||||
NULL, /* GSocketAddress **address */
|
NULL, /* GSocketAddress **address */
|
||||||
NULL,
|
NULL,
|
||||||
|
@@ -87,7 +87,6 @@ gvdb_table_setup_root (GvdbTable *file,
|
|||||||
{
|
{
|
||||||
const struct gvdb_hash_header *header;
|
const struct gvdb_hash_header *header;
|
||||||
guint32 n_bloom_words;
|
guint32 n_bloom_words;
|
||||||
guint32 bloom_shift;
|
|
||||||
guint32 n_buckets;
|
guint32 n_buckets;
|
||||||
gsize size;
|
gsize size;
|
||||||
|
|
||||||
@@ -100,7 +99,6 @@ gvdb_table_setup_root (GvdbTable *file,
|
|||||||
|
|
||||||
n_bloom_words = guint32_from_le (header->n_bloom_words);
|
n_bloom_words = guint32_from_le (header->n_bloom_words);
|
||||||
n_buckets = guint32_from_le (header->n_buckets);
|
n_buckets = guint32_from_le (header->n_buckets);
|
||||||
bloom_shift = n_bloom_words >> 27;
|
|
||||||
n_bloom_words &= (1u << 27) - 1;
|
n_bloom_words &= (1u << 27) - 1;
|
||||||
|
|
||||||
if G_UNLIKELY (n_bloom_words * sizeof (guint32_le) > size)
|
if G_UNLIKELY (n_bloom_words * sizeof (guint32_le) > size)
|
||||||
|
@@ -92,14 +92,11 @@ g_expander_converter_convert (GConverter *converter,
|
|||||||
gsize *bytes_written,
|
gsize *bytes_written,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
GExpanderConverter *conv;
|
|
||||||
const guint8 *in, *in_end;
|
const guint8 *in, *in_end;
|
||||||
guint8 v, *out;
|
guint8 v, *out;
|
||||||
int i;
|
int i;
|
||||||
gsize block_size;
|
gsize block_size;
|
||||||
|
|
||||||
conv = G_EXPANDER_CONVERTER (converter);
|
|
||||||
|
|
||||||
in = inbuf;
|
in = inbuf;
|
||||||
out = outbuf;
|
out = outbuf;
|
||||||
in_end = in + inbuf_size;
|
in_end = in + inbuf_size;
|
||||||
@@ -211,14 +208,11 @@ g_compressor_converter_convert (GConverter *converter,
|
|||||||
gsize *bytes_written,
|
gsize *bytes_written,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
GCompressorConverter *conv;
|
|
||||||
const guint8 *in, *in_end;
|
const guint8 *in, *in_end;
|
||||||
guint8 v, *out;
|
guint8 v, *out;
|
||||||
int i;
|
int i;
|
||||||
gsize block_size;
|
gsize block_size;
|
||||||
|
|
||||||
conv = G_COMPRESSOR_CONVERTER (converter);
|
|
||||||
|
|
||||||
in = inbuf;
|
in = inbuf;
|
||||||
out = outbuf;
|
out = outbuf;
|
||||||
in_end = in + inbuf_size;
|
in_end = in + inbuf_size;
|
||||||
|
@@ -206,10 +206,9 @@ ipending_cb (GObject *source,
|
|||||||
{
|
{
|
||||||
CreateDeleteData *data = user_data;
|
CreateDeleteData *data = user_data;
|
||||||
GError *error;
|
GError *error;
|
||||||
gssize size;
|
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
size = g_input_stream_read_finish (data->istream, res, &error);
|
g_input_stream_read_finish (data->istream, res, &error);
|
||||||
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_PENDING);
|
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_PENDING);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
}
|
}
|
||||||
@@ -334,10 +333,9 @@ opending_cb (GObject *source,
|
|||||||
{
|
{
|
||||||
CreateDeleteData *data = user_data;
|
CreateDeleteData *data = user_data;
|
||||||
GError *error;
|
GError *error;
|
||||||
gssize size;
|
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
size = g_output_stream_write_finish (data->ostream, res, &error);
|
g_output_stream_write_finish (data->ostream, res, &error);
|
||||||
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_PENDING);
|
g_assert_error (error, G_IO_ERROR, G_IO_ERROR_PENDING);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
}
|
}
|
||||||
@@ -512,11 +510,10 @@ replaced_cb (GObject *source,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
ReplaceLoadData *data = user_data;
|
ReplaceLoadData *data = user_data;
|
||||||
gboolean ret;
|
|
||||||
GError *error;
|
GError *error;
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
ret = g_file_replace_contents_finish (data->file, res, NULL, &error);
|
g_file_replace_contents_finish (data->file, res, NULL, &error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
|
|
||||||
g_file_load_contents_async (data->file, NULL, loaded_cb, data);
|
g_file_load_contents_async (data->file, NULL, loaded_cb, data);
|
||||||
|
@@ -72,6 +72,7 @@ handler (GThreadedSocketService *service,
|
|||||||
*tmp = 0;
|
*tmp = 0;
|
||||||
version = tmp + 1;
|
version = tmp + 1;
|
||||||
}
|
}
|
||||||
|
version = version; /* To avoid -Wunused-but-set-variable */
|
||||||
|
|
||||||
query = strchr (escaped, '?');
|
query = strchr (escaped, '?');
|
||||||
if (query != NULL)
|
if (query != NULL)
|
||||||
|
@@ -126,7 +126,6 @@ create_empty_file (GFile * parent, const char *filename,
|
|||||||
GFileCreateFlags create_flags)
|
GFileCreateFlags create_flags)
|
||||||
{
|
{
|
||||||
GFile *child;
|
GFile *child;
|
||||||
gboolean res;
|
|
||||||
GError *error;
|
GError *error;
|
||||||
GFileOutputStream *outs;
|
GFileOutputStream *outs;
|
||||||
|
|
||||||
@@ -138,7 +137,7 @@ create_empty_file (GFile * parent, const char *filename,
|
|||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
g_assert (outs != NULL);
|
g_assert (outs != NULL);
|
||||||
error = NULL;
|
error = NULL;
|
||||||
res = g_output_stream_close (G_OUTPUT_STREAM (outs), NULL, &error);
|
g_output_stream_close (G_OUTPUT_STREAM (outs), NULL, &error);
|
||||||
g_object_unref (outs);
|
g_object_unref (outs);
|
||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
|
@@ -164,11 +164,8 @@ read_line (GDataInputStream *stream,
|
|||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gsize length;
|
gsize length;
|
||||||
int eol_len;
|
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
eol_len = 1 + (eol[1] != '\0');
|
|
||||||
|
|
||||||
str = g_data_input_stream_read_line (stream, &length, NULL, error);
|
str = g_data_input_stream_read_line (stream, &length, NULL, error);
|
||||||
|
|
||||||
if (str == NULL)
|
if (str == NULL)
|
||||||
|
Reference in New Issue
Block a user