summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Balneaves <[email protected]>2017-03-29 09:04:59 -0500
committerraveit65 <[email protected]>2017-07-23 14:34:45 +0200
commitf34162f526a49e4302f6b87c82825f316408c745 (patch)
tree9fc5745d7ec13be80d75d9d7acbb1752818519df
parent8bb34e9a0ec0198d198903210a1b405cc01a7768 (diff)
downloadlibmateweather-f34162f526a49e4302f6b87c82825f316408c745.tar.bz2
libmateweather-f34162f526a49e4302f6b87c82825f316408c745.tar.xz
remove warning on unused bsun by actually testing value
-rw-r--r--libmateweather/test_sun_moon.c12
1 files changed, 8 insertions, 4 deletions
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);