comparison src/sys/x11/settings.cc @ 353:2f094656e775

sys/x11/settings: misc fixups
author Paper <paper@paper.us.eu.org>
date Sun, 14 Jul 2024 23:27:43 -0400
parents c844f8bb87ce
children 9aaf1e788896
comparison
equal deleted inserted replaced
352:a0e96f50bcce 353:2f094656e775
91 std::uint8_t *bytes_ = nullptr; 91 std::uint8_t *bytes_ = nullptr;
92 std::size_t offset_ = 0; 92 std::size_t offset_ = 0;
93 std::size_t size_ = 0; 93 std::size_t size_ = 0;
94 94
95 /* parsed in the constructor */ 95 /* parsed in the constructor */
96 std::uint8_t byte_order_ = 0; /* unused */ 96 std::uint8_t byte_order_ = 0;
97 std::uint32_t serial_ = 0; 97 std::uint32_t serial_ = 0;
98 std::uint32_t total_items_ = 0; 98 std::uint32_t total_items_ = 0;
99 }; 99 };
100 100
101 std::uint32_t Parser::GetTotalItems(void) { 101 std::uint32_t Parser::GetTotalItems(void) {
121 121
122 Parser::Parser(std::uint8_t *bytes, std::size_t size) { 122 Parser::Parser(std::uint8_t *bytes, std::size_t size) {
123 bytes_ = bytes; 123 bytes_ = bytes;
124 size_ = size; 124 size_ = size;
125 125
126 /* unused for now... don't know what the values are! :)
127 * assuming host byte order */
128 if (!ReadData<std::uint8_t>(byte_order_)) 126 if (!ReadData<std::uint8_t>(byte_order_))
129 return; 127 return;
130 128
131 Advance(3); 129 Advance(3);
132 130
133 if (!ReadData<std::uint32_t>(serial_)) 131 if (!ReadInt<std::uint32_t>(serial_))
134 return; 132 return;
135 133
136 if (!ReadData<std::uint32_t>(total_items_)) 134 if (!ReadInt<std::uint32_t>(total_items_))
137 return; 135 return;
138 } 136 }
139 137
140 std::optional<SettingsItem> Parser::ParseNextItem(void) { 138 std::optional<SettingsItem> Parser::ParseNextItem(void) {
141 SettingsItem item; 139 SettingsItem item;