summaryrefslogtreecommitdiff
path: root/src/ui/visbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/visbuf.c')
-rw-r--r--src/ui/visbuf.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/src/ui/visbuf.c b/src/ui/visbuf.c
index 503d0a2f..8f7a4c46 100644
--- a/src/ui/visbuf.c
+++ b/src/ui/visbuf.c
@@ -79,32 +79,6 @@ void dealloc_VisBuf(iVisBuf *d) {
79 } 79 }
80} 80}
81 81
82#if 0
83static size_t findMostDistant_VisBuf_(const iVisBuf *d, const size_t *avail, size_t numAvail,
84 const iRangei vis) {
85 size_t chosen = 0;
86 int distChosen = iAbsi(d->buffers[0].origin - vis.start);
87 printf(" avail (got %zu): %zu", numAvail, avail[0]);
88 for (size_t i = 1; i < numAvail; i++) {
89 printf(" %zu", avail[i]);
90 const int dist = iAbsi(d->buffers[i].origin - vis.start);
91 if (dist > distChosen) {
92 chosen = i;
93 distChosen = dist;
94 }
95 }
96 printf("\n chose index %zu (%d)\n", chosen, distChosen);
97 return chosen;
98}
99
100static size_t take_(size_t *avail, size_t *numAvail, size_t index) {
101 const size_t value = avail[index];
102 memmove(avail + index, avail + index + 1, sizeof(size_t) * (*numAvail - index - 1));
103 (*numAvail)--;
104 return value;
105}
106#endif
107
108static void roll_VisBuf_(iVisBuf *d, int dir) { 82static void roll_VisBuf_(iVisBuf *d, int dir) {
109 const size_t lastPos = iElemCount(d->buffers) - 1; 83 const size_t lastPos = iElemCount(d->buffers) - 1;
110 if (dir < 0) { 84 if (dir < 0) {
@@ -170,6 +144,7 @@ iBool reposition_VisBuf(iVisBuf *d, const iRangei vis) {
170 wasChanged = iTrue; 144 wasChanged = iTrue;
171 } 145 }
172 } 146 }
147 iUnused(wasChanged);
173#if 0 148#if 0
174 if (wasChanged) { 149 if (wasChanged) {
175 printf("\nVISIBLE RANGE: %d ... %d\n", vis.start, vis.end); 150 printf("\nVISIBLE RANGE: %d ... %d\n", vis.start, vis.end);