// Parse arguments
while (1) {
static const struct option long_options[] = {
- {"version", no_argument, 0, 'V'},
- {"help", no_argument, 0, 'h'},
+ {"version", no_argument, 0, 'V'},
+ {"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
}
}
- if(ret == 0) {
+ if (ret == 0) {
// Initialise the main window
pv::MainWindow w;
w.show();
{
const uint64_t new_data_length = ((m.length + MipMapDataUnit - 1) /
MipMapDataUnit) * MipMapDataUnit;
- if(new_data_length > m.data_length)
+ if (new_data_length > m.data_length)
{
m.data_length = new_data_length;
m.data = realloc(m.data, new_data_length * _unit_size);
m0.length = _sample_count / MipMapScaleFactor;
// Break off if there are no new samples to compute
- if(m0.length == prev_length)
+ if (m0.length == prev_length)
return;
reallocate_mip_map(m0);
diff_counter = MipMapScaleFactor;
const uint8_t *end_src_ptr = (uint8_t*)_data +
m0.length * _unit_size * MipMapScaleFactor;
- for(src_ptr = (uint8_t*)_data +
+ for (src_ptr = (uint8_t*)_data +
prev_length * _unit_size * MipMapScaleFactor;
src_ptr < end_src_ptr;)
{
// Accumulate transitions which have occurred in this sample
accumulator = 0;
diff_counter = MipMapScaleFactor;
- while(diff_counter-- > 0)
+ while (diff_counter-- > 0)
{
const uint64_t sample = *(uint64_t*)src_ptr;
accumulator |= _last_append_sample ^ sample;
}
// Compute higher level mipmaps
- for(unsigned int level = 1; level < ScaleStepCount; level++)
+ for (unsigned int level = 1; level < ScaleStepCount; level++)
{
MipMapLevel &m = _mip_map[level];
const MipMapLevel &ml = _mip_map[level-1];
m.length = ml.length / MipMapScaleFactor;
// Break off if there are no more samples to computed
- if(m.length == prev_length)
+ if (m.length == prev_length)
break;
reallocate_mip_map(m);
_unit_size * prev_length * MipMapScaleFactor;
const uint8_t *end_dest_ptr =
(uint8_t*)m.data + _unit_size * m.length;
- for(dest_ptr = (uint8_t*)m.data +
+ for (dest_ptr = (uint8_t*)m.data +
_unit_size * prev_length;
dest_ptr < end_dest_ptr;
dest_ptr += _unit_size)
{
accumulator = 0;
diff_counter = MipMapScaleFactor;
- while(diff_counter-- > 0)
+ while (diff_counter-- > 0)
{
accumulator |= *(uint64_t*)src_ptr;
src_ptr += _unit_size;
last_sample = (get_sample(start) & sig_mask) != 0;
edges.push_back(pair<int64_t, bool>(index++, last_sample));
- while(index + block_length <= end)
+ while (index + block_length <= end)
{
//----- Continue to search -----//
level = min_level;
fast_forward = true;
- if(min_length < MipMapScaleFactor)
+ if (min_length < MipMapScaleFactor)
{
// Search individual samples up to the beginning of
// the next first level mip map block
const uint64_t final_index = min(end,
pow2_ceil(index, MipMapScalePower));
- for(; index < final_index &&
+ for (; index < final_index &&
(index & ~(~0 << MipMapScalePower)) != 0;
index++)
{
(get_sample(index) & sig_mask) != 0;
// If there was a change we cannot fast forward
- if(sample != last_sample) {
+ if (sample != last_sample) {
fast_forward = false;
break;
}
const int min_level_scale_power =
(level + 1) * MipMapScalePower;
index = pow2_ceil(index, min_level_scale_power);
- if(index >= end)
+ if (index >= end)
break;
// We can fast forward only if there was no change
fast_forward = last_sample == sample;
}
- if(fast_forward) {
+ if (fast_forward) {
// Fast forward: This involves zooming out to higher
// levels of the mip map searching for changes, then
// Slide right and zoom out at the beginnings of mip-map
// blocks until we encounter a change
- while(1) {
+ while (1) {
const int level_scale_power =
(level + 1) * MipMapScalePower;
const uint64_t offset =
// Check if we reached the last block at this
// level, or if there was a change in this block
- if(offset >= _mip_map[level].length ||
+ if (offset >= _mip_map[level].length ||
(get_subsample(level, offset) &
sig_mask))
break;
- if((offset & ~(~0 << MipMapScalePower)) == 0) {
+ if ((offset & ~(~0 << MipMapScalePower)) == 0) {
// If we are now at the beginning of a
// higher level mip-map block ascend one
// level
- if(level + 1 >= ScaleStepCount ||
+ if (level + 1 >= ScaleStepCount ||
!_mip_map[level + 1].data)
break;
// Zoom in, and slide right until we encounter a change,
// and repeat until we reach min_level
- while(1) {
+ while (1) {
assert(_mip_map[level].data);
const int level_scale_power =
// Check if we reached the last block at this
// level, or if there was a change in this block
- if(offset >= _mip_map[level].length ||
+ if (offset >= _mip_map[level].length ||
(get_subsample(level, offset) &
sig_mask)) {
// Zoom in unless we reached the minimum
// zoom
- if(level == min_level)
+ if (level == min_level)
break;
level--;
// If individual samples within the limit of resolution,
// do a linear search for the next transition within the
// block
- if(min_length < MipMapScaleFactor) {
- for(; index < end; index++) {
+ if (min_length < MipMapScaleFactor) {
+ for (; index < end; index++) {
const bool sample = (get_sample(index) &
sig_mask) != 0;
- if(sample != last_sample)
+ if (sample != last_sample)
break;
}
}
// Take the last sample of the quanization block
const int64_t final_index = index + block_length;
- if(index + block_length > end)
+ if (index + block_length > end)
break;
// Store the final state
struct sr_dev_inst* SamplingBar::get_selected_device() const
{
const int index = _device_selector.currentIndex();
- if(index < 0)
+ if (index < 0)
return NULL;
return (sr_dev_inst*)_device_selector.itemData(
uint64_t SamplingBar::get_record_length() const
{
const int index = _record_length_selector.currentIndex();
- if(index < 0)
+ if (index < 0)
return 0;
return _record_length_selector.itemData(index).value<uint64_t>();
assert(_sample_rate_value_action);
assert(_sample_rate_list_action);
- if(_sample_rate_value_action->isVisible())
+ if (_sample_rate_value_action->isVisible())
return (uint64_t)_sample_rate_value.value();
- else if(_sample_rate_list_action->isVisible())
+ else if (_sample_rate_list_action->isVisible())
{
const int index = _sample_rate_list.currentIndex();
- if(index < 0)
+ if (index < 0)
return 0;
return _sample_rate_list.itemData(index).value<uint64_t>();
{
stop_capture();
- if(_sampling_thread.get())
+ if (_sampling_thread.get())
_sampling_thread->join();
_sampling_thread.reset();
void SigSession::stop_capture()
{
- if(get_capture_state() == Stopped)
+ if (get_capture_state() == Stopped)
return;
sr_session_stop();
// Check that sampling stopped
- if(_sampling_thread.get())
+ if (_sampling_thread.get())
_sampling_thread->join();
_sampling_thread.reset();
}
// Create an empty LogiData for coming data snapshots
_logic_data.reset(new LogicData(meta_logic));
assert(_logic_data);
- if(!_logic_data)
+ if (!_logic_data)
break;
}
const sr_probe *const probe =
(const sr_probe*)g_slist_nth_data(
sdi->probes, i);
- if(probe->enabled)
+ if (probe->enabled)
{
shared_ptr<LogicSignal> signal(
new LogicSignal(probe->name,
{
lock_guard<mutex> lock(_data_mutex);
assert(packet->payload);
- if(!_cur_logic_snapshot)
+ if (!_cur_logic_snapshot)
{
// Create a new data snapshot
_cur_logic_snapshot = shared_ptr<LogicDataSnapshot>(
0, s->get_v_offset() - v_offset,
w, View::SignalHeight);
- if(s->pt_in_label_rect(signal_heading_rect, pt))
+ if (s->pt_in_label_rect(signal_heading_rect, pt))
return s;
}
const vector< shared_ptr<Signal> > sigs(
_view.session().get_signals());
- if(event->button() & Qt::LeftButton) {
+ if (event->button() & Qt::LeftButton) {
_mouse_down_point = event->pos();
// Save the offsets of any signals which will be dragged
BOOST_FOREACH(const shared_ptr<Signal> s, sigs)
- if(s->selected())
+ if (s->selected())
_drag_sigs.push_back(
make_pair(s, s->get_v_offset()));
}
// Select the signal if it has been clicked
const shared_ptr<Signal> mouse_over_signal =
get_mouse_over_signal(event->pos());
- if(mouse_over_signal) {
- if(mouse_over_signal->selected())
+ if (mouse_over_signal) {
+ if (mouse_over_signal->selected())
mouse_over_signal->select(false);
else {
mouse_over_signal->select(true);
- if(~QApplication::keyboardModifiers() &
+ if (~QApplication::keyboardModifiers() &
Qt::ControlModifier)
_drag_sigs.clear();
// Add the signal to the drag list
- if(event->button() & Qt::LeftButton)
+ if (event->button() & Qt::LeftButton)
_drag_sigs.push_back(
make_pair(mouse_over_signal,
mouse_over_signal->get_v_offset()));
}
}
- if(~QApplication::keyboardModifiers() & Qt::ControlModifier) {
+ if (~QApplication::keyboardModifiers() & Qt::ControlModifier) {
// Unselect all other signals because the Ctrl is not
// pressed
BOOST_FOREACH(const shared_ptr<Signal> s, sigs)
- if(s != mouse_over_signal)
+ if (s != mouse_over_signal)
s->select(false);
}
void Header::mouseReleaseEvent(QMouseEvent *event)
{
assert(event);
- if(event->button() == Qt::LeftButton) {
+ if (event->button() == Qt::LeftButton) {
_drag_sigs.clear();
_view.normalize_layout();
}
_mouse_point = event->pos();
// Move the signals if we are dragging
- if(!_drag_sigs.empty()) {
+ if (!_drag_sigs.empty()) {
const int delta = event->pos().y() - _mouse_down_point.y();
- for(std::list<std::pair<boost::weak_ptr<Signal>,
+ for (std::list<std::pair<boost::weak_ptr<Signal>,
int> >::iterator i = _drag_sigs.begin();
i != _drag_sigs.end(); i++) {
const boost::shared_ptr<Signal> sig((*i).first);
- if(sig) {
+ if (sig) {
const int y = (*i).second + delta;
const int y_snap =
((y + View::SignalSnapGridSize / 2) /
{
const shared_ptr<Signal> s = get_mouse_over_signal(_mouse_point);
- if(!s)
+ if (!s)
return;
QMenu menu(this);
void Header::on_action_set_name_triggered()
{
shared_ptr<view::Signal> context_signal = _context_signal;
- if(!context_signal)
+ if (!context_signal)
return;
const QString new_label = QInputDialog::getText(this, tr("Set Name"),
tr("Name"), QLineEdit::Normal, context_signal->get_name());
- if(!new_label.isEmpty())
+ if (!new_label.isEmpty())
context_signal->set_name(new_label);
}
void Header::on_action_set_colour_triggered()
{
shared_ptr<view::Signal> context_signal = _context_signal;
- if(!context_signal)
+ if (!context_signal)
return;
const QColor new_colour = QColorDialog::getColor(
context_signal->get_colour(), this, tr("Set Colour"));
- if(new_colour.isValid())
+ if (new_colour.isValid())
context_signal->set_colour(new_colour);
}
const deque< shared_ptr<pv::LogicDataSnapshot> > &snapshots =
_data->get_snapshots();
- if(snapshots.empty())
+ if (snapshots.empty())
return;
const shared_ptr<pv::LogicDataSnapshot> &snapshot =
QLineF *const edge_lines = new QLineF[edge_count];
line = edge_lines;
- for(vector<pv::LogicDataSnapshot::EdgePair>::const_iterator i =
+ for (vector<pv::LogicDataSnapshot::EdgePair>::const_iterator i =
edges.begin() + 1;
i != edges.end() - 1; i++) {
const float x = ((*i).first / samples_per_pixel -
{
QLineF *line = lines;
- for(vector<pv::LogicDataSnapshot::EdgePair>::const_iterator i =
+ for (vector<pv::LogicDataSnapshot::EdgePair>::const_iterator i =
edges.begin(); i != (edges.end() - 1); i++)
- if((*i).second == level) {
+ if ((*i).second == level) {
*line++ = QLineF(
((*i).first / samples_per_pixel -
pixels_offset) + x_offset, y_offset,
do
{
tick_period = order_decimal * ScaleUnits[unit++];
- } while(tick_period < min_period && unit < countof(ScaleUnits));
+ } while (tick_period < min_period && unit < countof(ScaleUnits));
const unsigned int prefix = (order - FirstSIPrefixPower) / 3;
assert(prefix >= 0);
int division = (int)round(first_minor_division -
first_major_division * MinorTickSubdivision);
- while(1)
+ while (1)
{
const double t = t0 + division * minor_tick_period;
const double x = (t - _view.offset()) / _view.scale();
- if(x >= width())
+ if (x >= width())
break;
- if(division % MinorTickSubdivision == 0)
+ if (division % MinorTickSubdivision == 0)
{
// Draw a major tick
QString s;
void Ruler::mouseMoveEvent(QMouseEvent *e)
{
- if(!_grabbed_marker)
+ if (!_grabbed_marker)
return;
_grabbed_marker->set_time(_view.offset() +
void Ruler::mousePressEvent(QMouseEvent *e)
{
- if(e->buttons() & Qt::LeftButton) {
+ if (e->buttons() & Qt::LeftButton) {
_grabbed_marker = NULL;
- if(_view.cursors_shown()) {
+ if (_view.cursors_shown()) {
std::pair<Cursor, Cursor> &cursors =
_view.cursors();
- if(cursors.first.get_label_rect(
+ if (cursors.first.get_label_rect(
rect()).contains(e->pos()))
_grabbed_marker = &cursors.first;
- else if(cursors.second.get_label_rect(
+ else if (cursors.second.get_label_rect(
rect()).contains(e->pos()))
_grabbed_marker = &cursors.second;
}
void Ruler::draw_cursors(QPainter &p)
{
- if(!_view.cursors_shown())
+ if (!_view.cursors_shown())
return;
const QRect r = rect();
void Ruler::draw_hover_mark(QPainter &p)
{
const int x = _view.hover_point().x();
- if(x == -1 || _grabbed_marker)
+
+ if (x == -1 || _grabbed_marker)
return;
p.setPen(QPen(Qt::NoPen));
QPointF(label_rect.left() + 1, label_rect.bottom() - 1)
};
- if(_selected) {
+ if (_selected) {
p.setPen(QPen(QApplication::palette().brush(
QPalette::Highlight), LabelHighlightRadius,
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
void View::get_scroll_layout(double &length, double &offset) const
{
const shared_ptr<SignalData> sig_data = _session.get_data();
- if(!sig_data)
+ if (!sig_data)
return;
length = _data_length / (sig_data->get_samplerate() * _scale);
horizontalScrollBar()->setPageStep(areaSize.width());
- if(length < MaxScrollValue) {
+ if (length < MaxScrollValue) {
horizontalScrollBar()->setRange(0, length);
horizontalScrollBar()->setSliderPosition(offset);
} else {
bool View::eventFilter(QObject *object, QEvent *event)
{
const QEvent::Type type = event->type();
- if(type == QEvent::MouseMove) {
+ if (type == QEvent::MouseMove) {
const QMouseEvent *const mouse_event = (QMouseEvent*)event;
- if(object == _viewport)
+ if (object == _viewport)
_hover_point = mouse_event->pos();
- else if(object == _ruler)
+ else if (object == _ruler)
_hover_point = QPoint(mouse_event->x(), 0);
- else if(object == _header)
+ else if (object == _header)
_hover_point = QPoint(0, mouse_event->y());
else
_hover_point = QPoint(-1, -1);
hover_point_changed();
- } else if(type == QEvent::Leave) {
+ } else if (type == QEvent::Leave) {
_hover_point = QPoint(-1, -1);
hover_point_changed();
}
void View::h_scroll_value_changed(int value)
{
const int range = horizontalScrollBar()->maximum();
- if(range < MaxScrollValue)
+ if (range < MaxScrollValue)
_offset = _scale * value;
else {
double length = 0, offset;
// Get the new data length
_data_length = 0;
shared_ptr<LogicData> sig_data = _session.get_data();
- if(sig_data) {
+ if (sig_data) {
deque< shared_ptr<LogicDataSnapshot> > &snapshots =
sig_data->get_snapshots();
BOOST_FOREACH(shared_ptr<LogicDataSnapshot> s, snapshots)
- if(s)
+ if (s)
_data_length = max(_data_length,
s->get_sample_count());
}
{
assert(event);
- if(event->buttons() & Qt::LeftButton)
+ if (event->buttons() & Qt::LeftButton)
{
_view.set_scale_offset(_view.scale(),
_mouse_down_offset +
void Viewport::draw_cursors_background(QPainter &p)
{
- if(!_view.cursors_shown())
+ if (!_view.cursors_shown())
return;
p.setPen(Qt::NoPen);
void Viewport::draw_cursors_foreground(QPainter &p)
{
- if(!_view.cursors_shown())
+ if (!_view.cursors_shown())
return;
const QRect r = rect();
//----- Test LogicDataSnapshot::push_logic -----//
BOOST_CHECK(s.get_sample_count() == 0);
- for(unsigned int i = 0; i < LogicDataSnapshot::ScaleStepCount; i++)
+ for (unsigned int i = 0; i < LogicDataSnapshot::ScaleStepCount; i++)
{
const LogicDataSnapshot::MipMapLevel &m = s._mip_map[i];
BOOST_CHECK_EQUAL(m.length, 0);
BOOST_CHECK(s.get_sample_count() == 8);
// There should not be enough samples to have a single mip map sample
- for(unsigned int i = 0; i < LogicDataSnapshot::ScaleStepCount; i++)
+ for (unsigned int i = 0; i < LogicDataSnapshot::ScaleStepCount; i++)
{
const LogicDataSnapshot::MipMapLevel &m = s._mip_map[i];
BOOST_CHECK_EQUAL(m.length, 0);
BOOST_CHECK_EQUAL(((uint8_t*)m0.data)[0], 0x11);
// The higher levels should still be empty
- for(unsigned int i = 1; i < LogicDataSnapshot::ScaleStepCount; i++)
+ for (unsigned int i = 1; i < LogicDataSnapshot::ScaleStepCount; i++)
{
const LogicDataSnapshot::MipMapLevel &m = s._mip_map[i];
BOOST_CHECK_EQUAL(m.length, 0);
BOOST_CHECK_EQUAL(m0.data_length, LogicDataSnapshot::MipMapDataUnit);
BOOST_CHECK_EQUAL(((uint8_t*)m0.data)[1], 0x11);
- for(unsigned int i = 2; i < m0.length; i++)
+ for (unsigned int i = 2; i < m0.length; i++)
BOOST_CHECK_EQUAL(((uint8_t*)m0.data)[i], 0);
const LogicDataSnapshot::MipMapLevel &m1 = s._mip_map[1];
logic.data = new uint8_t[Length];
uint8_t *data = (uint8_t*)logic.data;
- for(unsigned int i = 0; i < Length; i++)
+ for (unsigned int i = 0; i < Length; i++)
*data++ = (uint8_t)(i >> 8);
LogicDataSnapshot s(logic);
BOOST_REQUIRE(s._mip_map[0].data != NULL);
prev_sample = 0;
- for(unsigned int i = 0; i < s._mip_map[0].length;)
+ for (unsigned int i = 0; i < s._mip_map[0].length;)
{
BOOST_TEST_MESSAGE("Testing mip_map[0].data[" << i << "]");
prev_sample ^ sample);
prev_sample = sample;
- for(int j = 1; i < s._mip_map[0].length && j < 16; j++)
+ for (int j = 1; i < s._mip_map[0].length && j < 16; j++)
{
BOOST_TEST_MESSAGE("Testing mip_map[0].data[" << i << "]");
BOOST_CHECK_EQUAL(s.get_subsample(0, i++) & 0xFF, 0);
BOOST_REQUIRE(s._mip_map[1].data != NULL);
prev_sample = 0;
- for(unsigned int i = 0; i < s._mip_map[1].length; i++)
+ for (unsigned int i = 0; i < s._mip_map[1].length; i++)
{
BOOST_TEST_MESSAGE("Testing mip_map[1].data[" << i << "]");
BOOST_REQUIRE(s._mip_map[2].data != NULL);
prev_sample = 0;
- for(unsigned int i = 0; i < s._mip_map[2].length; i++)
+ for (unsigned int i = 0; i < s._mip_map[2].length; i++)
{
BOOST_TEST_MESSAGE("Testing mip_map[2].data[" << i << "]");
LogicDataSnapshot::MipMapDataUnit);
BOOST_REQUIRE(s._mip_map[3].data != NULL);
- for(unsigned int i = 0; i < s._mip_map[3].length; i++)
+ for (unsigned int i = 0; i < s._mip_map[3].length; i++)
BOOST_CHECK_EQUAL(*((uint8_t*)s._mip_map[3].data + i),
0xFF);
// Check the higher levels
- for(unsigned int i = 4; i < LogicDataSnapshot::ScaleStepCount; i++)
+ for (unsigned int i = 4; i < LogicDataSnapshot::ScaleStepCount; i++)
{
const LogicDataSnapshot::MipMapLevel &m = s._mip_map[i];
BOOST_CHECK_EQUAL(m.length, 0);
BOOST_CHECK_EQUAL(edges.size(), 32);
- for(unsigned int i = 0; i < edges.size() - 1; i++)
+ for (unsigned int i = 0; i < edges.size() - 1; i++)
{
BOOST_CHECK_EQUAL(edges[i].first, i * 32768);
BOOST_CHECK_EQUAL(edges[i].second, i & 1);
logic.data = (uint64_t*)new uint8_t[Length];
uint8_t *p = (uint8_t*)logic.data;
- for(int i = 0; i < Cycles; i++) {
+ for (int i = 0; i < Cycles; i++) {
*p++ = 0xFF;
- for(int j = 1; j < Period; j++)
+ for (int j = 1; j < Period; j++)
*p++ = 0x00;
}
LogicDataSnapshot::MipMapDataUnit);
BOOST_REQUIRE(s._mip_map[0].data != NULL);
- for(unsigned int i = 0; i < s._mip_map[0].length;) {
+ for (unsigned int i = 0; i < s._mip_map[0].length;) {
BOOST_TEST_MESSAGE("Testing mip_map[0].data[" << i << "]");
BOOST_CHECK_EQUAL(s.get_subsample(0, i++) & 0xFF, 0xFF);
- for(int j = 1;
+ for (int j = 1;
i < s._mip_map[0].length &&
j < Period/LogicDataSnapshot::MipMapScaleFactor; j++) {
BOOST_TEST_MESSAGE(
}
// Check the higher levels are all inactive
- for(unsigned int i = 1; i < LogicDataSnapshot::ScaleStepCount; i++) {
+ for (unsigned int i = 1; i < LogicDataSnapshot::ScaleStepCount; i++) {
const LogicDataSnapshot::MipMapLevel &m = s._mip_map[i];
BOOST_CHECK_EQUAL(m.length, 0);
BOOST_CHECK_EQUAL(m.data_length, 0);
BOOST_REQUIRE_EQUAL(edges.size(), Cycles + 2);
BOOST_CHECK_EQUAL(0, false);
- for(unsigned int i = 1; i < edges.size(); i++)
+ for (unsigned int i = 1; i < edges.size(); i++)
BOOST_CHECK_EQUAL(edges[i].second, false);
}
logic.data = (uint64_t*)new uint64_t[Length];
uint64_t *p = (uint64_t*)logic.data;
- for(int i = 0; i < Cycles; i++) {
- for(j = 0; j < PulseWidth; j++)
+ for (int i = 0; i < Cycles; i++) {
+ for (j = 0; j < PulseWidth; j++)
*p++ = ~0;
- for(; j < Period; j++)
+ for (; j < Period; j++)
*p++ = 0;
}
LogicDataSnapshot::MipMapDataUnit);
BOOST_REQUIRE(s._mip_map[0].data != NULL);
- for(unsigned int i = 0; i < s._mip_map[0].length;) {
- for(j = 0; i < s._mip_map[0].length && j < 2; j++) {
+ for (unsigned int i = 0; i < s._mip_map[0].length;) {
+ for (j = 0; i < s._mip_map[0].length && j < 2; j++) {
BOOST_TEST_MESSAGE(
"Testing mip_map[0].data[" << i << "]");
BOOST_CHECK_EQUAL(s.get_subsample(0, i++), ~0);
}
- for(; i < s._mip_map[0].length &&
+ for (; i < s._mip_map[0].length &&
j < Period/LogicDataSnapshot::MipMapScaleFactor; j++) {
BOOST_TEST_MESSAGE(
"Testing mip_map[0].data[" << i << "]");
}
// Check the higher levels are all inactive
- for(unsigned int i = 1; i < LogicDataSnapshot::ScaleStepCount; i++) {
+ for (unsigned int i = 1; i < LogicDataSnapshot::ScaleStepCount; i++) {
const LogicDataSnapshot::MipMapLevel &m = s._mip_map[i];
BOOST_CHECK_EQUAL(m.length, 0);
BOOST_CHECK_EQUAL(m.data_length, 0);
s.get_subsampled_edges(edges, 0, Length-1, 16.0f, 2);
BOOST_REQUIRE_EQUAL(edges.size(), Cycles * 2 + 1);
- for(int i = 0; i < Cycles; i++) {
+ for (int i = 0; i < Cycles; i++) {
BOOST_CHECK_EQUAL(edges[i*2].first, i * Period);
BOOST_CHECK_EQUAL(edges[i*2].second, true);
BOOST_CHECK_EQUAL(edges[i*2+1].first, i * Period + PulseWidth);
BOOST_CHECK_EQUAL(edges[1].first, 16);
BOOST_CHECK_EQUAL(edges[1].second, false);
- for(int i = 1; i < Cycles; i++) {
+ for (int i = 1; i < Cycles; i++) {
BOOST_CHECK_EQUAL(edges[i+1].first, i * Period);
BOOST_CHECK_EQUAL(edges[i+1].second, false);
}
logic.data = new uint8_t[Length];
uint8_t *data = (uint8_t*)logic.data;
- for(unsigned int i = 0; i < countof(Edges); i++) {
+ for (unsigned int i = 0; i < countof(Edges); i++) {
const int edgePos = Edges[i];
memset(&data[lastEdgePos], state ? 0x02 : 0,
edgePos - lastEdgePos - 1);