Skip to content

Commit cdd2b8a

Browse files
committed
Merge whitespace changes that have been made to timelib and PHP-5.6 and master
1 parent 3cd3881 commit cdd2b8a

File tree

9 files changed

+67
-67
lines changed

9 files changed

+67
-67
lines changed

ext/date/lib/astro.c

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static double astro_GMST0(double d)
115115
/* time, imposing no runtime or code overhead. */
116116
sidtim0 = astro_revolution((180.0 + 356.0470 + 282.9404) + (0.9856002585 + 4.70935E-5) * d);
117117
return sidtim0;
118-
}
118+
}
119119

120120
/* This function computes the Sun's position at any instant */
121121

@@ -177,32 +177,32 @@ static void astro_sun_RA_dec(double d, double *RA, double *dec, double *r)
177177

178178
/**
179179
* Note: timestamp = unixtimestamp (NEEDS to be 00:00:00 UT)
180-
* Eastern longitude positive, Western longitude negative
181-
* Northern latitude positive, Southern latitude negative
182-
* The longitude value IS critical in this function!
183-
* altit = the altitude which the Sun should cross
184-
* Set to -35/60 degrees for rise/set, -6 degrees
185-
* for civil, -12 degrees for nautical and -18
186-
* degrees for astronomical twilight.
187-
* upper_limb: non-zero -> upper limb, zero -> center
188-
* Set to non-zero (e.g. 1) when computing rise/set
189-
* times, and to zero when computing start/end of
190-
* twilight.
191-
* *rise = where to store the rise time
192-
* *set = where to store the set time
193-
* Both times are relative to the specified altitude,
194-
* and thus this function can be used to compute
195-
* various twilight times, as well as rise/set times
196-
* Return value: 0 = sun rises/sets this day, times stored at
197-
* *trise and *tset.
198-
* +1 = sun above the specified "horizon" 24 hours.
199-
* *trise set to time when the sun is at south,
200-
* minus 12 hours while *tset is set to the south
201-
* time plus 12 hours. "Day" length = 24 hours
202-
* -1 = sun is below the specified "horizon" 24 hours
203-
* "Day" length = 0 hours, *trise and *tset are
204-
* both set to the time when the sun is at south.
205-
*
180+
* Eastern longitude positive, Western longitude negative
181+
* Northern latitude positive, Southern latitude negative
182+
* The longitude value IS critical in this function!
183+
* altit = the altitude which the Sun should cross
184+
* Set to -35/60 degrees for rise/set, -6 degrees
185+
* for civil, -12 degrees for nautical and -18
186+
* degrees for astronomical twilight.
187+
* upper_limb: non-zero -> upper limb, zero -> center
188+
* Set to non-zero (e.g. 1) when computing rise/set
189+
* times, and to zero when computing start/end of
190+
* twilight.
191+
* *rise = where to store the rise time
192+
* *set = where to store the set time
193+
* Both times are relative to the specified altitude,
194+
* and thus this function can be used to compute
195+
* various twilight times, as well as rise/set times
196+
* Return value: 0 = sun rises/sets this day, times stored at
197+
* *trise and *tset.
198+
* +1 = sun above the specified "horizon" 24 hours.
199+
* *trise set to time when the sun is at south,
200+
* minus 12 hours while *tset is set to the south
201+
* time plus 12 hours. "Day" length = 24 hours
202+
* -1 = sun is below the specified "horizon" 24 hours
203+
* "Day" length = 0 hours, *trise and *tset are
204+
* both set to the time when the sun is at south.
205+
*
206206
*/
207207
int timelib_astro_rise_set_altitude(timelib_time *t_loc, double lon, double lat, double altit, int upper_limb, double *h_rise, double *h_set, timelib_sll *ts_rise, timelib_sll *ts_set, timelib_sll *ts_transit)
208208
{

ext/date/lib/dow.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ void timelib_isoweek_from_date(timelib_sll y, timelib_sll m, timelib_sll d, time
136136
timelib_sll timelib_daynr_from_weeknr(timelib_sll y, timelib_sll w, timelib_sll d)
137137
{
138138
timelib_sll dow, day;
139-
139+
140140
/* Figure out the dayofweek for y-1-1 */
141141
dow = timelib_day_of_week(y, 1, 1);
142142
/* then use that to figure out the offset for day 1 of week 1 */

ext/date/lib/parse_date.re

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ const static timelib_tz_lookup_table* abbr_search(const char *word, long gmtoffs
677677
if (strcasecmp("utc", word) == 0 || strcasecmp("gmt", word) == 0) {
678678
return timelib_timezone_utc;
679679
}
680-
680+
681681
for (tp = timelib_timezone_lookup; tp->name; tp++) {
682682
if (strcasecmp(word, tp->name) == 0) {
683683
if (!first_found) {
@@ -808,7 +808,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
808808
{
809809
uchar *cursor = s->cur;
810810
char *str, *ptr = NULL;
811-
811+
812812
std:
813813
s->tok = cursor;
814814
s->len = 0;
@@ -1437,7 +1437,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
14371437
TIMELIB_INIT;
14381438
TIMELIB_HAVE_DATE();
14391439
TIMELIB_HAVE_RELATIVE();
1440-
1440+
14411441
s->time->y = timelib_get_nr((char **) &ptr, 4);
14421442
w = timelib_get_nr((char **) &ptr, 2);
14431443
d = timelib_get_nr((char **) &ptr, 1);
@@ -1456,7 +1456,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
14561456
TIMELIB_INIT;
14571457
TIMELIB_HAVE_DATE();
14581458
TIMELIB_HAVE_RELATIVE();
1459-
1459+
14601460
s->time->y = timelib_get_nr((char **) &ptr, 4);
14611461
w = timelib_get_nr((char **) &ptr, 2);
14621462
d = 1;
@@ -1560,7 +1560,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
15601560
if (s->time->relative.weekday_behavior != 2) {
15611561
s->time->relative.weekday_behavior = 1;
15621562
}
1563-
1563+
15641564
TIMELIB_DEINIT;
15651565
return TIMELIB_WEEKDAY;
15661566
}
@@ -1877,7 +1877,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
18771877
add_pbf_error(s, "A textual day could not be found", string, begin);
18781878
break;
18791879
} else {
1880-
in.time->have_relative = 1;
1880+
in.time->have_relative = 1;
18811881
in.time->relative.have_weekday_relative = 1;
18821882
in.time->relative.weekday = tmprel->multiplier;
18831883
in.time->relative.weekday_behavior = 1;
@@ -2148,13 +2148,13 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
21482148

21492149
/* do funky checking whether the parsed time was valid time */
21502150
if (s->time->h != TIMELIB_UNSET && s->time->i != TIMELIB_UNSET &&
2151-
s->time->s != TIMELIB_UNSET &&
2151+
s->time->s != TIMELIB_UNSET &&
21522152
!timelib_valid_time( s->time->h, s->time->i, s->time->s)) {
21532153
add_pbf_warning(s, "The parsed time was invalid", string, ptr);
21542154
}
21552155
/* do funky checking whether the parsed date was valid date */
21562156
if (s->time->y != TIMELIB_UNSET && s->time->m != TIMELIB_UNSET &&
2157-
s->time->d != TIMELIB_UNSET &&
2157+
s->time->d != TIMELIB_UNSET &&
21582158
!timelib_valid_date( s->time->y, s->time->m, s->time->d)) {
21592159
add_pbf_warning(s, "The parsed date was invalid", string, ptr);
21602160
}
@@ -2227,7 +2227,7 @@ int main(void)
22272227
printf ("%04d-%02d-%02d %02d:%02d:%02d.%-5d %+04d %1d",
22282228
time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst);
22292229
if (time.have_relative) {
2230-
printf ("%3dY %3dM %3dD / %3dH %3dM %3dS",
2230+
printf ("%3dY %3dM %3dD / %3dH %3dM %3dS",
22312231
time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative.s);
22322232
}
22332233
if (time.have_weekday_relative) {
@@ -2236,7 +2236,7 @@ int main(void)
22362236
if (time.have_weeknr_day) {
22372237
printf(" / %dW%d", time.relative.weeknr_day.weeknr, time.relative.weeknr_day.dayofweek);
22382238
}
2239-
return 0;
2239+
return 0;
22402240
}
22412241
#endif
22422242

ext/date/lib/parse_iso_intervals.re

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ static int scan(Scanner *s)
242242
{
243243
uchar *cursor = s->cur;
244244
char *str, *ptr = NULL;
245-
245+
246246
std:
247247
s->tok = cursor;
248248
s->len = 0;
@@ -336,11 +336,11 @@ isoweek = year4 "-"? "W" weekofyear;
336336
case 'D': s->period->d = nr; break;
337337
case 'H': s->period->h = nr; break;
338338
case 'S': s->period->s = nr; break;
339-
case 'M':
339+
case 'M':
340340
if (in_time) {
341341
s->period->i = nr;
342342
} else {
343-
s->period->m = nr;
343+
s->period->m = nr;
344344
}
345345
break;
346346
default:
@@ -398,9 +398,9 @@ isoweek = year4 "-"? "W" weekofyear;
398398

399399
/*!max:re2c */
400400

401-
void timelib_strtointerval(char *s, int len,
402-
timelib_time **begin, timelib_time **end,
403-
timelib_rel_time **period, int *recurrences,
401+
void timelib_strtointerval(char *s, int len,
402+
timelib_time **begin, timelib_time **end,
403+
timelib_rel_time **period, int *recurrences,
404404
struct timelib_error_container **errors)
405405
{
406406
Scanner in;

ext/date/lib/parse_tz.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
3737
# if defined(__LITTLE_ENDIAN__)
3838
# undef WORDS_BIGENDIAN
39-
# else
39+
# else
4040
# if defined(__BIG_ENDIAN__)
4141
# define WORDS_BIGENDIAN
4242
# endif
@@ -56,7 +56,7 @@ static int read_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
5656
/* read ID */
5757
version = (*tzf)[3] - '0';
5858
*tzf += 4;
59-
59+
6060
/* read BC flag */
6161
tz->bc = (**tzf == '\1');
6262
*tzf += 1;
@@ -119,7 +119,7 @@ static void read_transistions(const unsigned char **tzf, timelib_tzinfo *tz)
119119
memcpy(cbuffer, *tzf, sizeof(unsigned char) * tz->timecnt);
120120
*tzf += sizeof(unsigned char) * tz->timecnt;
121121
}
122-
122+
123123
tz->trans = buffer;
124124
tz->trans_idx = cbuffer;
125125
}
@@ -307,7 +307,7 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const
307307
cur_locale = strdup(tmp);
308308
}
309309
setlocale(LC_CTYPE, "C");
310-
#endif
310+
#endif
311311

312312
do {
313313
int mid = ((unsigned)left + right) >> 1;
@@ -322,7 +322,7 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const
322322
#ifdef HAVE_SETLOCALE
323323
setlocale(LC_CTYPE, cur_locale);
324324
if (cur_locale) free(cur_locale);
325-
#endif
325+
#endif
326326
return 1;
327327
}
328328

@@ -331,7 +331,7 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const
331331
#ifdef HAVE_SETLOCALE
332332
setlocale(LC_CTYPE, cur_locale);
333333
if (cur_locale) free(cur_locale);
334-
#endif
334+
#endif
335335
return 0;
336336
}
337337

@@ -449,7 +449,7 @@ int timelib_timestamp_is_in_dst(timelib_sll ts, timelib_tzinfo *tz)
449449
{
450450
ttinfo *to;
451451
timelib_sll dummy;
452-
452+
453453
if ((to = fetch_timezone_offset(tz, ts, &dummy))) {
454454
return to->isdst;
455455
}
@@ -492,12 +492,12 @@ timelib_sll timelib_get_current_offset(timelib_time *t)
492492
{
493493
timelib_time_offset *gmt_offset;
494494
timelib_sll retval;
495-
495+
496496
switch (t->zone_type) {
497497
case TIMELIB_ZONETYPE_ABBR:
498498
case TIMELIB_ZONETYPE_OFFSET:
499499
return (t->z + t->dst) * -60;
500-
500+
501501
case TIMELIB_ZONETYPE_ID:
502502
gmt_offset = timelib_get_time_zone_info(t->sse, t->tz_info);
503503
retval = gmt_offset->offset;

ext/date/lib/timelib.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ timelib_tzinfo *timelib_tzinfo_clone(timelib_tzinfo *tz)
122122
tmp->timecnt = tz->timecnt;
123123
tmp->typecnt = tz->typecnt;
124124
tmp->charcnt = tz->charcnt;
125-
125+
126126
tmp->trans = (int32_t *) malloc(tz->timecnt * sizeof(int32_t));
127127
tmp->trans_idx = (unsigned char*) malloc(tz->timecnt * sizeof(unsigned char));
128128
memcpy(tmp->trans, tz->trans, tz->timecnt * sizeof(int32_t));
@@ -236,7 +236,7 @@ void timelib_dump_date(timelib_time *d, int options)
236236

237237
if ((options & 1) == 1) {
238238
if (d->have_relative) {
239-
printf("%3lldY %3lldM %3lldD / %3lldH %3lldM %3lldS",
239+
printf("%3lldY %3lldM %3lldD / %3lldH %3lldM %3lldS",
240240
d->relative.y, d->relative.m, d->relative.d, d->relative.h, d->relative.i, d->relative.s);
241241
if (d->relative.first_last_day_of != 0) {
242242
switch (d->relative.first_last_day_of) {
@@ -271,7 +271,7 @@ void timelib_dump_date(timelib_time *d, int options)
271271

272272
void timelib_dump_rel_time(timelib_rel_time *d)
273273
{
274-
printf("%3lldY %3lldM %3lldD / %3lldH %3lldM %3lldS (days: %lld)%s",
274+
printf("%3lldY %3lldM %3lldD / %3lldH %3lldM %3lldS (days: %lld)%s",
275275
d->y, d->m, d->d, d->h, d->i, d->s, d->days, d->invert ? " inverted" : "");
276276
if (d->first_last_day_of != 0) {
277277
switch (d->first_last_day_of) {

ext/date/lib/timelib.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ long timelib_parse_tz_cor(char**);
8080

8181
/* From parse_iso_intervals.re */
8282
void timelib_strtointerval(char *s, int len,
83-
timelib_time **begin, timelib_time **end,
84-
timelib_rel_time **period, int *recurrences,
83+
timelib_time **begin, timelib_time **end,
84+
timelib_rel_time **period, int *recurrences,
8585
struct timelib_error_container **errors);
8686

8787

ext/date/lib/tm2unixtime.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static int do_range_limit_days(timelib_sll *y, timelib_sll *m, timelib_sll *d)
106106
timelib_sll days_this_month;
107107
timelib_sll last_month, last_year;
108108
timelib_sll days_last_month;
109-
109+
110110
/* can jump an entire leap year period quickly */
111111
if (*d >= DAYS_PER_LYEAR_PERIOD || *d <= -DAYS_PER_LYEAR_PERIOD) {
112112
*y += YEARS_PER_LYEAR_PERIOD * (*d / DAYS_PER_LYEAR_PERIOD);
@@ -396,7 +396,7 @@ static timelib_sll do_adjust_timezone(timelib_time *tz, timelib_tzinfo *tzi)
396396
timelib_time_offset *before, *after;
397397
timelib_sll tmp;
398398
int in_transistion;
399-
399+
400400
tz->is_localtime = 1;
401401
before = timelib_get_time_zone_info(tz->sse, tzi);
402402
after = timelib_get_time_zone_info(tz->sse - before->offset, tzi);
@@ -406,7 +406,7 @@ static timelib_sll do_adjust_timezone(timelib_time *tz, timelib_tzinfo *tzi)
406406
((tz->sse - after->offset) >= (after->transistion_time + (before->offset - after->offset))) &&
407407
((tz->sse - after->offset) < after->transistion_time)
408408
);
409-
409+
410410
if ((before->offset != after->offset) && !in_transistion) {
411411
tmp = -after->offset;
412412
} else {
@@ -464,7 +464,7 @@ int main(void)
464464
printf ("%04d-%02d-%02d %02d:%02d:%02d.%-5d %+04d %1d",
465465
time.y, time.m, time.d, time.h, time.i, time.s, time.f, time.z, time.dst);
466466
if (time.have_relative) {
467-
printf ("%3dY %3dM %3dD / %3dH %3dM %3dS",
467+
printf ("%3dY %3dM %3dD / %3dH %3dM %3dS",
468468
time.relative.y, time.relative.m, time.relative.d, time.relative.h, time.relative.i, time.relative.s);
469469
}
470470
if (time.have_weekday_relative) {

ext/date/lib/unixtime2tm.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void timelib_update_from_sse(timelib_time *tm)
141141
signed int dst = tm->dst;
142142

143143
sse = tm->sse;
144-
144+
145145
switch (tm->zone_type) {
146146
case TIMELIB_ZONETYPE_ABBR:
147147
case TIMELIB_ZONETYPE_OFFSET: {
@@ -152,11 +152,11 @@ void timelib_update_from_sse(timelib_time *tm)
152152

153153
case TIMELIB_ZONETYPE_ID: {
154154
timelib_time_offset *gmt_offset;
155-
155+
156156
gmt_offset = timelib_get_time_zone_info(tm->sse, tm->tz_info);
157157
timelib_unixtime2gmt(tm, tm->sse + gmt_offset->offset);
158158
timelib_time_offset_dtor(gmt_offset);
159-
159+
160160
goto cleanup;
161161
}
162162

@@ -182,7 +182,7 @@ void timelib_unixtime2local(timelib_time *tm, timelib_sll ts)
182182
case TIMELIB_ZONETYPE_OFFSET: {
183183
int z = tm->z;
184184
signed int dst = tm->dst;
185-
185+
186186
timelib_unixtime2gmt(tm, ts - (tm->z * 60) + (tm->dst * 3600));
187187

188188
tm->z = z;
@@ -195,7 +195,7 @@ void timelib_unixtime2local(timelib_time *tm, timelib_sll ts)
195195
timelib_unixtime2gmt(tm, ts + gmt_offset->offset);
196196

197197
/* we need to reset the sse here as unixtime2gmt modifies it */
198-
tm->sse = ts;
198+
tm->sse = ts;
199199
tm->dst = gmt_offset->is_dst;
200200
tm->z = gmt_offset->offset;
201201
tm->tz_info = tz;

0 commit comments

Comments
 (0)