mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-15 14:50:06 +00:00
Fix various compiler warnings with GCC 13
There are various null dereference warnings in GtkListItemManager that make the build noisy.
This commit is contained in:
parent
0434ad3bd9
commit
b2a3a5e226
@ -715,6 +715,7 @@ static void
|
|||||||
gtk_list_tile_set_type (GtkListTile *tile,
|
gtk_list_tile_set_type (GtkListTile *tile,
|
||||||
GtkListTileType type)
|
GtkListTileType type)
|
||||||
{
|
{
|
||||||
|
g_assert (tile != NULL);
|
||||||
if (tile->type == type)
|
if (tile->type == type)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -845,7 +846,8 @@ gtk_list_item_manager_remove_items (GtkListItemManager *self,
|
|||||||
if (offset)
|
if (offset)
|
||||||
tile = gtk_list_item_manager_ensure_split (self, tile, offset);
|
tile = gtk_list_item_manager_ensure_split (self, tile, offset);
|
||||||
header = gtk_list_tile_get_previous_skip (tile);
|
header = gtk_list_tile_get_previous_skip (tile);
|
||||||
if (header->type != GTK_LIST_TILE_HEADER && header->type != GTK_LIST_TILE_UNMATCHED_HEADER)
|
if (header != NULL &&
|
||||||
|
(header->type != GTK_LIST_TILE_HEADER && header->type != GTK_LIST_TILE_UNMATCHED_HEADER))
|
||||||
header = NULL;
|
header = NULL;
|
||||||
|
|
||||||
while (n_items > 0)
|
while (n_items > 0)
|
||||||
@ -962,7 +964,7 @@ gtk_list_item_manager_add_items (GtkListItemManager *self,
|
|||||||
{
|
{
|
||||||
GtkListTile *section = gtk_list_tile_get_previous_skip (tile);
|
GtkListTile *section = gtk_list_tile_get_previous_skip (tile);
|
||||||
|
|
||||||
if (section->type == GTK_LIST_TILE_HEADER)
|
if (section != NULL && section->type == GTK_LIST_TILE_HEADER)
|
||||||
{
|
{
|
||||||
gtk_list_item_change_clear_header (change, §ion->widget);
|
gtk_list_item_change_clear_header (change, §ion->widget);
|
||||||
gtk_list_tile_set_type (section,
|
gtk_list_tile_set_type (section,
|
||||||
@ -1225,7 +1227,8 @@ gtk_list_item_manager_insert_section (GtkListItemManager *self,
|
|||||||
tile = gtk_list_item_manager_ensure_split (self, tile, offset);
|
tile = gtk_list_item_manager_ensure_split (self, tile, offset);
|
||||||
|
|
||||||
header = gtk_list_tile_get_previous_skip (tile);
|
header = gtk_list_tile_get_previous_skip (tile);
|
||||||
if (header->type == GTK_LIST_TILE_HEADER || header->type == GTK_LIST_TILE_UNMATCHED_HEADER)
|
if (header != NULL &&
|
||||||
|
(header->type == GTK_LIST_TILE_HEADER || header->type == GTK_LIST_TILE_UNMATCHED_HEADER))
|
||||||
{
|
{
|
||||||
if (header_type == GTK_LIST_TILE_HEADER)
|
if (header_type == GTK_LIST_TILE_HEADER)
|
||||||
gtk_list_tile_set_type (header, header_type);
|
gtk_list_tile_set_type (header, header_type);
|
||||||
|
Loading…
Reference in New Issue
Block a user