Remove printing of buffers as floats. Refs #395

* There's no guarantee that the buffer is actually float data at all,
  so printing it as such can cause float exceptions if the data includes
  NaNs.
* This is not really useful anymore anyway, and if really needed the
  float values can be manually converted from the hex data.
This commit is contained in:
baldurk
2016-10-13 12:21:23 +02:00
parent f44aa27d19
commit 237b24e88e
+4 -11
View File
@@ -1893,24 +1893,17 @@ void Serialiser::SerialiseBuffer(const char *name, byte *&buf, size_t &len)
{
const char *ellipsis = "...";
float *fbuf = new float[4];
fbuf[0] = fbuf[1] = fbuf[2] = fbuf[3] = 0.0f;
uint32_t *lbuf = (uint32_t *)fbuf;
uint32_t lbuf[4];
memcpy(fbuf, buf, RDCMIN(len, 4 * sizeof(float)));
memcpy(lbuf, buf, RDCMIN(len, 4 * sizeof(uint32_t)));
if(bufLen <= 16)
{
ellipsis = " ";
}
DebugPrint(
"%s: RawBuffer % 5d:< 0x%08x 0x%08x 0x%08x 0x%08x %s % 8.4ff % 8.4ff % 8.4ff % 8.4ff "
"%s >\n",
name, bufLen, lbuf[0], lbuf[1], lbuf[2], lbuf[3], ellipsis, fbuf[0], fbuf[1], fbuf[2],
fbuf[3], ellipsis);
SAFE_DELETE_ARRAY(fbuf);
DebugPrint("%s: RawBuffer % 5d:< 0x%08x 0x%08x 0x%08x 0x%08x %s>\n", name, bufLen, lbuf[0],
lbuf[1], lbuf[2], lbuf[3], ellipsis);
}
}