Skip to content

Commit

Permalink
More explicit casting, removed 64-bit overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Jan 15, 2025
1 parent cc4583e commit ff84571
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/app/AttributeValueEncoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ class AttributeValueEncoder
// - we should figure where the extra const override is used
// - we should try to avoid having such footguns. This list template-explosion seems
// dangerous for flash.
inline CHIP_ERROR Encode(uint64_t const & aArg) const { return Encode((uint64_t) aArg); }
inline CHIP_ERROR Encode(uint64_t & aArg) const { return Encode((uint64_t) aArg); }
inline CHIP_ERROR Encode(uint32_t const & aArg) const { return Encode((uint32_t) aArg); }
inline CHIP_ERROR Encode(uint32_t & aArg) const { return Encode((uint32_t) aArg); }
inline CHIP_ERROR Encode(uint16_t const & aArg) const { return Encode((uint16_t) aArg); }
inline CHIP_ERROR Encode(uint16_t & aArg) const { return Encode((uint16_t) aArg); }
inline CHIP_ERROR Encode(uint8_t const & aArg) const { return Encode((uint8_t) aArg); }
inline CHIP_ERROR Encode(uint8_t & aArg) const { return Encode((uint8_t) aArg); }
//
// This relies on TLV numbers always being encoded as 64-bit value
inline CHIP_ERROR Encode(uint32_t const & aArg) const { return Encode<uint64_t>(aArg); }
inline CHIP_ERROR Encode(uint32_t & aArg) const { return Encode<uint64_t>(aArg); }
inline CHIP_ERROR Encode(uint16_t const & aArg) const { return Encode<uint64_t>(aArg); }
inline CHIP_ERROR Encode(uint16_t & aArg) const { return Encode<uint64_t>(aArg); }
inline CHIP_ERROR Encode(uint8_t const & aArg) const { return Encode<uint64_t>(aArg); }
inline CHIP_ERROR Encode(uint8_t & aArg) const { return Encode<uint64_t>(aArg); }

private:
AttributeValueEncoder & mAttributeValueEncoder;
Expand Down

0 comments on commit ff84571

Please sign in to comment.