diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2020-10-04 20:04:55 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2020-10-10 10:03:17 +0200 |
| commit | bbe81dff8c0241bdb51b746f42ce91ff795b9737 (patch) | |
| tree | 18fc3e9c4c4bbfd039c37259ce886a2e6eabb70b /text.c | |
| parent | 5f1ade1308a080fc27f43ae9504432255958a6f9 (diff) | |
| download | vis-bbe81dff8c0241bdb51b746f42ce91ff795b9737.tar.gz vis-bbe81dff8c0241bdb51b746f42ce91ff795b9737.tar.xz | |
text: mark return value of text_iterator_text as const
Diffstat (limited to 'text.c')
| -rw-r--r-- | text.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1412,7 +1412,7 @@ Iterator text_iterator_get(const Text *txt, size_t pos) { bool text_iterator_byte_get(const Iterator *it, char *b) { if (text_iterator_valid(it)) { - Text *txt = text_iterator_text(it); + const Text *txt = text_iterator_text(it); if (it->start <= it->text && it->text < it->end) { *b = *it->text; return true; @@ -1435,7 +1435,7 @@ bool text_iterator_prev(Iterator *it) { return text_iterator_init(it, it->pos-off, it->piece ? it->piece->prev : NULL, len); } -Text *text_iterator_text(const Iterator *it) { +const Text *text_iterator_text(const Iterator *it) { return it->piece ? it->piece->text : NULL; } @@ -1555,7 +1555,7 @@ bool text_iterator_char_next(Iterator *it, char *c) { if (!text_iterator_codepoint_next(it, c)) return false; mbstate_t ps = { 0 }; - Text *txt = text_iterator_text(it); + const Text *txt = text_iterator_text(it); for (;;) { char buf[MB_LEN_MAX]; size_t len = text_bytes_get(txt, it->pos, sizeof buf, buf); @@ -1581,7 +1581,7 @@ bool text_iterator_char_next(Iterator *it, char *c) { bool text_iterator_char_prev(Iterator *it, char *c) { if (!text_iterator_codepoint_prev(it, c)) return false; - Text *txt = text_iterator_text(it); + const Text *txt = text_iterator_text(it); for (;;) { char buf[MB_LEN_MAX]; size_t len = text_bytes_get(txt, it->pos, sizeof buf, buf); |
