From 4cfe4e853b4c1c296e0a2fb2d7e6a6777ed03559 Mon Sep 17 00:00:00 2001 From: Bin Chen Date: Fri, 19 Aug 2016 19:37:42 +1000 Subject: Disable implicit conversion According to Google coding style, need to add explicit keyword for single-argument constructors. Change-Id: I2673b5367e01b8cca9d908cf5fca96f4877e83d3 Signed-off-by: Bin Chen --- daemon/gpio_driver.h | 2 +- daemon/gpio_driver_mock.h | 2 +- daemon/gpio_driver_sysfs.h | 2 +- daemon/gpio_manager.h | 2 +- daemon/i2c_driver.h | 2 +- daemon/i2c_driver_i2cdev.h | 2 +- daemon/i2c_manager.h | 2 +- daemon/led_driver.h | 2 +- daemon/led_driver_sysfs.h | 2 +- daemon/led_manager.h | 2 +- daemon/spi_driver.h | 2 +- daemon/spi_driver_spidev.h | 2 +- daemon/spi_manager.h | 2 +- daemon/uart_driver.h | 2 +- daemon/uart_driver_sysfs.h | 2 +- daemon/uart_manager.h | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/daemon/gpio_driver.h b/daemon/gpio_driver.h index 20dcbb1..084c0f3 100644 --- a/daemon/gpio_driver.h +++ b/daemon/gpio_driver.h @@ -60,7 +60,7 @@ class GpioDriverInfoBase { template class GpioDriverInfo : public GpioDriverInfoBase { public: - GpioDriverInfo(PARAM param) : param_(param) {} + explicit GpioDriverInfo(PARAM param) : param_(param) {} ~GpioDriverInfo() override {} std::string Compat() override { return T::Compat(); } diff --git a/daemon/gpio_driver_mock.h b/daemon/gpio_driver_mock.h index d8e279c..f52b0f1 100644 --- a/daemon/gpio_driver_mock.h +++ b/daemon/gpio_driver_mock.h @@ -28,7 +28,7 @@ namespace android { class GpioDriverMock : public GpioDriverInterface { public: - GpioDriverMock(void* arg) : is_input(true) {} + explicit GpioDriverMock(void* arg) : is_input(true) {} ~GpioDriverMock() {} static std::string Compat() { return "GPIOSYSFS"; } diff --git a/daemon/gpio_driver_sysfs.h b/daemon/gpio_driver_sysfs.h index 21e33af..690066a 100644 --- a/daemon/gpio_driver_sysfs.h +++ b/daemon/gpio_driver_sysfs.h @@ -27,7 +27,7 @@ namespace android { class GpioDriverSysfs : public GpioDriverInterface { public: - GpioDriverSysfs(void* arg); + explicit GpioDriverSysfs(void* arg); ~GpioDriverSysfs(); static std::string Compat() { return "GPIOSYSFS"; } diff --git a/daemon/gpio_manager.h b/daemon/gpio_manager.h index c691f26..52bd779 100644 --- a/daemon/gpio_manager.h +++ b/daemon/gpio_manager.h @@ -41,7 +41,7 @@ class GpioPin { public: // TODO(leecam): pins should have a generic device // reference, not a sysfs one. - GpioPin(GpioPinSysfs* pin) : pin_(pin) {} + explicit GpioPin(GpioPinSysfs* pin) : pin_(pin) {} ~GpioPin() { if (!pin_->mux.empty()) { PinMuxManager::GetPinMuxManager()->ReleaseGpio(pin_->mux); diff --git a/daemon/i2c_driver.h b/daemon/i2c_driver.h index 4b8c079..7eac065 100644 --- a/daemon/i2c_driver.h +++ b/daemon/i2c_driver.h @@ -68,7 +68,7 @@ class I2cDriverInfoBase { template class I2cDriverInfo : public I2cDriverInfoBase { public: - I2cDriverInfo(PARAM param) : param_(param) {} + explicit I2cDriverInfo(PARAM param) : param_(param) {} ~I2cDriverInfo() override {} std::string Compat() override { return T::Compat(); } diff --git a/daemon/i2c_driver_i2cdev.h b/daemon/i2c_driver_i2cdev.h index ee9c1ce..8282b47 100644 --- a/daemon/i2c_driver_i2cdev.h +++ b/daemon/i2c_driver_i2cdev.h @@ -30,7 +30,7 @@ namespace android { class I2cDriverI2cDev : public I2cDriverInterface { public: - I2cDriverI2cDev(CharDeviceFactory* char_device_factory); + explicit I2cDriverI2cDev(CharDeviceFactory* char_device_factory); ~I2cDriverI2cDev(); static std::string Compat() { return "I2CDEV"; } diff --git a/daemon/i2c_manager.h b/daemon/i2c_manager.h index e6011ae..5627b4d 100644 --- a/daemon/i2c_manager.h +++ b/daemon/i2c_manager.h @@ -33,7 +33,7 @@ namespace android { struct I2cDevBus { - I2cDevBus(uint32_t b) : bus(b) {} + explicit I2cDevBus(uint32_t b) : bus(b) {} uint32_t bus; std::string mux; std::string mux_group; diff --git a/daemon/led_driver.h b/daemon/led_driver.h index 4dfc042..15c25e6 100644 --- a/daemon/led_driver.h +++ b/daemon/led_driver.h @@ -53,7 +53,7 @@ class LedDriverInfoBase { template class LedDriverInfo : public LedDriverInfoBase { public: - LedDriverInfo(PARAM param) : param_(param) {} + explicit LedDriverInfo(PARAM param) : param_(param) {} ~LedDriverInfo() override {} std::string Compat() override { return T::Compat(); } diff --git a/daemon/led_driver_sysfs.h b/daemon/led_driver_sysfs.h index ef14717..c4c46fc 100644 --- a/daemon/led_driver_sysfs.h +++ b/daemon/led_driver_sysfs.h @@ -27,7 +27,7 @@ namespace android { class LedDriverSysfs : public LedDriverInterface { public: - LedDriverSysfs(std::string* prefix); + explicit LedDriverSysfs(std::string* prefix); ~LedDriverSysfs(); static std::string Compat() { return "LEDSYSFS"; } diff --git a/daemon/led_manager.h b/daemon/led_manager.h index 66681e3..b6c93f9 100644 --- a/daemon/led_manager.h +++ b/daemon/led_manager.h @@ -39,7 +39,7 @@ struct LedSysfs { class Led { public: - Led(LedSysfs* led) : led_(led) {} + explicit Led(LedSysfs* led) : led_(led) {} ~Led() { if (!led_->mux.empty()) { // TODO(leecam): Set up pin muxing diff --git a/daemon/spi_driver.h b/daemon/spi_driver.h index 700a169..44ecc90 100644 --- a/daemon/spi_driver.h +++ b/daemon/spi_driver.h @@ -55,7 +55,7 @@ class SpiDriverInfoBase { template class SpiDriverInfo : public SpiDriverInfoBase { public: - SpiDriverInfo(PARAM param) : param_(param) {} + explicit SpiDriverInfo(PARAM param) : param_(param) {} ~SpiDriverInfo() override {} std::string Compat() override { return T::Compat(); } diff --git a/daemon/spi_driver_spidev.h b/daemon/spi_driver_spidev.h index f573fb0..67f3bd5 100644 --- a/daemon/spi_driver_spidev.h +++ b/daemon/spi_driver_spidev.h @@ -30,7 +30,7 @@ namespace android { class SpiDriverSpiDev : public SpiDriverInterface { public: - SpiDriverSpiDev(CharDeviceFactory* char_device_factory); + explicit SpiDriverSpiDev(CharDeviceFactory* char_device_factory); ~SpiDriverSpiDev(); static std::string Compat() { return "SPIDEV"; } diff --git a/daemon/spi_manager.h b/daemon/spi_manager.h index deec13c..9ef51e3 100644 --- a/daemon/spi_manager.h +++ b/daemon/spi_manager.h @@ -43,7 +43,7 @@ struct SpiDevBus { class SpiDevice { public: - SpiDevice(SpiDevBus* bus) : bus_(bus) {} + explicit SpiDevice(SpiDevBus* bus) : bus_(bus) {} ~SpiDevice() { if (!bus_->mux.empty()) { PinMuxManager::GetPinMuxManager()->ReleaseSource(bus_->mux, diff --git a/daemon/uart_driver.h b/daemon/uart_driver.h index c132391..e8d7ed7 100644 --- a/daemon/uart_driver.h +++ b/daemon/uart_driver.h @@ -55,7 +55,7 @@ class UartDriverInfoBase { template class UartDriverInfo : public UartDriverInfoBase { public: - UartDriverInfo(PARAM param) : param_(param) {} + explicit UartDriverInfo(PARAM param) : param_(param) {} ~UartDriverInfo() override {} std::string Compat() override { return T::Compat(); } diff --git a/daemon/uart_driver_sysfs.h b/daemon/uart_driver_sysfs.h index c5e3e27..35085b7 100644 --- a/daemon/uart_driver_sysfs.h +++ b/daemon/uart_driver_sysfs.h @@ -28,7 +28,7 @@ namespace android { class UartDriverSysfs : public UartDriverInterface { public: - UartDriverSysfs(CharDeviceFactory* factory); + explicit UartDriverSysfs(CharDeviceFactory* factory); ~UartDriverSysfs(); static std::string Compat() { return "UARTSYSFS"; } diff --git a/daemon/uart_manager.h b/daemon/uart_manager.h index eefa37f..ba8fa51 100644 --- a/daemon/uart_manager.h +++ b/daemon/uart_manager.h @@ -40,7 +40,7 @@ struct UartSysfs { class UartDevice { public: - UartDevice(UartSysfs* uart_device) : uart_device_(uart_device) {} + explicit UartDevice(UartSysfs* uart_device) : uart_device_(uart_device) {} ~UartDevice() { uart_device_->driver_.reset(); } int SetBaudrate(uint32_t baudrate) { -- cgit v1.2.3