Changed hard-coded 8 to sizeof(double)

This commit is contained in:
Anne de Jong 2023-06-18 21:05:47 +02:00
parent 1a22a33c0f
commit 3681e7adac
1 changed files with 4 additions and 2 deletions

View File

@ -26,7 +26,9 @@ DaqData::DaqData(const us nframes, const us nchannels,
DEBUGTRACE_PRINT(sw);
assert(sw > 0 && sw <= 8);
_data = reinterpret_cast<byte_t*>(new double[(sw * nchannels * nframes)/8 + 1]);
_data = reinterpret_cast<byte_t *>(
new double[(sw * nchannels * nframes) / sizeof(double) + 1]);
if (!_data) {
throw rte("Could not allocate memory for DaqData!");
}
@ -52,7 +54,7 @@ DaqData::DaqData(DaqData &&o)
DaqData::~DaqData() {
DEBUGTRACE_ENTER;
if (_data)
delete[] (reinterpret_cast<double*>(_data));
delete[](reinterpret_cast<double *>(_data));
}
void DaqData::copyInFromRaw(const std::vector<byte_t *> &ptrs) {