mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-15 08:50:34 +08:00
CI: enable clang-tidy bugprone-assignment-in-if-condition (#26580)
* docs: auto-sync metadata [skip ci] Co-Authored-By: PX4 BuildBot <bot@px4.io> CI: enable clang-tidy bugprone-assignment-in-if-condition Signed-off-by: kuralme <kuralme@protonmail.com> initialize and immediate assignments made one line Signed-off-by: kuralme <kuralme@protonmail.com> * two more initialization fix Signed-off-by: kuralme <kuralme@protonmail.com> --------- Signed-off-by: kuralme <kuralme@protonmail.com> Co-authored-by: PX4BuildBot <bot@px4.io>
This commit is contained in:
@@ -170,7 +170,9 @@ int MspV1::Receive(uint8_t *payload, uint8_t *message_id)
|
||||
}
|
||||
|
||||
while (bytes_available > 4) {
|
||||
if ((ret = read(_fd, header, 1)) != 1) {
|
||||
ret = read(_fd, header, 1);
|
||||
|
||||
if (ret != 1) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -186,7 +188,9 @@ int MspV1::Receive(uint8_t *payload, uint8_t *message_id)
|
||||
return -EWOULDBLOCK;
|
||||
}
|
||||
|
||||
if ((ret = read(_fd, &header[1], 4)) != 4) {
|
||||
ret = read(_fd, &header[1], 4);
|
||||
|
||||
if (ret != 4) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -198,7 +202,9 @@ int MspV1::Receive(uint8_t *payload, uint8_t *message_id)
|
||||
payload_size = header[3];
|
||||
*message_id = header[4];
|
||||
|
||||
if ((ret = read(_fd, payload, payload_size + MSP_CRC_SIZE)) != payload_size + MSP_CRC_SIZE) {
|
||||
ret = read(_fd, payload, payload_size + MSP_CRC_SIZE);
|
||||
|
||||
if (ret != payload_size + MSP_CRC_SIZE) {
|
||||
if (ret != -EWOULDBLOCK) {
|
||||
has_header = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user