Skip to content

Commit 98925a3

Browse files
joevtdingusdev
authored andcommitted
Code clean-up part 2.
1 parent 77503df commit 98925a3

File tree

10 files changed

+31
-31
lines changed

10 files changed

+31
-31
lines changed

devices/common/ata/atabasedevice.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class AtaBaseDevice : public HWComponent, public AtaInterface
5050

5151
virtual int perform_command() = 0;
5252

53-
int get_device_id() override { return this->my_dev_id; };
53+
int get_device_id() override { return this->my_dev_id; }
5454

5555
void pdiag_callback() override {
5656
this->r_error &= 0x7F;
@@ -62,7 +62,7 @@ class AtaBaseDevice : public HWComponent, public AtaInterface
6262
void update_intrq(uint8_t new_intrq_state);
6363
void signal_data_ready();
6464

65-
bool has_data() {
65+
bool has_data() const {
6666
return data_ptr && xfer_cnt;
6767
}
6868

@@ -73,7 +73,7 @@ class AtaBaseDevice : public HWComponent, public AtaInterface
7373
protected:
7474
bool is_selected() const {
7575
return ((this->r_dev_head >> 4) & 1) == this->my_dev_id;
76-
};
76+
}
7777

7878
void prepare_xfer(int xfer_size, int block_size);
7979

devices/common/ata/cmd646.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
3232
#include <memory>
3333

3434
constexpr auto DEV_ID_CMD646 = 0x646;
35-
constexpr auto MY_DEV_CLASS = 0x010180; // mass storage | IDE controller | IDE master;
35+
constexpr auto MY_DEV_CLASS = 0x010180; // mass storage | IDE controller | IDE master
3636
constexpr auto MY_REV_ID = 7;
3737

3838
// Offset for converting addresses of the device control block registers

devices/common/pci/bandit.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
4646
#include <memory>
4747
#include <string>
4848

49-
constexpr auto BANDIT_DEV = (11); // Bandit's own device number;
50-
constexpr auto BANDIT_CAR_TYPE = (1 << 0); // Bandit config address type bit;
49+
constexpr auto BANDIT_DEV = 11; // Bandit's own device number
50+
constexpr auto BANDIT_CAR_TYPE = 1 << 0; // Bandit config address type bit
5151

5252
/* Convenient macros for parsing CONFIG_ADDR fields. */
5353
#define BUS_NUM() ((this->config_addr >> 16) & 0xFFU)

devices/common/scsi/sc53c94.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ void Sc53C94::sequencer()
433433
case SeqState::BUS_FREE:
434434
if (this->bus_obj->current_phase() == ScsiPhase::BUS_FREE) {
435435
this->next_state = SeqState::ARB_BEGIN;
436-
this->seq_defer_state(uint64_t(BUS_FREE_DELAY) + BUS_SETTLE_DELAY);
436+
this->seq_defer_state(BUS_FREE_DELAY + BUS_SETTLE_DELAY);
437437
} else { // continue waiting
438438
this->next_state = SeqState::BUS_FREE;
439439
this->seq_defer_state(BUS_FREE_DELAY);
@@ -453,7 +453,7 @@ void Sc53C94::sequencer()
453453
case SeqState::ARB_END:
454454
if (this->bus_obj->end_arbitration(this->my_bus_id)) { // arbitration won
455455
this->next_state = this->cmd_steps->next_step;
456-
this->seq_defer_state(uint64_t(BUS_CLEAR_DELAY) + BUS_SETTLE_DELAY);
456+
this->seq_defer_state(BUS_CLEAR_DELAY + BUS_SETTLE_DELAY);
457457
} else { // arbitration lost
458458
LOG_F(INFO, "%s: arbitration lost!", this->name.c_str());
459459
this->bus_obj->release_ctrl_lines(this->my_bus_id);

devices/common/scsi/scsi.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@ enum ScsiError : int {
156156
};
157157

158158
/** Standard SCSI bus timing values measured in ns. */
159-
constexpr auto BUS_SETTLE_DELAY = 400;
160-
constexpr auto BUS_FREE_DELAY = 800;
161-
constexpr auto BUS_CLEAR_DELAY = 800;
162-
constexpr auto ARB_DELAY = 2400;
163-
constexpr auto SEL_ABORT_TIME = 200000;
164-
constexpr auto SEL_TIME_OUT = 250000000;
159+
constexpr uint64_t BUS_SETTLE_DELAY = 400;
160+
constexpr uint64_t BUS_FREE_DELAY = 800;
161+
constexpr uint64_t BUS_CLEAR_DELAY = 800;
162+
constexpr uint64_t ARB_DELAY = 2400;
163+
constexpr uint64_t SEL_ABORT_TIME = 200000;
164+
constexpr uint64_t SEL_TIME_OUT = 250000000;
165165

166166
constexpr auto SCSI_MAX_DEVS = 8;
167167

@@ -249,15 +249,15 @@ class ScsiBus : public HWComponent {
249249

250250
int current_phase() const {
251251
return this->cur_phase;
252-
};
252+
}
253253

254254
int get_initiator_id() const {
255255
return this->initiator_id;
256-
};
256+
}
257257

258258
int get_target_id() const {
259259
return this->target_id;
260-
};
260+
}
261261

262262
// reading/writing control lines
263263
void assert_ctrl_line(int id, uint16_t mask);

devices/ethernet/mace.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
3131
#include <memory>
3232

3333
/** Known MACE chip IDs. */
34-
constexpr auto MACE_ID_REV_B0 = 0x0940; // Darwin-0.3 source;
35-
constexpr auto MACE_ID_REV_A2 = 0x0941; // Darwin-0.3 source & Curio datasheet;
34+
constexpr auto MACE_ID_REV_B0 = 0x0940; // Darwin-0.3 source
35+
constexpr auto MACE_ID_REV_A2 = 0x0941; // Darwin-0.3 source & Curio datasheet
3636

3737
/** MACE registers offsets. */
3838
// Refer to the Am79C940 datasheet for details

devices/floppy/floppyimg.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
2727
#include <cinttypes>
2828
#include <string>
2929

30-
constexpr auto BLOCK_SIZE = 512; // size in bytes of a logical block;
30+
constexpr auto BLOCK_SIZE = 512; // size in bytes of a logical block
3131

3232
#define MFM_HD_SIZE (BLOCK_SIZE*2880) // maximal size of a high-density floppy
3333

@@ -52,31 +52,31 @@ class FloppyImgConverter {
5252

5353
int get_data_size() const {
5454
return this->data_size;
55-
};
55+
}
5656

5757
int get_disk_rec_method() const {
5858
return this->rec_method;
59-
};
59+
}
6060

