From: Colin Clark Date: Fri, 2 Feb 2024 14:33:35 +0000 (+0000) Subject: clang-tidy; -bugprone-suspicious-string-compare, misc-unused-parameters X-Git-Tag: v2.3~61 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=3b5e1879b1def5644c898498c443e54501e2c6d7 clang-tidy; -bugprone-suspicious-string-compare, misc-unused-parameters - Fix warnings identified by this flag - Remove the exclude from .clang-tidy file --- diff --git a/.clang-tidy b/.clang-tidy index 2e576602..cf322294 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -37,12 +37,10 @@ Checks: > -bugprone-reserved-identifier, -bugprone-sizeof-expression, -bugprone-suspicious-missing-comma, - -bugprone-suspicious-string-compare, -misc-const-correctness, -misc-no-recursion, -misc-non-private-member-variables-in-classes, -misc-redundant-expression, - -misc-unused-parameters, -misc-use-anonymous-namespace, -modernize-avoid-c-arrays, -modernize-macro-to-enum, diff --git a/src/ui-tabcomp.cc b/src/ui-tabcomp.cc index a652d22d..0196cd5b 100644 --- a/src/ui-tabcomp.cc +++ b/src/ui-tabcomp.cc @@ -208,7 +208,7 @@ void tab_completion_iter_menu_items(GtkWidget *widget, gpointer data) const gchar *prefix = filename_from_path(entry_text); guint prefix_len = strlen(prefix); - if (strlen(text) < prefix_len || strncmp(text, prefix, prefix_len)) + if (strlen(text) < prefix_len || strncmp(text, prefix, prefix_len) != 0) { /* Hide menu items not matching */ gtk_widget_hide(widget); diff --git a/src/zonedetect.cc b/src/zonedetect.cc index 2763e2d1..6ec9808d 100644 --- a/src/zonedetect.cc +++ b/src/zonedetect.cc @@ -265,7 +265,7 @@ static int ZDParseHeader(ZoneDetect *library) #if defined(_MSC_VER) __try { #endif - if(memcmp(library->mapping, "PLB", 3)) { + if(memcmp(library->mapping, "PLB", 3) != 0) { return -1; }