~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_time.cc

  • Committer: Eric Herman
  • Date: 2008-12-06 19:42:46 UTC
  • mto: (656.1.6 devel)
  • mto: This revision was merged to the branch mainline in revision 665.
  • Revision ID: eric@mysql.com-20081206194246-5cdexuu81i366eek
removed trailing whitespace with simple script:

for file in $(find . -name "*.c") $(find . -name "*.cc") $(find . -name "*.h"); do ruby -pe 'gsub(/\s+$/, $/)' < $file > $file.out; mv $file.out $file; done;

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
unsigned char days_in_month[]= {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 0};
43
43
 
44
44
/*
45
 
  Offset of system time zone from UTC in seconds used to speed up 
 
45
  Offset of system time zone from UTC in seconds used to speed up
46
46
  work of my_system_gmt_sec() function.
47
47
*/
48
48
static long my_time_zone=0;
588
588
  }
589
589
  else
590
590
    date[4]=0;
591
 
    
 
591
 
592
592
  /* Check for exponent part: E<gigit> | E<sign><digit> */
593
593
  /* (may occur as result of %g formatting of time value) */
594
594
  if ((end - str) > 1 &&
621
621
      date[2] > UINT_MAX || date[3] > UINT_MAX ||
622
622
      date[4] > UINT_MAX)
623
623
    return 1;
624
 
  
 
624
 
625
625
  l_time->year=         0;                      /* For protocol::store_time */
626
626
  l_time->month=        0;
627
627
  l_time->day=          date[0];
634
634
  /* Check if the value is valid and fits into DRIZZLE_TIME range */
635
635
  if (check_time_range(l_time, warning))
636
636
    return 1;
637
 
  
 
637
 
638
638
  /* Check if there is garbage at end of the DRIZZLE_TIME specification */
639
639
  if (str != end)
640
640
  {
669
669
    1        time value is invalid
670
670
*/
671
671
 
672
 
int check_time_range(DRIZZLE_TIME *my_time, int *warning) 
 
672
int check_time_range(DRIZZLE_TIME *my_time, int *warning)
673
673
{
674
674
  int64_t hour;
675
675
 
782
782
      in_dst_time_gap - set to true if time falls into spring time-gap
783
783
 
784
784
  NOTES
785
 
    The idea is to cache the time zone offset from UTC (including daylight 
786
 
    saving time) for the next call to make things faster. But currently we 
787
 
    just calculate this offset during startup (by calling init_time() 
 
785
    The idea is to cache the time zone offset from UTC (including daylight
 
786
    saving time) for the next call to make things faster. But currently we
 
787
    just calculate this offset during startup (by calling init_time()
788
788
    function) and use it all the time.
789
789
    Time value provided should be legal time value (e.g. '2003-01-01 25:00:00'
790
790
    is not allowed).