6161
int get_number_of_tracks() const {
6262
return this->num_tracks;
63-
};
63+
}
6464

6565
int get_number_of_sides() const {
6666
return this->num_sides;
67-
};
67+
}
6868

6969
int get_sectors_per_side() const {
7070
return this->num_sectors;
71-
};
71+
}
7272

7373
int get_rec_density() const {
7474
return this->density;
75-
};
75+
}
7676

7777
uint8_t get_format_byte() const {
7878
return this->format_byte;
79-
};
79+
}
8080

8181
protected:
8282
std::string img_path;

devices/memctrl/hammerhead.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
4040
namespace Hammerhead {
4141
constexpr auto RISC_MACHINE = 0x3;
4242
constexpr auto MACH_TYPE_TNT = 0x1;
43-
constexpr auto EXTENDED_ID = 0x1; // examine some other registers to get full ID;
43+
constexpr auto EXTENDED_ID = 0x1; // examine some other registers to get full ID
4444
constexpr auto HH_CPU_ID_TNT = ((RISC_MACHINE << 4) | (EXTENDED_ID << 3) | MACH_TYPE_TNT);
4545

4646
// constants for the MBID field of the MOTHERBOARD_ID register

devices/memctrl/hmc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
DingusPPC - The Experimental PowerPC Macintosh emulator
3-
Copyright (C) 2018-24 divingkatae and maximum
3+
Copyright (C) 2018-25 divingkatae and maximum
44
(theweirdo) spatium
55
66
(Contact divingkatae#1017 or powermax#2286 on Discord for more info)
@@ -77,7 +77,7 @@ class HMC : public MemCtrlBase, public MMIODevice {
7777

7878
uint64_t get_control_reg(void) const {
7979
return this->ctrl_reg;
80-
};
80+
}
8181

8282
protected:
8383
void remap_ram_regions();

devices/video/appleramdac.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ enum DacFlavour {
5353
DACULA,
5454
};
5555

56-
constexpr auto DACULA_VENDOR_SIERRA = 0x3C; // 14.3 MHz;
56+
constexpr auto DACULA_VENDOR_SIERRA = 0x3C; // 14.3 MHz
5757
constexpr auto DACULA_VENDOR_ATT = 0x84; // 15 MHz
5858

5959
constexpr auto VIDEO_XTAL = 14318180.0f; // external crystal oscillator frequency

0 commit comments

Comments
 (0)