mirror of https://github.com/ArduPilot/ardupilot
AP_Common: clean up bitmask operators
Code already won't compile if there are different numbers of bits as the template parameter will be different.
This commit is contained in:
parent
b030b8e789
commit
6a4520e8fd
|
@ -39,16 +39,12 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
Bitmask &operator=(const Bitmask&other) {
|
Bitmask &operator=(const Bitmask&other) {
|
||||||
memcpy(bits, other.bits, sizeof(bits[0])*other.numwords);
|
memcpy(bits, other.bits, sizeof(bits[0])*numwords);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const Bitmask&other) {
|
bool operator==(const Bitmask&other) {
|
||||||
if (other.numbits != numbits) {
|
return memcmp(bits, other.bits, sizeof(bits[0])*numwords) == 0;
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return memcmp(bits, other.bits, sizeof(bits[0])*numwords) == 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator!=(const Bitmask&other) {
|
bool operator!=(const Bitmask&other) {
|
||||||
|
|
Loading…
Reference in New Issue