Skip to content
This repository was archived by the owner on Apr 13, 2021. It is now read-only.

Commit 53d9f31

Browse files
author
Dmitry Tatarinov
committed
Add more corrections per review
1 parent 9c9fea3 commit 53d9f31

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/nav_msg_glo.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818
#include <libswiftnav/logging.h>
1919
#include <libswiftnav/bits.h>
2020

21-
#ifdef UNIT_TEST
22-
#undef log_error
23-
#define log_error(...)
24-
#endif
25-
2621
/* Word Ft (accuracy of measurements), refer to GLO ICD, Table 4.4 */
2722
const float f_t[] = { 1.0f, 2.0f, 2.5f, 4.0f, 5.0f, 7.0f, 10.0f, 12.0f, 14.0f,
2823
16.0f, 32.0f, 64.0f, 128.0f, 256.0f, 512.0f, -1.0f };
@@ -107,12 +102,12 @@ s8 error_detection_glo(const nav_msg_glo_t *n)
107102

108103
return 0; /* The string is good */
109104

110-
else if ((bit_set > 0 && !c_sum)
105+
if ((bit_set > 0 && !c_sum)
111106
|| (0 == bit_set && c_sum)) /* case c) from ICD */
112107

113108
return -1; /* multiple errors, bad string */
114109

115-
else if (bit_set > 1 && c_sum) { /* case b) from ICD */
110+
if (bit_set > 1 && c_sum) { /* case b) from ICD */
116111

117112
u8 i_corr = (c & 0x7f) + 8 - k; /* define number of bit to be corrected */
118113

tests/check_glo_decoder.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
1111
*/
1212
//#define DEBUG 1
13-
#define UNIT_TEST
1413

1514
#include <stdio.h>
1615
#include <check.h>
1716
#include <math.h>
1817
#include <string.h>
19-
#include <nav_msg_glo.c>
2018
#include <libswiftnav/logging.h>
19+
#undef log_error
20+
#define log_error(...)
21+
#include <nav_msg_glo.c>
2122

2223
nav_msg_glo_t n;
2324
ephemeris_t e;

0 commit comments

Comments
 (0)