Loading system/gd/l2cap/fcs.cc +6 −6 Original line number Diff line number Diff line Loading @@ -44,16 +44,16 @@ static const uint16_t crctab[256] = { namespace bluetooth { namespace l2cap { void Fcs::Initialize(Fcs& s) { s.crc = 0; void Fcs::Initialize() { crc = 0; } void Fcs::AddByte(Fcs& s, uint8_t byte) { s.crc = ((s.crc >> 8) & 0x00ff) ^ crctab[(s.crc & 0x00ff) ^ byte]; void Fcs::AddByte(uint8_t byte) { crc = ((crc >> 8) & 0x00ff) ^ crctab[(crc & 0x00ff) ^ byte]; } uint16_t Fcs::GetChecksum(const Fcs& s) { return s.crc; uint16_t Fcs::GetChecksum() const { return crc; } } // namespace l2cap Loading system/gd/l2cap/fcs.h +3 −3 Original line number Diff line number Diff line Loading @@ -24,11 +24,11 @@ namespace l2cap { // Frame Check Sequence from the L2CAP spec. class Fcs { public: static void Initialize(Fcs& s); void Initialize(); static void AddByte(Fcs& s, uint8_t byte); void AddByte(uint8_t byte); static uint16_t GetChecksum(const Fcs& s); uint16_t GetChecksum() const; private: uint16_t crc; Loading system/gd/packet/parser/checksum_type_checker.h +3 −3 Original line number Diff line number Diff line Loading @@ -28,13 +28,13 @@ namespace parser { template <typename T, typename TRET> class ChecksumTypeChecker { public: template <class C, void (*)(C&)> template <class C, void (C::*)()> struct InitializeChecker {}; template <class C, void (*)(C&, uint8_t byte)> template <class C, void (C::*)(uint8_t byte)> struct AddByteChecker {}; template <class C, typename CRET, CRET (*)(const C&)> template <class C, typename CRET, CRET (C::*)() const> struct GetChecksumChecker {}; // If all the methods are defined, this one matches Loading system/gd/packet/custom_type_checker.h→system/gd/packet/parser/custom_type_checker.h +5 −5 Original line number Diff line number Diff line Loading @@ -23,14 +23,14 @@ namespace bluetooth { namespace packet { // Checks a custom type has all the necessary static functions with the correct signatures. // Checks a custom type has all the necessary functions with the correct signatures. template <typename T> class CustomTypeChecker { public: template <class C, void (*)(const C&, BitInserter&)> template <class C, void (C::*)(BitInserter&) const> struct SerializeChecker {}; template <class C, size_t (*)(const C&)> template <class C, size_t (C::*)() const> struct SizeChecker {}; template <class C, Iterator<true> (*)(std::vector<C>& vec, Iterator<true> it)> Loading @@ -40,10 +40,10 @@ class CustomTypeChecker { struct ParseCheckerBigEndian {}; template <class C> static int Test(SerializeChecker<C, &C::Serialize>*, SizeChecker<C, &C::Size>*, ParseChecker<C, &C::Parse>*); static int Test(SerializeChecker<C, &C::Serialize>*, SizeChecker<C, &C::size>*, ParseChecker<C, &C::Parse>*); template <class C> static int Test(SerializeChecker<C, &C::Serialize>*, SizeChecker<C, &C::Size>*, ParseCheckerBigEndian<C, &C::Parse>*); static int Test(SerializeChecker<C, &C::Serialize>*, SizeChecker<C, &C::size>*, ParseCheckerBigEndian<C, &C::Parse>*); template <class C> static char Test(...); Loading system/gd/packet/parser/fields/array_field.cc +1 −1 Original line number Diff line number Diff line Loading @@ -192,7 +192,7 @@ void ArrayField::GenInserter(std::ostream& s) const { s << "insert(static_cast<" << util::GetTypeForSize(type_def_->size_) << ">(val), i, " << type_def_->size_ << ");"; } else if (IsCustomFieldArray()) { if (type_def_->size_ == -1) { s << type_def_->name_ << "::Serialize(val, i);"; s << "val.Serialize(i);"; } else { s << "insert(val, i);"; } Loading Loading
system/gd/l2cap/fcs.cc +6 −6 Original line number Diff line number Diff line Loading @@ -44,16 +44,16 @@ static const uint16_t crctab[256] = { namespace bluetooth { namespace l2cap { void Fcs::Initialize(Fcs& s) { s.crc = 0; void Fcs::Initialize() { crc = 0; } void Fcs::AddByte(Fcs& s, uint8_t byte) { s.crc = ((s.crc >> 8) & 0x00ff) ^ crctab[(s.crc & 0x00ff) ^ byte]; void Fcs::AddByte(uint8_t byte) { crc = ((crc >> 8) & 0x00ff) ^ crctab[(crc & 0x00ff) ^ byte]; } uint16_t Fcs::GetChecksum(const Fcs& s) { return s.crc; uint16_t Fcs::GetChecksum() const { return crc; } } // namespace l2cap Loading
system/gd/l2cap/fcs.h +3 −3 Original line number Diff line number Diff line Loading @@ -24,11 +24,11 @@ namespace l2cap { // Frame Check Sequence from the L2CAP spec. class Fcs { public: static void Initialize(Fcs& s); void Initialize(); static void AddByte(Fcs& s, uint8_t byte); void AddByte(uint8_t byte); static uint16_t GetChecksum(const Fcs& s); uint16_t GetChecksum() const; private: uint16_t crc; Loading
system/gd/packet/parser/checksum_type_checker.h +3 −3 Original line number Diff line number Diff line Loading @@ -28,13 +28,13 @@ namespace parser { template <typename T, typename TRET> class ChecksumTypeChecker { public: template <class C, void (*)(C&)> template <class C, void (C::*)()> struct InitializeChecker {}; template <class C, void (*)(C&, uint8_t byte)> template <class C, void (C::*)(uint8_t byte)> struct AddByteChecker {}; template <class C, typename CRET, CRET (*)(const C&)> template <class C, typename CRET, CRET (C::*)() const> struct GetChecksumChecker {}; // If all the methods are defined, this one matches Loading
system/gd/packet/custom_type_checker.h→system/gd/packet/parser/custom_type_checker.h +5 −5 Original line number Diff line number Diff line Loading @@ -23,14 +23,14 @@ namespace bluetooth { namespace packet { // Checks a custom type has all the necessary static functions with the correct signatures. // Checks a custom type has all the necessary functions with the correct signatures. template <typename T> class CustomTypeChecker { public: template <class C, void (*)(const C&, BitInserter&)> template <class C, void (C::*)(BitInserter&) const> struct SerializeChecker {}; template <class C, size_t (*)(const C&)> template <class C, size_t (C::*)() const> struct SizeChecker {}; template <class C, Iterator<true> (*)(std::vector<C>& vec, Iterator<true> it)> Loading @@ -40,10 +40,10 @@ class CustomTypeChecker { struct ParseCheckerBigEndian {}; template <class C> static int Test(SerializeChecker<C, &C::Serialize>*, SizeChecker<C, &C::Size>*, ParseChecker<C, &C::Parse>*); static int Test(SerializeChecker<C, &C::Serialize>*, SizeChecker<C, &C::size>*, ParseChecker<C, &C::Parse>*); template <class C> static int Test(SerializeChecker<C, &C::Serialize>*, SizeChecker<C, &C::Size>*, ParseCheckerBigEndian<C, &C::Parse>*); static int Test(SerializeChecker<C, &C::Serialize>*, SizeChecker<C, &C::size>*, ParseCheckerBigEndian<C, &C::Parse>*); template <class C> static char Test(...); Loading
system/gd/packet/parser/fields/array_field.cc +1 −1 Original line number Diff line number Diff line Loading @@ -192,7 +192,7 @@ void ArrayField::GenInserter(std::ostream& s) const { s << "insert(static_cast<" << util::GetTypeForSize(type_def_->size_) << ">(val), i, " << type_def_->size_ << ");"; } else if (IsCustomFieldArray()) { if (type_def_->size_ == -1) { s << type_def_->name_ << "::Serialize(val, i);"; s << "val.Serialize(i);"; } else { s << "insert(val, i);"; } Loading