[vte] Remove the fill argument from _vte_new_row_data()



commit 08caf3b174e68ba3d02f04c2595ad552cd50db30
Author: Behdad Esfahbod <behdad behdad org>
Date:   Thu Aug 20 23:20:06 2009 -0400

    Remove the fill argument from _vte_new_row_data()
    
    I cannot prove that this change is right, though it looks like it's
    correct!

 src/vte-private.h |    2 +-
 src/vte.c         |   28 +++++-----------------------
 src/vteseq.c      |   12 ++++++------
 3 files changed, 12 insertions(+), 30 deletions(-)
---
diff --git a/src/vte-private.h b/src/vte-private.h
index 6c45c87..a154cde 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -434,7 +434,7 @@ void _vte_invalidate_cells(VteTerminal *terminal,
 			   glong row_start, gint row_count);
 void _vte_invalidate_cell(VteTerminal *terminal, glong col, glong row);
 void _vte_invalidate_cursor_once(VteTerminal *terminal, gboolean periodic);
-VteRowData * _vte_new_row_data(VteTerminal *terminal, gboolean fill);
+VteRowData * _vte_new_row_data(VteTerminal *terminal);
 void _vte_terminal_adjust_adjustments(VteTerminal *terminal);
 void _vte_terminal_queue_contents_changed(VteTerminal *terminal);
 void _vte_terminal_emit_text_deleted(VteTerminal *terminal);
diff --git a/src/vte.c b/src/vte.c
index 4dc5166..478515a 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -294,22 +294,9 @@ vte_g_array_fill(GArray *array, gconstpointer item, guint final_size)
 	} while (--final_size);
 }
 
-static VteRowData *
-_vte_reset_row_data (VteTerminal *terminal, VteRowData *row, gboolean fill)
-{
-       g_array_set_size (row->cells, 0);
-       row->soft_wrapped = 0;
-       if (fill) {
-               vte_g_array_fill(row->cells,
-                               &terminal->pvt->screen->fill_defaults,
-                               terminal->column_count);
-       }
-       return row;
-}
-
 /* Allocate a new line. */
 VteRowData *
-_vte_new_row_data(VteTerminal *terminal, gboolean fill)
+_vte_new_row_data(VteTerminal *terminal)
 {
 	VteRowData *row = NULL;
 	row = g_slice_new(VteRowData);
@@ -317,11 +304,6 @@ _vte_new_row_data(VteTerminal *terminal, gboolean fill)
 				       sizeof(struct vte_charcell),
 				       terminal->column_count);
 	row->soft_wrapped = 0;
-	if (fill) {
-		vte_g_array_fill(row->cells,
-				 &terminal->pvt->screen->fill_defaults,
-				 terminal->column_count);
-	}
 	return row;
 }
 
@@ -332,11 +314,11 @@ vte_insert_line_internal(VteTerminal *terminal, glong position)
 	VteRowData *row;
 	/* Pad out the line data to the insertion point. */
 	while (_vte_ring_next(terminal->pvt->screen->row_data) < position) {
-		row = _vte_new_row_data(terminal, TRUE);
+		row = _vte_new_row_data(terminal);
 		_vte_ring_append(terminal->pvt->screen->row_data, row);
 	}
 	/* If we haven't inserted a line yet, insert a new one. */
-	row = _vte_new_row_data(terminal, TRUE);
+	row = _vte_new_row_data(terminal);
 	if (_vte_ring_next(terminal->pvt->screen->row_data) >= position) {
 		_vte_ring_insert(terminal->pvt->screen->row_data, position, row);
 	} else {
@@ -2326,7 +2308,7 @@ vte_terminal_insert_rows (VteTerminal *terminal, guint cnt)
 	const VteScreen *screen = terminal->pvt->screen;
 	VteRowData *row;
 	do {
-		row = _vte_new_row_data (terminal, FALSE);
+		row = _vte_new_row_data (terminal);
 		_vte_ring_append(screen->row_data, row);
 	} while(--cnt);
 	return row;
@@ -2956,7 +2938,7 @@ _vte_terminal_cursor_down (VteTerminal *terminal)
 				 * to insert_delta. */
 				start++;
 				end++;
-				row = _vte_new_row_data(terminal, FALSE);
+				row = _vte_new_row_data(terminal);
 				_vte_ring_insert_preserve(terminal->pvt->screen->row_data,
 							  screen->cursor_current.row,
 							  row);
diff --git a/src/vteseq.c b/src/vteseq.c
index f1719a2..50e951a 100644
--- a/src/vteseq.c
+++ b/src/vteseq.c
@@ -120,11 +120,11 @@ vte_insert_line_internal(VteTerminal *terminal, glong position)
 	VteRowData *row;
 	/* Pad out the line data to the insertion point. */
 	while (_vte_ring_next(terminal->pvt->screen->row_data) < position) {
-		row = _vte_new_row_data(terminal, TRUE);
+		row = _vte_new_row_data(terminal);
 		_vte_ring_append(terminal->pvt->screen->row_data, row);
 	}
 	/* If we haven't inserted a line yet, insert a new one. */
-	row = _vte_new_row_data(terminal, TRUE);
+	row = _vte_new_row_data(terminal);
 	if (_vte_ring_next(terminal->pvt->screen->row_data) >= position) {
 		_vte_ring_insert(terminal->pvt->screen->row_data, position, row);
 	} else {
@@ -328,7 +328,7 @@ _vte_terminal_clear_screen (VteTerminal *terminal)
 	initial = _vte_ring_next(screen->row_data);
 	/* Add a new screen's worth of rows. */
 	for (i = 0; i < terminal->row_count; i++) {
-		rowdata = _vte_new_row_data(terminal, TRUE);
+		rowdata = _vte_new_row_data(terminal);
 		_vte_ring_append(screen->row_data, rowdata);
 	}
 	/* Move the cursor and insertion delta to the first line in the
@@ -431,7 +431,7 @@ _vte_terminal_scroll_text (VteTerminal *terminal, int scroll_amount)
 	}
 
 	while (_vte_ring_next(screen->row_data) <= end) {
-		row = _vte_new_row_data(terminal, FALSE);
+		row = _vte_new_row_data(terminal);
 		_vte_ring_append(terminal->pvt->screen->row_data, row);
 	}
 	if (scroll_amount > 0) {
@@ -1140,7 +1140,7 @@ vte_sequence_handler_cd (VteTerminal *terminal, GValueArray *params)
 			rowdata = _vte_ring_index(screen->row_data, i);
 			g_assert(rowdata != NULL);
 		} else {
-			rowdata = _vte_new_row_data(terminal, FALSE);
+			rowdata = _vte_new_row_data(terminal);
 			_vte_ring_append(screen->row_data, rowdata);
 		}
 		/* Pad out the row. */
@@ -3082,7 +3082,7 @@ vte_sequence_handler_screen_alignment_test (VteTerminal *terminal, GValueArray *
 	     row++) {
 		/* Find this row. */
 		while (_vte_ring_next(screen->row_data) <= row) {
-			rowdata = _vte_new_row_data(terminal, FALSE);
+			rowdata = _vte_new_row_data(terminal);
 			_vte_ring_append(screen->row_data, rowdata);
 		}
 		_vte_terminal_adjust_adjustments(terminal);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]