@@ -89,7 +89,7 @@ static void repopulate_timezone_cache(
89
89
return ;
90
90
}
91
91
cache.clear ();
92
- DYNAMIC_TIME_ZONE_INFORMATION dtzi;
92
+ DYNAMIC_TIME_ZONE_INFORMATION dtzi{} ;
93
93
next_flush = current_time + CACHE_INVALIDATION_TIMEOUT;
94
94
for (DWORD dwResult = 0 , i = 0 ; dwResult != ERROR_NO_MORE_ITEMS; ++i) {
95
95
dwResult = EnumDynamicTimeZoneInformation (i, &dtzi);
@@ -135,17 +135,14 @@ representing a proper date at a given year.
135
135
*/
136
136
static void get_transition_date (int year, const SYSTEMTIME& src, SYSTEMTIME& dst)
137
137
{
138
- // if the year is 0, this is the absolute time.
138
+ dst = src;
139
+ // if the year is not 0, this is the absolute time.
139
140
if (src.wYear != 0 ) {
140
- dst = src;
141
141
return ;
142
142
}
143
- // otherwise, the transition happens yearly...
143
+ /* otherwise, the transition happens yearly at the specified month, hour,
144
+ and minute at the specified day of the week. */
144
145
dst.wYear = year;
145
- // at the specified month, hour, and minute.
146
- dst.wMonth = src.wMonth ; dst.wHour = src.wHour ; dst.wMinute = src.wMinute ;
147
- // at the specified day of the week.
148
- dst.wDayOfWeek = src.wDayOfWeek ;
149
146
// The number of the occurrence of the specified day of week in the month,
150
147
// or the special value "5" to denote the last such occurrence.
151
148
unsigned int dowOccurrenceNumber = src.wDay ;
@@ -248,7 +245,7 @@ static bool is_daylight_time(
248
245
static int offset_at_systime (DYNAMIC_TIME_ZONE_INFORMATION& dtzi,
249
246
const SYSTEMTIME& systime)
250
247
{
251
- TIME_ZONE_INFORMATION tzi;
248
+ TIME_ZONE_INFORMATION tzi{} ;
252
249
bool result = GetTimeZoneInformationForYear (systime.wYear , &dtzi, &tzi);
253
250
if (!result) {
254
251
return INT_MAX;
0 commit comments