mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-13 04:10:13 +00:00
gdk: Use G_N_ELEMENTS() when iterating over constant arrays
And do that everywhere. Because if we don't, we're gonna crash sometimes.
This commit is contained in:
parent
d092e8dd78
commit
7e137b2524
@ -99,8 +99,7 @@ static const struct {
|
|||||||
{ "nesw-resize", "fd_double_arrow" },
|
{ "nesw-resize", "fd_double_arrow" },
|
||||||
{ "nwse-resize", "bd_double_arrow" },
|
{ "nwse-resize", "bd_double_arrow" },
|
||||||
{ "zoom-in", "left_ptr" },
|
{ "zoom-in", "left_ptr" },
|
||||||
{ "zoom-out", "left_ptr" },
|
{ "zoom-out", "left_ptr" }
|
||||||
{ NULL, NULL }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const gchar *
|
static const gchar *
|
||||||
@ -108,7 +107,7 @@ name_fallback (const gchar *name)
|
|||||||
{
|
{
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
for (i = 0; name_map[i].css_name; i++)
|
for (i = 0; i < G_N_ELEMENTS (name_map); i++)
|
||||||
{
|
{
|
||||||
if (g_str_equal (name_map[i].css_name, name))
|
if (g_str_equal (name_map[i].css_name, name))
|
||||||
return name_map[i].traditional_name;
|
return name_map[i].traditional_name;
|
||||||
|
@ -140,8 +140,7 @@ static const struct {
|
|||||||
{ "nesw-resize", "fd_double_arrow", XC_X_cursor },
|
{ "nesw-resize", "fd_double_arrow", XC_X_cursor },
|
||||||
{ "nwse-resize", "bd_double_arrow", XC_X_cursor },
|
{ "nwse-resize", "bd_double_arrow", XC_X_cursor },
|
||||||
{ "zoom-in", "left_ptr", XC_draped_box },
|
{ "zoom-in", "left_ptr", XC_draped_box },
|
||||||
{ "zoom-out", "left_ptr", XC_draped_box },
|
{ "zoom-out", "left_ptr", XC_draped_box }
|
||||||
{ NULL, NULL, XC_X_cursor }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef HAVE_XCURSOR
|
#ifdef HAVE_XCURSOR
|
||||||
|
Loading…
Reference in New Issue
Block a user