Skip to content

Commit

Permalink
Remove a trivial sonar cloud 'issue'
Browse files Browse the repository at this point in the history
  • Loading branch information
woodfell committed Nov 23, 2023
1 parent 2b54f61 commit ee11ccf
Show file tree
Hide file tree
Showing 27 changed files with 630 additions and 995 deletions.
38 changes: 13 additions & 25 deletions c/src/acquisition.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ int sbp_msg_acq_result_cmp(const sbp_msg_acq_result_t *a,
}

ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid);
if (ret != 0) {
return ret;
}
return ret;
}

Expand Down Expand Up @@ -221,9 +218,6 @@ int sbp_msg_acq_result_dep_c_cmp(const sbp_msg_acq_result_dep_c_t *a,
}

ret = sbp_gnss_signal_dep_cmp(&a->sid, &b->sid);
if (ret != 0) {
return ret;
}
return ret;
}

Expand Down Expand Up @@ -327,9 +321,6 @@ int sbp_msg_acq_result_dep_b_cmp(const sbp_msg_acq_result_dep_b_t *a,
}

ret = sbp_gnss_signal_dep_cmp(&a->sid, &b->sid);
if (ret != 0) {
return ret;
}
return ret;
}

Expand Down Expand Up @@ -433,9 +424,6 @@ int sbp_msg_acq_result_dep_a_cmp(const sbp_msg_acq_result_dep_a_t *a,
}

ret = sbp_u8_cmp(&a->prn, &b->prn);
if (ret != 0) {
return ret;
}
return ret;
}

Expand Down Expand Up @@ -611,9 +599,6 @@ int sbp_acq_sv_profile_cmp(const sbp_acq_sv_profile_t *a,
}

ret = sbp_u32_cmp(&a->cp, &b->cp);
if (ret != 0) {
return ret;
}
return ret;
}

Expand Down Expand Up @@ -790,9 +775,6 @@ int sbp_acq_sv_profile_dep_cmp(const sbp_acq_sv_profile_dep_t *a,
}

ret = sbp_u32_cmp(&a->cp, &b->cp);
if (ret != 0) {
return ret;
}
return ret;
}

Expand Down Expand Up @@ -871,12 +853,15 @@ int sbp_msg_acq_sv_profile_cmp(const sbp_msg_acq_sv_profile_t *a,
int ret = 0;

ret = sbp_u8_cmp(&a->n_acq_sv_profile, &b->n_acq_sv_profile);
for (uint8_t i = 0; ret == 0 && i < a->n_acq_sv_profile; i++) {
ret = sbp_acq_sv_profile_cmp(&a->acq_sv_profile[i], &b->acq_sv_profile[i]);
}
if (ret != 0) {
return ret;
}
for (uint8_t i = 0; i < a->n_acq_sv_profile; i++) {
ret = sbp_acq_sv_profile_cmp(&a->acq_sv_profile[i], &b->acq_sv_profile[i]);
if (ret != 0) {
return ret;
}
}
return ret;
}

Expand Down Expand Up @@ -957,12 +942,15 @@ int sbp_msg_acq_sv_profile_dep_cmp(const sbp_msg_acq_sv_profile_dep_t *a,
int ret = 0;

ret = sbp_u8_cmp(&a->n_acq_sv_profile, &b->n_acq_sv_profile);
for (uint8_t i = 0; ret == 0 && i < a->n_acq_sv_profile; i++) {
ret = sbp_acq_sv_profile_dep_cmp(&a->acq_sv_profile[i],
&b->acq_sv_profile[i]);
}
if (ret != 0) {
return ret;
}
for (uint8_t i = 0; i < a->n_acq_sv_profile; i++) {
ret = sbp_acq_sv_profile_dep_cmp(&a->acq_sv_profile[i],
&b->acq_sv_profile[i]);
if (ret != 0) {
return ret;
}
}
return ret;
}
18 changes: 4 additions & 14 deletions c/src/bootload.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,6 @@ int sbp_msg_bootloader_handshake_resp_cmp(
}

ret = sbp_msg_bootloader_handshake_resp_version_strcmp(a, b);
if (ret != 0) {
return ret;
}
return ret;
}

Expand Down Expand Up @@ -338,9 +335,6 @@ int sbp_msg_bootloader_jump_to_app_cmp(
int ret = 0;

ret = sbp_u8_cmp(&a->jump, &b->jump);
if (ret != 0) {
return ret;
}
return ret;
}

