summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meson/suppressions/meson.build4
-rw-r--r--src/sord.c6
-rw-r--r--src/sord_validate.c8
-rw-r--r--test/test_sord.c8
4 files changed, 12 insertions, 14 deletions
diff --git a/meson/suppressions/meson.build b/meson/suppressions/meson.build
index 386d24c..cacc4f7 100644
--- a/meson/suppressions/meson.build
+++ b/meson/suppressions/meson.build
@@ -17,13 +17,11 @@ if cc.get_id() in ['clang', 'emscripten']
'-Wno-cast-align',
'-Wno-cast-function-type-strict',
'-Wno-cast-qual',
- '-Wno-conversion',
'-Wno-declaration-after-statement',
'-Wno-double-promotion',
'-Wno-format-nonliteral',
'-Wno-padded',
'-Wno-reserved-id-macro',
- '-Wno-sign-conversion',
'-Wno-switch-default',
'-Wno-switch-enum',
'-Wno-unsafe-buffer-usage',
@@ -64,7 +62,6 @@ elif cc.get_id() == 'gcc'
'-Wno-format-nonliteral',
'-Wno-inline',
'-Wno-padded',
- '-Wno-sign-conversion',
'-Wno-strict-overflow',
'-Wno-suggest-attribute=const',
'-Wno-suggest-attribute=pure',
@@ -100,7 +97,6 @@ elif cc.get_id() == 'msvc'
c_suppressions += [
'/wd4061', # enumerator in switch is not explicitly handled
'/wd4200', # zero-sized array in struct/union
- '/wd4365', # signed/unsigned mismatch
'/wd4514', # unreferenced inline function has been removed
'/wd4710', # function not inlined
'/wd4711', # function selected for automatic inline expansion
diff --git a/src/sord.c b/src/sord.c
index d605826..4e5934e 100644
--- a/src/sord.c
+++ b/src/sord.c
@@ -635,8 +635,8 @@ sord_best_index(SordModel* sord,
{
const bool graph_search = (pat[TUP_G] != 0);
- const unsigned sig = (pat[0] ? 1 : 0) * 0x100 + (pat[1] ? 1 : 0) * 0x010 +
- (pat[2] ? 1 : 0) * 0x001;
+ const unsigned sig = (pat[0] ? 1 : 0) * 0x100U + (pat[1] ? 1 : 0) * 0x010U +
+ (pat[2] ? 1 : 0) * 0x001U;
SordOrder good[2] = {(SordOrder)-1, (SordOrder)-1};
@@ -717,7 +717,7 @@ sord_new(SordWorld* world, unsigned indices, bool graphs)
const int* const ordering = orderings[i];
const int* const g_ordering = orderings[i + (NUM_ORDERS / 2)];
- if (indices & (1 << i)) {
+ if (indices & (1U << i)) {
model->indices[i] =
zix_btree_new(NULL, sord_quad_compare, (void*)ordering);
if (graphs) {
diff --git a/src/sord_validate.c b/src/sord_validate.c
index 51a3748..47c2051 100644
--- a/src/sord_validate.c
+++ b/src/sord_validate.c
@@ -583,7 +583,7 @@ check_instance(SordModel* model,
const SordNode* card =
sord_get(model, restriction, uris->owl_cardinality, NULL, NULL);
if (card) {
- const unsigned c = atoi((const char*)sord_node_get_string(card));
+ const unsigned c = (unsigned)atoi((const char*)sord_node_get_string(card));
if (values != c) {
st = errorf(quad,
"Property %s on %s has %u != %u values",
@@ -598,7 +598,8 @@ check_instance(SordModel* model,
const SordNode* minCard =
sord_get(model, restriction, uris->owl_minCardinality, NULL, NULL);
if (minCard) {
- const unsigned m = atoi((const char*)sord_node_get_string(minCard));
+ const unsigned m =
+ (unsigned)atoi((const char*)sord_node_get_string(minCard));
if (values < m) {
st = errorf(quad,
"Property %s on %s has %u < %u values",
@@ -613,7 +614,8 @@ check_instance(SordModel* model,
const SordNode* maxCard =
sord_get(model, restriction, uris->owl_maxCardinality, NULL, NULL);
if (maxCard) {
- const unsigned m = atoi((const char*)sord_node_get_string(maxCard));
+ const unsigned m =
+ (unsigned)atoi((const char*)sord_node_get_string(maxCard));
if (values < m) {
st = errorf(quad,
"Property %s on %s has %u > %u values",
diff --git a/test/test_sord.c b/test/test_sord.c
index d92f74c..e9e634d 100644
--- a/test/test_sord.c
+++ b/test/test_sord.c
@@ -614,8 +614,8 @@ main(void)
static const char* const index_names[6] = {
"spo", "sop", "ops", "osp", "pso", "pos"};
- for (int i = 0; i < 6; ++i) {
- sord = sord_new(world, (1 << i), false);
+ for (unsigned i = 0U; i < 6U; ++i) {
+ sord = sord_new(world, (1U << i), false);
printf("Testing Index `%s'\n", index_names[i]);
generate(world, sord, n_quads, 0);
if (test_read(world, sord, 0, n_quads)) {
@@ -627,8 +627,8 @@ main(void)
static const char* const graph_index_names[6] = {
"gspo", "gsop", "gops", "gosp", "gpso", "gpos"};
- for (int i = 0; i < 6; ++i) {
- sord = sord_new(world, (1 << i), true);
+ for (unsigned i = 0U; i < 6U; ++i) {
+ sord = sord_new(world, (1U << i), true);
printf("Testing Index `%s'\n", graph_index_names[i]);
SordNode* graph = uri(world, 42);
generate(world, sord, n_quads, graph);