[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-libc-commit] [2537] util/eu_dst.h: Fix reversed DST decision logic
From: |
j |
Subject: |
[avr-libc-commit] [2537] util/eu_dst.h: Fix reversed DST decision logic for March and October |
Date: |
Fri, 31 Mar 2017 15:46:35 -0400 (EDT) |
Revision: 2537
http://svn.sv.gnu.org/viewvc/?view=rev&root=avr-libc&revision=2537
Author: joerg_wunsch
Date: 2017-03-31 15:46:35 -0400 (Fri, 31 Mar 2017)
Log Message:
-----------
util/eu_dst.h: Fix reversed DST decision logic for March and October
Modified Paths:
--------------
trunk/avr-libc/ChangeLog
trunk/avr-libc/NEWS
trunk/avr-libc/include/util/eu_dst.h
Modified: trunk/avr-libc/ChangeLog
===================================================================
--- trunk/avr-libc/ChangeLog 2017-03-07 07:13:41 UTC (rev 2536)
+++ trunk/avr-libc/ChangeLog 2017-03-31 19:46:35 UTC (rev 2537)
@@ -1,3 +1,8 @@
+2017-03-31 Joerg Wunsch <address@hidden>
+
+ * include/util/eu_dst.h: Fix reversed DST decision logic for March
+ and October.
+
2017-03-07 Pitchumani Sivanupandi <address@hidden>
Fix for bug #50439: avr/iom32u4.h does not define PRTIM4
Modified: trunk/avr-libc/NEWS
===================================================================
--- trunk/avr-libc/NEWS 2017-03-07 07:13:41 UTC (rev 2536)
+++ trunk/avr-libc/NEWS 2017-03-31 19:46:35 UTC (rev 2537)
@@ -9,6 +9,7 @@
[#49447] Example code for uart_putchar() has error in recursive call
strings for storage in program memory
[#50439] avr/iom32u4.h does not define PRTIM4
+ [no-id] util/eu_dst.h: fix reversed DST decision logic for March and October
* New devices supported:
Modified: trunk/avr-libc/include/util/eu_dst.h
===================================================================
--- trunk/avr-libc/include/util/eu_dst.h 2017-03-07 07:13:41 UTC (rev
2536)
+++ trunk/avr-libc/include/util/eu_dst.h 2017-03-31 19:46:35 UTC (rev
2537)
@@ -88,24 +88,25 @@
n = 31 - d;
n /= 7; /* number of Sundays left in the month */
- d = d + 7 * n; /* mday of final Sunday */
+ d = d + 7 * n; /* d: mday of final Sunday */
if (month == MARCH) {
- if (d < mday)
+ if (mday < d) /* before last Sunday */
return 0;
- if (d > mday)
+ if (mday > d) /* past last Sunday */
return ONE_HOUR;
- if (hour < 2)
+ if (hour < 2) /* at last Sunday, before switching */
return 0;
- return ONE_HOUR;
+ return ONE_HOUR; /* at last Sunday, after switching */
}
- if (d < mday)
+ /* month == OCTOBER */
+ if (mday < d) /* before last Sunday */
return ONE_HOUR;
- if (d > mday)
+ if (mday > d) /* past last Sunday */
return 0;
- if (hour < 2)
+ if (hour < 2) /* at last Sunday, before switching */
return ONE_HOUR;
- return 0;
+ return 0; /* at last Sunday, after switchin */
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [avr-libc-commit] [2537] util/eu_dst.h: Fix reversed DST decision logic for March and October,
j <=