mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-08 19:49:41 +02:00
Merge branch 'backport-2285-svace-fixes-glib-2-70' into 'glib-2-70'
Backport !2285 “fix issues found by svace static code analyzer” to glib-2-70 See merge request GNOME/glib!2300
This commit is contained in:
commit
39183abe81
@ -881,8 +881,8 @@ keyring_generate_entry (const gchar *cookie_context,
|
|||||||
error))
|
error))
|
||||||
{
|
{
|
||||||
*out_id = 0;
|
*out_id = 0;
|
||||||
*out_cookie = 0;
|
|
||||||
g_free (*out_cookie);
|
g_free (*out_cookie);
|
||||||
|
*out_cookie = 0;
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -2011,7 +2011,16 @@ g_local_file_trash (GFile *file,
|
|||||||
* trying to rename across a filesystem boundary, which doesn't work. So
|
* trying to rename across a filesystem boundary, which doesn't work. So
|
||||||
* we use g_stat here instead of g_lstat, to know where the symlink
|
* we use g_stat here instead of g_lstat, to know where the symlink
|
||||||
* points to. */
|
* points to. */
|
||||||
g_stat (path, &file_stat);
|
if (g_stat (path, &file_stat))
|
||||||
|
{
|
||||||
|
errsv = errno;
|
||||||
|
g_free (path);
|
||||||
|
|
||||||
|
g_set_io_error (error,
|
||||||
|
_("Error trashing file %s: %s"),
|
||||||
|
file, errsv);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
g_free (path);
|
g_free (path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2650,7 +2650,7 @@ set_mtime_atime (char *filename,
|
|||||||
{
|
{
|
||||||
if (lazy_stat (filename, &statbuf, &got_stat) == 0)
|
if (lazy_stat (filename, &statbuf, &got_stat) == 0)
|
||||||
{
|
{
|
||||||
times[0].tv_sec = statbuf.st_mtime;
|
times[0].tv_sec = statbuf.st_atime;
|
||||||
#if defined (HAVE_STRUCT_STAT_ST_ATIMENSEC)
|
#if defined (HAVE_STRUCT_STAT_ST_ATIMENSEC)
|
||||||
times[0].tv_usec = statbuf.st_atimensec / 1000;
|
times[0].tv_usec = statbuf.st_atimensec / 1000;
|
||||||
#elif defined (HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC)
|
#elif defined (HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC)
|
||||||
|
@ -490,14 +490,14 @@ _g_cclosure_marshal_BOOLEAN__STRINGv (GClosure *closure,
|
|||||||
gpointer arg0;
|
gpointer arg0;
|
||||||
va_list args_copy;
|
va_list args_copy;
|
||||||
|
|
||||||
|
g_return_if_fail (return_value != NULL);
|
||||||
|
|
||||||
G_VA_COPY (args_copy, args);
|
G_VA_COPY (args_copy, args);
|
||||||
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
arg0 = (gpointer) va_arg (args_copy, gpointer);
|
||||||
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
if ((param_types[0] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0 && arg0 != NULL)
|
||||||
arg0 = g_strdup (arg0);
|
arg0 = g_strdup (arg0);
|
||||||
va_end (args_copy);
|
va_end (args_copy);
|
||||||
|
|
||||||
g_return_if_fail (return_value != NULL);
|
|
||||||
|
|
||||||
if (G_CCLOSURE_SWAP_DATA (closure))
|
if (G_CCLOSURE_SWAP_DATA (closure))
|
||||||
{
|
{
|
||||||
data1 = closure->data;
|
data1 = closure->data;
|
||||||
|
@ -108,6 +108,8 @@ g_openuri_portal_open_uri (const char *uri,
|
|||||||
errsv = errno;
|
errsv = errno;
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
{
|
{
|
||||||
|
g_free (path);
|
||||||
|
g_variant_builder_clear (&opt_builder);
|
||||||
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv),
|
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv),
|
||||||
"Failed to open '%s'", path);
|
"Failed to open '%s'", path);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -262,8 +262,12 @@ g_proxy_address_enumerator_next (GSocketAddressEnumerator *enumerator,
|
|||||||
}
|
}
|
||||||
dest_protocol = g_uri_parse_scheme (priv->dest_uri);
|
dest_protocol = g_uri_parse_scheme (priv->dest_uri);
|
||||||
|
|
||||||
g_return_val_if_fail (G_IS_INET_SOCKET_ADDRESS (priv->proxy_address),
|
if (!G_IS_INET_SOCKET_ADDRESS (priv->proxy_address))
|
||||||
NULL);
|
{
|
||||||
|
g_free (dest_hostname);
|
||||||
|
g_free (dest_protocol);
|
||||||
|
}
|
||||||
|
g_return_val_if_fail (G_IS_INET_SOCKET_ADDRESS (priv->proxy_address), NULL);
|
||||||
|
|
||||||
inetsaddr = G_INET_SOCKET_ADDRESS (priv->proxy_address);
|
inetsaddr = G_INET_SOCKET_ADDRESS (priv->proxy_address);
|
||||||
inetaddr = g_inet_socket_address_get_address (inetsaddr);
|
inetaddr = g_inet_socket_address_get_address (inetsaddr);
|
||||||
@ -352,6 +356,11 @@ return_result (GTask *task)
|
|||||||
}
|
}
|
||||||
dest_protocol = g_uri_parse_scheme (priv->dest_uri);
|
dest_protocol = g_uri_parse_scheme (priv->dest_uri);
|
||||||
|
|
||||||
|
if (!G_IS_INET_SOCKET_ADDRESS (priv->proxy_address))
|
||||||
|
{
|
||||||
|
g_free (dest_hostname);
|
||||||
|
g_free (dest_protocol);
|
||||||
|
}
|
||||||
g_return_if_fail (G_IS_INET_SOCKET_ADDRESS (priv->proxy_address));
|
g_return_if_fail (G_IS_INET_SOCKET_ADDRESS (priv->proxy_address));
|
||||||
|
|
||||||
inetsaddr = G_INET_SOCKET_ADDRESS (priv->proxy_address);
|
inetsaddr = G_INET_SOCKET_ADDRESS (priv->proxy_address);
|
||||||
|
@ -200,6 +200,8 @@ g_settings_get_mapping_int (GValue *value,
|
|||||||
l = g_variant_get_int32 (variant);
|
l = g_variant_get_int32 (variant);
|
||||||
else if (g_variant_type_equal (type, G_VARIANT_TYPE_INT64))
|
else if (g_variant_type_equal (type, G_VARIANT_TYPE_INT64))
|
||||||
l = g_variant_get_int64 (variant);
|
l = g_variant_get_int64 (variant);
|
||||||
|
else if (g_variant_type_equal (type, G_VARIANT_TYPE_HANDLE))
|
||||||
|
l = g_variant_get_handle (variant);
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
@ -291,8 +293,6 @@ g_settings_get_mapping_unsigned_int (GValue *value,
|
|||||||
u = g_variant_get_uint32 (variant);
|
u = g_variant_get_uint32 (variant);
|
||||||
else if (g_variant_type_equal (type, G_VARIANT_TYPE_UINT64))
|
else if (g_variant_type_equal (type, G_VARIANT_TYPE_UINT64))
|
||||||
u = g_variant_get_uint64 (variant);
|
u = g_variant_get_uint64 (variant);
|
||||||
else if (g_variant_type_equal (type, G_VARIANT_TYPE_HANDLE))
|
|
||||||
u = g_variant_get_handle (variant);
|
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
@ -459,7 +459,8 @@ g_settings_get_mapping (GValue *value,
|
|||||||
|
|
||||||
else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_INT16) ||
|
else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_INT16) ||
|
||||||
g_variant_is_of_type (variant, G_VARIANT_TYPE_INT32) ||
|
g_variant_is_of_type (variant, G_VARIANT_TYPE_INT32) ||
|
||||||
g_variant_is_of_type (variant, G_VARIANT_TYPE_INT64))
|
g_variant_is_of_type (variant, G_VARIANT_TYPE_INT64) ||
|
||||||
|
g_variant_is_of_type (variant, G_VARIANT_TYPE_HANDLE))
|
||||||
return g_settings_get_mapping_int (value, variant);
|
return g_settings_get_mapping_int (value, variant);
|
||||||
|
|
||||||
else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_DOUBLE))
|
else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_DOUBLE))
|
||||||
@ -467,8 +468,7 @@ g_settings_get_mapping (GValue *value,
|
|||||||
|
|
||||||
else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_UINT16) ||
|
else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_UINT16) ||
|
||||||
g_variant_is_of_type (variant, G_VARIANT_TYPE_UINT32) ||
|
g_variant_is_of_type (variant, G_VARIANT_TYPE_UINT32) ||
|
||||||
g_variant_is_of_type (variant, G_VARIANT_TYPE_UINT64) ||
|
g_variant_is_of_type (variant, G_VARIANT_TYPE_UINT64))
|
||||||
g_variant_is_of_type (variant, G_VARIANT_TYPE_HANDLE))
|
|
||||||
return g_settings_get_mapping_unsigned_int (value, variant);
|
return g_settings_get_mapping_unsigned_int (value, variant);
|
||||||
|
|
||||||
else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_STRING) ||
|
else if (g_variant_is_of_type (variant, G_VARIANT_TYPE_STRING) ||
|
||||||
|
@ -621,7 +621,7 @@ g_socket (gint domain,
|
|||||||
(flags & FD_CLOEXEC) == 0)
|
(flags & FD_CLOEXEC) == 0)
|
||||||
{
|
{
|
||||||
flags |= FD_CLOEXEC;
|
flags |= FD_CLOEXEC;
|
||||||
fcntl (fd, F_SETFD, flags);
|
(void) fcntl (fd, F_SETFD, flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -328,7 +328,7 @@ set_connect_msg (guint8 *msg,
|
|||||||
*
|
*
|
||||||
* The parser only requires 4 bytes.
|
* The parser only requires 4 bytes.
|
||||||
*/
|
*/
|
||||||
#define SOCKS5_CONN_REP_LEN 255
|
#define SOCKS5_CONN_REP_LEN 257
|
||||||
static gboolean
|
static gboolean
|
||||||
parse_connect_reply (const guint8 *data, gint *atype, GError **error)
|
parse_connect_reply (const guint8 *data, gint *atype, GError **error)
|
||||||
{
|
{
|
||||||
@ -509,7 +509,7 @@ g_socks5_proxy_connect (GProxy *proxy,
|
|||||||
guint8 data[SOCKS5_CONN_REP_LEN];
|
guint8 data[SOCKS5_CONN_REP_LEN];
|
||||||
gint atype;
|
gint atype;
|
||||||
|
|
||||||
if (!g_input_stream_read_all (in, data, 4, NULL,
|
if (!g_input_stream_read_all (in, data, 4 /* VER, REP, RSV, ATYP */, NULL,
|
||||||
cancellable, error))
|
cancellable, error))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
@ -519,23 +519,26 @@ g_socks5_proxy_connect (GProxy *proxy,
|
|||||||
switch (atype)
|
switch (atype)
|
||||||
{
|
{
|
||||||
case SOCKS5_ATYP_IPV4:
|
case SOCKS5_ATYP_IPV4:
|
||||||
if (!g_input_stream_read_all (in, data, 6, NULL,
|
if (!g_input_stream_read_all (in, data,
|
||||||
cancellable, error))
|
4 /* IPv4 length */ + 2 /* port */,
|
||||||
|
NULL, cancellable, error))
|
||||||
goto error;
|
goto error;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SOCKS5_ATYP_IPV6:
|
case SOCKS5_ATYP_IPV6:
|
||||||
if (!g_input_stream_read_all (in, data, 18, NULL,
|
if (!g_input_stream_read_all (in, data,
|
||||||
cancellable, error))
|
16 /* IPv6 length */ + 2 /* port */,
|
||||||
|
NULL, cancellable, error))
|
||||||
goto error;
|
goto error;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SOCKS5_ATYP_DOMAINNAME:
|
case SOCKS5_ATYP_DOMAINNAME:
|
||||||
if (!g_input_stream_read_all (in, data, 1, NULL,
|
if (!g_input_stream_read_all (in, data, 1 /* domain name length */,
|
||||||
cancellable, error))
|
NULL, cancellable, error))
|
||||||
goto error;
|
goto error;
|
||||||
if (!g_input_stream_read_all (in, data, data[0] + 2, NULL,
|
if (!g_input_stream_read_all (in, data,
|
||||||
cancellable, error))
|
data[0] /* domain name length */ + 2 /* port */,
|
||||||
|
NULL, cancellable, error))
|
||||||
goto error;
|
goto error;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -99,6 +99,8 @@ _xdg_mime_magic_matchlet_new (void)
|
|||||||
XdgMimeMagicMatchlet *matchlet;
|
XdgMimeMagicMatchlet *matchlet;
|
||||||
|
|
||||||
matchlet = malloc (sizeof (XdgMimeMagicMatchlet));
|
matchlet = malloc (sizeof (XdgMimeMagicMatchlet));
|
||||||
|
if (matchlet == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
matchlet->indent = 0;
|
matchlet->indent = 0;
|
||||||
matchlet->offset = 0;
|
matchlet->offset = 0;
|
||||||
@ -351,6 +353,11 @@ _xdg_mime_magic_parse_magic_line (FILE *magic_file,
|
|||||||
return XDG_MIME_MAGIC_ERROR;
|
return XDG_MIME_MAGIC_ERROR;
|
||||||
|
|
||||||
matchlet = _xdg_mime_magic_matchlet_new ();
|
matchlet = _xdg_mime_magic_matchlet_new ();
|
||||||
|
|
||||||
|
/* OOM */
|
||||||
|
if (matchlet == NULL)
|
||||||
|
return XDG_MIME_MAGIC_ERROR;
|
||||||
|
|
||||||
matchlet->indent = indent;
|
matchlet->indent = indent;
|
||||||
matchlet->offset = _xdg_mime_magic_read_a_number (magic_file, &end_of_file);
|
matchlet->offset = _xdg_mime_magic_read_a_number (magic_file, &end_of_file);
|
||||||
if (end_of_file)
|
if (end_of_file)
|
||||||
@ -765,6 +772,11 @@ _xdg_mime_magic_read_magic_file (XdgMimeMagic *mime_magic,
|
|||||||
{
|
{
|
||||||
case XDG_MIME_MAGIC_SECTION:
|
case XDG_MIME_MAGIC_SECTION:
|
||||||
match = _xdg_mime_magic_match_new ();
|
match = _xdg_mime_magic_match_new ();
|
||||||
|
|
||||||
|
/* OOM */
|
||||||
|
if (match == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
state = _xdg_mime_magic_parse_header (magic_file, match);
|
state = _xdg_mime_magic_parse_header (magic_file, match);
|
||||||
if (state == XDG_MIME_MAGIC_EOF || state == XDG_MIME_MAGIC_ERROR)
|
if (state == XDG_MIME_MAGIC_EOF || state == XDG_MIME_MAGIC_ERROR)
|
||||||
_xdg_mime_magic_match_free (match);
|
_xdg_mime_magic_match_free (match);
|
||||||
|
@ -340,7 +340,11 @@ stack_trace (const char * const *args)
|
|||||||
/* Save stderr for printing failure below */
|
/* Save stderr for printing failure below */
|
||||||
int old_err = dup (2);
|
int old_err = dup (2);
|
||||||
if (old_err != -1)
|
if (old_err != -1)
|
||||||
fcntl (old_err, F_SETFD, fcntl (old_err, F_GETFD) | FD_CLOEXEC);
|
{
|
||||||
|
int getfd = fcntl (old_err, F_GETFD);
|
||||||
|
if (getfd != -1)
|
||||||
|
(void) fcntl (old_err, F_SETFD, getfd | FD_CLOEXEC);
|
||||||
|
}
|
||||||
|
|
||||||
close (0); dup (in_fd[0]); /* set the stdin to the in pipe */
|
close (0); dup (in_fd[0]); /* set the stdin to the in pipe */
|
||||||
close (1); dup (out_fd[1]); /* set the stdout to the out pipe */
|
close (1); dup (out_fd[1]); /* set the stdout to the out pipe */
|
||||||
|
@ -2259,9 +2259,6 @@ g_key_file_get_locale_string (GKeyFile *key_file,
|
|||||||
|
|
||||||
if (translated_value)
|
if (translated_value)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
g_free (translated_value);
|
|
||||||
translated_value = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fallback to untranslated key
|
/* Fallback to untranslated key
|
||||||
|
@ -2321,7 +2321,10 @@ g_log_writer_format_fields (GLogLevelFlags log_level,
|
|||||||
now = g_get_real_time ();
|
now = g_get_real_time ();
|
||||||
now_secs = (time_t) (now / 1000000);
|
now_secs = (time_t) (now / 1000000);
|
||||||
now_tm = localtime (&now_secs);
|
now_tm = localtime (&now_secs);
|
||||||
|
if (G_LIKELY (now_tm != NULL))
|
||||||
strftime (time_buf, sizeof (time_buf), "%H:%M:%S", now_tm);
|
strftime (time_buf, sizeof (time_buf), "%H:%M:%S", now_tm);
|
||||||
|
else
|
||||||
|
strcpy (time_buf, "(error)");
|
||||||
|
|
||||||
g_string_append_printf (gstring, "%s%s.%03d%s: ",
|
g_string_append_printf (gstring, "%s%s.%03d%s: ",
|
||||||
use_color ? "\033[34m" : "",
|
use_color ? "\033[34m" : "",
|
||||||
|
@ -1307,7 +1307,7 @@ static gsize
|
|||||||
allocator_aligned_page_size (Allocator *allocator,
|
allocator_aligned_page_size (Allocator *allocator,
|
||||||
gsize n_bytes)
|
gsize n_bytes)
|
||||||
{
|
{
|
||||||
gsize val = 1 << g_bit_storage (n_bytes - 1);
|
gsize val = (gsize) 1 << g_bit_storage (n_bytes - 1);
|
||||||
val = MAX (val, allocator->min_page_size);
|
val = MAX (val, allocator->min_page_size);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
@ -800,7 +800,13 @@ g_variant_new_array (const GVariantType *child_type,
|
|||||||
|
|
||||||
for (i = 0; i < n_children; i++)
|
for (i = 0; i < n_children; i++)
|
||||||
{
|
{
|
||||||
TYPE_CHECK (children[i], child_type, NULL);
|
if G_UNLIKELY (!g_variant_is_of_type (children[i], child_type))
|
||||||
|
{
|
||||||
|
while (i != 0)
|
||||||
|
g_variant_unref (my_children[--i]);
|
||||||
|
g_free (my_children);
|
||||||
|
g_return_val_if_fail (g_variant_is_of_type (children[i], child_type), NULL);
|
||||||
|
}
|
||||||
my_children[i] = g_variant_ref_sink (children[i]);
|
my_children[i] = g_variant_ref_sink (children[i]);
|
||||||
trusted &= g_variant_is_trusted (children[i]);
|
trusted &= g_variant_is_trusted (children[i]);
|
||||||
}
|
}
|
||||||
@ -3190,8 +3196,7 @@ struct heap_builder
|
|||||||
#define GVSB_MAGIC ((gsize) 1033660112u)
|
#define GVSB_MAGIC ((gsize) 1033660112u)
|
||||||
#define GVSB_MAGIC_PARTIAL ((gsize) 2942751021u)
|
#define GVSB_MAGIC_PARTIAL ((gsize) 2942751021u)
|
||||||
#define GVHB_MAGIC ((gsize) 3087242682u)
|
#define GVHB_MAGIC ((gsize) 3087242682u)
|
||||||
#define is_valid_builder(b) (b != NULL && \
|
#define is_valid_builder(b) (GVSB(b)->magic == GVSB_MAGIC)
|
||||||
GVSB(b)->magic == GVSB_MAGIC)
|
|
||||||
#define is_valid_heap_builder(b) (GVHB(b)->magic == GVHB_MAGIC)
|
#define is_valid_heap_builder(b) (GVHB(b)->magic == GVHB_MAGIC)
|
||||||
|
|
||||||
/* Just to make sure that by adding a union to GVariantBuilder, we
|
/* Just to make sure that by adding a union to GVariantBuilder, we
|
||||||
@ -3201,7 +3206,9 @@ G_STATIC_ASSERT (sizeof (GVariantBuilder) == sizeof (gsize[16]));
|
|||||||
static gboolean
|
static gboolean
|
||||||
ensure_valid_builder (GVariantBuilder *builder)
|
ensure_valid_builder (GVariantBuilder *builder)
|
||||||
{
|
{
|
||||||
if (is_valid_builder (builder))
|
if (builder == NULL)
|
||||||
|
return FALSE;
|
||||||
|
else if (is_valid_builder (builder))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if (builder->u.s.partial_magic == GVSB_MAGIC_PARTIAL)
|
if (builder->u.s.partial_magic == GVSB_MAGIC_PARTIAL)
|
||||||
{
|
{
|
||||||
@ -3847,8 +3854,7 @@ struct heap_dict
|
|||||||
#define GVSD_MAGIC ((gsize) 2579507750u)
|
#define GVSD_MAGIC ((gsize) 2579507750u)
|
||||||
#define GVSD_MAGIC_PARTIAL ((gsize) 3488698669u)
|
#define GVSD_MAGIC_PARTIAL ((gsize) 3488698669u)
|
||||||
#define GVHD_MAGIC ((gsize) 2450270775u)
|
#define GVHD_MAGIC ((gsize) 2450270775u)
|
||||||
#define is_valid_dict(d) (d != NULL && \
|
#define is_valid_dict(d) (GVSD(d)->magic == GVSD_MAGIC)
|
||||||
GVSD(d)->magic == GVSD_MAGIC)
|
|
||||||
#define is_valid_heap_dict(d) (GVHD(d)->magic == GVHD_MAGIC)
|
#define is_valid_heap_dict(d) (GVHD(d)->magic == GVHD_MAGIC)
|
||||||
|
|
||||||
/* Just to make sure that by adding a union to GVariantDict, we didn't
|
/* Just to make sure that by adding a union to GVariantDict, we didn't
|
||||||
@ -3858,7 +3864,9 @@ G_STATIC_ASSERT (sizeof (GVariantDict) == sizeof (gsize[16]));
|
|||||||
static gboolean
|
static gboolean
|
||||||
ensure_valid_dict (GVariantDict *dict)
|
ensure_valid_dict (GVariantDict *dict)
|
||||||
{
|
{
|
||||||
if (is_valid_dict (dict))
|
if (dict == NULL)
|
||||||
|
return FALSE;
|
||||||
|
else if (is_valid_dict (dict))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if (dict->u.s.partial_magic == GVSD_MAGIC_PARTIAL)
|
if (dict->u.s.partial_magic == GVSD_MAGIC_PARTIAL)
|
||||||
{
|
{
|
||||||
|
@ -3159,11 +3159,14 @@ g_type_class_peek_parent (gpointer g_class)
|
|||||||
g_return_val_if_fail (g_class != NULL, NULL);
|
g_return_val_if_fail (g_class != NULL, NULL);
|
||||||
|
|
||||||
node = lookup_type_node_I (G_TYPE_FROM_CLASS (g_class));
|
node = lookup_type_node_I (G_TYPE_FROM_CLASS (g_class));
|
||||||
|
|
||||||
|
g_return_val_if_fail (node != NULL, NULL);
|
||||||
|
|
||||||
/* We used to acquire a read lock here. That is not necessary, since
|
/* We used to acquire a read lock here. That is not necessary, since
|
||||||
* parent->data->class.class is constant as long as the derived class
|
* parent->data->class.class is constant as long as the derived class
|
||||||
* exists.
|
* exists.
|
||||||
*/
|
*/
|
||||||
if (node && node->is_classed && node->data && NODE_PARENT_TYPE (node))
|
if (node->is_classed && node->data && NODE_PARENT_TYPE (node))
|
||||||
{
|
{
|
||||||
node = lookup_type_node_I (NODE_PARENT_TYPE (node));
|
node = lookup_type_node_I (NODE_PARENT_TYPE (node));
|
||||||
class = node->data->class.class;
|
class = node->data->class.class;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user