diff options
author | David Crocker <dcrocker@eschertech.com> | 2017-09-22 23:01:39 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2017-09-22 23:02:01 +0300 |
commit | 1bf86a532b80777c49ae13cda56c1326ac94de17 (patch) | |
tree | 0026f9741571dd68e6a7041e74cb6a0277d80283 /src/Libraries | |
parent | 8a71354e057609c6b015ed83826149a06e2aa8d6 (diff) |
Version 1.20alpha3
Upgraded compiler
Floading point constants now default to single-precision
Changed to hardware floating point ABI on Cortex-M4 targets
Diffstat (limited to 'src/Libraries')
-rw-r--r-- | src/Libraries/General/StringRef.cpp | 12 | ||||
-rw-r--r-- | src/Libraries/Math/Matrix.h | 6 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/Libraries/General/StringRef.cpp b/src/Libraries/General/StringRef.cpp index 290be8d4..a05e6070 100644 --- a/src/Libraries/General/StringRef.cpp +++ b/src/Libraries/General/StringRef.cpp @@ -8,7 +8,17 @@ #include "StringRef.h" #include <cstring> #include <cstdio> -#undef printf // some idiot defined printf as a macro inside cstdio, which prevents us using it as a member function name + +// Need to define strnlen here because it isn't ISO standard +size_t strnlen(const char *s, size_t n) +{ + size_t rslt = 0; + while (rslt < n && s[rslt] != 0) + { + ++rslt; + } + return rslt; +} //************************************************************************************************* // StringRef class member implementations diff --git a/src/Libraries/Math/Matrix.h b/src/Libraries/Math/Matrix.h index 69e36a5d..7bb7216e 100644 --- a/src/Libraries/Math/Matrix.h +++ b/src/Libraries/Math/Matrix.h @@ -101,10 +101,10 @@ template<class T, size_t ROWS, size_t COLS> void FixedMatrix<T, ROWS, COLS>::Gau } // Use row i to eliminate the ith element from previous and subsequent rows - float v = (*this)(i, i); + T v = (*this)(i, i); for (size_t j = 0; j < i; ++j) { - float factor = (*this)(j, i)/v; + T factor = (*this)(j, i)/v; (*this)(j, i) = 0.0; for (size_t k = i + 1; k <= numRows; ++k) { @@ -114,7 +114,7 @@ template<class T, size_t ROWS, size_t COLS> void FixedMatrix<T, ROWS, COLS>::Gau for (size_t j = i + 1; j < numRows; ++j) { - float factor = (*this)(j, i)/v; + T factor = (*this)(j, i)/v; (*this)(j, i) = 0.0; for (size_t k = i + 1; k <= numRows; ++k) { |