cleanup: don't allocate device_data_t structure

These can all just be local objects.

Also, don't overwrite them with 0. We later want to convert the
string to std::string, where this would be very sketchy.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-02 09:50:02 +02:00
parent 3d1ae76ebe
commit 0c45c5279b
4 changed files with 32 additions and 37 deletions

View file

@ -145,7 +145,6 @@ ConfigureDiveComputerDialog::ConfigureDiveComputerDialog(const QString &filename
ui.connectBluetoothButton->setVisible(false);
#endif
memset(&device_data, 0, sizeof(device_data));
fill_computer_list();
unsigned int selectedDiveComputerIndex = 0;
@ -267,7 +266,7 @@ ConfigureDiveComputerDialog::ConfigureDiveComputerDialog(const QString &filename
OstcFirmwareCheck::OstcFirmwareCheck(const QString &product) : parent(0)
{
QUrl url;
memset(&devData, 1, sizeof(devData));
devData = device_data_t();
if (product == "OSTC 3" || product == "OSTC 3+" || product == "OSTC cR" || product == "OSTC Plus") {
url = QUrl("http://www.heinrichsweikamp.net/autofirmware/ostc3_changelog.txt");
latestFirmwareHexFile = QString("http://www.heinrichsweikamp.net/autofirmware/ostc3_firmware.hex");