diff options
author | David Robillard <d@drobilla.net> | 2017-12-16 11:54:40 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-12-16 14:00:28 +0100 |
commit | 46b8e6ed53370d76c294c5e40b040ea78d6c9847 (patch) | |
tree | 87b3f6ba6fd93c3f20b9e169443d473b0450f635 /src/sord_validate.c | |
parent | ef7cd1f17eb468b3ac34197a477e6b22516185d4 (diff) | |
download | sord-46b8e6ed53370d76c294c5e40b040ea78d6c9847.tar.gz sord-46b8e6ed53370d76c294c5e40b040ea78d6c9847.tar.bz2 sord-46b8e6ed53370d76c294c5e40b040ea78d6c9847.zip |
Update BTree
Diffstat (limited to 'src/sord_validate.c')
-rw-r--r-- | src/sord_validate.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/sord_validate.c b/src/sord_validate.c index e30bbc0..a5c8d45 100644 --- a/src/sord_validate.c +++ b/src/sord_validate.c @@ -14,8 +14,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define _BSD_SOURCE 1 // for realpath -#define _DEFAULT_SOURCE 1 // for realpath +#define _BSD_SOURCE 1 // for realpath +#define _DEFAULT_SOURCE 1 // for realpath #include <assert.h> #include <stdlib.h> @@ -33,7 +33,7 @@ # include <pcre.h> #endif -#define USTR(s) ((const uint8_t*)s) +#define USTR(s) ((const uint8_t*)(s)) #define NS_foaf (const uint8_t*)"http://xmlns.com/foaf/0.1/" #define NS_owl (const uint8_t*)"http://www.w3.org/2002/07/owl#" @@ -155,8 +155,9 @@ is_descendant_of(SordModel* model, { if (!child) { return false; - } else if (sord_node_equals(child, parent) || - sord_ask(model, child, uris->owl_equivalentClass, parent, NULL)) { + } else if ( + sord_node_equals(child, parent) || + sord_ask(model, child, uris->owl_equivalentClass, parent, NULL)) { return true; } @@ -211,11 +212,12 @@ bound_cmp(SordModel* model, const SordNode* type, const SordNode* bound) { - const char* str = (const char*)sord_node_get_string(literal); - const char* bound_str = (const char*)sord_node_get_string(bound); - const bool is_numeric = - is_descendant_of(model, uris, type, uris->xsd_decimal, uris->owl_onDatatype) || - is_descendant_of(model, uris, type, uris->xsd_double, uris->owl_onDatatype); + const char* str = (const char*)sord_node_get_string(literal); + const char* bound_str = (const char*)sord_node_get_string(bound); + const SordNode* pred = uris->owl_onDatatype; + const bool is_numeric = + is_descendant_of(model, uris, type, uris->xsd_decimal, pred) || + is_descendant_of(model, uris, type, uris->xsd_double, pred); if (is_numeric) { const double fbound = serd_strtod(bound_str, NULL); |