mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 12:58:52 +08:00
Cosmetic fix (silencing cppcheck)
* For some reason cppcheck complains with `fp != nullptr` but accepts truthiness
of handle by itself.
* Note that the expressions are equivalent according to the C++ standard ("A
prvalue of arithmetic, unscoped enumeration, pointer, or pointer to member
type can be converted to a prvalue of type bool. A zero value, null pointer
value, or null member pointer value is converted to false; any other value is
converted to true. A prvalue of type std::nullptr_t can be converted to a
prvalue of type bool; the resulting value is false.")
This commit is contained in:
committed by
Lorenz Meier
parent
cc1b766824
commit
7cf2a49948
@@ -62,7 +62,7 @@ bool RCTest::dsmTest(const char *filepath, unsigned expected_chancount, unsigned
|
||||
FILE *fp;
|
||||
fp = fopen(filepath, "rt");
|
||||
|
||||
ut_test(fp != nullptr);
|
||||
ut_test(fp);
|
||||
//PX4_INFO("loading data from: %s", filepath);
|
||||
|
||||
float f;
|
||||
@@ -138,7 +138,7 @@ bool RCTest::sbus2Test()
|
||||
FILE *fp;
|
||||
fp = fopen(filepath, "rt");
|
||||
|
||||
ut_test(fp != nullptr);
|
||||
ut_test(fp);
|
||||
//warnx("loading data from: %s", filepath);
|
||||
|
||||
// if (argc < 2)
|
||||
@@ -221,7 +221,7 @@ bool RCTest::st24Test()
|
||||
FILE *fp;
|
||||
|
||||
fp = fopen(filepath, "rt");
|
||||
ut_test(fp != nullptr);
|
||||
ut_test(fp);
|
||||
|
||||
float f;
|
||||
unsigned x;
|
||||
@@ -282,7 +282,7 @@ bool RCTest::sumdTest()
|
||||
FILE *fp;
|
||||
|
||||
fp = fopen(filepath, "rt");
|
||||
ut_test(fp != nullptr);
|
||||
ut_test(fp);
|
||||
|
||||
float f;
|
||||
unsigned x;
|
||||
|
||||
Reference in New Issue
Block a user