Clean up some ctors/dtors.

This commit is contained in:
Maxim Poliakovski 2022-01-10 17:40:52 +01:00
parent d61d1d71eb
commit c218badd5a
5 changed files with 4 additions and 6 deletions

View File

@ -55,8 +55,6 @@ ADB_Bus::ADB_Bus() {
mouse_access_no = adb_relative;
}
ADB_Bus::~ADB_Bus() {}
bool ADB_Bus::listen(int device, int reg) {
if (device == keyboard_access_no) {
if (adb_keybd_listen(reg)) {

View File

@ -51,7 +51,7 @@ enum adb_default_values {
class ADB_Bus {
public:
ADB_Bus();
~ADB_Bus();
~ADB_Bus() = default;
bool listen(int device, int reg);
bool talk(int device, int reg, uint16_t value);

View File

@ -45,6 +45,7 @@ enum HWCompType : int {
/** Abstract base class for HW components. */
class HWComponent {
public:
HWComponent() = default;
virtual ~HWComponent() = default;
virtual std::string get_name(void) {

View File

@ -47,9 +47,7 @@ public:
I2CBus() {
std::memset(this->dev_list, 0, sizeof(this->dev_list));
};
~I2CBus() {
std::memset(this->dev_list, 0, sizeof(this->dev_list));
};
virtual ~I2CBus() = default;
virtual void register_device(uint8_t dev_addr, I2CDevice* dev_obj) {
if (this->dev_list[dev_addr]) {

View File

@ -30,6 +30,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
/** Abstract class representing a simple, memory-mapped I/O device */
class MMIODevice : public HWComponent {
public:
MMIODevice() = default;
virtual uint32_t read(uint32_t reg_start, uint32_t offset, int size) = 0;
virtual void write(uint32_t reg_start, uint32_t offset, uint32_t value, int size) = 0;
virtual ~MMIODevice() = default;