summaryrefslogtreecommitdiffstats
path: root/src/win32
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-02-04 19:25:22 -0500
committerDavid Robillard <d@drobilla.net>2023-02-04 19:25:22 -0500
commit5a9787b4247c6735cc3213944945e8983002edf9 (patch)
tree635a8711a53b9e50d7dcd24dc4acefefce694c3d /src/win32
parentc4b3814edad510c6c124089822bd5506f9334411 (diff)
downloadzix-5a9787b4247c6735cc3213944945e8983002edf9.tar.gz
zix-5a9787b4247c6735cc3213944945e8983002edf9.tar.bz2
zix-5a9787b4247c6735cc3213944945e8983002edf9.zip
Suppress/fix clang-tidy warnings on Windows
Diffstat (limited to 'src/win32')
-rw-r--r--src/win32/.clang-tidy8
-rw-r--r--src/win32/filesystem_win32.c4
2 files changed, 10 insertions, 2 deletions
diff --git a/src/win32/.clang-tidy b/src/win32/.clang-tidy
new file mode 100644
index 0000000..386137b
--- /dev/null
+++ b/src/win32/.clang-tidy
@@ -0,0 +1,8 @@
+# Copyright 2021-2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: 0BSD OR ISC
+
+Checks: >
+ -hicpp-signed-bitwise,
+ -misc-misplaced-const,
+ -performance-no-int-to-ptr,
+InheritParentConfig: true
diff --git a/src/win32/filesystem_win32.c b/src/win32/filesystem_win32.c
index 0484684..0038189 100644
--- a/src/win32/filesystem_win32.c
+++ b/src/win32/filesystem_win32.c
@@ -90,7 +90,7 @@ zix_create_temporary_directory(ZixAllocator* const allocator,
// Ensure that the pattern ends with "XXXXXX"
const size_t length = strlen(path_pattern);
- if (length < 7 || strcmp(path_pattern + length - 6, "XXXXXX")) {
+ if (length < 7 || !!strcmp(path_pattern + length - 6, "XXXXXX")) {
errno = EINVAL;
return NULL;
}
@@ -206,7 +206,7 @@ zix_canonical_path(ZixAllocator* const allocator, const char* const path)
}
char* const final = (char*)zix_calloc(allocator, final_size + 1U, 1U);
- if (final && !GetFinalPathNameByHandle(h, final, final_size + 1U, flags)) {
+ if (!final || !GetFinalPathNameByHandle(h, final, final_size + 1U, flags)) {
zix_free(allocator, final);
CloseHandle(h);
return NULL;