[gnome-clocks/bilelmoussaoui/3.36.2: 10/14] Return whether we can calculate the twilight or not
- From: Bilal Elmoussaoui <bilelmoussaoui src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks/bilelmoussaoui/3.36.2: 10/14] Return whether we can calculate the twilight or not
- Date: Sun, 10 May 2020 10:26:28 +0000 (UTC)
commit 2e8a75d55ca1753a3250c6f09283f0a438ffc9f4
Author: Manuel Genovés <manuel genoves gmail com>
Date: Mon Apr 13 18:46:24 2020 +0200
Return whether we can calculate the twilight or not
Signed-off-by: Manuel Genovés <manuel genoves gmail com>
src/twilight.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/twilight.c b/src/twilight.c
index dced3d4..2ad4840 100644
--- a/src/twilight.c
+++ b/src/twilight.c
@@ -17,6 +17,7 @@
* Zander Brown <zbrown gnome org>
*/
+#include <stdbool.h>
#include <math.h>
#include <glib.h>
@@ -74,7 +75,7 @@ is_in_north_winter (int month)
*
* Since: 3.36
*/
-void
+bool
calculate_sunrise_sunset (double lat,
double lon,
int year,
@@ -90,6 +91,7 @@ calculate_sunrise_sunset (double lat,
double sunrise_minute;
double sunset_hour;
double sunset_minute;
+ bool calculatable = TRUE;
// first we calculate our current Julian date
int julian_day_number = ((1461 * (year + 4800 + (month - 14) / 12)) / 4 +
@@ -132,6 +134,8 @@ calculate_sunrise_sunset (double lat,
sunrise_minute = 0;
sunset_hour = 23;
sunset_minute = 59;
+
+ calculatable = FALSE;
} else {
double sunrise_days;
double sunrise_day;
@@ -174,5 +178,7 @@ calculate_sunrise_sunset (double lat,
if (set_min) {
*set_min = sunset_minute;
}
+
+ return calculatable;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]