Use std::abs() instead of abs()

This fixes a FTBFS on newer versions of GCC
master
Timothy Pearson 6 years ago
parent 80b233440d
commit 42e4e04275

@ -692,7 +692,7 @@ void TraceData::drawTrace(TQPainter* p, int graticule_width, int graticule_heigh
rightEdgeIndex = numberOfSamples-1;
}
}
activeSamples = abs(rightEdgeIndex-leftEdgeIndex);
activeSamples = std::abs(rightEdgeIndex-leftEdgeIndex);
incr = (activeSamples/virtual_width)+1;
for (n=leftEdgeIndex; n<numberOfSamples-incr; n=n+incr) {
// Detect invalid samples and skip drawing of those samples
@ -925,13 +925,13 @@ void CursorData::drawCursor(TQPainter* p, int graticule_width, int graticule_hei
}
if (orientation == TQt::Vertical) {
int x = (abs(((position)/(100.0))*(virtual_width))-offset);
int x = (std::abs(((position)/(100.0))*(virtual_width))-offset);
if ((x >= 0) && (x < graticule_width)) {
p->drawLine(x, 0, x, graticule_height);
}
}
else {
int y = abs(((position)/(100.0))*(virtual_height));
int y = std::abs(((position)/(100.0))*(virtual_height));
p->drawLine(0, y, graticule_width, y);
}
}
@ -1148,7 +1148,7 @@ void GraticuleWidget::updateGraticule() {
TQRectF zoomBox = m_base->zoomBox();
if (!zoomBox.isNull()) {
// Translate zoombox coordinates to local drawing coordinates
TQRect drawingRect(abs(((zoomBox.x())/(100.0))*(virtualWidth()))-m_base->horizScrollOffset(), abs(((zoomBox.y())/(100.0))*(height())), abs(((zoomBox.width())/(100.0))*(virtualWidth())), abs(((zoomBox.height())/(100.0))*(height())));
TQRect drawingRect(std::abs(((zoomBox.x())/(100.0))*(virtualWidth()))-m_base->horizScrollOffset(), std::abs(((zoomBox.y())/(100.0))*(height())), std::abs(((zoomBox.width())/(100.0))*(virtualWidth())), std::abs(((zoomBox.height())/(100.0))*(height())));
p.fillRect(drawingRect, TQBrush(foregroundColor().dark(m_base->m_zoomBoxDarkness), TQt::BDiagPattern));
}
@ -2662,4 +2662,4 @@ TraceWidget* TraceScrollWidget::traceWidget() {
return m_traceScrollView->m_traceWidget;
}
#include "tracewidget.moc"
#include "tracewidget.moc"

Loading…
Cancel
Save