diff options
author | Benjamin Otte <otte@redhat.com> | 2020-03-05 07:02:24 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2020-03-05 08:14:37 +0100 |
commit | e356d59a92dfe24ff4a1c5b8300974f0427c90d0 (patch) | |
tree | 9a1e302fde600e7277d383d34ca11501f4b3afa8 /gtk/gtktextiter.c | |
parent | 4be479931666b65a615830d81d739894b5741076 (diff) | |
download | gtk+-e356d59a92dfe24ff4a1c5b8300974f0427c90d0.tar.gz |
build: Add -Wnull-dereference
Sprinkle various g_assert() around the code where gcc cannot figure out
on its own that a variable is not NULL and too much refactoring would be
needed to make it do that.
Also fix usage of g_assert_nonnull(x) to use g_assert(x) because the
first is not marked as G_GNUC_NORETURN because of course GTester
supports not aborting on aborts.
Diffstat (limited to 'gtk/gtktextiter.c')
-rw-r--r-- | gtk/gtktextiter.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk/gtktextiter.c b/gtk/gtktextiter.c index c4c1bfc024..237030c5f9 100644 --- a/gtk/gtktextiter.c +++ b/gtk/gtktextiter.c @@ -209,6 +209,8 @@ gtk_text_iter_make_real (const GtkTextIter *_iter) GtkTextRealIter *iter; iter = gtk_text_iter_make_surreal (_iter); + if (iter == NULL) + return NULL; if (iter->segments_changed_stamp != _gtk_text_btree_get_segments_changed_stamp (iter->tree)) @@ -242,8 +244,8 @@ iter_init_common (GtkTextIter *_iter, { GtkTextRealIter *iter = (GtkTextRealIter*)_iter; - g_return_val_if_fail (iter != NULL, NULL); - g_return_val_if_fail (tree != NULL, NULL); + g_assert (iter != NULL); + g_assert (tree != NULL); memset (iter, 0, sizeof (GtkTextRealIter)); |