diff --git a/src/osdep/gui/EditCDDrive.cpp b/src/osdep/gui/EditCDDrive.cpp index 4955adeba..fb9d491a4 100644 --- a/src/osdep/gui/EditCDDrive.cpp +++ b/src/osdep/gui/EditCDDrive.cpp @@ -45,7 +45,7 @@ class CDDriveActionListener : public gcn::ActionListener public: void action(const gcn::ActionEvent& actionEvent) override { - auto source = actionEvent.getSource(); + const auto source = actionEvent.getSource(); if (source == cmdCDDriveOK) { if (txtCDDrivePath->getText().empty()) @@ -64,7 +64,7 @@ class CDDriveActionListener : public gcn::ActionListener } else if (source == cboCDDriveController) { - auto posn = controller[cboCDDriveController->getSelected()].type; + const auto posn = controller[cboCDDriveController->getSelected()].type; current_cddlg.ci.controller_type = posn % HD_CONTROLLER_NEXT_UNIT; current_cddlg.ci.controller_type_unit = posn / HD_CONTROLLER_NEXT_UNIT; inithdcontroller(current_cddlg.ci.controller_type, current_cddlg.ci.controller_type_unit, UAEDEV_CD, current_cddlg.ci.rootdir[0] != 0); @@ -139,16 +139,15 @@ static void InitEditCDDrive() cboCDDriveUnit->setId("cboCDDriveUnit"); cboCDDriveUnit->addActionListener(cdDriveActionListener); - int posY = DISTANCE_BORDER; - int posX = DISTANCE_BORDER; + int pos_y = DISTANCE_BORDER; - wndEditCDDrive->add(lblCDDrivePath, DISTANCE_BORDER, posY); - wndEditCDDrive->add(txtCDDrivePath, lblCDDrivePath->getX() + lblCDDrivePath->getWidth() + 8, posY); - posY = txtCDDrivePath->getY() + txtCDDrivePath->getHeight() + DISTANCE_NEXT_Y; + wndEditCDDrive->add(lblCDDrivePath, DISTANCE_BORDER, pos_y); + wndEditCDDrive->add(txtCDDrivePath, lblCDDrivePath->getX() + lblCDDrivePath->getWidth() + 8, pos_y); + pos_y = txtCDDrivePath->getY() + txtCDDrivePath->getHeight() + DISTANCE_NEXT_Y; - wndEditCDDrive->add(lblCDDriveController, DISTANCE_BORDER, posY); - wndEditCDDrive->add(cboCDDriveController, lblCDDriveController->getX() + lblCDDriveController->getWidth() + 8, posY); - wndEditCDDrive->add(cboCDDriveUnit, cboCDDriveController->getX() + cboCDDriveController->getWidth() + DISTANCE_NEXT_X, posY); + wndEditCDDrive->add(lblCDDriveController, DISTANCE_BORDER, pos_y); + wndEditCDDrive->add(cboCDDriveController, lblCDDriveController->getX() + lblCDDriveController->getWidth() + 8, pos_y); + wndEditCDDrive->add(cboCDDriveUnit, cboCDDriveController->getX() + cboCDDriveController->getWidth() + DISTANCE_NEXT_X, pos_y); wndEditCDDrive->add(cmdCDDriveOK); wndEditCDDrive->add(cmdCDDriveCancel); diff --git a/src/osdep/gui/PanelHD.cpp b/src/osdep/gui/PanelHD.cpp index f1bd09134..0ccafbe49 100644 --- a/src/osdep/gui/PanelHD.cpp +++ b/src/osdep/gui/PanelHD.cpp @@ -352,7 +352,7 @@ class CDFileActionListener : public gcn::ActionListener } else { - auto selected = cdfileList.getElementAt(idx); + const auto selected = cdfileList.getElementAt(idx); // if selected starts with /dev/sr, it's a CD drive if (selected.find("/dev/") == 0) { @@ -527,25 +527,25 @@ void InitPanelHD(const config_category& category) cboCDFile->setId("cboCD"); cboCDFile->addActionListener(cdFileActionListener); - int posX = DISTANCE_BORDER + 2 + SMALL_BUTTON_WIDTH + 34; + int pos_x = DISTANCE_BORDER + 2 + SMALL_BUTTON_WIDTH + 34; for (col = 0; col < COL_COUNT; ++col) { - category.panel->add(lblList[col], posX, posY); - posX += COLUMN_SIZE[col]; + category.panel->add(lblList[col], pos_x, posY); + pos_x += COLUMN_SIZE[col]; } posY += lblList[0]->getHeight() + 2; for (row = 0; row < MAX_HD_DEVICES; ++row) { - posX = 1; - listEntry[row]->add(listCmdProps[row], posX, 2); - posX += listCmdProps[row]->getWidth() + 4; - listEntry[row]->add(listCmdDelete[row], posX, 2); - posX += listCmdDelete[row]->getWidth() + 8; + pos_x = 1; + listEntry[row]->add(listCmdProps[row], pos_x, 2); + pos_x += listCmdProps[row]->getWidth() + 4; + listEntry[row]->add(listCmdDelete[row], pos_x, 2); + pos_x += listCmdDelete[row]->getWidth() + 8; for (col = 0; col < COL_COUNT; ++col) { - listEntry[row]->add(listCells[row][col], posX, 2); - posX += COLUMN_SIZE[col]; + listEntry[row]->add(listCells[row][col], pos_x, 2); + pos_x += COLUMN_SIZE[col]; } category.panel->add(listEntry[row], DISTANCE_BORDER, posY); posY += listEntry[row]->getHeight() + DISTANCE_NEXT_Y / 2; diff --git a/src/osdep/gui/PanelQuickstart.cpp b/src/osdep/gui/PanelQuickstart.cpp index 8aecf93d7..15efc40ad 100644 --- a/src/osdep/gui/PanelQuickstart.cpp +++ b/src/osdep/gui/PanelQuickstart.cpp @@ -400,7 +400,7 @@ class QSCDActionListener : public gcn::ActionListener } else { - auto selected = cdfileList.getElementAt(idx); + const auto selected = cdfileList.getElementAt(idx); // if selected starts with /dev/sr, it's a CD drive if (selected.find("/dev/") == 0) {