summaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-02-04 05:23:31 +0000
committerDavid Robillard <d@drobilla.net>2011-02-04 05:23:31 +0000
commitedf40906a3988a4daace075fc714533a0e778814 (patch)
tree757f7e76af12d0b681ff5240bb95c011588ee950 /src/syntax.c
parentdd0de65f32718cbf5647ba0c1a2b5692507cf6b3 (diff)
downloadsord-edf40906a3988a4daace075fc714533a0e778814.tar.gz
sord-edf40906a3988a4daace075fc714533a0e778814.tar.bz2
sord-edf40906a3988a4daace075fc714533a0e778814.zip
Use uint8_t for API char type for UTF-8 friendliness.
Fix literal languages. git-svn-id: http://svn.drobilla.net/sord/trunk@20 3d64ff67-21c5-427c-a301-fe4f08042e5a
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/syntax.c b/src/syntax.c
index e7560c5..3afda17 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -101,8 +101,7 @@ sord_node_from_serd_node(ReadState* state, const SerdNode* sn)
case SERD_NOTHING:
return NULL;
case SERD_LITERAL:
- return sord_get_literal(state->sord, true, NULL,
- (const char*)sn->buf, NULL);
+ return sord_get_literal(state->sord, true, NULL, sn->buf, NULL);
case SERD_URI: {
SerdURI uri;
if (!serd_uri_parse(sn->buf, &uri)) {
@@ -114,7 +113,7 @@ sord_node_from_serd_node(ReadState* state, const SerdNode* sn)
}
SerdURI ignored;
SerdNode abs_uri_node = serd_node_new_uri(&abs_uri, &ignored);
- SordID ret = sord_get_uri(state->sord, true, (const char*)abs_uri_node.buf);
+ SordID ret = sord_get_uri(state->sord, true, abs_uri_node.buf);
serd_node_free(&abs_uri_node);
return ret;
}
@@ -126,7 +125,7 @@ sord_node_from_serd_node(ReadState* state, const SerdNode* sn)
return NULL;
}
const size_t uri_len = uri_prefix.len + uri_suffix.len;
- char* buf = malloc(uri_len + 1);
+ uint8_t* buf = malloc(uri_len + 1);
memcpy(buf, uri_prefix.buf, uri_prefix.len);
memcpy(buf + uri_prefix.len, uri_suffix.buf, uri_suffix.len);
buf[uri_len] = '\0';
@@ -138,7 +137,7 @@ sord_node_from_serd_node(ReadState* state, const SerdNode* sn)
case SERD_BLANK_ID:
case SERD_ANON_BEGIN:
case SERD_ANON:
- return sord_get_blank(state->sord, true, (const char*)sn->buf);
+ return sord_get_blank(state->sord, true, sn->buf);
}
return NULL;
}