Add asserts.
This commit is contained in:
parent
9b80c2e6fe
commit
d1664b4275
11
HD44780.cpp
11
HD44780.cpp
|
@ -32,6 +32,8 @@ m_rows(rows),
|
||||||
m_cols(cols),
|
m_cols(cols),
|
||||||
m_fd(-1)
|
m_fd(-1)
|
||||||
{
|
{
|
||||||
|
assert(rows > 1U);
|
||||||
|
assert(cols > 15U);
|
||||||
}
|
}
|
||||||
|
|
||||||
CHD44780::~CHD44780()
|
CHD44780::~CHD44780()
|
||||||
|
@ -90,6 +92,10 @@ void CHD44780::setDStar()
|
||||||
|
|
||||||
void CHD44780::writeDStar(const char* my1, const char* my2, const char* your)
|
void CHD44780::writeDStar(const char* my1, const char* my2, const char* your)
|
||||||
{
|
{
|
||||||
|
assert(my1 != NULL);
|
||||||
|
assert(my2 != NULL);
|
||||||
|
assert(your != NULL);
|
||||||
|
|
||||||
if (m_rows > 2U) {
|
if (m_rows > 2U) {
|
||||||
char buffer[40U];
|
char buffer[40U];
|
||||||
|
|
||||||
|
@ -145,6 +151,8 @@ void CHD44780::setDMR()
|
||||||
|
|
||||||
void CHD44780::writeDMR(unsigned int slotNo, unsigned int srcId, bool group, unsigned int dstId, const char* type)
|
void CHD44780::writeDMR(unsigned int slotNo, unsigned int srcId, bool group, unsigned int dstId, const char* type)
|
||||||
{
|
{
|
||||||
|
assert(type != NULL);
|
||||||
|
|
||||||
if (slotNo == 1U) {
|
if (slotNo == 1U) {
|
||||||
char buffer[40U];
|
char buffer[40U];
|
||||||
if (m_cols > 16U)
|
if (m_cols > 16U)
|
||||||
|
@ -190,6 +198,9 @@ void CHD44780::setFusion()
|
||||||
|
|
||||||
void CHD44780::writeFusion(const char* source, const char* dest)
|
void CHD44780::writeFusion(const char* source, const char* dest)
|
||||||
{
|
{
|
||||||
|
assert(source != NULL);
|
||||||
|
assert(dest != NULL);
|
||||||
|
|
||||||
if (m_rows > 2U) {
|
if (m_rows > 2U) {
|
||||||
char buffer[40U];
|
char buffer[40U];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue