From a22c188b5d6d0d3e6bb8820fb7b12fb0a352704d Mon Sep 17 00:00:00 2001 From: Explorer09 Date: Mon, 5 Feb 2024 18:59:18 +0800 Subject: [PATCH] needsExtraCell() int8_t type --- Meter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Meter.c b/Meter.c index bd59373db..bd353c4b7 100644 --- a/Meter.c +++ b/Meter.c @@ -446,7 +446,7 @@ static uint8_t GraphMeterMode_findTopCellItem(const Meter* this, double scaledTo return topCellItem; } -static int GraphMeterMode_needsExtraCell(unsigned int graphHeight, double scaledTotal, unsigned int y, const GraphColorAdjStack* stack, const GraphColorAdjOffset* adjOffset) { +static int8_t GraphMeterMode_needsExtraCell(unsigned int graphHeight, double scaledTotal, unsigned int y, const GraphColorAdjStack* stack, const GraphColorAdjOffset* adjOffset) { double areaSum = (stack->fractionSum + stack->valueSum / scaledTotal) * (double)(int)graphHeight; double adjOffsetVal = adjOffset ? (double)(int32_t)adjOffset->offsetVal : 0.0; double halfPoint = (double)(int)y + 0.5; @@ -770,7 +770,7 @@ static void GraphMeterMode_computeColors(Meter* this, const GraphDrawContext* co unsigned int y = restart.nCellsPainted + rItemMinCells; if (adjLarge.nCells > adjSmall.nCells) { - int res = GraphMeterMode_needsExtraCell(graphHeight, scaledTotal, y, &stack, &adjLarge); + int8_t res = GraphMeterMode_needsExtraCell(graphHeight, scaledTotal, y, &stack, &adjLarge); if (res > 0 || (res < 0 && rItemMinCells <= nCells)) { rItemHasExtraCell = true; @@ -779,7 +779,7 @@ static void GraphMeterMode_computeColors(Meter* this, const GraphDrawContext* co } if (rItemHasExtraCell) { - int res = GraphMeterMode_needsExtraCell(graphHeight, scaledTotal, y, &stack, &adjSmall); + int8_t res = GraphMeterMode_needsExtraCell(graphHeight, scaledTotal, y, &stack, &adjSmall); if (res == 0 || (res < 0 && rItemMinCells > nCells)) { rItemHasExtraCell = false;