aboutsummaryrefslogtreecommitdiffstats
path: root/src/writer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/writer.c')
-rw-r--r--src/writer.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/writer.c b/src/writer.c
index 6e3f5d7e..594422ee 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -215,7 +215,7 @@ uri_must_escape(const char c)
case '^': case '`': case '{': case '|': case '}':
return true;
default:
- return !in_range(c, 0x20, 0x7E);
+ return !in_range((uint8_t)c, 0x20, 0x7E);
}
}
@@ -303,7 +303,7 @@ write_lname(SerdWriter* writer, const char* utf8, size_t n_bytes)
static size_t
write_text(SerdWriter* writer, TextContext ctx,
- const char* utf8, size_t n_bytes)
+ const uint8_t* utf8, size_t n_bytes)
{
size_t len = 0;
for (size_t i = 0; i < n_bytes;) {
@@ -321,7 +321,7 @@ write_text(SerdWriter* writer, TextContext ctx,
break; // Reached end
}
- const uint8_t in = utf8[i++];
+ const char in = utf8[i++];
if (ctx == WRITE_LONG_STRING) {
switch (in) {
case '\\': len += sink("\\\\", 2, writer); continue;
@@ -482,11 +482,11 @@ write_literal(SerdWriter* writer,
if (supports_abbrev(writer)
&& (node->flags & (SERD_HAS_NEWLINE|SERD_HAS_QUOTE))) {
sink("\"\"\"", 3, writer);
- write_text(writer, WRITE_LONG_STRING, node_str, node->n_bytes);
+ write_text(writer, WRITE_LONG_STRING, (const uint8_t*)node_str, node->n_bytes);
sink("\"\"\"", 3, writer);
} else {
sink("\"", 1, writer);
- write_text(writer, WRITE_STRING, node_str, node->n_bytes);
+ write_text(writer, WRITE_STRING, (const uint8_t*)node_str, node->n_bytes);
sink("\"", 1, writer);
}
if (lang && serd_node_get_string(lang)) {
@@ -501,7 +501,7 @@ write_literal(SerdWriter* writer,
// Return true iff `buf` is a valid prefixed name suffix
static inline bool
-is_name(const char* buf, const size_t len)
+is_name(const uint8_t* buf, const size_t len)
{
// TODO: This is more strict than it should be.
for (size_t i = 0; i < len; ++i) {
@@ -538,7 +538,7 @@ write_uri_node(SerdWriter* const writer,
return sink("()", 2, writer) == 2;
} else if (has_scheme && supports_abbrev(writer) &&
serd_env_qualify_in_place(env, node, &prefix, &suffix) &&
- is_name(suffix.buf, suffix.len)) {
+ is_name((const uint8_t*)suffix.buf, suffix.len)) {
write_uri_from_node(writer, prefix);
sink(":", 1, writer);
write_uri(writer, suffix.buf, suffix.len);