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:
Peter Duerr 2017-08-07 15:36:52 +02:00 committed by Lorenz Meier
parent cc1b766824
commit 7cf2a49948
1 changed files with 4 additions and 4 deletions

View File

@ -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;