[clang-tidy] Fix additional clang-tidy errors

Fix/NOLINT the following clang-tidy errors, additional errors found
after fixing compilation errors in build-unit-test-docker cl/695533330:
clang-diagnostic-error
cert-dcl58-cpp
cert-env33-c
modernize-avoid-bind

Google-Bug-Id: 375054631
Change-Id: I2436dbb6d76a180f3e5548b8bc44ac3911a7f954
Signed-off-by: David Tang <davtang@google.com>
diff --git a/libhoth_usb.cpp b/libhoth_usb.cpp
index cffadbb..c367e82 100644
--- a/libhoth_usb.cpp
+++ b/libhoth_usb.cpp
@@ -16,6 +16,7 @@
 
 #include <stdexcept>
 
+// NOLINTNEXTLINE(cert-dcl58-cpp)
 namespace google
 {
 namespace hoth
diff --git a/libhoth_usb.hpp b/libhoth_usb.hpp
index 44d073f..df7a4ce 100644
--- a/libhoth_usb.hpp
+++ b/libhoth_usb.hpp
@@ -24,6 +24,7 @@
 
 #include <memory>
 
+// NOLINTNEXTLINE(cert-dcl58-cpp)
 namespace google
 {
 namespace hoth
diff --git a/libusb.hpp b/libusb.hpp
index 84f924c..4b2265c 100644
--- a/libusb.hpp
+++ b/libusb.hpp
@@ -22,6 +22,7 @@
 #include <utility>
 #include <vector>
 
+// NOLINTNEXTLINE(cert-dcl58-cpp)
 namespace google
 {
 namespace hoth
diff --git a/message_hoth_usb.cpp b/message_hoth_usb.cpp
index fc0c615..e1727e0 100644
--- a/message_hoth_usb.cpp
+++ b/message_hoth_usb.cpp
@@ -20,6 +20,7 @@
 #include <format>
 #include <stdexcept>
 
+// NOLINTNEXTLINE(cert-dcl58-cpp)
 namespace google
 {
 namespace hoth
@@ -120,7 +121,7 @@
   public:
     explicit USBClaim(LibHothUsbIntf* usb, libhoth_device* device)
     {
-        callThrow(std::bind(&LibHothUsbIntf::claim, usb, device));
+        callThrow([usb, device] { return usb->claim(device); });
         usb_ = usb;
         device_ = device;
     }
@@ -254,7 +255,7 @@
         try
         {
             callThrow(
-                std::bind(&LibHothUsbIntf::open, libhoth_usb_, &option, &dev));
+                [this, option = &option, dev = &dev] { return libhoth_usb_->open(option, dev); });
 
             // Don't indefinitely hold the USB interface.
             libhoth_usb_->release(dev);
@@ -303,7 +304,7 @@
     USBClaim usb_claim(libhoth_usb_, hoth_dev_);
 
     callThrow(
-        std::bind(&LibHothUsbIntf::send, libhoth_usb_, hoth_dev_, buf, size));
+        [this, buf, size] { return libhoth_usb_->send(hoth_dev_, buf, size); });
 
     // libhoth_usb read/write is non addressible, we need to buffer the
     // response.
@@ -315,8 +316,7 @@
     {
         try
         {
-            callThrow(std::bind(&LibHothUsbIntf::recv, libhoth_usb_, hoth_dev_,
-                                buff_.data(), kMailboxSize, &read, timeout));
+            callThrow([this, data = buff_.data(), read = &read] { return libhoth_usb_->recv(hoth_dev_, data, kMailboxSize, read, timeout); });
             break;
         }
         catch (const TimeOut& e)
diff --git a/message_hoth_usb.hpp b/message_hoth_usb.hpp
index 079a2b5..215efff 100644
--- a/message_hoth_usb.hpp
+++ b/message_hoth_usb.hpp
@@ -16,6 +16,7 @@
 #include "libhoth_usb.hpp"
 #include "libusb.hpp"
 #include "message_intf.hpp"
+// NOLINTNEXTLINE(cert-dcl58-cpp)
 namespace google
 {
 namespace hoth
diff --git a/message_intf.hpp b/message_intf.hpp
index 136c9ad..e318726 100644
--- a/message_intf.hpp
+++ b/message_intf.hpp
@@ -20,6 +20,7 @@
 #include <string>
 #include <vector>
 
+// NOLINTNEXTLINE(cert-dcl58-cpp)
 namespace google
 {
 namespace hoth
diff --git a/test/message_usb_unittest.cpp b/test/message_usb_unittest.cpp
index acc7502..a62c42d 100644
--- a/test/message_usb_unittest.cpp
+++ b/test/message_usb_unittest.cpp
@@ -64,6 +64,7 @@
 
     void add_device(int devn, int bus, const std::vector<uint8_t>& ports)
     {
+        // NOLINTNEXTLINE(performance-no-int-to-ptr)
         libusb_device* dev = reinterpret_cast<libusb_device*>(devn);
         EXPECT_CALL(libusb, get_bus_number(dev)).WillRepeatedly(Return(bus));
         EXPECT_CALL(libusb, get_port_numbers(dev, _, _))
diff --git a/tools/hoth_dbus.cpp b/tools/hoth_dbus.cpp
index 87b3308..2871106 100644
--- a/tools/hoth_dbus.cpp
+++ b/tools/hoth_dbus.cpp
@@ -272,6 +272,7 @@
 bool HothDBus::confirmPayload(const std::string& hothId)
 {
     // Need to make sure the ipmi system tool is working before confirming
+    // NOLINTNEXTLINE(cert-env33-c)
     int ret = system("ipmitool mc info");
     if (ret)
     {