[vte] Add _vte_ring_set_length



commit 7f9757c725f769ce582a928ecbadc2c352c1b635
Author: Behdad Esfahbod <behdad behdad org>
Date:   Mon Aug 24 16:51:54 2009 -0400

    Add _vte_ring_set_length

 src/ring.h |    3 ++-
 src/vte.c  |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/ring.h b/src/ring.h
index 0da0cf2..efd0afd 100644
--- a/src/ring.h
+++ b/src/ring.h
@@ -78,10 +78,11 @@ struct _VteRing {
 	(((__position) >= (__ring)->delta) && \
 	 ((__position) < (__ring)->delta + (__ring)->length))
 #define _vte_ring_delta(__ring) ((__ring)->delta + 0)
-#define _vte_ring_length(__ring) ((__ring)->length /* + 0 XXX */)
+#define _vte_ring_length(__ring) ((__ring)->length + 0)
 #define _vte_ring_next(__ring) ((__ring)->delta + (__ring)->length)
 #define _vte_ring_max(__ring) ((__ring)->max + 0)
 #define _vte_ring_index(__ring, __position) (&(__ring)->array[(__position) % (__ring)->max])
+#define _vte_ring_set_length(__ring, __length) ((__ring)->length = __length)
 
 VteRing *_vte_ring_new(glong max_elements);
 void _vte_ring_resize(VteRing *ring, glong max_elements);
diff --git a/src/vte.c b/src/vte.c
index 3264ca6..9e58235 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -13087,14 +13087,14 @@ vte_terminal_set_scrollback_lines(VteTerminal *terminal, glong lines)
 		scroll_delta = CLAMP (scroll_delta, low, screen->insert_delta);
 		next = MIN (next, screen->insert_delta + terminal->row_count);
 		if (_vte_ring_next (screen->row_data) > next){
-			_vte_ring_length (screen->row_data) = next - low;
+			_vte_ring_set_length (screen->row_data, next - low);
 		}
 	} else {
 		_vte_ring_resize (screen->row_data, terminal->row_count);
 		scroll_delta = _vte_ring_delta (screen->row_data);
 		screen->insert_delta = _vte_ring_delta (screen->row_data);
 		if (_vte_ring_next (screen->row_data) > screen->insert_delta + terminal->row_count){
-			_vte_ring_length (screen->row_data) = terminal->row_count;
+			_vte_ring_set_length (screen->row_data, terminal->row_count);
 		}
 	}
 



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