diff options
author | Matthias Clasen <mclasen@redhat.com> | 2006-05-14 03:46:14 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2006-05-14 03:46:14 +0000 |
commit | 075e7464320d49ddb0bbb7d3331db340f51703f6 (patch) | |
tree | 0e150e0e22e797b4dd0f930b7856032d25b150e3 /gtk/gtktextbtree.c | |
parent | 2fc15d31cf2fd3f416e2309adca113861205167f (diff) | |
download | gtk+-075e7464320d49ddb0bbb7d3331db340f51703f6.tar.gz |
Move some asserts to the right place. (#341661, #341665, Pascal Terjan)
2006-05-13 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktextbtree.c:
* gtk/gtktextview.c: Move some asserts to the right
place. (#341661, #341665, Pascal Terjan)
Diffstat (limited to 'gtk/gtktextbtree.c')
-rw-r--r-- | gtk/gtktextbtree.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/gtk/gtktextbtree.c b/gtk/gtktextbtree.c index 1216d1834b..30b5d5cd85 100644 --- a/gtk/gtktextbtree.c +++ b/gtk/gtktextbtree.c @@ -3768,9 +3768,9 @@ _gtk_text_line_byte_to_segment (GtkTextLine *line, while (offset >= seg->byte_count) { - g_assert (seg != NULL); /* means an invalid byte index */ offset -= seg->byte_count; seg = seg->next; + g_assert (seg != NULL); /* means an invalid byte index */ } if (seg_offset) @@ -3794,9 +3794,9 @@ _gtk_text_line_char_to_segment (GtkTextLine *line, while (offset >= seg->char_count) { - g_assert (seg != NULL); /* means an invalid char index */ offset -= seg->char_count; seg = seg->next; + g_assert (seg != NULL); /* means an invalid char index */ } if (seg_offset) @@ -3820,9 +3820,9 @@ _gtk_text_line_byte_to_any_segment (GtkTextLine *line, while (offset > 0 && offset >= seg->byte_count) { - g_assert (seg != NULL); /* means an invalid byte index */ offset -= seg->byte_count; seg = seg->next; + g_assert (seg != NULL); /* means an invalid byte index */ } if (seg_offset) @@ -3846,9 +3846,9 @@ _gtk_text_line_char_to_any_segment (GtkTextLine *line, while (offset > 0 && offset >= seg->char_count) { - g_assert (seg != NULL); /* means an invalid byte index */ offset -= seg->char_count; seg = seg->next; + g_assert (seg != NULL); /* means an invalid byte index */ } if (seg_offset) @@ -3872,12 +3872,10 @@ _gtk_text_line_byte_to_char (GtkTextLine *line, while (byte_offset >= seg->byte_count) /* while (we need to go farther than the next segment) */ { - g_assert (seg != NULL); /* our byte_index was bogus if this happens */ - byte_offset -= seg->byte_count; char_offset += seg->char_count; - seg = seg->next; + g_assert (seg != NULL); /* our byte_index was bogus if this happens */ } g_assert (seg != NULL); |