Clang-tidy-14 fixes
Do as the robot commands. All changes made automatically by tidy.
Tested: (Thanks Zhikui)
Downloaded and run on system. Sensors scan normally.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I752f37c9e7a95aa3be8e6980ba6e4b2b48b3395a
diff --git a/src/FileHandle.cpp b/src/FileHandle.cpp
index 6724698..c77fc3d 100644
--- a/src/FileHandle.cpp
+++ b/src/FileHandle.cpp
@@ -19,9 +19,9 @@
FileHandle::FileHandle(int fdIn) : fd(fdIn){};
-FileHandle::FileHandle(FileHandle&& in) noexcept
+FileHandle::FileHandle(FileHandle&& in) noexcept : fd(in.fd)
{
- fd = in.fd;
+
in.fd = -1;
}
@@ -34,7 +34,7 @@
FileHandle::~FileHandle()
{
- if (fd)
+ if (fd != 0)
{
int r = close(fd);
if (r < 0)
@@ -44,7 +44,7 @@
}
}
-int FileHandle::handle()
+int FileHandle::handle() const
{
return fd;
}