From 8da9f28157f3bb38a4ddc3723ea54930df430107 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Thu, 3 Nov 2016 12:58:21 -0600 Subject: [PATCH] gas: fix sign comparison warnings Signed-off-by: Jon Trulson --- src/gas/gas.cxx | 2 +- src/gas/gas.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gas/gas.cxx b/src/gas/gas.cxx index 06855aeb..ac261102 100644 --- a/src/gas/gas.cxx +++ b/src/gas/gas.cxx @@ -92,7 +92,7 @@ Gas::getSample () { void Gas::printGraph (thresholdContext* ctx, uint8_t resolution) { std::cout << "(" << ctx->runningAverage << ") | "; - for (int i = 0; i < ctx->runningAverage / resolution; i++) + for (unsigned int i = 0; i < ctx->runningAverage / resolution; i++) std::cout << "*"; std::cout << std::endl; } diff --git a/src/gas/gas.hpp b/src/gas/gas.hpp index 60b7a8f2..00f59b7a 100644 --- a/src/gas/gas.hpp +++ b/src/gas/gas.hpp @@ -28,7 +28,7 @@ struct thresholdContext { long averageReading; - long runningAverage; + unsigned long runningAverage; int averagedOver; };