Expand Down Expand Up @@ -482,12 +476,11 @@ int sbp_msg_nap_device_dna_resp_cmp(const sbp_msg_nap_device_dna_resp_t *a,
const sbp_msg_nap_device_dna_resp_t *b) {
int ret = 0;

for (uint8_t i = 0; ret == 0 && i < SBP_MSG_NAP_DEVICE_DNA_RESP_DNA_MAX;
i++) {
for (uint8_t i = 0; i < SBP_MSG_NAP_DEVICE_DNA_RESP_DNA_MAX; i++) {
ret = sbp_u8_cmp(&a->dna[i], &b->dna[i]);
}
if (ret != 0) {
return ret;
if (ret != 0) {
return ret;
}
}
return ret;
}
Expand Down Expand Up @@ -662,8 +655,5 @@ int sbp_msg_bootloader_handshake_dep_a_cmp(
int ret = 0;

ret = sbp_msg_bootloader_handshake_dep_a_handshake_strcmp(a, b);
if (ret != 0) {
return ret;
}
return ret;
}
3 changes: 0 additions & 3 deletions c/src/ext_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,5 @@ int sbp_msg_ext_event_cmp(const sbp_msg_ext_event_t *a,
}

ret = sbp_u8_cmp(&a->pin, &b->pin);
if (ret != 0) {
return ret;
}
return ret;
}
39 changes: 12 additions & 27 deletions c/src/file_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,6 @@ int sbp_msg_fileio_read_req_cmp(const sbp_msg_fileio_read_req_t *a,
}

ret = sbp_msg_fileio_read_req_filename_strcmp(a, b);
if (ret != 0) {
return ret;
}
return ret;
}

Expand Down Expand Up @@ -311,12 +308,15 @@ int sbp_msg_fileio_read_resp_cmp(const sbp_msg_fileio_read_resp_t *a,
}

ret = sbp_u8_cmp(&a->n_contents, &b->n_contents);
for (uint8_t i = 0; ret == 0 && i < a->n_contents; i++) {
ret = sbp_u8_cmp(&a->contents[i], &b->contents[i]);
}
if (ret != 0) {
return ret;
}
for (uint8_t i = 0; i < a->n_contents; i++) {
ret = sbp_u8_cmp(&a->contents[i], &b->contents[i]);
if (ret != 0) {
return ret;
}
}
return ret;
}

Expand Down Expand Up @@ -509,9 +509,6 @@ int sbp_msg_fileio_read_dir_req_cmp(const sbp_msg_fileio_read_dir_req_t *a,
}

ret = sbp_msg_fileio_read_dir_req_dirname_strcmp(a, b);
if (ret != 0) {
return ret;
}
return ret;
}

Expand Down Expand Up @@ -686,9 +683,6 @@ int sbp_msg_fileio_read_dir_resp_cmp(const sbp_msg_fileio_read_dir_resp_t *a,
}

ret = sbp_msg_fileio_read_dir_resp_contents_strcmp(a, b);
if (ret != 0) {
return ret;
}
return ret;
}

Expand Down Expand Up @@ -859,9 +853,6 @@ int sbp_msg_fileio_remove_cmp(const sbp_msg_fileio_remove_t *a,
int ret = 0;

ret = sbp_msg_fileio_remove_filename_strcmp(a, b);
if (ret != 0) {
return ret;
}
return ret;
}

Expand Down Expand Up @@ -1075,12 +1066,15 @@ int sbp_msg_fileio_write_req_cmp(const sbp_msg_fileio_write_req_t *a,
}

ret = sbp_u8_cmp(&a->n_data, &b->n_data);
for (uint8_t i = 0; ret == 0 && i < a->n_data; i++) {
ret = sbp_u8_cmp(&a->data[i], &b->data[i]);
}
if (ret != 0) {
return ret;
}
for (uint8_t i = 0; i < a->n_data; i++) {
ret = sbp_u8_cmp(&a->data[i], &b->data[i]);
if (ret != 0) {
return ret;
}
}
return ret;
}

Expand Down Expand Up @@ -1151,9 +1145,6 @@ int sbp_msg_fileio_write_resp_cmp(const sbp_msg_fileio_write_resp_t *a,
int ret = 0;

ret = sbp_u32_cmp(&a->sequence, &b->sequence);
if (ret != 0) {
return ret;
}
return ret;
}

Expand Down Expand Up @@ -1224,9 +1215,6 @@ int sbp_msg_fileio_config_req_cmp(const sbp_msg_fileio_config_req_t *a,
int ret = 0;

ret = sbp_u32_cmp(&a->sequence, &b->sequence);
if (ret != 0) {
return ret;
}
return ret;
}

Expand Down Expand Up @@ -1330,8 +1318,5 @@ int sbp_msg_fileio_config_resp_cmp(const sbp_msg_fileio_config_resp_t *a,
}

ret = sbp_u32_cmp(&a->fileio_version, &b->fileio_version);
if (ret != 0) {
return ret;
}
return ret;
}
Loading

0 comments on commit ee11ccf

Please sign in to comment.