diff options
author | Juan Manuel Tomás <jtomas1815@gmail.com> | 2020-03-31 06:58:52 -0300 |
---|---|---|
committer | Juan Manuel Tomás <jtomas1815@gmail.com> | 2020-03-31 06:58:52 -0300 |
commit | 4d0fe897a45e71edccc078cd6ac6a4787a1d34c3 (patch) | |
tree | ef1682d11015317cbfe275d1e6dc919f1aeb2e9c /page.c | |
parent | 6090a3a1b9a5379f960c87759b0c0f60b79ff503 (diff) | |
download | jet-4d0fe897a45e71edccc078cd6ac6a4787a1d34c3.tar.gz jet-4d0fe897a45e71edccc078cd6ac6a4787a1d34c3.zip |
Change page item type from char to uint8_t
Diffstat (limited to 'page.c')
-rw-r--r-- | page.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,11 +1,12 @@ +#include <stdint.h> #include <string.h> #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++; |