~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/item.cc

Renamed __attribute__((__unused__)) to __attribute__((unused)). 
It takes up a few less chars, but also seems to be the standard usage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
 
45
45
my_decimal *
46
46
Hybrid_type_traits::val_decimal(Hybrid_type *val,
47
 
                                my_decimal *to __attribute__((__unused__))) const
 
47
                                my_decimal *to __attribute__((unused))) const
48
48
{
49
49
  double2my_decimal(E_DEC_FATAL_ERROR, val->real, val->dec_buf);
50
50
  return val->dec_buf;
148
148
 
149
149
void
150
150
Hybrid_type_traits_integer::fix_length_and_dec(Item *item,
151
 
                                               Item *arg __attribute__((__unused__))) const
 
151
                                               Item *arg __attribute__((unused))) const
152
152
{
153
153
  item->decimals= 0;
154
154
  item->max_length= MY_INT64_NUM_DECIMAL_DIGITS;
469
469
  @param arg   a dummy parameter, is not used here
470
470
*/
471
471
 
472
 
bool Item::cleanup_processor(uchar *arg __attribute__((__unused__)))
 
472
bool Item::cleanup_processor(uchar *arg __attribute__((unused)))
473
473
{
474
474
  if (fixed)
475
475
    cleanup();
733
733
  - When trying to find an ORDER BY/GROUP BY item in the SELECT part
734
734
*/
735
735
 
736
 
bool Item::eq(const Item *item, bool binary_cmp __attribute__((__unused__))) const
 
736
bool Item::eq(const Item *item, bool binary_cmp __attribute__((unused))) const
737
737
{
738
738
  /*
739
739
    Note, that this is never true if item is a Item_param:
763
763
  the latter returns a non-fixed Item, so val_str() crashes afterwards.
764
764
  Override Item_num method, to return a fixed item.
765
765
*/
766
 
Item *Item_num::safe_charset_converter(CHARSET_INFO *tocs __attribute__((__unused__)))
 
766
Item *Item_num::safe_charset_converter(CHARSET_INFO *tocs __attribute__((unused)))
767
767
{
768
768
  Item_string *conv;
769
769
  char buf[64];
778
778
}
779
779
 
780
780
 
781
 
Item *Item_static_float_func::safe_charset_converter(CHARSET_INFO *tocs __attribute__((__unused__)))
 
781
Item *Item_static_float_func::safe_charset_converter(CHARSET_INFO *tocs __attribute__((unused)))
782
782
{
783
783
  Item_string *conv;
784
784
  char buf[64];
1426
1426
  Item_field (this is important in prepared statements).
1427
1427
*/
1428
1428
 
1429
 
Item_field::Item_field(THD *thd __attribute__((__unused__)),
 
1429
Item_field::Item_field(THD *thd __attribute__((unused)),
1430
1430
                       Name_resolution_context *context_arg,
1431
1431
                       Field *f)
1432
1432
  :Item_ident(context_arg, f->table->s->db.str, *f->table_name, f->field_name),
1523
1523
}
1524
1524
 
1525
1525
void Item_ident::print(String *str,
1526
 
                       enum_query_type query_type __attribute__((__unused__)))
 
1526
                       enum_query_type query_type __attribute__((unused)))
1527
1527
{
1528
1528
  THD *thd= current_thd;
1529
1529
  char d_name_buff[MAX_ALIAS_NAME], t_name_buff[MAX_ALIAS_NAME];
1701
1701
 
1702
1702
 
1703
1703
bool Item_field::eq(const Item *item,
1704
 
                    bool binary_cmp __attribute__((__unused__))) const
 
1704
                    bool binary_cmp __attribute__((unused))) const
1705
1705
{
1706
1706
  Item *real_item= ((Item *) item)->real_item();
1707
1707
  if (real_item->type() != FIELD_ITEM)
1740
1740
 
1741
1741
 
1742
1742
void Item_field::fix_after_pullout(st_select_lex *new_parent,
1743
 
                                   Item **ref __attribute__((__unused__)))
 
1743
                                   Item **ref __attribute__((unused)))
1744
1744
{
1745
1745
  if (new_parent == depended_from)
1746
1746
    depended_from= NULL;
1761
1761
  return new_item;
1762
1762
}
1763
1763
 
1764
 
int64_t Item_field::val_int_endpoint(bool left_endp __attribute__((__unused__)),
1765
 
                                      bool *incl_endp __attribute__((__unused__)))
 
1764
int64_t Item_field::val_int_endpoint(bool left_endp __attribute__((unused)),
 
1765
                                      bool *incl_endp __attribute__((unused)))
1766
1766
{
1767
1767
  int64_t res= val_int();
1768
1768
  return null_value? INT64_MIN : res;
1800
1800
}
1801
1801
 
1802
1802
void Item_int::print(String *str,
1803
 
                     enum_query_type query_type __attribute__((__unused__)))
 
1803
                     enum_query_type query_type __attribute__((unused)))
1804
1804
{
1805
1805
  // my_charset_bin is good enough for numbers
1806
1806
  str_value.set(value, &my_charset_bin);
1832
1832
 
1833
1833
 
1834
1834
void Item_uint::print(String *str,
1835
 
                      enum_query_type query_type __attribute__((__unused__)))
 
1835
                      enum_query_type query_type __attribute__((unused)))
1836
1836
{
1837
1837
  // latin1 is good enough for numbers
1838
1838
  str_value.set((uint64_t) value, default_charset());
1862
1862
 
1863
1863
 
1864
1864
Item_decimal::Item_decimal(double val,
1865
 
                           int precision __attribute__((__unused__)),
1866
 
                           int scale __attribute__((__unused__)))
 
1865
                           int precision __attribute__((unused)),
 
1866
                           int scale __attribute__((unused)))
1867
1867
{
1868
1868
  double2my_decimal(E_DEC_FATAL_ERROR, val, &decimal_value);
1869
1869
  decimals= (uint8_t) decimal_value.frac;
1927
1927
}
1928
1928
 
1929
1929
void Item_decimal::print(String *str,
1930
 
                         enum_query_type query_type __attribute__((__unused__)))
 
1930
                         enum_query_type query_type __attribute__((unused)))
1931
1931
{
1932
1932
  my_decimal2string(E_DEC_FATAL_ERROR, &decimal_value, 0, 0, 0, &str_value);
1933
1933
  str->append(str_value);
1935
1935
 
1936
1936
 
1937
1937
bool Item_decimal::eq(const Item *item,
1938
 
                      bool binary_cmp __attribute__((__unused__))) const
 
1938
                      bool binary_cmp __attribute__((unused))) const
1939
1939
{
1940
1940
  if (type() == item->type() && item->basic_const_item())
1941
1941
  {
2081
2081
 
2082
2082
 
2083
2083
bool Item_null::eq(const Item *item,
2084
 
                   bool binary_cmp __attribute__((__unused__))) const
 
2084
                   bool binary_cmp __attribute__((unused))) const
2085
2085
{ return item->type() == type(); }
2086
2086
 
2087
2087
 
2100
2100
  return 0;
2101
2101
}
2102
2102
/* ARGSUSED */
2103
 
String *Item_null::val_str(String *str __attribute__((__unused__)))
 
2103
String *Item_null::val_str(String *str __attribute__((unused)))
2104
2104
{
2105
2105
  // following assert is redundant, because fixed=1 assigned in constructor
2106
2106
  assert(fixed == 1);
2108
2108
  return 0;
2109
2109
}
2110
2110
 
2111
 
my_decimal *Item_null::val_decimal(my_decimal *decimal_value __attribute__((__unused__)))
 
2111
my_decimal *Item_null::val_decimal(my_decimal *decimal_value __attribute__((unused)))
2112
2112
{
2113
2113
  return 0;
2114
2114
}
2776
2776
/* End of Item_param related */
2777
2777
 
2778
2778
void Item_param::print(String *str,
2779
 
                       enum_query_type query_type __attribute__((__unused__)))
 
2779
                       enum_query_type query_type __attribute__((unused)))
