1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-09 21:29:53 +00:00

Ensures Sectors are move constructible (and still default constructible), and adds proper const qualifiers to Sector::Address.

This commit is contained in:
Thomas Harte 2017-09-24 22:40:38 -04:00
parent 3319a4f589
commit 8875982e1f

View File

@ -27,7 +27,7 @@ struct Sector {
struct Address { struct Address {
uint8_t track = 0, side = 0, sector = 0; uint8_t track = 0, side = 0, sector = 0;
bool operator < (Address &rhs) { bool operator < (const Address &rhs) const {
return ((track << 24) | (side << 8) | sector) < ((rhs.track << 24) | (rhs.side << 8) | rhs.sector); return ((track << 24) | (side << 8) | sector) < ((rhs.track << 24) | (rhs.side << 8) | rhs.sector);
} }
}; };
@ -39,6 +39,16 @@ struct Sector {
bool has_data_crc_error = false; bool has_data_crc_error = false;
bool has_header_crc_error = false; bool has_header_crc_error = false;
bool is_deleted = false; bool is_deleted = false;
Sector() {}
Sector(const Sector &&rhs) :
address(rhs.address),
size(rhs.size),
data(std::move(rhs.data)),
has_data_crc_error(rhs.has_data_crc_error),
has_header_crc_error(rhs.has_header_crc_error),
is_deleted(rhs.is_deleted ){}
}; };
} }