summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominick Allen <djallen@librehumanitas.org>2024-10-15 14:15:36 -0500
committerDominick Allen <djallen@librehumanitas.org>2024-10-15 14:15:36 -0500
commit71976e927cca43b970cb659c03fd6908c352ea3d (patch)
treeac354a07b08119ddd172ebb67060ee496f4683a5
parent93d8e7d066ec89a235630907164b07ada6ee5c3c (diff)
Style fixes for clang tidy.
-rw-r--r--include/fud_c_file.hpp2
-rw-r--r--test/test_directory.cpp8
2 files changed, 5 insertions, 5 deletions
diff --git a/include/fud_c_file.hpp b/include/fud_c_file.hpp
index 1c7c304..c81a340 100644
--- a/include/fud_c_file.hpp
+++ b/include/fud_c_file.hpp
@@ -329,7 +329,7 @@ class CFile {
return result;
}
- auto* sourceBytes = static_cast<const char*>(source);
+ const auto* sourceBytes = static_cast<const char*>(source);
result.bytesWritten = fwrite(sourceBytes, 1, length, self.m_file);
static_cast<void>(self.reset());
if (result.bytesWritten != length) {
diff --git a/test/test_directory.cpp b/test/test_directory.cpp
index 3c43663..ff10c2d 100644
--- a/test/test_directory.cpp
+++ b/test/test_directory.cpp
@@ -20,7 +20,6 @@
#include "fud_directory.hpp"
#include "fud_memory.hpp"
#include "fud_string.hpp"
-#include "test_common.hpp"
#include "gtest/gtest.h"
#include <algorithm>
@@ -31,12 +30,13 @@
namespace fud {
-int unlink_cb(const char* fpath, const struct stat* sb, int typeflag, struct FTW* ftwbuf)
+int unlink_cb(const char* fpath, const struct stat* sb_unused, int typeflag, struct FTW* ftwbuf)
{
+ static_cast<void>(sb_unused);
int retValue = remove(fpath);
EXPECT_EQ(retValue, 0);
- if (retValue) {
+ if (retValue != 0) {
perror(fpath);
}
@@ -128,7 +128,7 @@ TEST(FudDirectory, Basic)
break;
}
const auto dirEntry = *dirEntryOpt;
- const auto expected = std::find_if(
+ const auto* expected = std::find_if(
expectedFiles.begin(),
expectedFiles.end(),
[&dirEntry](const DirectoryEntry& entry) { return entry.name.compare(dirEntry.name) && entry.entryType == dirEntry.entryType; });