Merge pull request #116 from rgeissert/cppcheck-warnings
Cppcheck warnings fixes
This commit is contained in:
commit
162bf9d0b7
20
cprtests.c
20
cprtests.c
|
@ -163,7 +163,7 @@ static int testCPRGlobalAirborne() {
|
||||||
|| fabs(rlon - cprGlobalAirborneTests[i].even_rlon) > 1e-6) {
|
|| fabs(rlon - cprGlobalAirborneTests[i].even_rlon) > 1e-6) {
|
||||||
ok = 0;
|
ok = 0;
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"testCPRGlobalAirborne[%d,EVEN]: FAIL: decodeCPRairborne(%d,%d,%d,%d,EVEN) failed:\n"
|
"testCPRGlobalAirborne[%u,EVEN]: FAIL: decodeCPRairborne(%d,%d,%d,%d,EVEN) failed:\n"
|
||||||
" result %d (expected %d)\n"
|
" result %d (expected %d)\n"
|
||||||
" lat %.6f (expected %.6f)\n"
|
" lat %.6f (expected %.6f)\n"
|
||||||
" lon %.6f (expected %.6f)\n",
|
" lon %.6f (expected %.6f)\n",
|
||||||
|
@ -174,7 +174,7 @@ static int testCPRGlobalAirborne() {
|
||||||
rlat, cprGlobalAirborneTests[i].even_rlat,
|
rlat, cprGlobalAirborneTests[i].even_rlat,
|
||||||
rlon, cprGlobalAirborneTests[i].even_rlon);
|
rlon, cprGlobalAirborneTests[i].even_rlon);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "testCPRGlobalAirborne[%d,EVEN]: PASS\n", i);
|
fprintf(stderr, "testCPRGlobalAirborne[%u,EVEN]: PASS\n", i);
|
||||||
}
|
}
|
||||||
|
|
||||||
res = decodeCPRairborne(cprGlobalAirborneTests[i].even_cprlat, cprGlobalAirborneTests[i].even_cprlon,
|
res = decodeCPRairborne(cprGlobalAirborneTests[i].even_cprlat, cprGlobalAirborneTests[i].even_cprlon,
|
||||||
|
@ -186,7 +186,7 @@ static int testCPRGlobalAirborne() {
|
||||||
|| fabs(rlon - cprGlobalAirborneTests[i].odd_rlon) > 1e-6) {
|
|| fabs(rlon - cprGlobalAirborneTests[i].odd_rlon) > 1e-6) {
|
||||||
ok = 0;
|
ok = 0;
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"testCPRGlobalAirborne[%d,ODD]: FAIL: decodeCPRairborne(%d,%d,%d,%d,ODD) failed:\n"
|
"testCPRGlobalAirborne[%u,ODD]: FAIL: decodeCPRairborne(%d,%d,%d,%d,ODD) failed:\n"
|
||||||
" result %d (expected %d)\n"
|
" result %d (expected %d)\n"
|
||||||
" lat %.6f (expected %.6f)\n"
|
" lat %.6f (expected %.6f)\n"
|
||||||
" lon %.6f (expected %.6f)\n",
|
" lon %.6f (expected %.6f)\n",
|
||||||
|
@ -197,7 +197,7 @@ static int testCPRGlobalAirborne() {
|
||||||
rlat, cprGlobalAirborneTests[i].odd_rlat,
|
rlat, cprGlobalAirborneTests[i].odd_rlat,
|
||||||
rlon, cprGlobalAirborneTests[i].odd_rlon);
|
rlon, cprGlobalAirborneTests[i].odd_rlon);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "testCPRGlobalAirborne[%d,ODD]: PASS\n", i);
|
fprintf(stderr, "testCPRGlobalAirborne[%u,ODD]: PASS\n", i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@ static int testCPRGlobalSurface() {
|
||||||
|| fabs(rlon - cprGlobalSurfaceTests[i].even_rlon) > 1e-6) {
|
|| fabs(rlon - cprGlobalSurfaceTests[i].even_rlon) > 1e-6) {
|
||||||
ok = 0;
|
ok = 0;
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"testCPRGlobalSurface[%d,EVEN]: FAIL: decodeCPRsurface(%.6f,%.6f,%d,%d,%d,%d,EVEN) failed:\n"
|
"testCPRGlobalSurface[%u,EVEN]: FAIL: decodeCPRsurface(%.6f,%.6f,%d,%d,%d,%d,EVEN) failed:\n"
|
||||||
" result %d (expected %d)\n"
|
" result %d (expected %d)\n"
|
||||||
" lat %.6f (expected %.6f)\n"
|
" lat %.6f (expected %.6f)\n"
|
||||||
" lon %.6f (expected %.6f)\n",
|
" lon %.6f (expected %.6f)\n",
|
||||||
|
@ -233,7 +233,7 @@ static int testCPRGlobalSurface() {
|
||||||
rlat, cprGlobalSurfaceTests[i].even_rlat,
|
rlat, cprGlobalSurfaceTests[i].even_rlat,
|
||||||
rlon, cprGlobalSurfaceTests[i].even_rlon);
|
rlon, cprGlobalSurfaceTests[i].even_rlon);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "testCPRGlobalSurface[%d,EVEN]: PASS\n", i);
|
fprintf(stderr, "testCPRGlobalSurface[%u,EVEN]: PASS\n", i);
|
||||||
}
|
}
|
||||||
|
|
||||||
res = decodeCPRsurface(cprGlobalSurfaceTests[i].reflat, cprGlobalSurfaceTests[i].reflon,
|
res = decodeCPRsurface(cprGlobalSurfaceTests[i].reflat, cprGlobalSurfaceTests[i].reflon,
|
||||||
|
@ -246,7 +246,7 @@ static int testCPRGlobalSurface() {
|
||||||
|| fabs(rlon - cprGlobalSurfaceTests[i].odd_rlon) > 1e-6) {
|
|| fabs(rlon - cprGlobalSurfaceTests[i].odd_rlon) > 1e-6) {
|
||||||
ok = 0;
|
ok = 0;
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"testCPRGlobalSurface[%d,ODD]: FAIL: decodeCPRsurface(%.6f,%.6f,%d,%d,%d,%d,ODD) failed:\n"
|
"testCPRGlobalSurface[%u,ODD]: FAIL: decodeCPRsurface(%.6f,%.6f,%d,%d,%d,%d,ODD) failed:\n"
|
||||||
" result %d (expected %d)\n"
|
" result %d (expected %d)\n"
|
||||||
" lat %.6f (expected %.6f)\n"
|
" lat %.6f (expected %.6f)\n"
|
||||||
" lon %.6f (expected %.6f)\n",
|
" lon %.6f (expected %.6f)\n",
|
||||||
|
@ -258,7 +258,7 @@ static int testCPRGlobalSurface() {
|
||||||
rlat, cprGlobalSurfaceTests[i].odd_rlat,
|
rlat, cprGlobalSurfaceTests[i].odd_rlat,
|
||||||
rlon, cprGlobalSurfaceTests[i].odd_rlon);
|
rlon, cprGlobalSurfaceTests[i].odd_rlon);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "testCPRGlobalSurface[%d,ODD]: PASS\n", i);
|
fprintf(stderr, "testCPRGlobalSurface[%u,ODD]: PASS\n", i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ static int testCPRRelative() {
|
||||||
|| fabs(rlon - cprRelativeTests[i].rlon) > 1e-6) {
|
|| fabs(rlon - cprRelativeTests[i].rlon) > 1e-6) {
|
||||||
ok = 0;
|
ok = 0;
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"testCPRRelative[%d]: FAIL: decodeCPRrelative(%.6f,%.6f,%d,%d,%d,%d) failed:\n"
|
"testCPRRelative[%u]: FAIL: decodeCPRrelative(%.6f,%.6f,%d,%d,%d,%d) failed:\n"
|
||||||
" result %d (expected %d)\n"
|
" result %d (expected %d)\n"
|
||||||
" lat %.6f (expected %.6f)\n"
|
" lat %.6f (expected %.6f)\n"
|
||||||
" lon %.6f (expected %.6f)\n",
|
" lon %.6f (expected %.6f)\n",
|
||||||
|
@ -293,7 +293,7 @@ static int testCPRRelative() {
|
||||||
rlat, cprRelativeTests[i].rlat,
|
rlat, cprRelativeTests[i].rlat,
|
||||||
rlon, cprRelativeTests[i].rlon);
|
rlon, cprRelativeTests[i].rlon);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "testCPRRelative[%d]: PASS\n", i);
|
fprintf(stderr, "testCPRRelative[%u]: PASS\n", i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
mode_s.c
2
mode_s.c
|
@ -1141,7 +1141,7 @@ void displayModesMessage(struct modesMessage *mm) {
|
||||||
if (mm->timestampMsg == MAGIC_MLAT_TIMESTAMP)
|
if (mm->timestampMsg == MAGIC_MLAT_TIMESTAMP)
|
||||||
printf("This is a synthetic MLAT message.\n");
|
printf("This is a synthetic MLAT message.\n");
|
||||||
else
|
else
|
||||||
printf("Time: %.2fus (phase: %d)\n", mm->timestampMsg / 12.0, (unsigned int) (360 * (mm->timestampMsg % 6) / 6));
|
printf("Time: %.2fus (phase: %u)\n", mm->timestampMsg / 12.0, (unsigned int) (360 * (mm->timestampMsg % 6) / 6));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mm->msgtype == 0) { // DF 0
|
if (mm->msgtype == 0) { // DF 0
|
||||||
|
|
Loading…
Reference in a new issue