forked from Archive/PX4-Autopilot
matrix: use stack allocation for debug output string
This commit is contained in:
parent
b1435c6e34
commit
9f8fa99d70
|
@ -367,10 +367,9 @@ public:
|
|||
{
|
||||
// element: tab, point, 8 digits, 4 scientific notation chars; row: newline; string: \0 end
|
||||
static const size_t n = 15 * N * M + M + 1;
|
||||
char *buf = new char[n];
|
||||
write_string(buf, n);
|
||||
printf("%s\n", buf);
|
||||
delete[] buf;
|
||||
char string[n];
|
||||
write_string(string, n);
|
||||
printf("%s\n", string);
|
||||
}
|
||||
|
||||
Matrix<Type, N, M> transpose() const
|
||||
|
@ -817,11 +816,9 @@ OStream &operator<<(OStream &os, const matrix::Matrix<Type, M, N> &matrix)
|
|||
os << "\n";
|
||||
// element: tab, point, 8 digits, 4 scientific notation chars; row: newline; string: \0 end
|
||||
static const size_t n = 15 * N * M + M + 1;
|
||||
char *buf = new char[n];
|
||||
matrix.write_string(buf, n);
|
||||
os << buf;
|
||||
delete[] buf;
|
||||
|
||||
char string[n];
|
||||
matrix.write_string(string, n);
|
||||
os << string;
|
||||
return os;
|
||||
}
|
||||
|
||||
|
|
|
@ -161,11 +161,9 @@ OStream &operator<<(OStream &os, const matrix::Vector<Type, M> &vector)
|
|||
os << "\n";
|
||||
// element: tab, point, 8 digits, 4 scientific notation chars; row: newline; string: \0 end
|
||||
static const size_t n = 15 * M * 1 + 1 + 1;
|
||||
char *buf = new char[n];
|
||||
vector.transpose().write_string(buf, n);
|
||||
os << buf;
|
||||
delete[] buf;
|
||||
|
||||
char string[n];
|
||||
vector.transpose().write_string(string, n);
|
||||
os << string;
|
||||
return os;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue