diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/.clang-tidy | 1 | ||||
-rw-r--r-- | src/state.c | 11 | ||||
-rw-r--r-- | src/world.c | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/.clang-tidy b/src/.clang-tidy index 1c26307..21665f3 100644 --- a/src/.clang-tidy +++ b/src/.clang-tidy @@ -6,7 +6,6 @@ Checks: > -android-cloexec-fopen, -bugprone-branch-clone, -bugprone-narrowing-conversions, - -bugprone-suspicious-string-compare, -cert-err33-c, -cert-err34-c, -clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling, diff --git a/src/state.c b/src/state.c index a662b8d..e67714d 100644 --- a/src/state.c +++ b/src/state.c @@ -1204,7 +1204,7 @@ lilv_state_make_links(const LilvState* state, const char* dir) char* const path = zix_path_join(NULL, dir, pm->rel); if (path_is_child(pm->abs, state->copy_dir) && - strcmp(state->copy_dir, dir)) { + !!strcmp(state->copy_dir, dir)) { // Link directly to snapshot in the copy directory maybe_symlink(pm->abs, path); } else if (!path_is_child(pm->abs, dir)) { @@ -1486,7 +1486,7 @@ lilv_state_equals(const LilvState* a, const LilvState* b) { if (!lilv_node_equals(a->plugin_uri, b->plugin_uri) || (a->label && !b->label) || (b->label && !a->label) || - (a->label && b->label && strcmp(a->label, b->label)) || + (a->label && b->label && !!strcmp(a->label, b->label)) || a->props.n != b->props.n || a->n_values != b->n_values) { return false; } @@ -1495,8 +1495,8 @@ lilv_state_equals(const LilvState* a, const LilvState* b) PortValue* const av = &a->values[i]; PortValue* const bv = &b->values[i]; if (av->atom->size != bv->atom->size || av->atom->type != bv->atom->type || - strcmp(av->symbol, bv->symbol) || - memcmp(av->atom + 1, bv->atom + 1, av->atom->size)) { + !!strcmp(av->symbol, bv->symbol) || + !!memcmp(av->atom + 1, bv->atom + 1, av->atom->size)) { return false; } } @@ -1514,7 +1514,8 @@ lilv_state_equals(const LilvState* a, const LilvState* b) lilv_state_rel2abs(b, (char*)bp->value))) { return false; } - } else if (ap->size != bp->size || memcmp(ap->value, bp->value, ap->size)) { + } else if (ap->size != bp->size || + !!memcmp(ap->value, bp->value, ap->size)) { return false; } } diff --git a/src/world.c b/src/world.c index 23116e9..695cc29 100644 --- a/src/world.c +++ b/src/world.c @@ -1093,11 +1093,11 @@ lilv_world_load_file(LilvWorld* world, SerdReader* reader, const LilvNode* uri) size_t uri_len = 0; const uint8_t* const uri_str = sord_node_get_string_counted(uri->node, &uri_len); - if (strncmp((const char*)uri_str, "file:", 5)) { + if (!!strncmp((const char*)uri_str, "file:", 5)) { return SERD_FAILURE; // Not a local file } - if (strcmp((const char*)uri_str + uri_len - 4, ".ttl")) { + if (!!strcmp((const char*)uri_str + uri_len - 4, ".ttl")) { return SERD_FAILURE; // Not a Turtle file } |