From 070a672d3e1ddb994f6bd8bdd9f517ec584ae01c Mon Sep 17 00:00:00 2001 From: Marco Nilsson Date: Thu, 5 Sep 2013 17:32:21 +0200 Subject: [PATCH] Fix gcc warning: enumeral and non-enumeral type in conditional expression --- TinyGPS.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TinyGPS.cpp b/TinyGPS.cpp index deae922..ba0d1eb 100644 --- a/TinyGPS.cpp +++ b/TinyGPS.cpp @@ -353,7 +353,7 @@ void TinyGPS::get_position(long *latitude, long *longitude, unsigned long *fix_a if (latitude) *latitude = _latitude; if (longitude) *longitude = _longitude; if (fix_age) *fix_age = _last_position_fix == GPS_INVALID_FIX_TIME ? - GPS_INVALID_AGE : millis() - _last_position_fix; + (unsigned long) GPS_INVALID_AGE : millis() - _last_position_fix; } // date as ddmmyy, time as hhmmsscc, and age in milliseconds @@ -362,7 +362,7 @@ void TinyGPS::get_datetime(unsigned long *date, unsigned long *time, unsigned lo if (date) *date = _date; if (time) *time = _time; if (age) *age = _last_time_fix == GPS_INVALID_FIX_TIME ? - GPS_INVALID_AGE : millis() - _last_time_fix; + (unsigned long) GPS_INVALID_AGE : millis() - _last_time_fix; } void TinyGPS::f_get_position(float *latitude, float *longitude, unsigned long *fix_age)