/*
- * This file is part of the sigrok project.
+ * This file is part of the PulseView project.
*
* Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
*
#include <assert.h>
#include <string.h>
+#include <stdlib.h>
#include <math.h>
#include <boost/foreach.hpp>
{
assert(_unit_size == logic.unitsize);
- const uint64_t prev_length = _data_length;
append_data(logic.data, logic.length);
// Generate the first mip-map from the data
// Expand the data buffer to fit the new samples
prev_length = m0.length;
- m0.length = _data_length / MipMapScaleFactor;
+ m0.length = _sample_count / MipMapScaleFactor;
// Break off if there are no new samples to compute
if(m0.length == prev_length)
uint64_t LogicDataSnapshot::get_sample(uint64_t index) const
{
assert(_data);
- assert(index >= 0 && index < _data_length);
+ assert(index >= 0 && index < _sample_count);
return *(uint64_t*)((uint8_t*)_data + index * _unit_size);
}