summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2014-11-19 09:13:38 +0100
committerSergei Golubchik <serg@mariadb.org>2014-12-04 10:41:51 +0100
commit2ae7541bcf93985302bc7efb2629e6f623ccfc64 (patch)
treed0b14c1dba4bffc2ae82f2d51f1f9ef4ebf7035a
parent0d30423900dd3a384f061c32f6ec3de9c11cdde9 (diff)
downloadmariadb-git-2ae7541bcf93985302bc7efb2629e6f623ccfc64.tar.gz
cleanup: s/const CHARSET_INFO/CHARSET_INFO/
as CHARSET_INFO is already const, using const on it is redundant and results in compiler warnings (on Windows)
-rw-r--r--include/hash.h4
-rw-r--r--mysys/hash.c2
-rw-r--r--sql/field.cc2
-rw-r--r--sql/field.h2
-rw-r--r--sql/filesort.cc6
-rw-r--r--sql/item_strfunc.cc2
-rw-r--r--sql/item_timefunc.h2
-rw-r--r--sql/mdl.cc2
-rw-r--r--sql/mdl.h2
-rw-r--r--sql/sql_acl.cc3
-rw-r--r--sql/sql_explain.cc8
-rw-r--r--sql/sql_partition.cc6
-rw-r--r--sql/sql_select.cc2
-rw-r--r--sql/sql_string.h8
-rw-r--r--strings/ctype-cp932.c2
-rw-r--r--strings/ctype-mb.c2
-rw-r--r--strings/ctype-sjis.c2
-rw-r--r--strings/ctype-tis620.c2
-rw-r--r--strings/ctype-uca.c2
-rw-r--r--strings/ctype-ucs2.c6
20 files changed, 33 insertions, 34 deletions
diff --git a/include/hash.h b/include/hash.h
index ba36df23f58..fde7fc30d38 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -44,7 +44,7 @@ extern "C" {
typedef uint my_hash_value_type;
typedef uchar *(*my_hash_get_key)(const uchar *,size_t*,my_bool);
-typedef my_hash_value_type (*my_hash_function)(const CHARSET_INFO *,
+typedef my_hash_value_type (*my_hash_function)(CHARSET_INFO *,
const uchar *, size_t);
typedef void (*my_hash_free_key)(void *);
typedef my_bool (*my_hash_walk_action)(void *,void *);
@@ -78,7 +78,7 @@ uchar *my_hash_search(const HASH *info, const uchar *key, size_t length);
uchar *my_hash_search_using_hash_value(const HASH *info,
my_hash_value_type hash_value,
const uchar *key, size_t length);
-my_hash_value_type my_hash_sort(const CHARSET_INFO *cs,
+my_hash_value_type my_hash_sort(CHARSET_INFO *cs,
const uchar *key, size_t length);
#define my_calc_hash(A, B, C) my_hash_sort((A)->charset, B, C)
uchar *my_hash_first(const HASH *info, const uchar *key, size_t length,
diff --git a/mysys/hash.c b/mysys/hash.c
index a501f7d38f7..dc03ea9a4dc 100644
--- a/mysys/hash.c
+++ b/mysys/hash.c
@@ -40,7 +40,7 @@ static void movelink(HASH_LINK *array,uint pos,uint next_link,uint newlink);
static int hashcmp(const HASH *hash, HASH_LINK *pos, const uchar *key,
size_t length);
-my_hash_value_type my_hash_sort(const CHARSET_INFO *cs, const uchar *key,
+my_hash_value_type my_hash_sort(CHARSET_INFO *cs, const uchar *key,
size_t length)
{
ulong nr1= 1, nr2= 4;
diff --git a/sql/field.cc b/sql/field.cc
index 4fef2b996c5..7467aa63a26 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -5517,7 +5517,7 @@ void Field_time::sql_type(String &res) const
res.set_ascii(STRING_WITH_LEN("time"));
return;
}
- const CHARSET_INFO *cs= res.charset();
+ CHARSET_INFO *cs= res.charset();
res.length(cs->cset->snprintf(cs, (char*) res.ptr(), res.alloced_length(),
"time(%d)", decimals()));
}
diff --git a/sql/field.h b/sql/field.h
index b4b94bfa712..dabb6c6b0e0 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1583,7 +1583,7 @@ public:
enum Derivation derivation(void) const { return DERIVATION_NUMERIC; }
uint repertoire(void) const { return MY_REPERTOIRE_NUMERIC; }
CHARSET_INFO *charset(void) const { return &my_charset_numeric; }
- const CHARSET_INFO *sort_charset(void) const { return &my_charset_bin; }
+ CHARSET_INFO *sort_charset(void) const { return &my_charset_bin; }
bool binary() const { return true; }
enum Item_result cmp_type () const { return TIME_RESULT; }
uint is_equal(Create_field *new_field);
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 509a7f8e9b3..569e1d37e0c 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -988,7 +988,7 @@ static void make_sortkey(register Sort_param *param,
switch (sort_field->result_type) {
case STRING_RESULT:
{
- const CHARSET_INFO *cs=item->collation.collation;
+ CHARSET_INFO *cs=item->collation.collation;
char fill_char= ((cs->state & MY_CS_BINSORT) ? (char) 0 : ' ');
if (maybe_null)
@@ -1863,8 +1863,8 @@ static uint
sortlength(THD *thd, SORT_FIELD *sortorder, uint s_length,
bool *multi_byte_charset)
{
- reg2 uint length;
- const CHARSET_INFO *cs;
+ uint length;
+ CHARSET_INFO *cs;
*multi_byte_charset= 0;
length=0;
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 875d9470dac..f3f3edae3b4 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -3041,7 +3041,7 @@ String *Item_func_space::val_str(String *str)
{
uint tot_length;
longlong count= args[0]->val_int();
- const CHARSET_INFO *cs= collation.collation;
+ CHARSET_INFO *cs= collation.collation;
if (args[0]->null_value)
goto err; // string and/or delim are null
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 839a5a4845d..8438119ddc6 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -523,7 +523,7 @@ public:
return cached_field_type == MYSQL_TYPE_STRING ?
STRING_RESULT : TIME_RESULT;
}
- const CHARSET_INFO *charset_for_protocol() const
+ CHARSET_INFO *charset_for_protocol() const
{
/*
Can return TIME, DATE, DATETIME or VARCHAR depending on arguments.
diff --git a/sql/mdl.cc b/sql/mdl.cc
index 09c26cf4c34..ec2dea0676f 100644
--- a/sql/mdl.cc
+++ b/sql/mdl.cc
@@ -793,7 +793,7 @@ void MDL_map::init()
}
-my_hash_value_type mdl_hash_function(const CHARSET_INFO *cs,
+my_hash_value_type mdl_hash_function(CHARSET_INFO *cs,
const uchar *key, size_t length)
{
MDL_key *mdl_key= (MDL_key*) (key - offsetof(MDL_key, m_ptr));
diff --git a/sql/mdl.h b/sql/mdl.h
index 44e692b97a0..4cefaa8d6c3 100644
--- a/sql/mdl.h
+++ b/sql/mdl.h
@@ -416,7 +416,7 @@ private:
private:
MDL_key(const MDL_key &); /* not implemented */
MDL_key &operator=(const MDL_key &); /* not implemented */
- friend my_hash_value_type mdl_hash_function(const CHARSET_INFO *,
+ friend my_hash_value_type mdl_hash_function(CHARSET_INFO *,
const uchar *, size_t);
};
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 4e872c1960c..0eabc4fe281 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -11284,8 +11284,7 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio)
}
static bool
-read_client_connect_attrs(char **ptr, char *end,
- const CHARSET_INFO *from_cs)
+read_client_connect_attrs(char **ptr, char *end, CHARSET_INFO *from_cs)
{
size_t length;
char *ptr_save= *ptr;
diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc
index 59f38f7f167..0ad6a4d89ea 100644
--- a/sql/sql_explain.cc
+++ b/sql/sql_explain.cc
@@ -207,7 +207,7 @@ void Explain_query::print_explain_json(select_result_sink *output, bool is_analy
writer.end_object();
- const CHARSET_INFO *cs= system_charset_info;
+ CHARSET_INFO *cs= system_charset_info;
List<Item> item_list;
String *buf= &writer.output;
item_list.push_back(new Item_string(buf->ptr(), buf->length(), cs));
@@ -416,7 +416,7 @@ int Explain_union::print_explain(Explain_query *query,
uint8 explain_flags,
bool is_analyze)
{
- //const CHARSET_INFO *cs= system_charset_info;
+ //CHARSET_INFO *cs= system_charset_info;
char table_name_buffer[SAFE_NAME_LEN];
/* print all UNION children, in order */
@@ -762,7 +762,7 @@ void Explain_table_access::push_extra(enum explain_extra_tag extra_tag)
void Explain_table_access::fill_key_str(String *key_str, bool is_json) const
{
- const CHARSET_INFO *cs= system_charset_info;
+ CHARSET_INFO *cs= system_charset_info;
bool is_hj= (type == JT_HASH || type == JT_HASH_NEXT ||
type == JT_HASH_RANGE || type == JT_HASH_INDEX_MERGE);
const char *hash_key_prefix= "#hash#";
@@ -882,7 +882,7 @@ int Explain_table_access::print_explain(select_result_sink *output, uint8 explai
uint select_id, const char *select_type,
bool using_temporary, bool using_filesort)
{
- //const CHARSET_INFO *cs= system_charset_info;
+ //CHARSET_INFO *cs= system_charset_info;
List<Item> item_list;
Item *item_null= new Item_null();
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index b307c60d317..555ee2a3f40 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -195,7 +195,7 @@ static int cmp_rec_and_tuple_prune(part_column_list_val *val,
item New converted item
*/
-Item* convert_charset_partition_constant(Item *item, const CHARSET_INFO *cs)
+Item* convert_charset_partition_constant(Item *item, CHARSET_INFO *cs)
{
THD *thd= current_thd;
Name_resolution_context *context= &thd->lex->current_select->context;
@@ -2222,7 +2222,7 @@ static int add_column_list_values(File fptr, partition_info *part_info,
else
{
String *res;
- const CHARSET_INFO *field_cs;
+ CHARSET_INFO *field_cs;
bool need_cs_check= FALSE;
Item_result result_type= STRING_RESULT;
@@ -4292,7 +4292,7 @@ bool mysql_unpack_partition(THD *thd,
{
bool result= TRUE;
partition_info *part_info;
- const CHARSET_INFO *old_character_set_client=
+ CHARSET_INFO *old_character_set_client=
thd->variables.character_set_client;
LEX *old_lex= thd->lex;
LEX lex;
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 531f968fd8c..d81202ea18d 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -23289,7 +23289,7 @@ void JOIN_TAB::save_explain_data(Explain_table_access *eta, table_map prefix_tab
bool distinct, JOIN_TAB *first_top_tab)
{
int quick_type;
- const CHARSET_INFO *cs= system_charset_info;
+ CHARSET_INFO *cs= system_charset_info;
JOIN_TAB *tab= this;
THD *thd=join->thd;
diff --git a/sql/sql_string.h b/sql/sql_string.h
index dff2a457044..7f6aed9f804 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -35,9 +35,9 @@ typedef struct st_mem_root MEM_ROOT;
int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
inline uint32 copy_and_convert(char *to, uint32 to_length,
- const CHARSET_INFO *to_cs,
+ CHARSET_INFO *to_cs,
const char *from, uint32 from_length,
- const CHARSET_INFO *from_cs, uint *errors)
+ CHARSET_INFO *from_cs, uint *errors)
{
return my_convert(to, to_length, to_cs, from, from_length, from_cs, errors);
}
@@ -575,11 +575,11 @@ class StringBuffer : public String
public:
StringBuffer() : String(buff, buff_sz, &my_charset_bin) { length(0); }
- explicit StringBuffer(const CHARSET_INFO *cs) : String(buff, buff_sz, cs)
+ explicit StringBuffer(CHARSET_INFO *cs) : String(buff, buff_sz, cs)
{
length(0);
}
- StringBuffer(const char *str, size_t length, const CHARSET_INFO *cs)
+ StringBuffer(const char *str, size_t length, CHARSET_INFO *cs)
: String(buff, buff_sz, cs)
{
set(str, length, cs);
diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c
index b3d08c5a54c..86f450718d7 100644
--- a/strings/ctype-cp932.c
+++ b/strings/ctype-cp932.c
@@ -1709,7 +1709,7 @@ MY_UNICASE_INFO my_caseinfo_cp932=
my_caseinfo_pages_cp932
};
-static int my_strnncoll_cp932_internal(const CHARSET_INFO *cs,
+static int my_strnncoll_cp932_internal(CHARSET_INFO *cs,
const uchar **a_res, size_t a_length,
const uchar **b_res, size_t b_length)
{
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c
index 02a9a91ca6a..cc0513dbc90 100644
--- a/strings/ctype-mb.c
+++ b/strings/ctype-mb.c
@@ -63,7 +63,7 @@ size_t my_casedn_str_mb(CHARSET_INFO * cs, char *str)
static inline MY_UNICASE_CHARACTER*
-get_case_info_for_ch(const CHARSET_INFO *cs, uint page, uint offs)
+get_case_info_for_ch(CHARSET_INFO *cs, uint page, uint offs)
{
MY_UNICASE_CHARACTER *p;
return cs->caseinfo && (p= cs->caseinfo->page[page]) ? &p[offs] : NULL;
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c
index dce9e5ad37f..c6e55879102 100644
--- a/strings/ctype-sjis.c
+++ b/strings/ctype-sjis.c
@@ -1079,7 +1079,7 @@ static MY_UNICASE_INFO my_caseinfo_sjis=
};
-static int my_strnncoll_sjis_internal(const CHARSET_INFO *cs,
+static int my_strnncoll_sjis_internal(CHARSET_INFO *cs,
const uchar **a_res, size_t a_length,
const uchar **b_res, size_t b_length)
{
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c
index c2ed01a0603..61477f177c1 100644
--- a/strings/ctype-tis620.c
+++ b/strings/ctype-tis620.c
@@ -618,7 +618,7 @@ ret:
*/
static size_t
-my_strnxfrm_tis620(const CHARSET_INFO *cs,
+my_strnxfrm_tis620(CHARSET_INFO *cs,
uchar *dst, size_t dstlen, uint nweights,
const uchar *src, size_t srclen, uint flags)
{
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index 60de0a106a1..b3a7c6afde9 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -20714,7 +20714,7 @@ static int my_strnncoll_uca(CHARSET_INFO *cs,
static inline int
-my_space_weight(const CHARSET_INFO *cs) /* W3-TODO */
+my_space_weight(CHARSET_INFO *cs) /* W3-TODO */
{
return cs->uca->level[0].weights[0][0x20 * cs->uca->level[0].lengths[0]];
}
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index 593f9a12950..a560eb08bae 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -1753,7 +1753,7 @@ struct charset_info_st my_charset_utf16_bin=
static int
-my_utf16le_uni(const CHARSET_INFO *cs __attribute__((unused)),
+my_utf16le_uni(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
{
my_wc_t lo;
@@ -1783,7 +1783,7 @@ my_utf16le_uni(const CHARSET_INFO *cs __attribute__((unused)),
static int
-my_uni_utf16le(const CHARSET_INFO *cs __attribute__((unused)),
+my_uni_utf16le(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
uint32 first, second, total;
@@ -1813,7 +1813,7 @@ my_uni_utf16le(const CHARSET_INFO *cs __attribute__((unused)),
static size_t
-my_lengthsp_utf16le(const CHARSET_INFO *cs __attribute__((unused)),
+my_lengthsp_utf16le(CHARSET_INFO *cs __attribute__((unused)),
const char *ptr, size_t length)
{
const char *end= ptr + length;