mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-08 18:36:17 +01:00
Merge branch 'fix_garray_warning' into 'main'
Fix always true comparison warning in glib/garray.c See merge request GNOME/glib!2311
This commit is contained in:
commit
746ce4e042
@ -181,7 +181,9 @@ g_array_new (gboolean zero_terminated,
|
||||
guint elt_size)
|
||||
{
|
||||
g_return_val_if_fail (elt_size > 0, NULL);
|
||||
#if (UINT_WIDTH / 8) >= GLIB_SIZEOF_SIZE_T
|
||||
g_return_val_if_fail (elt_size <= G_MAXSIZE / 2 - 1, NULL);
|
||||
#endif
|
||||
|
||||
return g_array_sized_new (zero_terminated, clear, elt_size, 0);
|
||||
}
|
||||
@ -262,7 +264,9 @@ g_array_sized_new (gboolean zero_terminated,
|
||||
GRealArray *array;
|
||||
|
||||
g_return_val_if_fail (elt_size > 0, NULL);
|
||||
g_return_val_if_fail (elt_size <= G_MAXSIZE, NULL);
|
||||
#if (UINT_WIDTH / 8) >= GLIB_SIZEOF_SIZE_T
|
||||
g_return_val_if_fail (elt_size <= G_MAXSIZE / 2 - 1, NULL);
|
||||
#endif
|
||||
|
||||
array = g_slice_new (GRealArray);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user