~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/time/period_add.cc

  • Committer: Brian Aker
  • Date: 2008-12-23 07:19:26 UTC
  • Revision ID: brian@tangent.org-20081223071926-69z2ugpftfz1lfnm
Remove dead variables.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include "config.h"
21
 
 
22
 
#include "drizzled/function/time/period_add.h"
23
 
#include "drizzled/calendar.h"
24
 
 
25
 
namespace drizzled
26
 
{
 
20
#include <drizzled/server_includes.h>
 
21
#include CSTDINT_H
 
22
#include <drizzled/function/time/period_add.h>
27
23
 
28
24
int64_t Item_func_period_add::val_int()
29
25
{
30
26
  assert(fixed == 1);
31
 
  uint32_t period= (uint32_t) args[0]->val_int();
32
 
  uint32_t months= (uint32_t) args[1]->val_int();
 
27
  uint32_t period= args[0]->val_int();
 
28
  int months=(int) args[1]->val_int();
33
29
 
34
 
  if ((null_value= args[0]->null_value || args[1]->null_value) ||
 
30
  if ((null_value=args[0]->null_value || args[1]->null_value) ||
35
31
      period == 0L)
36
 
    return 0;
37
 
 
38
 
  return (int64_t) months_to_year_month(year_month_to_months(period) + months);
 
32
    return 0; /* purecov: inspected */
 
33
  return (int64_t)
 
34
    convert_month_to_period((uint) ((int) convert_period_to_month(period)+
 
35
                                    months));
39
36
}
40
37
 
41
 
} /* namespace drizzled */