Commit 6f38873a authored by hjk's avatar hjk
Browse files

Debugger: Fix compiler warning



Losing precision in case of 64 bit ints is ok in readNumericVectorHelper,
as the result is only used to plot data.

Change-Id: I7f0e4c332ee8302b0bb774a7eca2ff5823c37eac
Reviewed-by: default avatarKai Koehne <kai.koehne@theqtcompany.com>
parent 029b83b8
......@@ -645,7 +645,12 @@ template <class T>
void readNumericVectorHelper(std::vector<double> *v, const QByteArray &ba)
{
const T *p = (const T *) ba.data();
std::copy(p, p + ba.size() / sizeof(T), std::back_insert_iterator<std::vector<double> >(*v));
const int n = ba.size() / sizeof(T);
v->resize(n);
// Losing precision in case of 64 bit ints is ok here, as the result
// is only used to plot data.
for (int i = 0; i != n; ++i)
(*v)[i] = static_cast<double>(p[i]);
}
void readNumericVector(std::vector<double> *v, const QByteArray &rawData, DebuggerEncoding encoding)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment