@@ -387,10 +387,10 @@ constexpr
387
387
#endif
388
388
std::array<char , 3 > format_slot_number_impl (unsigned char number) {
389
389
return std::array<char , 3 >{
390
- number > 100
390
+ number >= 100
391
391
? dec_digit2char (number / 100 )
392
392
: ' 0' ,
393
- number > 10
393
+ number >= 10
394
394
? dec_digit2char ((number / 10 ) % 10 )
395
395
: ' 0' ,
396
396
number
@@ -1304,11 +1304,11 @@ unsigned char types_count[MAGNITUDE_MAX]{};
1304
1304
} // namespace internal
1305
1305
1306
1306
unsigned char instance_count_add (unsigned char id) {
1307
- return ++ internal::instance_count[id];
1307
+ return internal::instance_count[id]++ ;
1308
1308
}
1309
1309
1310
1310
unsigned char types_count_add (unsigned char type) {
1311
- return ++ internal::types_count[type];
1311
+ return internal::types_count[type]++ ;
1312
1312
}
1313
1313
1314
1314
unsigned char types_count (unsigned char type) {
@@ -1350,9 +1350,9 @@ String format_slot(const Magnitude& magnitude) {
1350
1350
const auto slot = make_slot (
1351
1351
SlotValues{
1352
1352
.id = magnitude.sensor ->id (),
1353
- .index = magnitude.slot_global ,
1353
+ .index = static_cast < unsigned char >( magnitude.slot_global + 1 ) ,
1354
1354
.type = magnitude.type ,
1355
- .slot = magnitude.slot ,
1355
+ .slot = static_cast < unsigned char >( magnitude.slot + 1 ) ,
1356
1356
});
1357
1357
1358
1358
const auto out = StringView (slot.data (), slot.size ());
0 commit comments