aboutsummaryrefslogtreecommitdiffstats
path: root/src/node.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/node.c
parent60bb4a81c03d6b0a08f9c858ff1a99bf3bcc602e (diff)
downloadserd-1997ab63fb66a55341de0311e1b309419a32d724.tar.gz
serd-1997ab63fb66a55341de0311e1b309419a32d724.tar.bz2
serd-1997ab63fb66a55341de0311e1b309419a32d724.zip
Fix various warnings and conversion issues
Diffstat (limited to 'src/node.c')
-rw-r--r--src/node.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/node.c b/src/node.c
index ea571922..cc0b0a30 100644
--- a/src/node.c
+++ b/src/node.c
@@ -31,15 +31,6 @@
#include <stdlib.h>
#include <string.h>
-#ifdef _WIN32
-# ifndef isnan
-# define isnan(x) _isnan(x)
-# endif
-# ifndef isinf
-# define isinf(x) (!_finite(x))
-# endif
-#endif
-
static const size_t serd_node_align = sizeof(SerdNode);
static SerdNode*
@@ -107,7 +98,7 @@ serd_node_malloc(size_t n_bytes, SerdNodeFlags flags, SerdNodeType type)
node->n_bytes = 0;
node->flags = flags;
node->type = type;
- assert((intptr_t)node % serd_node_align == 0);
+ assert((uintptr_t)node % serd_node_align == 0u);
return node;
}
@@ -467,6 +458,7 @@ is_uri_path_char(const char c)
if (is_alpha(c) || is_digit(c)) {
return true;
}
+
switch (c) {
case '-': case '.': case '_': case '~': // unreserved
case ':': case '@': // pchar
@@ -582,7 +574,7 @@ serd_digits(double abs)
SerdNode*
serd_new_decimal(double d, unsigned frac_digits, const SerdNode* datatype)
{
- if (isnan(d) || isinf(d)) {
+ if (!isfinite(d)) {
return NULL;
}