aboutsummaryrefslogtreecommitdiffstats
path: root/src/uri.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-01-07 20:33:42 +0100
committerDavid Robillard <d@drobilla.net>2019-04-13 19:48:23 +0200
commit2719fc4709d05193aa89557051af1d65a738c4d5 (patch)
tree18a11d72f789535d79f835f7ad44daa4d1b536b5 /src/uri.c
parent105cc91e8fb7bb1a70e5715dbbbf3f967d508065 (diff)
downloadserd-2719fc4709d05193aa89557051af1d65a738c4d5.tar.gz
serd-2719fc4709d05193aa89557051af1d65a738c4d5.tar.bz2
serd-2719fc4709d05193aa89557051af1d65a738c4d5.zip
Fix integer conversion warnings
Diffstat (limited to 'src/uri.c')
-rw-r--r--src/uri.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/uri.c b/src/uri.c
index dbe5c19f..fe7de476 100644
--- a/src/uri.c
+++ b/src/uri.c
@@ -40,8 +40,9 @@ serd_file_uri_parse(const char* uri, char** hostname)
return NULL;
}
if (hostname) {
- *hostname = (char*)calloc(path - auth + 1, 1);
- memcpy(*hostname, auth, path - auth);
+ const size_t len = (size_t)(path - auth);
+ *hostname = (char*)calloc(len + 1, 1);
+ memcpy(*hostname, auth, len);
}
}
}
@@ -110,7 +111,7 @@ serd_uri_parse(const char* utf8, SerdURI* out)
goto path; // Relative URI (starts with path by definition)
case ':':
out->scheme.buf = utf8;
- out->scheme.len = (ptr++) - utf8;
+ out->scheme.len = (size_t)((ptr++) - utf8);
goto maybe_authority; // URI with scheme
case '+': case '-': case '.':
continue;
@@ -279,12 +280,12 @@ merge(SerdStringView* base, SerdStringView* path)
} while (up > 0 && (--base_last > base->buf));
// Set path prefix
- base->len = base_last - base->buf + 1;
+ base->len = (size_t)(base_last - base->buf + 1);
}
// Set path suffix
path->buf = begin;
- path->len = end - begin;
+ path->len = (size_t)(end - begin);
}
/// See http://tools.ietf.org/html/rfc3986#section-5.2.2