~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/functions/time/add_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:
51
51
 
52
52
/**
53
53
  ADDTIME(t,a) and SUBTIME(t,a) are time functions that calculate a
54
 
  time/datetime value 
 
54
  time/datetime value
55
55
 
56
56
  t: time_or_datetime_expression
57
57
  a: time_expression
58
 
  
 
58
 
59
59
  Result: Time value or datetime value
60
60
*/
61
61
 
71
71
  null_value=0;
72
72
  if (is_date)                        // TIMESTAMP function
73
73
  {
74
 
    if (get_arg0_date(&l_time1, TIME_FUZZY_DATE) || 
 
74
    if (get_arg0_date(&l_time1, TIME_FUZZY_DATE) ||
75
75
        args[1]->get_time(&l_time2) ||
76
 
        l_time1.time_type == DRIZZLE_TIMESTAMP_TIME || 
 
76
        l_time1.time_type == DRIZZLE_TIMESTAMP_TIME ||
77
77
        l_time2.time_type != DRIZZLE_TIMESTAMP_TIME)
78
78
      goto null_date;
79
79
  }
80
80
  else                                // ADDTIME function
81
81
  {
82
 
    if (args[0]->get_time(&l_time1) || 
 
82
    if (args[0]->get_time(&l_time1) ||
83
83
        args[1]->get_time(&l_time2) ||
84
84
        l_time2.time_type == DRIZZLE_TIMESTAMP_DATETIME)
85
85
      goto null_date;
87
87
  }
88
88
  if (l_time1.neg != l_time2.neg)
89
89
    l_sign= -l_sign;
90
 
  
 
90
 
91
91
  memset(&l_time3, 0, sizeof(l_time3));
92
 
  
 
92
 
93
93
  l_time3.neg= calc_time_diff(&l_time1, &l_time2, -l_sign,
94
94
                              &seconds, &microseconds);
95
95
 
117
117
      return str;
118
118
    goto null_date;
119
119
  }
120
 
  
 
120
 
121
121
  l_time3.hour+= days*24;
122
122
  if (!make_datetime_with_warn(l_time1.second_part || l_time2.second_part ?
123
123
                               TIME_MICROSECOND : TIME_ONLY,