~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/time.cc

  • Committer: Brian Aker
  • Date: 2008-07-13 22:45:08 UTC
  • Revision ID: brian@tangent.org-20080713224508-hb20z4okblotb39a
longlong replacement

Show diffs side-by-side

added added

removed removed

Lines of Context:
784
784
  case INTERVAL_DAY_MINUTE:
785
785
  case INTERVAL_DAY_HOUR:
786
786
  {
787
 
    longlong sec, days, daynr, microseconds, extra_sec;
 
787
    int64_t sec, days, daynr, microseconds, extra_sec;
788
788
    ltime->time_type= MYSQL_TIMESTAMP_DATETIME; // Return full date
789
789
    microseconds= ltime->second_part + sign*interval.second_part;
790
790
    extra_sec= microseconds/1000000L;
792
792
 
793
793
    sec=((ltime->day-1)*3600*24L+ltime->hour*3600+ltime->minute*60+
794
794
         ltime->second +
795
 
         sign* (longlong) (interval.day*3600*24L +
 
795
         sign* (int64_t) (interval.day*3600*24L +
796
796
                           interval.hour*3600LL+interval.minute*60LL+
797
797
                           interval.second))+ extra_sec;
798
798
    if (microseconds < 0)
896
896
*/
897
897
 
898
898
bool
899
 
calc_time_diff(MYSQL_TIME *l_time1, MYSQL_TIME *l_time2, int l_sign, longlong *seconds_out,
 
899
calc_time_diff(MYSQL_TIME *l_time1, MYSQL_TIME *l_time2, int l_sign, int64_t *seconds_out,
900
900
               long *microseconds_out)
901
901
{
902
902
  long days;
903
903
  bool neg;
904
 
  longlong microseconds;
 
904
  int64_t microseconds;
905
905
 
906
906
  /*
907
907
    We suppose that if first argument is MYSQL_TIMESTAMP_TIME
923
923
                               (uint) l_time2->day);
924
924
  }
925
925
 
926
 
  microseconds= ((longlong)days*86400LL +
927
 
                 (longlong)(l_time1->hour*3600L +
 
926
  microseconds= ((int64_t)days*86400LL +
 
927
                 (int64_t)(l_time1->hour*3600L +
928
928
                            l_time1->minute*60L +
929
929
                            l_time1->second) -
930
 
                 l_sign*(longlong)(l_time2->hour*3600L +
 
930
                 l_sign*(int64_t)(l_time2->hour*3600L +
931
931
                                   l_time2->minute*60L +
932
932
                                   l_time2->second)) * 1000000LL +
933
 
                (longlong)l_time1->second_part -
934
 
                l_sign*(longlong)l_time2->second_part;
 
933
                (int64_t)l_time1->second_part -
 
934
                l_sign*(int64_t)l_time2->second_part;
935
935
 
936
936
  neg= 0;
937
937
  if (microseconds < 0)