More linting in src/qt
This commit is contained in:
@@ -511,24 +511,24 @@ void
|
||||
HarddiskDialog::onExistingFileSelected(const QString &fileName, bool precheck)
|
||||
{
|
||||
// TODO : Over to non-existing file selected
|
||||
/*
|
||||
#if 0
|
||||
if (!(existing & 1)) {
|
||||
f = _wfopen(wopenfilestring, L"rb");
|
||||
if (f != NULL) {
|
||||
fclose(f);
|
||||
fp = _wfopen(wopenfilestring, L"rb");
|
||||
if (fp != NULL) {
|
||||
fclose(fp);
|
||||
if (settings_msgbox_ex(MBX_QUESTION_YN, (wchar_t *) IDS_4111, (wchar_t *) IDS_4118, (wchar_t *) IDS_4120, (wchar_t *) IDS_4121, NULL) != 0) / * yes * /
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
f = _wfopen(wopenfilestring, (existing & 1) ? L"rb" : L"wb");
|
||||
if (f == NULL) {
|
||||
fp = _wfopen(wopenfilestring, (existing & 1) ? L"rb" : L"wb");
|
||||
if (fp == NULL) {
|
||||
hdd_add_file_open_error:
|
||||
fclose(f);
|
||||
fclose(fp);
|
||||
settings_msgbox_header(MBX_ERROR, (existing & 1) ? (wchar_t *) IDS_4114 : (wchar_t *) IDS_4115, (existing & 1) ? (wchar_t *) IDS_4107 : (wchar_t *) IDS_4108);
|
||||
return TRUE;
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
|
||||
uint64_t size = 0;
|
||||
uint32_t sector_size = 0;
|
||||
|
||||
@@ -259,7 +259,7 @@ NewFloppyDialog::onCreate()
|
||||
bool
|
||||
NewFloppyDialog::create86f(const QString &filename, const disk_size_t &disk_size, uint8_t rpm_mode)
|
||||
{
|
||||
FILE *f;
|
||||
FILE *fp;
|
||||
|
||||
uint32_t magic = 0x46423638;
|
||||
uint16_t version = 0x020C;
|
||||
@@ -326,13 +326,13 @@ NewFloppyDialog::create86f(const QString &filename, const disk_size_t &disk_size
|
||||
memset(tarray, 0, 2048);
|
||||
memset(empty, 0, array_size);
|
||||
|
||||
f = plat_fopen(filename.toUtf8().data(), "wb");
|
||||
if (!f)
|
||||
fp = plat_fopen(filename.toUtf8().data(), "wb");
|
||||
if (!fp)
|
||||
return false;
|
||||
|
||||
fwrite(&magic, 4, 1, f);
|
||||
fwrite(&version, 2, 1, f);
|
||||
fwrite(&dflags, 2, 1, f);
|
||||
fwrite(&magic, 4, 1, fp);
|
||||
fwrite(&version, 2, 1, fp);
|
||||
fwrite(&dflags, 2, 1, fp);
|
||||
|
||||
track_size = array_size + 6;
|
||||
|
||||
@@ -344,17 +344,17 @@ NewFloppyDialog::create86f(const QString &filename, const disk_size_t &disk_size
|
||||
for (i = 0; i < (disk_size.tracks * disk_size.sides) << shift; i++)
|
||||
tarray[i] = track_base + (i * track_size);
|
||||
|
||||
fwrite(tarray, 1, (disk_size.sides == 2) ? 2048 : 1024, f);
|
||||
fwrite(tarray, 1, (disk_size.sides == 2) ? 2048 : 1024, fp);
|
||||
|
||||
for (i = 0; i < (disk_size.tracks * disk_size.sides) << shift; i++) {
|
||||
fwrite(&tflags, 2, 1, f);
|
||||
fwrite(&index_hole_pos, 4, 1, f);
|
||||
fwrite(empty, 1, array_size, f);
|
||||
fwrite(&tflags, 2, 1, fp);
|
||||
fwrite(&index_hole_pos, 4, 1, fp);
|
||||
fwrite(empty, 1, array_size, fp);
|
||||
}
|
||||
|
||||
free(empty);
|
||||
|
||||
fclose(f);
|
||||
fclose(fp);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ SettingsFloppyCDROM::SettingsFloppyCDROM(QWidget *parent)
|
||||
auto *modelType = ui->comboBoxCDROMType->model();
|
||||
int removeRows = modelType->rowCount();
|
||||
|
||||
int j = 0;
|
||||
uint32_t j = 0;
|
||||
int selectedTypeRow = 0;
|
||||
int eligibleRows = 0;
|
||||
while (cdrom_drive_types[j].bus_type != BUS_TYPE_NONE) {
|
||||
@@ -337,7 +337,7 @@ SettingsFloppyCDROM::on_comboBoxBus_activated(int)
|
||||
auto *modelType = ui->comboBoxCDROMType->model();
|
||||
int removeRows = modelType->rowCount();
|
||||
|
||||
int j = 0;
|
||||
uint32_t j = 0;
|
||||
int selectedTypeRow = 0;
|
||||
int eligibleRows = 0;
|
||||
while (cdrom_drive_types[j].bus_type != BUS_TYPE_NONE) {
|
||||
|
||||
@@ -52,6 +52,9 @@ setMOBus(QAbstractItemModel *model, const QModelIndex &idx, uint8_t bus, uint8_t
|
||||
case MO_BUS_SCSI:
|
||||
icon = ProgSettings::loadIcon("/mo.ico");
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
auto i = idx.siblingAtColumn(0);
|
||||
@@ -84,6 +87,9 @@ setZIPBus(QAbstractItemModel *model, const QModelIndex &idx, uint8_t bus, uint8_
|
||||
case ZIP_BUS_SCSI:
|
||||
icon = ProgSettings::loadIcon("/zip.ico");
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
auto i = idx.siblingAtColumn(0);
|
||||
@@ -158,9 +164,9 @@ SettingsOtherRemovable::~SettingsOtherRemovable()
|
||||
void
|
||||
SettingsOtherRemovable::save()
|
||||
{
|
||||
auto *model = ui->tableViewMO->model();
|
||||
for (int i = 0; i < MO_NUM; i++) {
|
||||
mo_drives[i].f = NULL;
|
||||
const auto *model = ui->tableViewMO->model();
|
||||
for (uint8_t i = 0; i < MO_NUM; i++) {
|
||||
mo_drives[i].fp = NULL;
|
||||
mo_drives[i].priv = NULL;
|
||||
mo_drives[i].bus_type = model->index(i, 0).data(Qt::UserRole).toUInt();
|
||||
mo_drives[i].res = model->index(i, 0).data(Qt::UserRole + 1).toUInt();
|
||||
@@ -168,8 +174,8 @@ SettingsOtherRemovable::save()
|
||||
}
|
||||
|
||||
model = ui->tableViewZIP->model();
|
||||
for (int i = 0; i < ZIP_NUM; i++) {
|
||||
zip_drives[i].f = NULL;
|
||||
for (uint8_t i = 0; i < ZIP_NUM; i++) {
|
||||
zip_drives[i].fp = NULL;
|
||||
zip_drives[i].priv = NULL;
|
||||
zip_drives[i].bus_type = model->index(i, 0).data(Qt::UserRole).toUInt();
|
||||
zip_drives[i].res = model->index(i, 0).data(Qt::UserRole + 1).toUInt();
|
||||
@@ -185,8 +191,8 @@ SettingsOtherRemovable::onMORowChanged(const QModelIndex ¤t)
|
||||
uint8_t type = current.siblingAtColumn(1).data(Qt::UserRole).toUInt();
|
||||
|
||||
ui->comboBoxMOBus->setCurrentIndex(-1);
|
||||
auto *model = ui->comboBoxMOBus->model();
|
||||
auto match = model->match(model->index(0, 0), Qt::UserRole, bus);
|
||||
const auto *model = ui->comboBoxMOBus->model();
|
||||
auto match = model->match(model->index(0, 0), Qt::UserRole, bus);
|
||||
if (!match.isEmpty())
|
||||
ui->comboBoxMOBus->setCurrentIndex(match.first().row());
|
||||
|
||||
@@ -205,8 +211,8 @@ SettingsOtherRemovable::onZIPRowChanged(const QModelIndex ¤t)
|
||||
bool is250 = current.siblingAtColumn(1).data(Qt::UserRole).toBool();
|
||||
|
||||
ui->comboBoxZIPBus->setCurrentIndex(-1);
|
||||
auto *model = ui->comboBoxZIPBus->model();
|
||||
auto match = model->match(model->index(0, 0), Qt::UserRole, bus);
|
||||
const auto *model = ui->comboBoxZIPBus->model();
|
||||
auto match = model->match(model->index(0, 0), Qt::UserRole, bus);
|
||||
if (!match.isEmpty())
|
||||
ui->comboBoxZIPBus->setCurrentIndex(match.first().row());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user