From 13390ca75860ca5ae7ff04ec4f67e2e2ee22b473 Mon Sep 17 00:00:00 2001 From: Scott Allen Date: Mon, 15 Sep 2014 19:19:15 -0400 Subject: [PATCH] Fix compiler warning: signed/unsigned comparison --- MicroView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MicroView.cpp b/MicroView.cpp index 53f0ca3..afa5eff 100644 --- a/MicroView.cpp +++ b/MicroView.cpp @@ -631,11 +631,11 @@ void MicroView::circleFill(uint8_t x0, uint8_t y0, uint8_t radius, uint8_t color bool intersected = false; // Optimization: relative x squared only changes with the outer loop/the horizontal scan. - int16_t rx2 = (x-x0) * (x-x0); + uint16_t rx2 = (x-x0) * (x-x0); // Scan vertically... for (uint16_t y = yStart; y <= yEnd; ++y) { - int16_t ry2 = (y-y0) * (y-y0); + uint16_t ry2 = (y-y0) * (y-y0); if (rx2 + ry2 <= radiusSq) { pixel(x, y, color, mode); intersected = true;