diff --git a/cscore/src/main/native/cpp/Image.h b/cscore/src/main/native/cpp/Image.h index 5bc7a87349..110bee4994 100644 --- a/cscore/src/main/native/cpp/Image.h +++ b/cscore/src/main/native/cpp/Image.h @@ -34,7 +34,7 @@ class Image { Image& operator=(const Image&) = delete; // Getters - operator wpi::StringRef() const { return str(); } + operator wpi::StringRef() const { return str(); } // NOLINT wpi::StringRef str() const { return wpi::StringRef(data(), size()); } size_t capacity() const { return m_data.capacity(); } const char* data() const { diff --git a/cscore/src/main/native/windows/WindowsMessagePump.h b/cscore/src/main/native/windows/WindowsMessagePump.h index 9693371a1d..97a3f2d018 100644 --- a/cscore/src/main/native/windows/WindowsMessagePump.h +++ b/cscore/src/main/native/windows/WindowsMessagePump.h @@ -12,7 +12,7 @@ namespace cs { class WindowsMessagePump { public: - WindowsMessagePump( + explicit WindowsMessagePump( std::function callback); ~WindowsMessagePump(); diff --git a/hal/src/main/native/include/hal/SimDevice.h b/hal/src/main/native/include/hal/SimDevice.h index 0808880cb7..b2e92f9182 100644 --- a/hal/src/main/native/include/hal/SimDevice.h +++ b/hal/src/main/native/include/hal/SimDevice.h @@ -322,7 +322,7 @@ class SimValue { * * @return internal handle */ - operator HAL_SimValueHandle() const { return m_handle; } + operator HAL_SimValueHandle() const { return m_handle; } // NOLINT /** * Gets the simulated value. @@ -544,7 +544,7 @@ class SimDevice { * * @return internal handle */ - operator HAL_SimDeviceHandle() const { return m_handle; } + operator HAL_SimDeviceHandle() const { return m_handle; } // NOLINT /** * Creates a value on the simulated device. diff --git a/hal/src/main/native/include/hal/Types.h b/hal/src/main/native/include/hal/Types.h index 8ca0494160..1aba2c2983 100644 --- a/hal/src/main/native/include/hal/Types.h +++ b/hal/src/main/native/include/hal/Types.h @@ -96,7 +96,7 @@ class Handle { return *this; } - operator CType() const { return m_handle; } + operator CType() const { return m_handle; } // NOLINT private: CType m_handle = CInvalid; diff --git a/hal/src/main/native/include/hal/simulation/SimDataValue.h b/hal/src/main/native/include/hal/simulation/SimDataValue.h index fe2998a9b0..4368a101bc 100644 --- a/hal/src/main/native/include/hal/simulation/SimDataValue.h +++ b/hal/src/main/native/include/hal/simulation/SimDataValue.h @@ -28,7 +28,7 @@ class SimDataValueBase : protected SimCallbackRegistryBase { return m_value; } - LLVM_ATTRIBUTE_ALWAYS_INLINE operator T() const { return Get(); } + LLVM_ATTRIBUTE_ALWAYS_INLINE operator T() const { return Get(); } // NOLINT void Reset(T value) { std::scoped_lock lock(m_mutex); diff --git a/wpigui/src/main/native/include/wpigui.h b/wpigui/src/main/native/include/wpigui.h index 1c27233174..228f89d3ed 100644 --- a/wpigui/src/main/native/include/wpigui.h +++ b/wpigui/src/main/native/include/wpigui.h @@ -296,7 +296,7 @@ class Texture { /** * Implicit conversion to ImTextureID. */ - operator ImTextureID() const { return m_texture; } + operator ImTextureID() const { return m_texture; } // NOLINT /** * Gets the texture pixel format. diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/InstantCommand.h b/wpilibNewCommands/src/main/native/include/frc2/command/InstantCommand.h index f7da59f530..08651ebbe1 100644 --- a/wpilibNewCommands/src/main/native/include/frc2/command/InstantCommand.h +++ b/wpilibNewCommands/src/main/native/include/frc2/command/InstantCommand.h @@ -37,8 +37,8 @@ class InstantCommand : public CommandHelper { * @param toRun the Runnable to run * @param requirements the subsystems required by this command */ - InstantCommand(std::function toRun, - wpi::ArrayRef requirements = {}); + explicit InstantCommand(std::function toRun, + wpi::ArrayRef requirements = {}); InstantCommand(InstantCommand&& other) = default; diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/RunCommand.h b/wpilibNewCommands/src/main/native/include/frc2/command/RunCommand.h index e04ceea9f3..2d994705f6 100644 --- a/wpilibNewCommands/src/main/native/include/frc2/command/RunCommand.h +++ b/wpilibNewCommands/src/main/native/include/frc2/command/RunCommand.h @@ -38,8 +38,8 @@ class RunCommand : public CommandHelper { * @param toRun the Runnable to run * @param requirements the subsystems to require */ - RunCommand(std::function toRun, - wpi::ArrayRef requirements = {}); + explicit RunCommand(std::function toRun, + wpi::ArrayRef requirements = {}); RunCommand(RunCommand&& other) = default; diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/SelectCommand.h b/wpilibNewCommands/src/main/native/include/frc2/command/SelectCommand.h index 9710e54fcc..34062a3e26 100644 --- a/wpilibNewCommands/src/main/native/include/frc2/command/SelectCommand.h +++ b/wpilibNewCommands/src/main/native/include/frc2/command/SelectCommand.h @@ -48,8 +48,8 @@ class SelectCommand : public CommandHelper> { template >...>>> - SelectCommand(std::function selector, - std::pair... commands) + explicit SelectCommand(std::function selector, + std::pair... commands) : m_selector{std::move(selector)} { std::vector>> foo; diff --git a/wpilibc/src/main/native/include/frc/SerialPort.h b/wpilibc/src/main/native/include/frc/SerialPort.h index 9323574a1a..9bbd9961ca 100644 --- a/wpilibc/src/main/native/include/frc/SerialPort.h +++ b/wpilibc/src/main/native/include/frc/SerialPort.h @@ -65,8 +65,9 @@ class SerialPort : public ErrorBase { * @param stopBits The number of stop bits to use as defined by the enum * StopBits. */ - SerialPort(int baudRate, Port port = kOnboard, int dataBits = 8, - Parity parity = kParity_None, StopBits stopBits = kStopBits_One); + explicit SerialPort(int baudRate, Port port = kOnboard, int dataBits = 8, + Parity parity = kParity_None, + StopBits stopBits = kStopBits_One); /** * Create an instance of a Serial Port class. diff --git a/wpilibc/src/main/native/include/frc/simulation/LinearSystemSim.h b/wpilibc/src/main/native/include/frc/simulation/LinearSystemSim.h index eb59f48e80..db0a3a7ddc 100644 --- a/wpilibc/src/main/native/include/frc/simulation/LinearSystemSim.h +++ b/wpilibc/src/main/native/include/frc/simulation/LinearSystemSim.h @@ -36,8 +36,9 @@ class LinearSystemSim { * @param system The system to simulate. * @param measurementStdDevs The standard deviations of the measurements. */ - LinearSystemSim(const LinearSystem& system, - const std::array& measurementStdDevs = {}) + explicit LinearSystemSim( + const LinearSystem& system, + const std::array& measurementStdDevs = {}) : m_plant(system), m_measurementStdDevs(measurementStdDevs) { m_x = Eigen::Matrix::Zero(); m_y = Eigen::Matrix::Zero(); diff --git a/wpilibc/src/main/native/include/frc/util/Color8Bit.h b/wpilibc/src/main/native/include/frc/util/Color8Bit.h index bf4a31b6d6..f289865031 100644 --- a/wpilibc/src/main/native/include/frc/util/Color8Bit.h +++ b/wpilibc/src/main/native/include/frc/util/Color8Bit.h @@ -34,12 +34,12 @@ class Color8Bit { * * @param color The color */ - constexpr Color8Bit(const Color& color) + constexpr Color8Bit(const Color& color) // NOLINT : red(color.red * 255), green(color.green * 255), blue(color.blue * 255) {} - constexpr operator Color() const { + constexpr operator Color() const { // NOLINT return Color(red / 255.0, green / 255.0, blue / 255.0); } diff --git a/wpimath/src/main/native/include/frc/estimator/MerweScaledSigmaPoints.h b/wpimath/src/main/native/include/frc/estimator/MerweScaledSigmaPoints.h index 26b4c7d2ea..36c593c517 100644 --- a/wpimath/src/main/native/include/frc/estimator/MerweScaledSigmaPoints.h +++ b/wpimath/src/main/native/include/frc/estimator/MerweScaledSigmaPoints.h @@ -37,8 +37,8 @@ class MerweScaledSigmaPoints { * For Gaussian distributions, beta = 2 is optimal. * @param kappa Secondary scaling parameter usually set to 0 or 3 - States. */ - MerweScaledSigmaPoints(double alpha = 1e-3, double beta = 2, - int kappa = 3 - States) { + explicit MerweScaledSigmaPoints(double alpha = 1e-3, double beta = 2, + int kappa = 3 - States) { m_alpha = alpha; m_kappa = kappa; diff --git a/wpiutil/src/main/native/include/wpi/future.h b/wpiutil/src/main/native/include/wpi/future.h index 2d453d271e..5cb4a8d5d6 100644 --- a/wpiutil/src/main/native/include/wpi/future.h +++ b/wpiutil/src/main/native/include/wpi/future.h @@ -287,7 +287,7 @@ class future final { future(const future&) = delete; template - future(future&& oth) noexcept + future(future&& oth) noexcept // NOLINT : future(oth.then([](R&& val) -> T { return val; })) {} /** diff --git a/wpiutil/src/main/native/include/wpi/uv/Buffer.h b/wpiutil/src/main/native/include/wpi/uv/Buffer.h index d8735cde56..530ee79ca0 100644 --- a/wpiutil/src/main/native/include/wpi/uv/Buffer.h +++ b/wpiutil/src/main/native/include/wpi/uv/Buffer.h @@ -46,8 +46,8 @@ class Buffer : public uv_buf_t { ArrayRef data() const { return ArrayRef{base, len}; } MutableArrayRef data() { return MutableArrayRef{base, len}; } - operator ArrayRef() const { return data(); } - operator MutableArrayRef() { return data(); } + operator ArrayRef() const { return data(); } // NOLINT + operator MutableArrayRef() { return data(); } // NOLINT static Buffer Allocate(size_t size) { return Buffer{new char[size], size}; }