From ac1ebfefadb922ee72431605e6ba5a8685039727 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Fri, 10 Apr 2020 22:13:13 +0200 Subject: [PATCH] minor fixes --- README.md | 2 +- examples/calculator.cpp | 2 +- src/foptiattr.cpp | 26 +++++++++++++------------- test/fstring-test.cpp | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 74c793ef..c5eddc73 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ The calculator example in newfont mode: Benchmark --------- -Here you can find a test for ![measuring the character speed](doc/benchmark.md#benchmark) in the terminal. +Here you can find a test for [measuring the character speed](doc/benchmark.md#benchmark) in the terminal. Virtual terminal diff --git a/examples/calculator.cpp b/examples/calculator.cpp index d1981ab7..5d099862 100644 --- a/examples/calculator.cpp +++ b/examples/calculator.cpp @@ -999,7 +999,7 @@ void Calc::onKeyPress (finalcut::FKeyEvent* ev) else { input = input.left(input.getLength() - 1); - x = lDouble(std::atof(input.c_str())); + x = std::strtold(input.c_str(), nullptr); } drawDispay(); diff --git a/src/foptiattr.cpp b/src/foptiattr.cpp index c55cf9e1..bcdb2d91 100644 --- a/src/foptiattr.cpp +++ b/src/foptiattr.cpp @@ -1195,19 +1195,19 @@ bool FOptiAttr::hasAttribute (const FChar* const& attr) { if ( attr ) { - return attr->attr.bit.bold == 1 - || attr->attr.bit.dim == 1 - || attr->attr.bit.italic == 1 - || attr->attr.bit.underline == 1 - || attr->attr.bit.blink == 1 - || attr->attr.bit.reverse == 1 - || attr->attr.bit.standout == 1 - || attr->attr.bit.invisible == 1 - || attr->attr.bit.protect == 1 - || attr->attr.bit.crossed_out == 1 - || attr->attr.bit.dbl_underline == 1 - || attr->attr.bit.alt_charset == 1 - || attr->attr.bit.pc_charset == 1; + return attr->attr.bit.bold + || attr->attr.bit.dim + || attr->attr.bit.italic + || attr->attr.bit.underline + || attr->attr.bit.blink + || attr->attr.bit.reverse + || attr->attr.bit.standout + || attr->attr.bit.invisible + || attr->attr.bit.protect + || attr->attr.bit.crossed_out + || attr->attr.bit.dbl_underline + || attr->attr.bit.alt_charset + || attr->attr.bit.pc_charset; } return false; diff --git a/test/fstring-test.cpp b/test/fstring-test.cpp index 96b5952d..6641f289 100644 --- a/test/fstring-test.cpp +++ b/test/fstring-test.cpp @@ -992,11 +992,11 @@ void FStringTest::streamExtractionTest() float in_12; finalcut::FString("2.71828") >> in_12; - CPPUNIT_ASSERT ( in_12 == 2.71828f ); + CPPUNIT_ASSERT ( std::fabs(in_12 - 2.71828f) <= FLT_EPSILON ); double in_13; finalcut::FString("2.7182818284590452353") >> in_13; - CPPUNIT_ASSERT ( in_13 == 2.7182818284590452353 ); + CPPUNIT_ASSERT ( std::fabs(in_13 - 2.7182818284590452353) <= DBL_EPSILON ); finalcut::FString in; std::istringstream istream("abc");