From ae003d1854021bdbc3128b2752198761d06772fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Wed, 22 Apr 2020 20:16:30 -0300 Subject: Refactor page structure Changed the page's memory alignment to hopefully use less space. Also renamed buffer to elements. --- point.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'point.c') diff --git a/point.c b/point.c index e9d6472..8413ad8 100644 --- a/point.c +++ b/point.c @@ -15,7 +15,7 @@ uint16_t index_to_offset(struct point *point) { } uint8_t element(struct point *point) { - return point->page->buffer[index_to_offset(point)]; + return point->page->elements[index_to_offset(point)]; } bool at_eof(struct point *point) { @@ -60,7 +60,7 @@ void insert_at_point(struct point *point, uint8_t c) { } } align_gap(point); - point->page->buffer[point->page->gap_start] = c; + point->page->elements[point->page->gap_start] = c; point->page->gap_start++; point->page->element_count++; move_point_forward(point); -- cgit v1.2.3