From 5d249e884c6f8ad74b8217e9516a6c6d2980f907 Mon Sep 17 00:00:00 2001 From: Explorer09 Date: Sat, 3 Feb 2024 15:27:55 +0800 Subject: [PATCH] "increment" arg back in unsigned int type This reverts commit 619badcb14241b9dcc7b6228247a4a1ca7e7e373. --- Meter.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Meter.c b/Meter.c index 559e0815c..ea4e07003 100644 --- a/Meter.c +++ b/Meter.c @@ -320,7 +320,7 @@ static void GraphMeterMode_reallocateGraphBuffer(Meter* this, const GraphDrawCon data->nValues = nValues; } -static size_t GraphMeterMode_valueCellIndex(unsigned int graphHeight, bool isPercentChart, int deltaExp, unsigned int y, unsigned int* scaleFactor, size_t* increment) { +static size_t GraphMeterMode_valueCellIndex(unsigned int graphHeight, bool isPercentChart, int deltaExp, unsigned int y, unsigned int* scaleFactor, unsigned int* increment) { *scaleFactor = 1; assert(deltaExp >= 0); @@ -559,7 +559,7 @@ static uint16_t GraphMeterMode_makeDetailsMask(const GraphColorComputeState* pre return mask; } -static void GraphMeterMode_paintCellsForItem(GraphColorCell* cellsStart, size_t increment, uint8_t itemIndex, unsigned int nCells, uint16_t mask) { +static void GraphMeterMode_paintCellsForItem(GraphColorCell* cellsStart, unsigned int increment, uint8_t itemIndex, unsigned int nCells, uint16_t mask) { GraphColorCell* cell = cellsStart; while (nCells > 0) { cell->c.itemNum = itemIndex + 1; @@ -583,7 +583,7 @@ static void GraphMeterMode_computeColors(Meter* this, const GraphDrawContext* co assert(numDots > 0 && numDots <= (int)graphHeight * 8); unsigned int scaleFactor; - size_t increment; + unsigned int increment; size_t firstCellIndex = GraphMeterMode_valueCellIndex(graphHeight, isPercentChart, deltaExp, 0, &scaleFactor, &increment); (void)scaleFactor; @@ -784,7 +784,7 @@ static void GraphMeterMode_computeColors(Meter* this, const GraphDrawContext* co int blanksAtTopCellArg = (new.nCellsPainted == nCellsToPaint) ? (int)blanksAtTopCell : -1; uint16_t mask = GraphMeterMode_makeDetailsMask(&prev, &new, prevTopPoint, rem, blanksAtTopCellArg); - GraphColorCell* cellsStart = &valueStart[firstCellIndex + increment * prev.nCellsPainted]; + GraphColorCell* cellsStart = &valueStart[firstCellIndex + (size_t)increment * prev.nCellsPainted]; GraphMeterMode_paintCellsForItem(cellsStart, increment, prev.nItemsPainted, nCells, mask); } @@ -888,7 +888,7 @@ static void GraphMeterMode_recordNewValue(Meter* this, const GraphDrawContext* c // Clear cells unsigned int y = ((unsigned int)numDots + 8 - 1) / 8; // Round up unsigned int scaleFactor; - size_t increment; + unsigned int increment; size_t i = GraphMeterMode_valueCellIndex(graphHeight, isPercentChart, 0, y, &scaleFactor, &increment); (void)scaleFactor; (void)increment; @@ -1025,7 +1025,7 @@ static int GraphMeterMode_lookupCell(const Meter* this, const GraphDrawContext* int deltaExpArg = deltaExp >= UINT16_WIDTH ? UINT16_WIDTH - 1 : deltaExp; unsigned int scaleFactor; - size_t increment; + unsigned int increment; size_t i = GraphMeterMode_valueCellIndex(graphHeight, isPercentChart, deltaExpArg, y, &scaleFactor, &increment); (void)increment; if (i == (size_t)-1)