cppcheck experiment. A couple of memory leaks fixed
This commit is contained in:
@@ -114,7 +114,7 @@ bool Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Er9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
bool Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying er9x import... ";
|
||||
|
||||
@@ -123,7 +123,7 @@ bool Er9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen(eeprom, size, BOARD_STOCK)) {
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
|
||||
std::cout << "wrong file system\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ class Er9xInterface : public EEPROMInterface
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, uint8_t * eeprom, int size);
|
||||
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ bool Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Ersky9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
bool Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying ersky9x import... ";
|
||||
|
||||
@@ -160,7 +160,7 @@ bool Ersky9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen(eeprom, size, BOARD_SKY9X)) {
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_SKY9X)) {
|
||||
std::cout << "wrong file system\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ class Ersky9xInterface : public EEPROMInterface
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, uint8_t * eeprom, int size);
|
||||
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ bool Gruvin9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
}
|
||||
|
||||
|
||||
bool Gruvin9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying " << getName() << " import... ";
|
||||
|
||||
@@ -108,7 +108,7 @@ bool Gruvin9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen(eeprom, size, BOARD_STOCK)) {
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
|
||||
std::cout << "wrong file system\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class Gruvin9xInterface : public EEPROMInterface
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, uint8_t *eeprom, int size);
|
||||
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t *eeprom,int esize, int index);
|
||||
|
||||
|
||||
@@ -290,7 +290,7 @@ bool OpenTxInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool OpenTxInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
bool OpenTxInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying " << getName() << " import...";
|
||||
|
||||
@@ -305,7 +305,8 @@ bool OpenTxInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
if (notnull) {
|
||||
std::cout << " wrong size (" << size << ")\n";
|
||||
return false;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(NULL, "companion", QObject::tr("Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"));
|
||||
size=2048;
|
||||
}
|
||||
@@ -315,7 +316,7 @@ bool OpenTxInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
}
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen(eeprom, size, board)) {
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, board)) {
|
||||
std::cout << " wrong file system\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class OpenTxInterface : public EEPROMInterface
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, uint8_t *eeprom, int size);
|
||||
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ bool Th9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Th9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
bool Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying th9x import... ";
|
||||
|
||||
@@ -71,7 +71,7 @@ bool Th9xInterface::load(RadioData &radioData, uint8_t *eeprom, int size)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen(eeprom, size, BOARD_STOCK)) {
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
|
||||
std::cout << "wrong file system\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ class Th9xInterface : public EEPROMInterface
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, uint8_t *eeprom, int size);
|
||||
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user