mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
Kill off red blobs in most of main/*
Everything still compiled after making these changes, so I assume these whitespace-only changes didn't break anything (and shouldn't have). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1290,7 +1290,7 @@ static int tzparse(const char *name, struct state *sp, const int lastditch)
|
||||
for (year = EPOCH_YEAR;
|
||||
sp->timecnt + 2 <= TZ_MAX_TIMES;
|
||||
++year) {
|
||||
time_t newfirst;
|
||||
time_t newfirst;
|
||||
|
||||
starttime = transtime(janfirst, year, &start,
|
||||
stdoffset);
|
||||
@@ -1578,23 +1578,23 @@ struct ast_tm *ast_localtime(const struct timeval *timep, struct ast_tm *tmp, co
|
||||
}
|
||||
|
||||
/*
|
||||
** This function provides informaton about daylight savings time
|
||||
** for the given timezone. This includes whether it can determine
|
||||
** if daylight savings is used for this timezone, the UTC times for
|
||||
** when daylight savings transitions, and the offset in seconds from
|
||||
** UTC.
|
||||
** This function provides informaton about daylight savings time
|
||||
** for the given timezone. This includes whether it can determine
|
||||
** if daylight savings is used for this timezone, the UTC times for
|
||||
** when daylight savings transitions, and the offset in seconds from
|
||||
** UTC.
|
||||
*/
|
||||
|
||||
void ast_get_dst_info(const time_t * const timep, int *dst_enabled, time_t *dst_start, time_t *dst_end, int *gmt_off, const char * const zone)
|
||||
{
|
||||
int i;
|
||||
int i;
|
||||
int transition1 = -1;
|
||||
int transition2 = -1;
|
||||
time_t seconds;
|
||||
int bounds_exceeded = 0;
|
||||
time_t t = *timep;
|
||||
const struct state *sp;
|
||||
|
||||
|
||||
if (NULL == dst_enabled)
|
||||
return;
|
||||
*dst_enabled = 0;
|
||||
@@ -1602,17 +1602,17 @@ void ast_get_dst_info(const time_t * const timep, int *dst_enabled, time_t *dst_
|
||||
if (NULL == dst_start || NULL == dst_end || NULL == gmt_off)
|
||||
return;
|
||||
|
||||
*gmt_off = 0;
|
||||
|
||||
*gmt_off = 0;
|
||||
|
||||
sp = ast_tzset(zone);
|
||||
if (NULL == sp)
|
||||
if (NULL == sp)
|
||||
return;
|
||||
|
||||
/* If the desired time exceeds the bounds of the defined time transitions
|
||||
* then give give up on determining DST info and simply look for gmt offset
|
||||
* This requires that I adjust the given time using increments of Gregorian
|
||||
* repeats to place the time within the defined time transitions in the
|
||||
* timezone structure.
|
||||
|
||||
/* If the desired time exceeds the bounds of the defined time transitions
|
||||
* then give give up on determining DST info and simply look for gmt offset
|
||||
* This requires that I adjust the given time using increments of Gregorian
|
||||
* repeats to place the time within the defined time transitions in the
|
||||
* timezone structure.
|
||||
*/
|
||||
if ((sp->goback && t < sp->ats[0]) ||
|
||||
(sp->goahead && t > sp->ats[sp->timecnt - 1])) {
|
||||
@@ -1635,7 +1635,7 @@ void ast_get_dst_info(const time_t * const timep, int *dst_enabled, time_t *dst_
|
||||
t += seconds;
|
||||
else
|
||||
t -= seconds;
|
||||
|
||||
|
||||
if (t < sp->ats[0] || t > sp->ats[sp->timecnt - 1])
|
||||
return; /* "cannot happen" */
|
||||
|
||||
@@ -1654,26 +1654,26 @@ void ast_get_dst_info(const time_t * const timep, int *dst_enabled, time_t *dst_
|
||||
}
|
||||
*gmt_off = sp->ttis[i].tt_gmtoff;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 1; i < sp->timecnt; ++i) {
|
||||
if (t < sp->ats[i]) {
|
||||
transition1 = sp->types[i - 1];
|
||||
transition2 = sp->types[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* if I found transition times that do not bounded the given time and these correspond to
|
||||
/* if I found transition times that do not bounded the given time and these correspond to
|
||||
or the bounding zones do not reflect a changes in day light savings, then I do not have dst active */
|
||||
if (i >= sp->timecnt || 0 > transition1 || 0 > transition2 ||
|
||||
(sp->ttis[transition1].tt_isdst == sp->ttis[transition2].tt_isdst)) {
|
||||
*dst_enabled = 0;
|
||||
*gmt_off = sp->ttis[sp->types[sp->timecnt -1]].tt_gmtoff;
|
||||
*gmt_off = sp->ttis[sp->types[sp->timecnt -1]].tt_gmtoff;
|
||||
} else {
|
||||
/* I have valid daylight savings information. */
|
||||
if(sp->ttis[transition2].tt_isdst)
|
||||
if(sp->ttis[transition2].tt_isdst)
|
||||
*gmt_off = sp->ttis[transition1].tt_gmtoff;
|
||||
else
|
||||
else
|
||||
*gmt_off = sp->ttis[transition2].tt_gmtoff;
|
||||
|
||||
/* If I adjusted the time earlier, indicate that the dst is invalid */
|
||||
@@ -1688,7 +1688,7 @@ void ast_get_dst_info(const time_t * const timep, int *dst_enabled, time_t *dst_
|
||||
*dst_end = sp->ats[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/*! \file
|
||||
/*! \file
|
||||
\brief Testing localtime functionality */
|
||||
|
||||
#include "localtime.c"
|
||||
|
Reference in New Issue
Block a user