2780
2780
{
2781
2781
  if (state == NO_VALUE)
2782
2782
  {
2806
2806
}
2807
2807
 
2808
2808
/* ARGSUSED */
2809
 
String *Item_copy_string::val_str(String *str __attribute__((__unused__)))
 
2809
String *Item_copy_string::val_str(String *str __attribute__((unused)))
2810
2810
{
2811
2811
  // Item_copy_string is used without fix_fields call
2812
2812
  if (null_value)
2830
2830
*/
2831
2831
 
2832
2832
/* ARGSUSED */
2833
 
bool Item::fix_fields(THD *thd __attribute__((__unused__)),
2834
 
                      Item **ref __attribute__((__unused__)))
 
2833
bool Item::fix_fields(THD *thd __attribute__((unused)),
 
2834
                      Item **ref __attribute__((unused)))
2835
2835
{
2836
2836
 
2837
2837
  // We do not check fields which are fixed during construction
3872
3872
  See comments in Arg_comparator::set_compare_func() for details.
3873
3873
*/
3874
3874
 
3875
 
bool Item_field::set_no_const_sub(uchar *arg __attribute__((__unused__)))
 
3875
bool Item_field::set_no_const_sub(uchar *arg __attribute__((unused)))
3876
3876
{
3877
3877
  if (field->charset() != &my_charset_bin)
3878
3878
    no_const_subst=1;
3905
3905
    - this - otherwise.
3906
3906
*/
3907
3907
 
3908
 
Item *Item_field::replace_equal_field(uchar *arg __attribute__((__unused__)))
 
3908
Item *Item_field::replace_equal_field(uchar *arg __attribute__((unused)))
3909
3909
{
3910
3910
  if (item_equal)
3911
3911
  {
4356
4356
 
4357
4357
 
4358
4358
int Item_string::save_in_field(Field *field,
4359
 
                               bool no_conversions __attribute__((__unused__)))
 
4359
                               bool no_conversions __attribute__((unused)))
4360
4360
{
4361
4361
  String *result;
4362
4362
  result=val_str(&str_value);
4372
4372
 
4373
4373
 
4374
4374
int Item_int::save_in_field(Field *field,
4375
 
                            bool no_conversions __attribute__((__unused__)))
 
4375
                            bool no_conversions __attribute__((unused)))
4376
4376
{
4377
4377
  int64_t nr=val_int();
4378
4378
  if (null_value)
4383
4383
 
4384
4384
 
4385
4385
int Item_decimal::save_in_field(Field *field,
4386
 
                                bool no_conversions __attribute__((__unused__)))
 
4386
                                bool no_conversions __attribute__((unused)))
4387
4387
{
4388
4388
  field->set_notnull();
4389
4389
  return field->store_decimal(&decimal_value);
4391
4391
 
4392
4392
 
4393
4393
bool Item_int::eq(const Item *arg,
4394
 
                  bool binary_cmp __attribute__((__unused__))) const
 
4394
                  bool binary_cmp __attribute__((unused))) const
4395
4395
{
4396
4396
  /* No need to check for null value as basic constant can't be NULL */
4397
4397
  if (arg->basic_const_item() && arg->type() == type())
4478
4478
 
4479
4479
 
4480
4480
int Item_float::save_in_field(Field *field,
4481
 
                              bool no_conversions __attribute__((__unused__)))
 
4481
                              bool no_conversions __attribute__((unused)))
4482
4482
{
4483
4483
  double nr= val_real();
4484
4484
  if (null_value)
4489
4489
 
4490
4490
 
4491
4491
void Item_float::print(String *str,
4492
 
                       enum_query_type query_type __attribute__((__unused__)))
 
4492
                       enum_query_type query_type __attribute__((unused)))
4493
4493
{
4494
4494
  if (presentation)
4495
4495
  {
4510
4510
*/
4511
4511
 
4512
4512
bool Item_float::eq(const Item *arg,
4513
 
                    bool binary_cmp __attribute__((__unused__))) const
 
4513
                    bool binary_cmp __attribute__((unused))) const
4514
4514
{
4515
4515
  if (arg->basic_const_item() && arg->type() == type())
4516
4516
  {
4579
4579
 
4580
4580
 
4581
4581
int Item_hex_string::save_in_field(Field *field,
4582
 
                                   bool no_conversions __attribute__((__unused__)))
 
4582
                                   bool no_conversions __attribute__((unused)))
4583
4583
{
4584
4584
  field->set_notnull();
4585
4585
  if (field->result_type() == STRING_RESULT)
4610
4610
 
4611
4611
 
4612
4612
void Item_hex_string::print(String *str,
4613
 
                            enum_query_type query_type __attribute__((__unused__)))
 
4613
                            enum_query_type query_type __attribute__((unused)))
4614
4614
{
4615
4615
  char *end= (char*) str_value.ptr() + str_value.length(),
4616
4616
       *ptr= end - min(str_value.length(), sizeof(int64_t));
4690
4690
*/
4691
4691
 
4692
4692
bool Item_null::send(Protocol *protocol,
4693
 
                     String *packet __attribute__((__unused__)))
 
4693
                     String *packet __attribute__((unused)))
4694
4694
{
4695
4695
  return protocol->store_null();
4696
4696
}
4790
4790
 
4791
4791
 
4792
4792
bool Item_field::send(Protocol *protocol,
4793
 
                      String *buffer __attribute__((__unused__)))
 
4793
                      String *buffer __attribute__((unused)))
4794
4794
{
4795
4795
  return protocol->store(result_field);
4796
4796
}
5538
5538
}
5539
5539
 
5540
5540
void Item_ref::fix_after_pullout(st_select_lex *new_parent,
5541
 
                                 Item **refptr __attribute__((__unused__)))
 
5541
                                 Item **refptr __attribute__((unused)))
5542
5542
{
5543
5543
  if (depended_from == new_parent)
5544
5544
  {
5565
5565
*/
5566
5566
 
5567
5567
bool Item_direct_view_ref::eq(const Item *item,
5568
 
                              bool binary_cmp __attribute__((__unused__))) const
 
5568
                              bool binary_cmp __attribute__((unused))) const
5569
5569
{
5570
5570
  if (item->type() == REF_ITEM)
5571
5571
  {
5587
5587
 
5588
5588
 
5589
5589
bool Item_default_value::fix_fields(THD *thd,
5590
 
                                    Item **items __attribute__((__unused__)))
 
5590
                                    Item **items __attribute__((unused)))
5591
5591
{
5592
5592
  Item *real_arg;
5593
5593
  Item_field *field_arg;
5704
5704
 
5705
5705
 
5706
5706
bool Item_insert_value::fix_fields(THD *thd,
5707
 
                                   Item **items __attribute__((__unused__)))
 
5707
                                   Item **items __attribute__((unused)))
5708
5708
{
5709
5709
  assert(fixed == 0);
5710
5710
  /* We should only check that arg is in first table */
6047
6047
  return str;
6048
6048
}
6049
6049
 
6050
 
my_decimal *Item_cache_decimal::val_decimal(my_decimal *val __attribute__((__unused__)))
 
6050
my_decimal *Item_cache_decimal::val_decimal(my_decimal *val __attribute__((unused)))
6051
6051
{
6052
6052
  assert(fixed);
6053
6053
  return &decimal_value;
6155
6155
}
6156
6156
 
6157
6157
 
6158
 
void Item_cache_row::illegal_method_call(const char *method __attribute__((__unused__)))
 
6158
void Item_cache_row::illegal_method_call(const char *method __attribute__((unused)))
6159
6159
{
6160
6160
  assert(0);
6161
6161
  my_error(ER_OPERAND_COLUMNS, MYF(0), 1);
6310
6310
    false  OK
6311
6311
*/
6312
6312
 
6313
 
bool Item_type_holder::join_types(THD *thd __attribute__((__unused__)),
 
6313
bool Item_type_holder::join_types(THD *thd __attribute__((unused)),
6314
6314
                                  Item *item)
6315
6315
{
6316
6316
  uint max_length_orig= max_length;
6560
6560
    do nothing
6561
6561
*/
6562
6562
 
6563
 
void dummy_error_processor(THD *thd __attribute__((__unused__)),
6564
 
                           void *data __attribute__((__unused__)))
 
6563
void dummy_error_processor(THD *thd __attribute__((unused)),
 
6564
                           void *data __attribute__((unused)))
6565
6565
{}
6566
6566
 
6567
6567
/**