~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2010-12-12 11:52:00 UTC
  • mto: (2023.3.15 innodb-cxx)
  • mto: This revision was merged to the branch mainline in revision 2014.
  • Revision ID: mordred@inaugust.com-20101212115200-uyk1h5crevvt77gh
RevertĀ -Wc++-compatĀ change.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include <config.h>
 
20
#include "config.h"
21
21
 
22
 
#include <drizzled/function/time/makedate.h>
23
 
#include <drizzled/time_functions.h>
 
22
#include "drizzled/function/time/makedate.h"
 
23
#include "drizzled/time_functions.h"
24
24
 
25
25
namespace drizzled
26
26
{
38
38
String *Item_func_makedate::val_str(String *str)
39
39
{
40
40
  assert(fixed == 1);
41
 
  type::Time l_time;
 
41
  DRIZZLE_TIME l_time;
42
42
  long daynr=  (long) args[1]->val_int();
43
43
  long year= (long) args[0]->val_int();
44
44
  long days;
56
56
  {
57
57
    null_value=0;
58
58
    get_date_from_daynr(days,&l_time.year,&l_time.month,&l_time.day);
59
 
    if (str->alloc(type::Time::MAX_STRING_LENGTH))
 
59
    if (str->alloc(MAX_DATE_STRING_REP_LENGTH))
60
60
      goto err;
61
 
 
62
 
    l_time.convert(*str, type::DRIZZLE_TIMESTAMP_DATE);
63
 
 
 
61
    make_date(&l_time, str);
64
62
    return str;
65
63
  }
66
64
 
83
81
int64_t Item_func_makedate::val_int()
84
82
{
85
83
  assert(fixed == 1);
86
 
  type::Time l_time;
 
84
  DRIZZLE_TIME l_time;
87
85
  long daynr=  (long) args[1]->val_int();
88
86
  long year= (long) args[0]->val_int();
89
87
  long days;