Skip to content

Commit 875007c

Browse files
authored
Merge pull request #590 from elbeno/work-around-the-____ing-parser-bug
2 parents c8da90d + f36cb71 commit 875007c

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

include/log/catalog/mipi_encoder.hpp

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,31 @@ template <typename S> constexpr auto to_module() {
5151
namespace logging::mipi {
5252
namespace defn {
5353
using msg::at;
54+
using msg::dword_index_t;
5455
using msg::field;
5556
using msg::message;
56-
using msg::operator""_dw;
5757
using msg::operator""_msb;
5858
using msg::operator""_lsb;
5959

6060
enum struct type : uint8_t { Build = 0, Short32 = 1, Catalog = 3 };
6161
enum struct build_subtype : uint8_t { Compact32 = 0, Compact64 = 1, Long = 2 };
6262
enum struct catalog_subtype : uint8_t { Id32_Pack32 = 1 };
6363

64-
using type_f = field<"type", type>::located<at{0_dw, 3_msb, 0_lsb}>;
65-
using opt_len_f = field<"opt_len", bool>::located<at{0_dw, 9_msb, 9_lsb}>;
64+
using type_f = field<"type", type>::located<at{dword_index_t{0}, 3_msb, 0_lsb}>;
65+
using opt_len_f =
66+
field<"opt_len", bool>::located<at{dword_index_t{0}, 9_msb, 9_lsb}>;
6667
using payload_len_f =
67-
field<"payload_len", std::uint16_t>::located<at{1_dw, 15_msb, 0_lsb}>;
68+
field<"payload_len",
69+
std::uint16_t>::located<at{dword_index_t{1}, 15_msb, 0_lsb}>;
6870

6971
using build_subtype_f =
70-
field<"subtype", build_subtype>::located<at{0_dw, 29_msb, 24_lsb}>;
71-
using compact32_build_id_f =
72-
field<"build_id", std::uint32_t>::located<at{0_dw, 31_msb, 30_lsb},
73-
at{0_dw, 23_msb, 4_lsb}>;
72+
field<"subtype",
73+
build_subtype>::located<at{dword_index_t{0}, 29_msb, 24_lsb}>;
74+
using compact32_build_id_f = field<"build_id", std::uint32_t>::located<
75+
at{dword_index_t{0}, 31_msb, 30_lsb}, at{dword_index_t{0}, 23_msb, 4_lsb}>;
7476
using compact64_build_id_f = field<"build_id", std::uint64_t>::located<
75-
at{1_dw, 31_msb, 0_lsb}, at{0_dw, 31_msb, 30_lsb}, at{0_dw, 23_msb, 4_lsb}>;
77+
at{dword_index_t{1}, 31_msb, 0_lsb}, at{dword_index_t{0}, 31_msb, 30_lsb},
78+
at{dword_index_t{0}, 23_msb, 4_lsb}>;
7679

7780
using normal_build_msg_t =
7881
message<"normal_build", type_f::with_required<type::Build>,
@@ -88,16 +91,19 @@ using compact64_build_msg_t =
8891
compact64_build_id_f>;
8992

9093
using short32_payload_f =
91-
field<"payload", std::uint32_t>::located<at{0_dw, 31_msb, 4_lsb}>;
94+
field<"payload",
95+
std::uint32_t>::located<at{dword_index_t{0}, 31_msb, 4_lsb}>;
9296
using short32_msg_t =
9397
message<"short32", type_f::with_required<type::Short32>, short32_payload_f>;
9498

9599
using catalog_subtype_f =
96-
field<"subtype", catalog_subtype>::located<at{0_dw, 29_msb, 24_lsb}>;
97-
using severity_f =
98-
field<"severity", std::uint8_t>::located<at{0_dw, 6_msb, 4_lsb}>;
100+
field<"subtype",
101+
catalog_subtype>::located<at{dword_index_t{0}, 29_msb, 24_lsb}>;
102+
using severity_f = field<"severity", std::uint8_t>::located<at{dword_index_t{0},
103+
6_msb, 4_lsb}>;
99104
using module_id_f =
100-
field<"module_id", std::uint8_t>::located<at{0_dw, 22_msb, 16_lsb}>;
105+
field<"module_id",
106+
std::uint8_t>::located<at{dword_index_t{0}, 22_msb, 16_lsb}>;
101107

102108
using catalog_msg_t =
103109
message<"catalog", type_f::with_required<type::Catalog>, severity_f,

0 commit comments

Comments
 (0)