Loading system/gd/packet/endian_inserter.h +3 −3 Original line number Diff line number Diff line Loading @@ -74,13 +74,13 @@ class EndianInserter { for (size_t i = 0; i < num_bits / 8; i++) { if (little_endian == true) { it.insert_byte(static_cast<uint8_t>(value >> (i * 8))); it.insert_byte(static_cast<uint8_t>(static_cast<uint64_t>(value) >> (i * 8))); } else { it.insert_byte(static_cast<uint8_t>(value >> (((num_bits / 8) - i - 1) * 8))); it.insert_byte(static_cast<uint8_t>(static_cast<uint64_t>(value) >> (((num_bits / 8) - i - 1) * 8))); } } if (num_bits % 8) { it.insert_bits(static_cast<uint8_t>(value >> ((num_bits / 8) * 8)), num_bits % 8); it.insert_bits(static_cast<uint8_t>(static_cast<uint64_t>(value) >> ((num_bits / 8) * 8)), num_bits % 8); } } Loading system/gd/packet/parser/fields/fixed_scalar_field.cc +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ void FixedScalarField::GenValue(std::ostream& s) const { } void FixedScalarField::GenStringRepresentation(std::ostream& s, std::string) const { s << "+" << value_; s << value_; } void FixedScalarField::GenRustWriter(std::ostream& s, Size start_offset, Size end_offset) const { Loading system/gd/packet/parser/fields/scalar_field.cc +4 −1 Original line number Diff line number Diff line Loading @@ -133,7 +133,10 @@ void ScalarField::GenValidator(std::ostream&) const { } void ScalarField::GenStringRepresentation(std::ostream& s, std::string accessor) const { s << "+" << accessor; // Generate a static_cast to uint64_t (largest supported field type) in order // to force hexadecimal formatting; uint8_t fields will be rendered as escaped // characters otherwise. s << "static_cast<uint64_t>(" << accessor << ")"; } std::string ScalarField::GetRustDataType() const { Loading Loading
system/gd/packet/endian_inserter.h +3 −3 Original line number Diff line number Diff line Loading @@ -74,13 +74,13 @@ class EndianInserter { for (size_t i = 0; i < num_bits / 8; i++) { if (little_endian == true) { it.insert_byte(static_cast<uint8_t>(value >> (i * 8))); it.insert_byte(static_cast<uint8_t>(static_cast<uint64_t>(value) >> (i * 8))); } else { it.insert_byte(static_cast<uint8_t>(value >> (((num_bits / 8) - i - 1) * 8))); it.insert_byte(static_cast<uint8_t>(static_cast<uint64_t>(value) >> (((num_bits / 8) - i - 1) * 8))); } } if (num_bits % 8) { it.insert_bits(static_cast<uint8_t>(value >> ((num_bits / 8) * 8)), num_bits % 8); it.insert_bits(static_cast<uint8_t>(static_cast<uint64_t>(value) >> ((num_bits / 8) * 8)), num_bits % 8); } } Loading
system/gd/packet/parser/fields/fixed_scalar_field.cc +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ void FixedScalarField::GenValue(std::ostream& s) const { } void FixedScalarField::GenStringRepresentation(std::ostream& s, std::string) const { s << "+" << value_; s << value_; } void FixedScalarField::GenRustWriter(std::ostream& s, Size start_offset, Size end_offset) const { Loading
system/gd/packet/parser/fields/scalar_field.cc +4 −1 Original line number Diff line number Diff line Loading @@ -133,7 +133,10 @@ void ScalarField::GenValidator(std::ostream&) const { } void ScalarField::GenStringRepresentation(std::ostream& s, std::string accessor) const { s << "+" << accessor; // Generate a static_cast to uint64_t (largest supported field type) in order // to force hexadecimal formatting; uint8_t fields will be rendered as escaped // characters otherwise. s << "static_cast<uint64_t>(" << accessor << ")"; } std::string ScalarField::GetRustDataType() const { Loading