summaryrefslogtreecommitdiff
path: root/point.c
diff options
context:
space:
mode:
authorJuan Manuel Tomás <jtomas1815@gmail.com>2020-04-22 20:16:30 -0300
committerJuan Manuel Tomás <jtomas1815@gmail.com>2020-04-22 20:16:30 -0300
commitae003d1854021bdbc3128b2752198761d06772fd (patch)
tree2cfbeaeb275b951341c1e4314825ddf1d68c1e89 /point.c
parentde0a7c2e5e2a060057428547c786b5bbd51325bc (diff)
downloadjet-ae003d1854021bdbc3128b2752198761d06772fd.tar.gz
jet-ae003d1854021bdbc3128b2752198761d06772fd.zip
Refactor page structure
Changed the page's memory alignment to hopefully use less space. Also renamed buffer to elements.
Diffstat (limited to 'point.c')
-rw-r--r--point.c4
1 files changed, 2 insertions, 2 deletions
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);