summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2010-05-31 12:29:54 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2010-05-31 12:29:54 -0300
commit5dec0c963713822cafc5f2f65b485e8846938318 (patch)
treebbbd0851e788a87bdf80dacc828f8de102b381b4 /sql/item_sum.cc
parent7e84f28c74e6e75f2093fa7e21b6a2b3781b9fe9 (diff)
downloadmariadb-git-5dec0c963713822cafc5f2f65b485e8846938318.tar.gz
Bug#53445: Build with -Wall and fix warnings that it generates
Fix various mismatches between function's language linkage. Any particular function that is declared in C++ but should be callable from C must have C linkage. Note that function types with different linkages are also distinct. Thus, if a function type is declared in C code, it will have C linkage (same if declared in a extern "C" block).
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 917acb0e908..15927c4b11e 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -2827,6 +2827,7 @@ String *Item_sum_udf_str::val_str(String *str)
@retval 1 : key1 > key2
*/
+extern "C"
int group_concat_key_cmp_with_distinct(void* arg, const void* key1,
const void* key2)
{
@@ -2861,6 +2862,7 @@ int group_concat_key_cmp_with_distinct(void* arg, const void* key1,
function of sort for syntax: GROUP_CONCAT(expr,... ORDER BY col,... )
*/
+extern "C"
int group_concat_key_cmp_with_order(void* arg, const void* key1,
const void* key2)
{
@@ -2905,13 +2907,16 @@ int group_concat_key_cmp_with_order(void* arg, const void* key1,
Append data from current leaf to item->result.
*/
-int dump_leaf_key(uchar* key, element_count count __attribute__((unused)),
- Item_func_group_concat *item)
+extern "C"
+int dump_leaf_key(void* key_arg, element_count count __attribute__((unused)),
+ void* item_arg)
{
+ Item_func_group_concat *item= (Item_func_group_concat *) item_arg;
TABLE *table= item->table;
String tmp((char *)table->record[1], table->s->reclength,
default_charset_info);
String tmp2;
+ uchar *key= (uchar *) key_arg;
String *result= &item->result;
Item **arg= item->args, **arg_end= item->args + item->arg_count_field;
uint old_length= result->length();
@@ -3385,8 +3390,7 @@ String* Item_func_group_concat::val_str(String* str)
return 0;
if (no_appended && tree)
/* Tree is used for sorting as in ORDER BY */
- tree_walk(tree, (tree_walk_action)&dump_leaf_key, (void*)this,
- left_root_right);
+ tree_walk(tree, &dump_leaf_key, this, left_root_right);
return &result;
}