From 8801355ace125cbd7a3df9b2787cd4da5054ad67 Mon Sep 17 00:00:00 2001 From: Tony Corbett G0WFV Date: Thu, 30 Jun 2016 20:35:32 +0100 Subject: [PATCH] Change incorrect variable type to unsigned int --- Conf.cpp | 4 ++-- Conf.h | 4 ++-- HD44780.cpp | 2 +- HD44780.h | 4 ++-- MMDVMHost.cpp | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Conf.cpp b/Conf.cpp index f5670a5..67eb40e 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -440,7 +440,7 @@ bool CConf::read() else if (::strcmp(key, "Columns") == 0) m_hd44780Columns = (unsigned int)::atoi(value); else if (::strcmp(key, "I2CAddress") == 0) - m_hd44780i2cAddress = value; + m_hd44780i2cAddress = (unsigned int)::atoi(value); else if (::strcmp(key, "PWM") == 0) m_hd44780PWM = ::atoi(value) == 1; else if (::strcmp(key, "PWMPin") == 0) @@ -892,7 +892,7 @@ std::vector CConf::getHD44780Pins() const return m_hd44780Pins; } -std::string CConf::getHD44780i2cAddress() const +unsigned int CConf::getHD44780i2cAddress() const { return m_hd44780i2cAddress; } diff --git a/Conf.h b/Conf.h index 35111a2..aa5b998 100644 --- a/Conf.h +++ b/Conf.h @@ -137,7 +137,7 @@ public: unsigned int getHD44780Rows() const; unsigned int getHD44780Columns() const; std::vector getHD44780Pins() const; - std::string getHD44780i2cAddress() const; + unsigned int getHD44780i2cAddress() const; bool getHD44780PWM() const; unsigned int getHD44780PWMPin() const; unsigned int getHD44780PWMBright() const; @@ -253,7 +253,7 @@ private: unsigned int m_hd44780Rows; unsigned int m_hd44780Columns; std::vector m_hd44780Pins; - std::string m_hd44780i2cAddress; + unsigned int m_hd44780i2cAddress; bool m_hd44780PWM; unsigned int m_hd44780PWMPin; unsigned int m_hd44780PWMBright; diff --git a/HD44780.cpp b/HD44780.cpp index 751a84a..0e1d52c 100644 --- a/HD44780.cpp +++ b/HD44780.cpp @@ -36,7 +36,7 @@ char m_buffer2[128U]; char m_buffer3[128U]; char m_buffer4[128U]; -CHD44780::CHD44780(unsigned int rows, unsigned int cols, const std::string& callsign, unsigned int dmrid, const std::vector& pins, const std::string& i2cAddress, bool pwm, unsigned int pwmPin, unsigned int pwmBright, unsigned int pwmDim, bool displayClock, bool utc, bool duplex) : +CHD44780::CHD44780(unsigned int rows, unsigned int cols, const std::string& callsign, unsigned int dmrid, const std::vector& pins, unsigned int i2cAddress, bool pwm, unsigned int pwmPin, unsigned int pwmBright, unsigned int pwmDim, bool displayClock, bool utc, bool duplex) : CDisplay(), m_rows(rows), m_cols(cols), diff --git a/HD44780.h b/HD44780.h index d7fb13a..4748b79 100644 --- a/HD44780.h +++ b/HD44780.h @@ -89,7 +89,7 @@ enum ADAFRUIT_COLOUR { class CHD44780 : public CDisplay { public: - CHD44780(unsigned int rows, unsigned int cols, const std::string& callsign, unsigned int dmrid, const std::vector& pins, const std::string& i2cAddress, bool pwm, unsigned int pwmPin, unsigned int pwmBright, unsigned int pwmDim, bool displayClock, bool utc, bool duplex); + CHD44780(unsigned int rows, unsigned int cols, const std::string& callsign, unsigned int dmrid, const std::vector& pins, unsigned int i2cAddress, bool pwm, unsigned int pwmPin, unsigned int pwmBright, unsigned int pwmDim, bool displayClock, bool utc, bool duplex); virtual ~CHD44780(); virtual bool open(); @@ -123,7 +123,7 @@ private: unsigned int m_d1; unsigned int m_d2; unsigned int m_d3; - std::string m_i2cAddress; + unsigned int m_i2cAddress; bool m_pwm; unsigned int m_pwmPin; unsigned int m_pwmBright; diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index c2fd081..c638821 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -875,7 +875,7 @@ void CMMDVMHost::createDisplay() unsigned int rows = m_conf.getHD44780Rows(); unsigned int columns = m_conf.getHD44780Columns(); std::vector pins = m_conf.getHD44780Pins(); - std::string i2cAddress = m_conf.getHD44780i2cAddress(); + unsigned int i2cAddress = m_conf.getHD44780i2cAddress(); bool pwm = m_conf.getHD44780PWM(); unsigned int pwmPin = m_conf.getHD44780PWMPin(); unsigned int pwmBright = m_conf.getHD44780PWMBright();