mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Applied Antony T Curtis patch for declaring many CHARSET objects as const
Removed compiler warnings extra/libevent/epoll.c: Removed compiler warnings extra/libevent/evbuffer.c: Removed compiler warnings extra/libevent/event.c: Removed compiler warnings extra/libevent/select.c: Removed compiler warnings extra/libevent/signal.c: Removed compiler warnings include/m_ctype.h: Define CHARSET_INFO, MY_CHARSET_HANDLER, MY_COLLATION_HANDLER, MY_UNICASE_INFO, MY_UNI_CTYPE and MY_UNI_IDX as const structures. Declare that pointers point to const data include/m_string.h: Declare that pointers point to const data include/my_sys.h: Redefine variables and function prototypes include/mysql.h: Declare charset as const include/mysql.h.pp: Declare charset as const include/mysql/plugin.h: Declare charset as const include/mysql/plugin.h.pp: Declare charset as const mysys/charset-def.c: Charset can't be of type CHARSET_INFO as they are changed when they are initialized. mysys/charset.c: Functions that change CHARSET_INFO must use 'struct charset_info_st' Add temporary variables to not have to change all_charsets[] (Which now is const) sql-common/client.c: Added cast to const sql/item_cmpfunc.h: Added cast to avoid compiler error. sql/sql_class.cc: Added cast to const sql/sql_lex.cc: Added cast to const storage/maria/ma_ft_boolean_search.c: Added cast to avoid compiler error. storage/maria/ma_ft_parser.c: Added cast to avoid compiler error. storage/maria/ma_search.c: Added cast to const storage/myisam/ft_boolean_search.c: Added cast to avoid compiler error storage/myisam/ft_parser.c: Added cast to avoid compiler error storage/myisam/mi_search.c: Added cast to const storage/pbxt/src/datadic_xt.cc: Added cast to const storage/pbxt/src/ha_pbxt.cc: Added cast to const Removed compiler warning by changing prototype of XTThreadPtr() storage/pbxt/src/myxt_xt.h: Character sets should be const storage/pbxt/src/xt_defs.h: Character sets should be const storage/xtradb/btr/btr0cur.c: Removed compiler warning strings/conf_to_src.c: Added const Functions that change CHARSET_INFO must use 'struct charset_info_st' strings/ctype-big5.c: Made arrays const strings/ctype-bin.c: Made arrays const strings/ctype-cp932.c: Made arrays const strings/ctype-czech.c: Made arrays const strings/ctype-euc_kr.c: Made arrays const strings/ctype-eucjpms.c: Made arrays const strings/ctype-extra.c: Made arrays const strings/ctype-gb2312.c: Made arrays const strings/ctype-gbk.c: Made arrays const strings/ctype-latin1.c: Made arrays const strings/ctype-mb.c: Made arrays const strings/ctype-simple.c: Made arrays const strings/ctype-sjis.c: Made arrays const strings/ctype-tis620.c: Made arrays const strings/ctype-uca.c: Made arrays const strings/ctype-ucs2.c: Made arrays const strings/ctype-ujis.c: Made arrays const strings/ctype-utf8.c: Made arrays const strings/ctype-win1250ch.c: Made arrays const strings/ctype.c: Made arrays const Added cast to const Functions that change CHARSET_INFO must use 'struct charset_info_st' strings/int2str.c: Added cast to const
This commit is contained in:
@ -23,15 +23,15 @@
|
||||
#define ROW16_LEN 8
|
||||
#define MAX_BUF 64*1024
|
||||
|
||||
static CHARSET_INFO all_charsets[256];
|
||||
static struct charset_info_st all_charsets[256];
|
||||
|
||||
|
||||
void
|
||||
print_array(FILE *f, const char *set, const char *name, uchar *a, int n)
|
||||
print_array(FILE *f, const char *set, const char *name, const uchar *a, int n)
|
||||
{
|
||||
int i;
|
||||
|
||||
fprintf(f,"uchar %s_%s[] = {\n", name, set);
|
||||
fprintf(f,"static const uchar %s_%s[] = {\n", name, set);
|
||||
|
||||
for (i=0 ;i<n ; i++)
|
||||
{
|
||||
@ -44,11 +44,11 @@ print_array(FILE *f, const char *set, const char *name, uchar *a, int n)
|
||||
|
||||
|
||||
void
|
||||
print_array16(FILE *f, const char *set, const char *name, uint16 *a, int n)
|
||||
print_array16(FILE *f, const char *set, const char *name, const uint16 *a, int n)
|
||||
{
|
||||
int i;
|
||||
|
||||
fprintf(f,"uint16 %s_%s[] = {\n", name, set);
|
||||
fprintf(f,"static const uint16 %s_%s[] = {\n", name, set);
|
||||
|
||||
for (i=0 ;i<n ; i++)
|
||||
{
|
||||
@ -80,7 +80,7 @@ char *mdup(const char *src, uint len)
|
||||
return dst;
|
||||
}
|
||||
|
||||
static void simple_cs_copy_data(CHARSET_INFO *to, CHARSET_INFO *from)
|
||||
static void simple_cs_copy_data(struct charset_info_st *to, CHARSET_INFO *from)
|
||||
{
|
||||
to->number= from->number ? from->number : to->number;
|
||||
to->state|= from->state;
|
||||
@ -122,7 +122,7 @@ static my_bool simple_cs_is_full(CHARSET_INFO *cs)
|
||||
(cs->sort_order || (cs->state & MY_CS_BINSORT))));
|
||||
}
|
||||
|
||||
static int add_collation(CHARSET_INFO *cs)
|
||||
static int add_collation(struct charset_info_st *cs)
|
||||
{
|
||||
if (cs->name && (cs->number || (cs->number=get_charset_number(cs->name))))
|
||||
{
|
||||
@ -329,7 +329,7 @@ main(int argc, char **argv __attribute__((unused)))
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(f,"CHARSET_INFO compiled_charsets[] = {\n");
|
||||
fprintf(f,"struct charset_info_st compiled_charsets[] = {\n");
|
||||
for (cs=all_charsets; cs < all_charsets+256; cs++)
|
||||
{
|
||||
if (simple_cs_is_full(cs))
|
||||
|
Reference in New Issue
Block a user