Skip to content

Commit

Permalink
"increment" arg back in unsigned int type
Browse files Browse the repository at this point in the history
This reverts commit 619badc.
  • Loading branch information
Explorer09 committed Feb 3, 2024
1 parent 97bb649 commit 5d249e8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5d249e8

Please sign in to comment.