remove all occurance of specifying endianness inside BitField

This commit it automatically generated by command in zsh:
sed -i -- 's/BitField<\(.*\)_le>/BitField<\1>/g' **/*(D.)

BitField is now aware to endianness and default to little endian. It expects a value representation type without storage specification for its template parameter.
This commit is contained in:
Weiyi Wang 2019-01-25 12:26:47 -05:00
parent 055b9513a3
commit 104829ae58
7 changed files with 99 additions and 99 deletions

View file

@ -19,9 +19,9 @@ namespace Service::IR {
struct ExtraHIDResponse {
union {
BitField<0, 8, u32_le> header;
BitField<8, 12, u32_le> c_stick_x;
BitField<20, 12, u32_le> c_stick_y;
BitField<0, 8, u32> header;
BitField<8, 12, u32> c_stick_x;
BitField<20, 12, u32> c_stick_y;
} c_stick;
union {
BitField<0, 5, u8> battery_level;

View file

@ -27,13 +27,13 @@ namespace Service::IR {
union PadState {
u32_le hex{};
BitField<14, 1, u32_le> zl;
BitField<15, 1, u32_le> zr;
BitField<14, 1, u32> zl;
BitField<15, 1, u32> zr;
BitField<24, 1, u32_le> c_stick_right;
BitField<25, 1, u32_le> c_stick_left;
BitField<26, 1, u32_le> c_stick_up;
BitField<27, 1, u32_le> c_stick_down;
BitField<24, 1, u32> c_stick_right;
BitField<25, 1, u32> c_stick_left;
BitField<26, 1, u32> c_stick_up;
BitField<27, 1, u32> c_stick_down;
};
/// Interface to "ir:rst" service

View file

@ -231,8 +231,8 @@ private:
*/
union SegmentTag {
u32_le raw;
BitField<0, 4, u32_le> segment_index;
BitField<4, 28, u32_le> offset_into_segment;
BitField<0, 4, u32> segment_index;
BitField<4, 28, u32> offset_into_segment;
SegmentTag() = default;
explicit SegmentTag(u32 raw_) : raw(raw_) {}
@ -270,8 +270,8 @@ private:
u16_le test_bit; // bit address into the name to test
union Child {
u16_le raw;
BitField<0, 15, u16_le> next_index;
BitField<15, 1, u16_le> is_end;
BitField<0, 15, u16> next_index;
BitField<15, 1, u16> is_end;
} left, right;
u16_le export_table_index; // index of an ExportNamedSymbolEntry