From 4d0fe897a45e71edccc078cd6ac6a4787a1d34c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Tue, 31 Mar 2020 06:58:52 -0300 Subject: Change page item type from char to uint8_t --- page.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/page.c b/page.c index 5d15f1d..128a88a 100644 --- a/page.c +++ b/page.c @@ -1,11 +1,12 @@ +#include #include #define PAGE_SIZE 1024 struct page { - char contents[PAGE_SIZE]; - char *gap_start; - char *gap_end; + uint8_t contents[PAGE_SIZE]; + uint8_t *gap_start; + uint8_t *gap_end; struct page *next; struct page *prev; }; @@ -75,7 +76,7 @@ static inline int page_is_empty(struct page *page) { && page->gap_end == page->contents + PAGE_SIZE - 1; } -void insert_into_page(struct page *page, char c) { +void insert_into_page(struct page *page, uint8_t c) { if (!page_is_full(page)) { *(page->gap_start) = c; page->gap_start++; -- cgit v1.2.3