From f34162f526a49e4302f6b87c82825f316408c745 Mon Sep 17 00:00:00 2001 From: Scott Balneaves Date: Wed, 29 Mar 2017 09:04:59 -0500 Subject: remove warning on unused bsun by actually testing value --- libmateweather/test_sun_moon.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'libmateweather') diff --git a/libmateweather/test_sun_moon.c b/libmateweather/test_sun_moon.c index 9ee1fd7..a3ab787 100644 --- a/libmateweather/test_sun_moon.c +++ b/libmateweather/test_sun_moon.c @@ -71,10 +71,14 @@ main (int argc, char **argv) fabs(latitude), (latitude >= 0. ? 'N' : 'S'), fabs(longitude), (longitude >= 0. ? 'E' : 'W'), asctime(gmtime(&info.update))); - printf("sunrise: %s", - (info.sunriseValid ? ctime(&info.sunrise) : "(invalid)\n")); - printf("sunset: %s", - (info.sunsetValid ? ctime(&info.sunset) : "(invalid)\n")); + + if (bsun) { + printf("sunrise: %s", + (info.sunriseValid ? ctime(&info.sunrise) : "(invalid)\n")); + printf("sunset: %s", + (info.sunsetValid ? ctime(&info.sunset) : "(invalid)\n")); + } + if (bmoon) { printf("moonphase: %g\n", info.moonphase); printf("moonlat: %g\n", info.moonlatitude); -- cgit v1.2.1