Berry fix walrus operator (#22685)

This commit is contained in:
s-hadinger 2024-12-19 21:46:16 +01:00 committed by GitHub
parent af724a6149
commit fde529fac4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 10 deletions

View File

@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file.
### Fixed
- Berry Zigbee fix wrong attributes (#22684)
- Berry fix walrus operator
### Removed

View File

@ -716,6 +716,8 @@ int be_code_setvar(bfuncinfo *finfo, bexpdesc *e1, bexpdesc *e2, bbool keep_reg)
free_expreg(finfo, e2); /* free source (checks only ETREG) */
*e2 = *e1; /* now e2 is e1 ETLOCAL */
}
} else {
*e2 = *e1; /* ETLOCAL wins over ETREG */
}
break;
case ETGLOBAL: /* store to grobal R(A) -> G(Bx) by global index */

View File

@ -205,13 +205,11 @@ class zcl_attribute_list : zcl_attribute_list_ntv
var v
# shortaddr
v = self.shortaddr
if v != nil
if (v := self.shortaddr) != nil
items.push(f'"Device":"0x{v:04X}"')
end
# groupaddr
v = self.groupaddr
if v != nil
if (v := self.groupaddr) != nil
items.push(f'"Group":"0x{v:04X}"')
end
@ -225,15 +223,13 @@ class zcl_attribute_list : zcl_attribute_list_ntv
end
# Endpoint
v = self.src_ep
if v != nil
if (v := self.src_ep) != nil
items.push(f'"Endpoint":{v}')
end
# LQI
v := self.lqi
if v != nil
items.push(f'"LinkQuality":{v:i}')
if (v := self.lqi) != nil
items.push(f'"LinkQuality":{v}')
end
var s = "{" + items.concat(",") + "}"

View File

@ -553,7 +553,7 @@ static const bvalue be_ktab_class_zcl_attribute_list[27] = {
/* K19 */ be_nested_str_weak(tostring),
/* K20 */ be_const_int(1),
/* K21 */ be_nested_str_weak(_X22Endpoint_X22_X3A_X25s),
/* K22 */ be_nested_str_weak(_X22LinkQuality_X22_X3A_X25i),
/* K22 */ be_nested_str_weak(_X22LinkQuality_X22_X3A_X25s),
/* K23 */ be_nested_str_weak(_X7B),
/* K24 */ be_nested_str_weak(concat),
/* K25 */ be_nested_str_weak(_X2C),