comparison of integers of different signs [-Wsign-compare]

This commit is contained in:
Philippe Teuwen
2019-04-13 23:38:34 +02:00
parent ce606b51fc
commit 97676d3210
17 changed files with 85 additions and 86 deletions

View File

@@ -33,7 +33,7 @@ extern "C" {
bool g_useOverlays = false;
int g_absVMax = 0;
int startMax;
uint32_t startMax;
int PageWidth;
int unlockStart = 0;
@@ -274,7 +274,7 @@ QColor Plot::getColor(int graphNum) {
}
}
void Plot::setMaxAndStart(int *buffer, int len, QRect plotRect) {
void Plot::setMaxAndStart(int *buffer, size_t len, QRect plotRect) {
if (len == 0) return;
startMax = (len - (int)((plotRect.right() - plotRect.left() - 40) / GraphPixelsPerPoint));
if (startMax < 0) {
@@ -285,7 +285,7 @@ void Plot::setMaxAndStart(int *buffer, int len, QRect plotRect) {
}
if (GraphStart > len) return;
int vMin = INT_MAX, vMax = INT_MIN, v = 0;
int sample_index = GraphStart ;
uint32_t sample_index = GraphStart ;
for (; sample_index < len && xCoordOf(sample_index, plotRect) < plotRect.right() ; sample_index++) {
v = buffer[sample_index];
@@ -299,7 +299,7 @@ void Plot::setMaxAndStart(int *buffer, int len, QRect plotRect) {
g_absVMax = (int)(g_absVMax * 1.25 + 1);
}
void Plot::PlotDemod(uint8_t *buffer, size_t len, QRect plotRect, QRect annotationRect, QPainter *painter, int graphNum, int plotOffset) {
void Plot::PlotDemod(uint8_t *buffer, size_t len, QRect plotRect, QRect annotationRect, QPainter *painter, int graphNum, uint32_t plotOffset) {
if (len == 0 || PlotGridX <= 0) return;
//clock_t begin = clock();
QPainterPath penPath;
@@ -354,11 +354,12 @@ void Plot::PlotDemod(uint8_t *buffer, size_t len, QRect plotRect, QRect annotati
painter->drawPath(penPath);
}
void Plot::PlotGraph(int *buffer, int len, QRect plotRect, QRect annotationRect, QPainter *painter, int graphNum) {
void Plot::PlotGraph(int *buffer, size_t len, QRect plotRect, QRect annotationRect, QPainter *painter, int graphNum) {
if (len == 0) return;
// clock_t begin = clock();
QPainterPath penPath;
int vMin = INT_MAX, vMax = INT_MIN, vMean = 0, v = 0, i = 0;
int vMin = INT_MAX, vMax = INT_MIN, vMean = 0, v = 0;
uint32_t i = 0;
int x = xCoordOf(GraphStart, plotRect);
int y = yCoordOf(buffer[GraphStart], plotRect, g_absVMax);
penPath.moveTo(x, y);
@@ -416,7 +417,7 @@ void Plot::PlotGraph(int *buffer, int len, QRect plotRect, QRect annotationRect,
//Graph annotations
painter->drawPath(penPath);
char str[200];
sprintf(str, "max=%d min=%d mean=%d n=%d/%d CursorAVal=[%d] CursorBVal=[%d]",
sprintf(str, "max=%d min=%d mean=%d n=%d/%zu CursorAVal=[%d] CursorBVal=[%d]",
vMax, vMin, vMean, i, len, buffer[CursorAPos], buffer[CursorBPos]);
painter->drawText(20, annotationRect.bottom() - 23 - 20 * graphNum, str);