diff options
| -rw-r--r-- | builtins/datatypes.h | 2 | ||||
| -rw-r--r-- | builtins/text.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/builtins/datatypes.h b/builtins/datatypes.h index f8852c33..f7cc23ee 100644 --- a/builtins/datatypes.h +++ b/builtins/datatypes.h @@ -81,7 +81,7 @@ typedef struct Text_s { char short_ascii[8]; const char *ascii; int32_t short_graphemes[2]; - int32_t *graphemes; + const int32_t *graphemes; struct Text_s *subtexts; }; } Text_t; diff --git a/builtins/text.c b/builtins/text.c index 3beda82f..be304184 100644 --- a/builtins/text.c +++ b/builtins/text.c @@ -262,7 +262,7 @@ public int Text$print(FILE *stream, Text_t t) case TEXT_SHORT_ASCII: return fwrite(t.short_ascii, sizeof(char), t.length, stream); case TEXT_ASCII: return fwrite(t.ascii, sizeof(char), t.length, stream); case TEXT_GRAPHEMES: case TEXT_SHORT_GRAPHEMES: { - int32_t *graphemes = t.tag == TEXT_SHORT_GRAPHEMES ? t.short_graphemes : t.graphemes; + const int32_t *graphemes = t.tag == TEXT_SHORT_GRAPHEMES ? t.short_graphemes : t.graphemes; int written = 0; for (int64_t i = 0; i < t.length; i++) { int32_t grapheme = graphemes[i]; @@ -794,7 +794,7 @@ public uint64_t Text$hash(Text_t *text) siphashadd64bits(&sh, tmp.whole); } } else if (subtext.tag == TEXT_GRAPHEMES) { - int32_t *graphemes = subtext.graphemes; + const int32_t *graphemes = subtext.graphemes; int64_t grapheme = 0; if (leftover) { tmp.chunks[0] = leftover; |
