Loading system/gd/hci/address.cc +4 −2 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ static_assert(sizeof(Address) == 6, "Address must be 6 bytes long!"); const Address Address::kAny{{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}}; const Address Address::kEmpty{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}; // Address cannot initialize member variables as it is a POD type // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) Address::Address(const uint8_t (&addr)[6]) { std::copy(addr, addr + kLength, address); }; Loading @@ -46,7 +48,7 @@ std::string Address::ToString() const { } bool Address::FromString(const std::string& from, Address& to) { Address new_addr; Address new_addr{}; if (from.length() != 17) { return false; } Loading Loading @@ -86,7 +88,7 @@ size_t Address::FromOctets(const uint8_t* from) { }; bool Address::IsValidAddress(const std::string& address) { Address tmp; Address tmp{}; return Address::FromString(address, tmp); } Loading system/gd/hci/class_of_device.cc +4 −2 Original line number Diff line number Diff line Loading @@ -30,6 +30,8 @@ namespace hci { static_assert(sizeof(ClassOfDevice) == ClassOfDevice::kLength, "ClassOfDevice must be 3 bytes long!"); // ClassOfDevice cannot initialize member variables as it is a POD type // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) ClassOfDevice::ClassOfDevice(const uint8_t (&class_of_device)[kLength]) { std::copy(class_of_device, class_of_device + kLength, cod); }; Loading @@ -43,7 +45,7 @@ std::string ClassOfDevice::ToString() const { } bool ClassOfDevice::FromString(const std::string& from, ClassOfDevice& to) { ClassOfDevice new_cod; ClassOfDevice new_cod{}; if (from.length() != 8) return false; std::istringstream stream(from); Loading Loading @@ -90,7 +92,7 @@ size_t ClassOfDevice::FromOctets(const uint8_t* from) { }; bool ClassOfDevice::IsValid(const std::string& cod) { ClassOfDevice tmp; ClassOfDevice tmp{}; return ClassOfDevice::FromString(cod, tmp); } } // namespace hci Loading system/gd/hci/class_of_device.h +0 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ class ClassOfDevice final { ClassOfDevice() = default; ClassOfDevice(const uint8_t (&class_of_device)[kLength]); bool operator==(const ClassOfDevice& rhs) const { return (std::memcmp(cod, rhs.cod, sizeof(cod)) == 0); } Loading system/gd/packet/iterator.h +1 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ class Iterator : public std::iterator<std::random_access_iterator_tag, uint8_t> template <typename FixedWidthPODType> FixedWidthPODType extract() { static_assert(std::is_pod<FixedWidthPODType>::value, "Iterator::extract requires a fixed-width type."); FixedWidthPODType extracted_value; FixedWidthPODType extracted_value{}; uint8_t* value_ptr = (uint8_t*)&extracted_value; for (size_t i = 0; i < sizeof(FixedWidthPODType); i++) { Loading system/gd/packet/parser/fields/array_field.cc +1 −1 Original line number Diff line number Diff line Loading @@ -119,7 +119,7 @@ void ArrayField::GenGetter(std::ostream& s, Size start_offset, Size end_offset) s << "auto to_bound = begin();"; int num_leading_bits = GenBounds(s, start_offset, end_offset, GetSize()); s << GetDataType() << " " << GetName() << "_value;"; s << GetDataType() << " " << GetName() << "_value{};"; s << GetDataType() << "* " << GetName() << "_ptr = &" << GetName() << "_value;"; GenExtractor(s, num_leading_bits, false); Loading Loading
system/gd/hci/address.cc +4 −2 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ static_assert(sizeof(Address) == 6, "Address must be 6 bytes long!"); const Address Address::kAny{{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}}; const Address Address::kEmpty{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}; // Address cannot initialize member variables as it is a POD type // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) Address::Address(const uint8_t (&addr)[6]) { std::copy(addr, addr + kLength, address); }; Loading @@ -46,7 +48,7 @@ std::string Address::ToString() const { } bool Address::FromString(const std::string& from, Address& to) { Address new_addr; Address new_addr{}; if (from.length() != 17) { return false; } Loading Loading @@ -86,7 +88,7 @@ size_t Address::FromOctets(const uint8_t* from) { }; bool Address::IsValidAddress(const std::string& address) { Address tmp; Address tmp{}; return Address::FromString(address, tmp); } Loading
system/gd/hci/class_of_device.cc +4 −2 Original line number Diff line number Diff line Loading @@ -30,6 +30,8 @@ namespace hci { static_assert(sizeof(ClassOfDevice) == ClassOfDevice::kLength, "ClassOfDevice must be 3 bytes long!"); // ClassOfDevice cannot initialize member variables as it is a POD type // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) ClassOfDevice::ClassOfDevice(const uint8_t (&class_of_device)[kLength]) { std::copy(class_of_device, class_of_device + kLength, cod); }; Loading @@ -43,7 +45,7 @@ std::string ClassOfDevice::ToString() const { } bool ClassOfDevice::FromString(const std::string& from, ClassOfDevice& to) { ClassOfDevice new_cod; ClassOfDevice new_cod{}; if (from.length() != 8) return false; std::istringstream stream(from); Loading Loading @@ -90,7 +92,7 @@ size_t ClassOfDevice::FromOctets(const uint8_t* from) { }; bool ClassOfDevice::IsValid(const std::string& cod) { ClassOfDevice tmp; ClassOfDevice tmp{}; return ClassOfDevice::FromString(cod, tmp); } } // namespace hci Loading
system/gd/hci/class_of_device.h +0 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ class ClassOfDevice final { ClassOfDevice() = default; ClassOfDevice(const uint8_t (&class_of_device)[kLength]); bool operator==(const ClassOfDevice& rhs) const { return (std::memcmp(cod, rhs.cod, sizeof(cod)) == 0); } Loading
system/gd/packet/iterator.h +1 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ class Iterator : public std::iterator<std::random_access_iterator_tag, uint8_t> template <typename FixedWidthPODType> FixedWidthPODType extract() { static_assert(std::is_pod<FixedWidthPODType>::value, "Iterator::extract requires a fixed-width type."); FixedWidthPODType extracted_value; FixedWidthPODType extracted_value{}; uint8_t* value_ptr = (uint8_t*)&extracted_value; for (size_t i = 0; i < sizeof(FixedWidthPODType); i++) { Loading
system/gd/packet/parser/fields/array_field.cc +1 −1 Original line number Diff line number Diff line Loading @@ -119,7 +119,7 @@ void ArrayField::GenGetter(std::ostream& s, Size start_offset, Size end_offset) s << "auto to_bound = begin();"; int num_leading_bits = GenBounds(s, start_offset, end_offset, GetSize()); s << GetDataType() << " " << GetName() << "_value;"; s << GetDataType() << " " << GetName() << "_value{};"; s << GetDataType() << "* " << GetName() << "_ptr = &" << GetName() << "_value;"; GenExtractor(s, num_leading_bits, false); Loading