aboutsummaryrefslogtreecommitdiffstats
path: root/src/string.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-12-31 11:48:42 -0500
committerDavid Robillard <d@drobilla.net>2020-10-27 13:13:58 +0100
commit1997ab63fb66a55341de0311e1b309419a32d724 (patch)
treed1513d326679ec79b01ab4b0e6cee310c721514b /src/string.c
parent60bb4a81c03d6b0a08f9c858ff1a99bf3bcc602e (diff)
downloadserd-1997ab63fb66a55341de0311e1b309419a32d724.tar.gz
serd-1997ab63fb66a55341de0311e1b309419a32d724.tar.bz2
serd-1997ab63fb66a55341de0311e1b309419a32d724.zip
Fix various warnings and conversion issues
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/string.c b/src/string.c
index b465bf8d..1b106841 100644
--- a/src/string.c
+++ b/src/string.c
@@ -117,16 +117,16 @@ serd_strtod(const char* str, size_t* end)
{
double result = 0.0;
-#define SET_END(index) do { if (end) { *end = index; } } while (0)
+#define SET_END(index) do { if (end) { *end = (size_t)(index); } } while (0)
if (!strcmp(str, "NaN")) {
- SET_END(3);
+ SET_END(3u);
return NAN;
} else if (!strcmp(str, "-INF")) {
- SET_END(4);
+ SET_END(4u);
return -INFINITY;
} else if (!strcmp(str, "INF")) {
- SET_END(3);
+ SET_END(3u);
return INFINITY;
}