~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/math/neg.cc

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

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
 
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
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
36
36
{
37
37
  int64_t value= args[0]->val_int();
38
38
  null_value= args[0]->null_value;
 
39
 
39
40
  return -value;
40
41
}
41
42
 
42
43
 
43
 
my_decimal *Item_func_neg::decimal_op(my_decimal *decimal_value)
 
44
type::Decimal *Item_func_neg::decimal_op(type::Decimal *decimal_value)
44
45
{
45
 
  my_decimal val, *value= args[0]->val_decimal(&val);
 
46
  type::Decimal val, *value= args[0]->val_decimal(&val);
46
47
  if (!(null_value= args[0]->null_value))
47
48
  {
48
 
    my_decimal2decimal(value, decimal_value);
49
 
    my_decimal_neg(decimal_value);
 
49
    class_decimal2decimal(value, decimal_value);
 
50
    class_decimal_neg(decimal_value);
50
51
    return decimal_value;
51
52
  }
52
53
  return 0;
85
86
      hybrid_type= DECIMAL_RESULT;
86
87
    }
87
88
  }
88
 
  unsigned_flag= 0;
89
 
  return;
 
89
  unsigned_flag= false;
90
90
}
91
91
 
92
92
} /* namespace drizzled */