diff options
Diffstat (limited to 'strings')
54 files changed, 2072 insertions, 1363 deletions
diff --git a/strings/CMakeLists.txt b/strings/CMakeLists.txt index 77b093c4fb1..18fae59d394 100644 --- a/strings/CMakeLists.txt +++ b/strings/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2010, Oracle and/or its affiliates # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,6 +22,7 @@ SET(STRINGS_SOURCES bchange.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c is_prefix.c llstr.c longlong2str.c my_strtoll10.c my_vsnprintf.c str2int.c str_alloc.c strcend.c strend.c strfill.c strmake.c strmov.c strnmov.c strxmov.c strxnmov.c xml.c + strmov_overlapp.c my_strchr.c strcont.c strappend.c) IF(NOT HAVE_STRNLEN) diff --git a/strings/bchange.c b/strings/bchange.c index ed7b2e1e05b..c8e477fa186 100644 --- a/strings/bchange.c +++ b/strings/bchange.c @@ -1,18 +1,30 @@ -/* Copyright (c) 2000, 2001, 2006, 2007 MySQL AB - Use is subject to license terms. +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. +*/ /* File : bchange.c Author : Michael widenius @@ -24,8 +36,7 @@ src in a buffer with tot_length bytes. */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" void bchange(register uchar *dst, size_t old_length, register const uchar *src, size_t new_length, size_t tot_length) diff --git a/strings/bmove_upp.c b/strings/bmove_upp.c index f05cc180c59..a1a955c9c51 100644 --- a/strings/bmove_upp.c +++ b/strings/bmove_upp.c @@ -1,17 +1,30 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. +*/ /* File : bmove.c Author : Michael widenius @@ -22,8 +35,7 @@ "src-len" to the destination "dst-len" counting downwards. */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" void bmove_upp(register uchar *dst, register const uchar *src, register size_t len) diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c index a8d442dbfc3..7dfc76e5417 100644 --- a/strings/conf_to_src.c +++ b/strings/conf_to_src.c @@ -1,5 +1,7 @@ /* Copyright (c) 2000-2003, 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc. + Copyright (c) 2009-2011, Monty Program Ab Use is subject to license terms. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -14,8 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <my_global.h> -#include <m_string.h> +#include "strings_def.h" #include <m_ctype.h> #include <fcntl.h> #include <my_xml.h> @@ -24,15 +25,14 @@ #define ROW16_LEN 8 #define MAX_BUF 64*1024 -static CHARSET_INFO all_charsets[512]; - +static struct charset_info_st all_charsets[512]; 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++) { @@ -45,11 +45,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++) { @@ -83,7 +83,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; @@ -125,7 +125,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)))) { @@ -253,7 +253,9 @@ static void fprint_copyright(FILE *file) { fprintf(file, -"/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.\n" +"/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems Inc.\n" +" Copyright 2010-2011 Monty Program Ab\n" +" Copyright (c) 2003, 2011, Oracle and/or its affiliates\n" "\n" " This program is free software; you can redistribute it and/or modify\n" " it under the terms of the GNU General Public License as published by\n" @@ -274,7 +276,7 @@ fprint_copyright(FILE *file) int main(int argc, char **argv __attribute__((unused))) { - CHARSET_INFO ncs; + struct charset_info_st ncs; CHARSET_INFO *cs; char filename[256]; FILE *f= stdout; @@ -336,7 +338,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 + array_elements(all_charsets); cs++) diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index 6d2e7250cbf..7c7d8c7b2f5 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,9 +27,8 @@ * .configure. mbmaxlen_big5=2 */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #ifdef HAVE_CHARSET_big5 @@ -47,7 +47,7 @@ #define big5head(e) ((uchar)(e>>8)) #define big5tail(e) ((uchar)(e&0xff)) -static uchar ctype_big5[257] = +static const uchar ctype_big5[257] = { 0, /* For standard library */ 32,32,32,32,32,32,32,32,32,40,40,40,40,40,32,32, @@ -68,7 +68,7 @@ static uchar ctype_big5[257] = 3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0, }; -static uchar to_lower_big5[]= +static const uchar to_lower_big5[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -104,7 +104,7 @@ static uchar to_lower_big5[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uchar to_upper_big5[]= +static const uchar to_upper_big5[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -140,7 +140,7 @@ static uchar to_upper_big5[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uchar sort_order_big5[]= +static const uchar sort_order_big5[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -1008,7 +1008,7 @@ static uint mbcharlen_big5(CHARSET_INFO *cs __attribute__((unused)), uint c) /* page 0 0xA140-0xC7FC */ -static uint16 tab_big5_uni0[]={ +static const uint16 tab_big5_uni0[]={ 0x3000,0xFF0C,0x3001,0x3002,0xFF0E,0x2022,0xFF1B,0xFF1A, 0xFF1F,0xFF01,0xFE30,0x2026,0x2025,0xFE50,0xFF64,0xFE52, 0x00B7,0xFE54,0xFE55,0xFE56,0xFE57,0xFF5C,0x2013,0xFE31, @@ -2251,7 +2251,7 @@ static uint16 tab_big5_uni0[]={ 0x2479,0x247A,0x247B,0x247C,0x247D}; /* page 1 0xC940-0xF9DC */ -static uint16 tab_big5_uni1[]={ +static const uint16 tab_big5_uni1[]={ 0x4E42,0x4E5C,0x51F5,0x531A,0x5382,0x4E07,0x4E0C,0x4E47, 0x4E8D,0x56D7,0xFA0C,0x5C6E,0x5F73,0x4E0F,0x5187,0x4E0E, 0x4E2E,0x4E93,0x4EC2,0x4EC9,0x4EC8,0x5198,0x52FC,0x536C, @@ -3819,7 +3819,7 @@ static int func_big5_uni_onechar(int code){ /* page 0 0x00A2-0x00F7 */ -static uint16 tab_uni_big50[]={ +static const uint16 tab_uni_big50[]={ 0xA246,0xA247, 0,0xA244, 0,0xA1B1, 0, 0, 0, 0, 0, 0, 0, 0,0xA258,0xA1D3, 0, 0, 0, 0, 0,0xA150, 0, 0, @@ -3833,7 +3833,7 @@ static uint16 tab_uni_big50[]={ 0, 0, 0, 0, 0,0xA1D2}; /* page 1 0x02C7-0x0451 */ -static uint16 tab_uni_big51[]={ +static const uint16 tab_uni_big51[]={ 0xA3BE, 0,0xA3BC,0xA3BD,0xA3BF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0xA3BB, 0, 0, 0, 0, 0, @@ -3886,7 +3886,7 @@ static uint16 tab_uni_big51[]={ 0xC7E8, 0,0xC7CE}; /* page 2 0x2013-0x22BF */ -static uint16 tab_uni_big52[]={ +static const uint16 tab_uni_big52[]={ 0xA156,0xA158, 0, 0, 0,0xA1A5,0xA1A6, 0, 0,0xA1A7,0xA1A8, 0, 0, 0, 0,0xA145, 0, 0,0xA14C,0xA14B, 0, 0, 0, 0, @@ -3975,7 +3975,7 @@ static uint16 tab_uni_big52[]={ 0, 0, 0, 0,0xA1E9}; /* page 3 0x2460-0x2642 */ -static uint16 tab_uni_big53[]={ +static const uint16 tab_uni_big53[]={ 0xC7E9,0xC7EA,0xC7EB,0xC7EC,0xC7ED,0xC7EE,0xC7EF,0xC7F0, 0xC7F1,0xC7F2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0xC7F3,0xC7F4,0xC7F5,0xC7F6, @@ -4039,7 +4039,7 @@ static uint16 tab_uni_big53[]={ 0xA1F0,0xA1F2,0xA1F1}; /* page 4 0x3000-0x3129 */ -static uint16 tab_uni_big54[]={ +static const uint16 tab_uni_big54[]={ 0xA140,0xA142,0xA143,0xA1B2, 0,0xC6A4, 0, 0, 0xA171,0xA172,0xA16D,0xA16E,0xA175,0xA176,0xA179,0xA17A, 0xA169,0xA16A,0xA245, 0,0xA165,0xA166, 0, 0, @@ -4080,11 +4080,11 @@ static uint16 tab_uni_big54[]={ 0xA3B9,0xA3BA}; /* page 5 0x32A3-0x32A3 */ -static uint16 tab_uni_big55[]={ +static const uint16 tab_uni_big55[]={ 0xA1C0}; /* page 6 0x338E-0x33D5 */ -static uint16 tab_uni_big56[]={ +static const uint16 tab_uni_big56[]={ 0xA255,0xA256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0xA250,0xA251, 0xA252, 0, 0,0xA254, 0, 0, 0, 0, @@ -4097,7 +4097,7 @@ static uint16 tab_uni_big56[]={ }; /* page 7 0x4E00-0x9483 */ -static uint16 tab_uni_big57[]={ +static const uint16 tab_uni_big57[]={ 0xA440,0xA442, 0,0xA443, 0, 0, 0,0xC945, 0xA456,0xA454,0xA457,0xA455,0xC946,0xA4A3,0xC94F,0xC94D, 0xA4A2,0xA4A1, 0, 0,0xA542,0xA541,0xA540, 0, @@ -6357,7 +6357,7 @@ static uint16 tab_uni_big57[]={ 0xF9C0,0xF9C1,0xF9BF,0xF9C9}; /* page 8 0x9577-0x9FA4 */ -static uint16 tab_uni_big58[]={ +static const uint16 tab_uni_big58[]={ 0xAAF8, 0, 0,0xD844,0xDC78,0xE8A5,0xF376, 0, 0,0xAAF9, 0,0xADAC,0xB07B, 0, 0,0xD845, 0,0xD846,0xB3AC, 0,0xB67D,0xDC7A,0xDC79,0xB6A3, @@ -6686,11 +6686,11 @@ static uint16 tab_uni_big58[]={ 0,0xEFB6, 0,0xF7CF, 0,0xF9A1}; /* page 9 0xFA0C-0xFA0D */ -static uint16 tab_uni_big59[]={ +static const uint16 tab_uni_big59[]={ 0xC94A,0xDDFC}; /* page 10 0xFE30-0xFFFD */ -static uint16 tab_uni_big510[]={ +static const uint16 tab_uni_big510[]={ 0xA14A,0xA157, 0,0xA159,0xA15B,0xA15F,0xA160,0xA163, 0xA164,0xA167,0xA168,0xA16B,0xA16C,0xA16F,0xA170,0xA173, 0xA174,0xA177,0xA178,0xA17B,0xA17C, 0, 0, 0, @@ -6914,7 +6914,7 @@ static MY_CHARSET_HANDLER my_charset_big5_handler= my_scan_8bit }; -CHARSET_INFO my_charset_big5_chinese_ci= +struct charset_info_st my_charset_big5_chinese_ci= { 1,0,0, /* number */ MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM, /* state */ @@ -6947,7 +6947,7 @@ CHARSET_INFO my_charset_big5_chinese_ci= }; -CHARSET_INFO my_charset_big5_bin= +struct charset_info_st my_charset_big5_bin= { 84,0,0, /* number */ MY_CS_COMPILED|MY_CS_BINSORT, /* state */ diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index 8b9391e40ad..07cf9d45f07 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. & tommy@valley.ne.jp. +/* Copyright (c) 2002-2007 MySQL AB & tommy@valley.ne.jp + Copyright (c) 2009-2011, Monty Program Ab This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -18,11 +19,10 @@ /* This file is for binary pseudo charset, created by bar@mysql.com */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> -static uchar ctype_bin[]= +static const uchar ctype_bin[]= { 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, @@ -46,7 +46,7 @@ static uchar ctype_bin[]= /* Dummy array for toupper / tolower / sortorder */ -static uchar bin_char_array[] = +static const uchar bin_char_array[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -68,7 +68,7 @@ static uchar bin_char_array[] = static my_bool -my_coll_init_8bit_bin(CHARSET_INFO *cs, +my_coll_init_8bit_bin(struct charset_info_st *cs, void *(*alloc)(size_t) __attribute__((unused))) { cs->max_sort_char=255; @@ -559,7 +559,7 @@ static MY_CHARSET_HANDLER my_charset_handler= }; -CHARSET_INFO my_charset_bin = +struct charset_info_st my_charset_bin = { 63,0,0, /* number */ MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_PRIMARY,/* state */ diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c index 692f1d37bf6..b7847e4509e 100644 --- a/strings/ctype-cp932.c +++ b/strings/ctype-cp932.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,9 +17,8 @@ /* This file is for cp932 charaset (Windows Japanese), and created based on ctype-sjis.c file */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #ifdef HAVE_CHARSET_cp932 @@ -31,7 +31,7 @@ * .configure. mbmaxlen_cp932=2 */ -static uchar ctype_cp932[257] = +static const uchar ctype_cp932[257] = { 0, /* For standard library */ 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* NUL ^A - ^G */ @@ -68,7 +68,7 @@ static uchar ctype_cp932[257] = 0020, 0020, 0020, 0020, 0020, 0000, 0000, 0000 }; -static uchar to_lower_cp932[]= +static const uchar to_lower_cp932[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -104,7 +104,7 @@ static uchar to_lower_cp932[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' }; -static uchar to_upper_cp932[]= +static const uchar to_upper_cp932[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -140,7 +140,7 @@ static uchar to_upper_cp932[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' }; -static uchar sort_order_cp932[]= +static const uchar sort_order_cp932[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -1812,7 +1812,7 @@ static size_t my_strnxfrm_cp932(CHARSET_INFO *cs __attribute__((unused)), } -static uint16 cp932_to_unicode[65536]= +static const uint16 cp932_to_unicode[65536]= { 0x0000, 0x0001, 0x0002, 0x0003, /* 0000 */ 0x0004, 0x0005, 0x0006, 0x0007, @@ -18201,7 +18201,7 @@ static uint16 cp932_to_unicode[65536]= }; -static uint16 unicode_to_cp932[65536]= +static const uint16 unicode_to_cp932[65536]= { 0x0000, 0x0001, 0x0002, 0x0003, /* 0000 */ 0x0004, 0x0005, 0x0006, 0x0007, @@ -34822,7 +34822,7 @@ static MY_CHARSET_HANDLER my_charset_handler= }; -CHARSET_INFO my_charset_cp932_japanese_ci= +struct charset_info_st my_charset_cp932_japanese_ci= { 95,0,0, /* number */ MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM, /* state */ @@ -34854,7 +34854,7 @@ CHARSET_INFO my_charset_cp932_japanese_ci= &my_collation_ci_handler }; -CHARSET_INFO my_charset_cp932_bin= +struct charset_info_st my_charset_cp932_bin= { 96,0,0, /* number */ MY_CS_COMPILED|MY_CS_BINSORT, /* state */ diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c index b65a771d36a..36fc6b36f0c 100644 --- a/strings/ctype-czech.c +++ b/strings/ctype-czech.c @@ -1,4 +1,6 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000-2007 MySQL AB + Copyright (c) 2009-2011, Monty Program Ab + Use is subject to license terms. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -65,9 +67,8 @@ #ifdef REAL_MYSQL -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #else @@ -83,7 +84,7 @@ below for what are the "special values" */ -static uchar *CZ_SORT_TABLE[] = { +static const uchar *const CZ_SORT_TABLE[] = { (uchar*) "\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\043\044\045\046\047\050\051\052\053\054\000\000\000\000\000\000\000\003\004\377\007\010\011\012\013\015\016\017\020\022\023\024\025\026\027\031\033\034\035\036\037\040\041\000\000\000\000\000\000\003\004\377\007\010\011\012\013\015\016\017\020\022\023\024\025\026\027\031\033\034\035\036\037\040\041\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\000\021\000\020\032\000\000\032\032\033\042\000\042\042\000\003\000\021\000\020\032\000\000\032\032\033\042\000\042\042\027\003\003\003\003\020\006\006\006\010\010\010\010\015\015\007\007\023\023\024\024\024\024\000\030\034\034\034\034\040\033\000\027\003\003\003\003\020\006\006\006\010\010\010\010\015\015\007\007\023\023\024\024\024\024\000\030\034\034\034\034\040\033\000", (uchar*) "\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\106\107\110\111\112\113\114\115\116\117\000\000\000\000\000\000\000\003\011\377\016\021\026\027\030\032\035\036\037\043\044\047\054\055\056\061\065\070\075\076\077\100\102\000\000\000\000\000\000\003\011\377\016\021\026\027\030\032\035\036\037\043\044\047\054\055\056\061\065\070\075\076\077\100\102\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\010\000\042\000\041\063\000\000\062\064\066\104\000\103\105\000\010\000\042\000\041\063\000\000\062\064\066\104\000\103\105\057\004\005\007\006\040\014\015\013\022\025\024\023\033\034\017\020\046\045\050\051\053\052\000\060\072\071\074\073\101\067\000\057\004\005\007\006\040\014\015\013\022\025\024\023\033\034\017\020\046\045\050\051\053\052\000\060\072\071\074\073\101\067\000", (uchar*) "\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\212\213\214\215\216\217\220\221\222\223\000\000\000\000\000\000\000\004\020\377\032\040\052\054\056\063\071\073\075\105\107\115\127\131\133\141\151\157\171\173\175\177\203\000\000\000\000\000\000\003\017\377\031\037\051\053\055\062\070\072\074\104\106\114\126\130\132\140\150\156\170\172\174\176\202\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\103\000\101\145\000\000\143\147\153\207\000\205\211\000\015\000\102\000\100\144\000\000\142\146\152\206\000\204\210\135\006\010\014\012\077\026\030\024\042\050\046\044\065\067\034\036\113\111\117\121\125\123\000\137\163\161\167\165\201\155\000\134\005\007\013\011\076\025\027\023\041\047\045\043\064\066\033\035\112\110\116\120\124\122\000\136\162\160\166\164\200\154\000", @@ -99,14 +100,14 @@ static uchar *CZ_SORT_TABLE[] = { struct wordvalue { const char * word; - uchar *outvalue; + const uchar *outvalue; }; -static struct wordvalue doubles[] = { - { "ch", (uchar*) "\014\031\057\057" }, - { "Ch", (uchar*) "\014\031\060\060" }, - { "CH", (uchar*) "\014\031\061\061" }, - { "c", (uchar*) "\005\012\021\021" }, - { "C", (uchar*) "\005\012\022\022" }, +static const struct wordvalue doubles[] = { + { "ch", (const uchar*) "\014\031\057\057" }, + { "Ch", (const uchar*) "\014\031\060\060" }, + { "CH", (const uchar*) "\014\031\061\061" }, + { "c", (const uchar*) "\005\012\021\021" }, + { "C", (const uchar*) "\005\012\022\022" }, }; /* @@ -427,10 +428,9 @@ static my_bool my_like_range_czech(CHARSET_INFO *cs __attribute__((unused)), * * definition table reworked by Jaromir Dolecek <dolecek@ics.muni.cz> */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" -static uchar ctype_czech[257] = { +static const uchar ctype_czech[257] = { 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, @@ -450,7 +450,7 @@ static uchar ctype_czech[257] = { 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 16, }; -static uchar to_lower_czech[] = { +static const uchar to_lower_czech[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, @@ -469,7 +469,7 @@ static uchar to_lower_czech[] = { 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255, }; -static uchar to_upper_czech[] = { +static const uchar to_upper_czech[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, @@ -488,7 +488,7 @@ static uchar to_upper_czech[] = { 240,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255, }; -static uchar sort_order_czech[] = { +static const uchar sort_order_czech[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, @@ -507,7 +507,7 @@ static uchar sort_order_czech[] = { 255, 98, 99,101,102,103,104,255,109,119,118,120,121,126,116,255, }; -static uint16 tab_8859_2_uni[256]={ +static const uint16 tab_8859_2_uni[256]={ 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -544,7 +544,7 @@ static uint16 tab_8859_2_uni[256]={ /* 0000-00FD , 254 chars */ -static uchar tab_uni_8859_2_plane00[]={ +static const uchar tab_uni_8859_2_plane00[]={ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -563,7 +563,7 @@ static uchar tab_uni_8859_2_plane00[]={ 0x00,0x00,0x00,0xF3,0xF4,0x00,0xF6,0xF7,0x00,0x00,0xFA,0x00,0xFC,0xFD}; /* 0102-017E , 125 chars */ -static uchar tab_uni_8859_2_plane01[]={ +static const uchar tab_uni_8859_2_plane01[]={ 0xC3,0xE3,0xA1,0xB1,0xC6,0xE6,0x00,0x00,0x00,0x00,0xC8,0xE8,0xCF,0xEF,0xD0,0xF0, 0x00,0x00,0x00,0x00,0x00,0x00,0xCA,0xEA,0xCC,0xEC,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -574,7 +574,7 @@ static uchar tab_uni_8859_2_plane01[]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAC,0xBC,0xAF,0xBF,0xAE,0xBE}; /* 02C7-02DD , 23 chars */ -static uchar tab_uni_8859_2_plane02[]={ +static const uchar tab_uni_8859_2_plane02[]={ 0xB7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0xA2,0xFF,0x00,0xB2,0x00,0xBD}; @@ -601,7 +601,7 @@ static MY_COLLATION_HANDLER my_collation_latin2_czech_ci_handler = my_propagate_simple }; -CHARSET_INFO my_charset_latin2_czech_ci = +struct charset_info_st my_charset_latin2_czech_ci = { 2,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_CSSORT, /* state */ diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c index 5267ca8fa50..3caa1977c0b 100644 --- a/strings/ctype-euc_kr.c +++ b/strings/ctype-euc_kr.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,14 +26,13 @@ * .configure. mbmaxlen_euc_kr=2 */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #ifdef HAVE_CHARSET_euckr -static uchar ctype_euc_kr[257] = +static const uchar ctype_euc_kr[257] = { 0, /* For standard library */ 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* NUL ^A - ^G */ @@ -69,7 +69,7 @@ static uchar ctype_euc_kr[257] = 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0000, }; -static uchar to_lower_euc_kr[]= +static const uchar to_lower_euc_kr[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -105,7 +105,7 @@ static uchar to_lower_euc_kr[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uchar to_upper_euc_kr[]= +static const uchar to_upper_euc_kr[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -141,7 +141,7 @@ static uchar to_upper_euc_kr[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uchar sort_order_euc_kr[]= +static const uchar sort_order_euc_kr[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -1484,7 +1484,7 @@ static MY_UNICASE_INFO *my_caseinfo_euckr[256]= /* page 0 0x8141-0xC8FE */ -static uint16 tab_ksc5601_uni0[]={ +static const uint16 tab_ksc5601_uni0[]={ 0xAC02,0xAC03,0xAC05,0xAC06,0xAC0B,0xAC0C,0xAC0D,0xAC0E, 0xAC0F,0xAC18,0xAC1E,0xAC1F,0xAC21,0xAC22,0xAC23,0xAC25, 0xAC26,0xAC27,0xAC28,0xAC29,0xAC2A,0xAC2B,0xAC2E,0xAC32, @@ -3783,7 +3783,7 @@ static uint16 tab_ksc5601_uni0[]={ 0xD78C,0xD790,0xD798,0xD799,0xD79B,0xD79D}; /* page 1 0xCAA1-0xFDFE */ -static uint16 tab_ksc5601_uni1[]={ +static const uint16 tab_ksc5601_uni1[]={ 0x4F3D,0x4F73,0x5047,0x50F9,0x52A0,0x53EF,0x5475,0x54E5, 0x5609,0x5AC1,0x5BB6,0x6687,0x67B6,0x67B7,0x67EF,0x6B4C, 0x73C2,0x75C2,0x7A3C,0x82DB,0x8304,0x8857,0x8888,0x8A36, @@ -5437,7 +5437,7 @@ static int func_ksc5601_uni_onechar(int code){ return(0); } /* page 0 0x00A1-0x0167 */ -static uint16 tab_uni_ksc56010[]={ +static const uint16 tab_uni_ksc56010[]={ 0xA2AE, 0, 0,0xA2B4, 0, 0,0xA1D7,0xA1A7, 0,0xA8A3, 0, 0,0xA1A9,0xA2E7, 0,0xA1C6, 0xA1BE,0xA9F7,0xA9F8,0xA2A5, 0,0xA2D2,0xA1A4,0xA2AC, @@ -5465,7 +5465,7 @@ static uint16 tab_uni_ksc56010[]={ 0, 0, 0, 0, 0,0xA8AE,0xA9AE}; /* page 1 0x02C7-0x0451 */ -static uint16 tab_uni_ksc56011[]={ +static const uint16 tab_uni_ksc56011[]={ 0xA2A7, 0, 0, 0, 0, 0, 0, 0, 0,0xA2B0, 0, 0, 0, 0, 0, 0, 0,0xA2A8,0xA2AB,0xA2AA,0xA2AD, 0,0xA2A9, 0, @@ -5518,7 +5518,7 @@ static uint16 tab_uni_ksc56011[]={ 0xACF1, 0,0xACD7}; /* page 2 0x2015-0x2312 */ -static uint16 tab_uni_ksc56012[]={ +static const uint16 tab_uni_ksc56012[]={ 0xA1AA, 0, 0,0xA1AE,0xA1AF, 0, 0,0xA1B0, 0xA1B1, 0, 0,0xA2D3,0xA2D4, 0, 0, 0, 0xA1A5,0xA1A6, 0, 0, 0, 0, 0, 0, @@ -5617,7 +5617,7 @@ static uint16 tab_uni_ksc56012[]={ 0, 0, 0, 0, 0,0xA1D2}; /* page 3 0x2460-0x266D */ -static uint16 tab_uni_ksc56013[]={ +static const uint16 tab_uni_ksc56013[]={ 0xA8E7,0xA8E8,0xA8E9,0xA8EA,0xA8EB,0xA8EC,0xA8ED,0xA8EE, 0xA8EF,0xA8F0,0xA8F1,0xA8F2,0xA8F3,0xA8F4,0xA8F5, 0, 0, 0, 0, 0,0xA9E7,0xA9E8,0xA9E9,0xA9EA, @@ -5686,7 +5686,7 @@ static uint16 tab_uni_ksc56013[]={ 0xA2CD,0xA2DB,0xA2DC, 0,0xA2DD,0xA2DA}; /* page 4 0x3000-0x327F */ -static uint16 tab_uni_ksc56014[]={ +static const uint16 tab_uni_ksc56014[]={ 0xA1A1,0xA1A2,0xA1A3,0xA1A8, 0, 0, 0, 0, 0xA1B4,0xA1B5,0xA1B6,0xA1B7,0xA1B8,0xA1B9,0xA1BA,0xA1BB, 0xA1BC,0xA1BD, 0,0xA1EB,0xA1B2,0xA1B3, 0, 0, @@ -5770,7 +5770,7 @@ static uint16 tab_uni_ksc56014[]={ }; /* page 5 0x3380-0x33DD */ -static uint16 tab_uni_ksc56015[]={ +static const uint16 tab_uni_ksc56015[]={ 0xA7C9,0xA7CA,0xA7CB,0xA7CC,0xA7CD, 0, 0, 0, 0xA7BA,0xA7BB,0xA7DC,0xA7DD,0xA7DE,0xA7B6,0xA7B7,0xA7B8, 0xA7D4,0xA7D5,0xA7D6,0xA7D7,0xA7D8,0xA7A1,0xA7A2,0xA7A3, @@ -5785,7 +5785,7 @@ static uint16 tab_uni_ksc56015[]={ 0xA2E4, 0, 0,0xA7E4,0xA7EE,0xA7E9}; /* page 6 0x4E00-0x947F */ -static uint16 tab_uni_ksc56016[]={ +static const uint16 tab_uni_ksc56016[]={ 0xECE9,0xEFCB, 0,0xF6D2, 0, 0, 0,0xD8B2, 0xEDDB,0xDFB2,0xDFBE,0xF9BB, 0,0xDCF4, 0, 0, 0,0xF5E4, 0, 0,0xF3A6,0xDDE0,0xE1A6, 0, @@ -8045,7 +8045,7 @@ static uint16 tab_uni_ksc56016[]={ }; /* page 7 0x9577-0x9F9C */ -static uint16 tab_uni_ksc56017[]={ +static const uint16 tab_uni_ksc56017[]={ 0xEDFE, 0, 0, 0, 0, 0, 0, 0, 0,0xDAA6, 0, 0,0xE0EC, 0, 0, 0, 0, 0,0xF8CD, 0,0xCBD2, 0, 0, 0, @@ -8373,7 +8373,7 @@ static uint16 tab_uni_ksc56017[]={ 0, 0, 0, 0, 0,0xCFCF}; /* page 8 0xAC00-0xD7A3 */ -static uint16 tab_uni_ksc56018[]={ +static const uint16 tab_uni_ksc56018[]={ 0xB0A1,0xB0A2,0x8141,0x8142,0xB0A3,0x8143,0x8144,0xB0A4, 0xB0A5,0xB0A6,0xB0A7,0x8145,0x8146,0x8147,0x8148,0x8149, 0xB0A8,0xB0A9,0xB0AA,0xB0AB,0xB0AC,0xB0AD,0xB0AE,0xB0AF, @@ -9773,7 +9773,7 @@ static uint16 tab_uni_ksc56018[]={ 0xC64F,0xC650,0xC651,0xC652}; /* page 9 0xF900-0xFA0B */ -static uint16 tab_uni_ksc56019[]={ +static const uint16 tab_uni_ksc56019[]={ 0xCBD0,0xCBD6,0xCBE7,0xCDCF,0xCDE8,0xCEAD,0xCFFB,0xD0A2, 0xD0B8,0xD0D0,0xD0DD,0xD1D4,0xD1D5,0xD1D8,0xD1DB,0xD1DC, 0xD1DD,0xD1DE,0xD1DF,0xD1E0,0xD1E2,0xD1E3,0xD1E4,0xD1E5, @@ -9810,7 +9810,7 @@ static uint16 tab_uni_ksc56019[]={ 0xFAA1,0xFAA2,0xFAE6,0xFCA9}; /* page 10 0xFF01-0xFFE6 */ -static uint16 tab_uni_ksc560110[]={ +static const uint16 tab_uni_ksc560110[]={ 0xA3A1,0xA3A2,0xA3A3,0xA3A4,0xA3A5,0xA3A6,0xA3A7,0xA3A8, 0xA3A9,0xA3AA,0xA3AB,0xA3AC,0xA3AD,0xA3AE,0xA3AF,0xA3B0, 0xA3B1,0xA3B2,0xA3B3,0xA3B4,0xA3B5,0xA3B6,0xA3B7,0xA3B8, @@ -10004,7 +10004,7 @@ static MY_CHARSET_HANDLER my_charset_handler= }; -CHARSET_INFO my_charset_euckr_korean_ci= +struct charset_info_st my_charset_euckr_korean_ci= { 19,0,0, /* number */ MY_CS_COMPILED|MY_CS_PRIMARY, /* state */ @@ -10037,7 +10037,7 @@ CHARSET_INFO my_charset_euckr_korean_ci= }; -CHARSET_INFO my_charset_euckr_bin= +struct charset_info_st my_charset_euckr_bin= { 85,0,0, /* number */ MY_CS_COMPILED|MY_CS_BINSORT, /* state */ diff --git a/strings/ctype-eucjpms.c b/strings/ctype-eucjpms.c index c759d27b985..fe6bb744706 100644 --- a/strings/ctype-eucjpms.c +++ b/strings/ctype-eucjpms.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. & tommy@valley.ne.jp. +/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -26,14 +27,13 @@ ctype-ujis.c file. * .configure. mbmaxlen_eucjpms=3 */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #ifdef HAVE_CHARSET_eucjpms -static uchar ctype_eucjpms[257] = +static const uchar ctype_eucjpms[257] = { 0, /* For standard library */ 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* NUL ^A - ^G */ @@ -70,7 +70,7 @@ static uchar ctype_eucjpms[257] = 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0000, }; -static uchar to_lower_eucjpms[]= +static const uchar to_lower_eucjpms[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -106,7 +106,7 @@ static uchar to_lower_eucjpms[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' }; -static uchar to_upper_eucjpms[]= +static const uchar to_upper_eucjpms[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -142,7 +142,7 @@ static uchar to_upper_eucjpms[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' }; -static uchar sort_order_eucjpms[]= +static const uchar sort_order_eucjpms[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -201,7 +201,6 @@ static uint mbcharlen_eucjpms(CHARSET_INFO *cs __attribute__((unused)),uint c) } - /* Case info pages for JIS-X-0208 range */ static MY_UNICASE_INFO cA2[256]= @@ -1730,7 +1729,7 @@ static MY_UNICASE_INFO *my_caseinfo_eucjpms[512]= }; -static uint16 jisx0208_eucjpms_to_unicode[65536]= +static const uint16 jisx0208_eucjpms_to_unicode[65536]= { 0x0000, 0x0001, 0x0002, 0x0003, /* 0000 */ 0x0004, 0x0005, 0x0006, 0x0007, @@ -67548,7 +67547,7 @@ static MY_CHARSET_HANDLER my_charset_handler= -CHARSET_INFO my_charset_eucjpms_japanese_ci= +struct charset_info_st my_charset_eucjpms_japanese_ci= { 97,0,0, /* number */ MY_CS_COMPILED|MY_CS_PRIMARY, /* state */ @@ -67581,7 +67580,7 @@ CHARSET_INFO my_charset_eucjpms_japanese_ci= }; -CHARSET_INFO my_charset_eucjpms_bin= +struct charset_info_st my_charset_eucjpms_bin= { 98,0,0, /* number */ MY_CS_COMPILED|MY_CS_BINSORT, /* state */ diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c index b45e995e127..e0499c6f2e3 100644 --- a/strings/ctype-extra.c +++ b/strings/ctype-extra.c @@ -6,7 +6,8 @@ ./conf_to_src ../sql/share/charsets/ > FILE */ -/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. + Copyright (c) 2000, 2011, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,11 +22,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <my_global.h> +#include "strings_def.h" #include <m_ctype.h> #ifdef HAVE_CHARSET_dec8 -uchar ctype_dec8_swedish_ci[] = { +static const uchar ctype_dec8_swedish_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -45,7 +46,7 @@ uchar ctype_dec8_swedish_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 }; -uchar to_lower_dec8_swedish_ci[] = { +static const uchar to_lower_dec8_swedish_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -64,7 +65,7 @@ uchar to_lower_dec8_swedish_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_dec8_swedish_ci[] = { +static const uchar to_upper_dec8_swedish_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -83,7 +84,7 @@ uchar to_upper_dec8_swedish_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uchar sort_order_dec8_swedish_ci[] = { +static const uchar sort_order_dec8_swedish_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -102,7 +103,7 @@ uchar sort_order_dec8_swedish_ci[] = { 0x44,0x4E,0x4F,0x4F,0x4F,0x4F,0x5D,0xF7,0xD8,0x55,0x55,0x55,0x59,0x59,0xDE,0xFF }; -uint16 to_uni_dec8_swedish_ci[] = { +static const uint16 to_uni_dec8_swedish_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -140,7 +141,7 @@ uint16 to_uni_dec8_swedish_ci[] = { #endif #ifdef HAVE_CHARSET_cp850 -uchar ctype_cp850_general_ci[] = { +static const uchar ctype_cp850_general_ci[] = { 0x00, 0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x30,0x30, 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x20,0x30,0x30,0x30,0x30,0x30, @@ -160,7 +161,7 @@ uchar ctype_cp850_general_ci[] = { 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20 }; -uchar to_lower_cp850_general_ci[] = { +static const uchar to_lower_cp850_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -179,7 +180,7 @@ uchar to_lower_cp850_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp850_general_ci[] = { +static const uchar to_upper_cp850_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -198,7 +199,7 @@ uchar to_upper_cp850_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar sort_order_cp850_general_ci[] = { +static const uchar sort_order_cp850_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -217,7 +218,7 @@ uchar sort_order_cp850_general_ci[] = { 0xED,0xF1,0xC1,0xFE,0xF6,0xE7,0xBF,0xBC,0xF0,0xE8,0xF7,0xF9,0xF3,0xF2,0xDF,0xE0 }; -uint16 to_uni_cp850_general_ci[] = { +static const uint16 to_uni_cp850_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -255,7 +256,7 @@ uint16 to_uni_cp850_general_ci[] = { #endif #ifdef HAVE_CHARSET_latin1 -uchar ctype_latin1_german1_ci[] = { +static const uchar ctype_latin1_german1_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -275,7 +276,7 @@ uchar ctype_latin1_german1_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 }; -uchar to_lower_latin1_german1_ci[] = { +static const uchar to_lower_latin1_german1_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -294,7 +295,7 @@ uchar to_lower_latin1_german1_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_latin1_german1_ci[] = { +static const uchar to_upper_latin1_german1_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -313,7 +314,7 @@ uchar to_upper_latin1_german1_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uchar sort_order_latin1_german1_ci[] = { +static const uchar sort_order_latin1_german1_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -332,7 +333,7 @@ uchar sort_order_latin1_german1_ci[] = { 0xD0,0x4E,0x4F,0x4F,0x4F,0x4F,0x4F,0xF7,0x4F,0x55,0x55,0x55,0x55,0x59,0xDE,0xFF }; -uint16 to_uni_latin1_german1_ci[] = { +static const uint16 to_uni_latin1_german1_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -370,7 +371,7 @@ uint16 to_uni_latin1_german1_ci[] = { #endif #ifdef HAVE_CHARSET_hp8 -uchar ctype_hp8_english_ci[] = { +static const uchar ctype_hp8_english_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -390,7 +391,7 @@ uchar ctype_hp8_english_ci[] = { 0x10,0x10,0x20,0x20,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20 }; -uchar to_lower_hp8_english_ci[] = { +static const uchar to_lower_hp8_english_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -409,7 +410,7 @@ uchar to_lower_hp8_english_ci[] = { 0xF1,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_hp8_english_ci[] = { +static const uchar to_upper_hp8_english_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -428,7 +429,7 @@ uchar to_upper_hp8_english_ci[] = { 0xF0,0xF0,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar sort_order_hp8_english_ci[] = { +static const uchar sort_order_hp8_english_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -447,7 +448,7 @@ uchar sort_order_hp8_english_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_hp8_english_ci[] = { +static const uint16 to_uni_hp8_english_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -485,7 +486,7 @@ uint16 to_uni_hp8_english_ci[] = { #endif #ifdef HAVE_CHARSET_koi8r -uchar ctype_koi8r_general_ci[] = { +static const uchar ctype_koi8r_general_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -505,7 +506,7 @@ uchar ctype_koi8r_general_ci[] = { 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01 }; -uchar to_lower_koi8r_general_ci[] = { +static const uchar to_lower_koi8r_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -524,7 +525,7 @@ uchar to_lower_koi8r_general_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF }; -uchar to_upper_koi8r_general_ci[] = { +static const uchar to_upper_koi8r_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -543,7 +544,7 @@ uchar to_upper_koi8r_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar sort_order_koi8r_general_ci[] = { +static const uchar sort_order_koi8r_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -562,7 +563,7 @@ uchar sort_order_koi8r_general_ci[] = { 0xEF,0xFF,0xF0,0xF1,0xF2,0xF3,0xE6,0xE1,0xFC,0xFB,0xE7,0xF8,0xFD,0xF9,0xF7,0xFA }; -uint16 to_uni_koi8r_general_ci[] = { +static const uint16 to_uni_koi8r_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -600,7 +601,7 @@ uint16 to_uni_koi8r_general_ci[] = { #endif #ifdef HAVE_CHARSET_latin2 -uchar ctype_latin2_general_ci[] = { +static const uchar ctype_latin2_general_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -620,7 +621,7 @@ uchar ctype_latin2_general_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 }; -uchar to_lower_latin2_general_ci[] = { +static const uchar to_lower_latin2_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -639,7 +640,7 @@ uchar to_lower_latin2_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_latin2_general_ci[] = { +static const uchar to_upper_latin2_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -658,7 +659,7 @@ uchar to_upper_latin2_general_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uchar sort_order_latin2_general_ci[] = { +static const uchar sort_order_latin2_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -677,7 +678,7 @@ uchar sort_order_latin2_general_ci[] = { 0xFF,0x55,0x54,0x57,0x56,0x56,0x56,0xFF,0x5A,0x5F,0x5F,0x5F,0x5F,0x63,0x5E,0xFF }; -uint16 to_uni_latin2_general_ci[] = { +static const uint16 to_uni_latin2_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -715,7 +716,7 @@ uint16 to_uni_latin2_general_ci[] = { #endif #ifdef HAVE_CHARSET_swe7 -uchar ctype_swe7_swedish_ci[] = { +static const uchar ctype_swe7_swedish_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -735,7 +736,7 @@ uchar ctype_swe7_swedish_ci[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -uchar to_lower_swe7_swedish_ci[] = { +static const uchar to_lower_swe7_swedish_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -754,7 +755,7 @@ uchar to_lower_swe7_swedish_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_swe7_swedish_ci[] = { +static const uchar to_upper_swe7_swedish_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -773,7 +774,7 @@ uchar to_upper_swe7_swedish_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar sort_order_swe7_swedish_ci[] = { +static const uchar sort_order_swe7_swedish_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -792,7 +793,7 @@ uchar sort_order_swe7_swedish_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_swe7_swedish_ci[] = { +static const uint16 to_uni_swe7_swedish_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -830,7 +831,7 @@ uint16 to_uni_swe7_swedish_ci[] = { #endif #ifdef HAVE_CHARSET_ascii -uchar ctype_ascii_general_ci[] = { +static const uchar ctype_ascii_general_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -850,7 +851,7 @@ uchar ctype_ascii_general_ci[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -uchar to_lower_ascii_general_ci[] = { +static const uchar to_lower_ascii_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -869,7 +870,7 @@ uchar to_lower_ascii_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_ascii_general_ci[] = { +static const uchar to_upper_ascii_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -888,7 +889,7 @@ uchar to_upper_ascii_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar sort_order_ascii_general_ci[] = { +static const uchar sort_order_ascii_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -907,7 +908,7 @@ uchar sort_order_ascii_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_ascii_general_ci[] = { +static const uint16 to_uni_ascii_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -945,7 +946,7 @@ uint16 to_uni_ascii_general_ci[] = { #endif #ifdef HAVE_CHARSET_cp1251 -uchar ctype_cp1251_bulgarian_ci[] = { +static const uchar ctype_cp1251_bulgarian_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -965,7 +966,7 @@ uchar ctype_cp1251_bulgarian_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 }; -uchar to_lower_cp1251_bulgarian_ci[] = { +static const uchar to_lower_cp1251_bulgarian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -984,7 +985,7 @@ uchar to_lower_cp1251_bulgarian_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp1251_bulgarian_ci[] = { +static const uchar to_upper_cp1251_bulgarian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1003,7 +1004,7 @@ uchar to_upper_cp1251_bulgarian_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF }; -uchar sort_order_cp1251_bulgarian_ci[] = { +static const uchar sort_order_cp1251_bulgarian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1022,7 +1023,7 @@ uchar sort_order_cp1251_bulgarian_ci[] = { 0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B }; -uint16 to_uni_cp1251_bulgarian_ci[] = { +static const uint16 to_uni_cp1251_bulgarian_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -1060,7 +1061,7 @@ uint16 to_uni_cp1251_bulgarian_ci[] = { #endif #ifdef HAVE_CHARSET_latin1 -uchar ctype_latin1_danish_ci[] = { +static const uchar ctype_latin1_danish_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -1080,7 +1081,7 @@ uchar ctype_latin1_danish_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 }; -uchar to_lower_latin1_danish_ci[] = { +static const uchar to_lower_latin1_danish_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1099,7 +1100,7 @@ uchar to_lower_latin1_danish_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_latin1_danish_ci[] = { +static const uchar to_upper_latin1_danish_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1118,7 +1119,7 @@ uchar to_upper_latin1_danish_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uchar sort_order_latin1_danish_ci[] = { +static const uchar sort_order_latin1_danish_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1137,7 +1138,7 @@ uchar sort_order_latin1_danish_ci[] = { 0x44,0x4E,0x4F,0x4F,0x4F,0x4F,0x5C,0xF7,0x5C,0x55,0x55,0x55,0x59,0x59,0xDE,0xFF }; -uint16 to_uni_latin1_danish_ci[] = { +static const uint16 to_uni_latin1_danish_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -1175,7 +1176,7 @@ uint16 to_uni_latin1_danish_ci[] = { #endif #ifdef HAVE_CHARSET_hebrew -uchar ctype_hebrew_general_ci[] = { +static const uchar ctype_hebrew_general_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -1195,7 +1196,7 @@ uchar ctype_hebrew_general_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x00,0x20,0x20,0x00 }; -uchar to_lower_hebrew_general_ci[] = { +static const uchar to_lower_hebrew_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1214,7 +1215,7 @@ uchar to_lower_hebrew_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_hebrew_general_ci[] = { +static const uchar to_upper_hebrew_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1233,7 +1234,7 @@ uchar to_upper_hebrew_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar sort_order_hebrew_general_ci[] = { +static const uchar sort_order_hebrew_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1252,7 +1253,7 @@ uchar sort_order_hebrew_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_hebrew_general_ci[] = { +static const uint16 to_uni_hebrew_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -1290,7 +1291,7 @@ uint16 to_uni_hebrew_general_ci[] = { #endif #ifdef HAVE_CHARSET_latin7 -uchar ctype_latin7_estonian_cs[] = { +static const uchar ctype_latin7_estonian_cs[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -1310,7 +1311,7 @@ uchar ctype_latin7_estonian_cs[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 }; -uchar to_lower_latin7_estonian_cs[] = { +static const uchar to_lower_latin7_estonian_cs[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1329,7 +1330,7 @@ uchar to_lower_latin7_estonian_cs[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_latin7_estonian_cs[] = { +static const uchar to_upper_latin7_estonian_cs[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1348,7 +1349,7 @@ uchar to_upper_latin7_estonian_cs[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uchar sort_order_latin7_estonian_cs[] = { +static const uchar sort_order_latin7_estonian_cs[] = { 0x00,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x2E,0x2F,0x30,0x31,0x32,0x0A,0x0B, 0x0C,0x0D,0x0E,0x0F,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B, 0x2C,0x33,0x34,0x35,0x36,0x37,0x38,0x27,0x39,0x3A,0x3B,0x5D,0x3C,0x28,0x3D,0x3E, @@ -1367,7 +1368,7 @@ uchar sort_order_latin7_estonian_cs[] = { 0xDC,0xC3,0xC5,0xC9,0xCB,0xF3,0xF7,0x65,0xED,0xBD,0xD9,0xEB,0xF9,0xE2,0xE4,0x53 }; -uint16 to_uni_latin7_estonian_cs[] = { +static const uint16 to_uni_latin7_estonian_cs[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -1405,7 +1406,7 @@ uint16 to_uni_latin7_estonian_cs[] = { #endif #ifdef HAVE_CHARSET_latin2 -uchar ctype_latin2_hungarian_ci[] = { +static const uchar ctype_latin2_hungarian_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -1425,7 +1426,7 @@ uchar ctype_latin2_hungarian_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 }; -uchar to_lower_latin2_hungarian_ci[] = { +static const uchar to_lower_latin2_hungarian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1444,7 +1445,7 @@ uchar to_lower_latin2_hungarian_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_latin2_hungarian_ci[] = { +static const uchar to_upper_latin2_hungarian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1463,7 +1464,7 @@ uchar to_upper_latin2_hungarian_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uchar sort_order_latin2_hungarian_ci[] = { +static const uchar sort_order_latin2_hungarian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1482,7 +1483,7 @@ uchar sort_order_latin2_hungarian_ci[] = { 0xFF,0x62,0x63,0x64,0x66,0x67,0x67,0xFF,0x6D,0x77,0x75,0x78,0x78,0x7E,0x74,0xFF }; -uint16 to_uni_latin2_hungarian_ci[] = { +static const uint16 to_uni_latin2_hungarian_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -1520,7 +1521,7 @@ uint16 to_uni_latin2_hungarian_ci[] = { #endif #ifdef HAVE_CHARSET_koi8u -uchar ctype_koi8u_general_ci[] = { +static const uchar ctype_koi8u_general_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -1540,7 +1541,7 @@ uchar ctype_koi8u_general_ci[] = { 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01 }; -uchar to_lower_koi8u_general_ci[] = { +static const uchar to_lower_koi8u_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1559,7 +1560,7 @@ uchar to_lower_koi8u_general_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF }; -uchar to_upper_koi8u_general_ci[] = { +static const uchar to_upper_koi8u_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1578,7 +1579,7 @@ uchar to_upper_koi8u_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar sort_order_koi8u_general_ci[] = { +static const uchar sort_order_koi8u_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1597,7 +1598,7 @@ uchar sort_order_koi8u_general_ci[] = { 0x94,0xA4,0x95,0x96,0x97,0x98,0x89,0x82,0xA1,0xA0,0x8A,0x9D,0xA2,0x9E,0x9C,0x9F }; -uint16 to_uni_koi8u_general_ci[] = { +static const uint16 to_uni_koi8u_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -1635,7 +1636,7 @@ uint16 to_uni_koi8u_general_ci[] = { #endif #ifdef HAVE_CHARSET_cp1251 -uchar ctype_cp1251_ukrainian_ci[] = { +static const uchar ctype_cp1251_ukrainian_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -1655,7 +1656,7 @@ uchar ctype_cp1251_ukrainian_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 }; -uchar to_lower_cp1251_ukrainian_ci[] = { +static const uchar to_lower_cp1251_ukrainian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1674,7 +1675,7 @@ uchar to_lower_cp1251_ukrainian_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp1251_ukrainian_ci[] = { +static const uchar to_upper_cp1251_ukrainian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1693,7 +1694,7 @@ uchar to_upper_cp1251_ukrainian_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF }; -uchar sort_order_cp1251_ukrainian_ci[] = { +static const uchar sort_order_cp1251_ukrainian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1712,7 +1713,7 @@ uchar sort_order_cp1251_ukrainian_ci[] = { 0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,0xA0,0xA1,0xA2,0xA3,0xA4 }; -uint16 to_uni_cp1251_ukrainian_ci[] = { +static const uint16 to_uni_cp1251_ukrainian_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -1750,7 +1751,7 @@ uint16 to_uni_cp1251_ukrainian_ci[] = { #endif #ifdef HAVE_CHARSET_greek -uchar ctype_greek_general_ci[] = { +static const uchar ctype_greek_general_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -1770,7 +1771,7 @@ uchar ctype_greek_general_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00 }; -uchar to_lower_greek_general_ci[] = { +static const uchar to_lower_greek_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1789,7 +1790,7 @@ uchar to_lower_greek_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_greek_general_ci[] = { +static const uchar to_upper_greek_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1808,7 +1809,7 @@ uchar to_upper_greek_general_ci[] = { 0xD0,0xD1,0xD3,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xCF,0xD5,0xD9,0xFF }; -uchar sort_order_greek_general_ci[] = { +static const uchar sort_order_greek_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1827,7 +1828,7 @@ uchar sort_order_greek_general_ci[] = { 0xD0,0xD1,0xD3,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xC9,0xD5,0xCF,0xD5,0xD9,0xFF }; -uint16 to_uni_greek_general_ci[] = { +static const uint16 to_uni_greek_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -1865,7 +1866,7 @@ uint16 to_uni_greek_general_ci[] = { #endif #ifdef HAVE_CHARSET_cp1250 -uchar ctype_cp1250_general_ci[] = { +static const uchar ctype_cp1250_general_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -1885,7 +1886,7 @@ uchar ctype_cp1250_general_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 }; -uchar to_lower_cp1250_general_ci[] = { +static const uchar to_lower_cp1250_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1904,7 +1905,7 @@ uchar to_lower_cp1250_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp1250_general_ci[] = { +static const uchar to_upper_cp1250_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1923,7 +1924,7 @@ uchar to_upper_cp1250_general_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uchar sort_order_cp1250_general_ci[] = { +static const uchar sort_order_cp1250_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -1942,7 +1943,7 @@ uchar sort_order_cp1250_general_ci[] = { 0x47,0x53,0x53,0x55,0x55,0x55,0x55,0xF7,0x58,0x5C,0x5C,0x5C,0x5C,0x60,0x5B,0xFF }; -uint16 to_uni_cp1250_general_ci[] = { +static const uint16 to_uni_cp1250_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -1980,7 +1981,7 @@ uint16 to_uni_cp1250_general_ci[] = { #endif #ifdef HAVE_CHARSET_latin2 -uchar ctype_latin2_croatian_ci[] = { +static const uchar ctype_latin2_croatian_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -2000,7 +2001,7 @@ uchar ctype_latin2_croatian_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 }; -uchar to_lower_latin2_croatian_ci[] = { +static const uchar to_lower_latin2_croatian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2019,7 +2020,7 @@ uchar to_lower_latin2_croatian_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_latin2_croatian_ci[] = { +static const uchar to_upper_latin2_croatian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2038,7 +2039,7 @@ uchar to_upper_latin2_croatian_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uchar sort_order_latin2_croatian_ci[] = { +static const uchar sort_order_latin2_croatian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2057,7 +2058,7 @@ uchar sort_order_latin2_croatian_ci[] = { 0x4A,0x57,0x57,0x59,0x59,0x59,0x59,0xFE,0x5D,0x64,0x64,0x64,0x64,0x69,0x62,0xFF }; -uint16 to_uni_latin2_croatian_ci[] = { +static const uint16 to_uni_latin2_croatian_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -2095,7 +2096,7 @@ uint16 to_uni_latin2_croatian_ci[] = { #endif #ifdef HAVE_CHARSET_cp1257 -uchar ctype_cp1257_lithuanian_ci[] = { +static const uchar ctype_cp1257_lithuanian_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -2115,7 +2116,7 @@ uchar ctype_cp1257_lithuanian_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00 }; -uchar to_lower_cp1257_lithuanian_ci[] = { +static const uchar to_lower_cp1257_lithuanian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2134,7 +2135,7 @@ uchar to_lower_cp1257_lithuanian_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp1257_lithuanian_ci[] = { +static const uchar to_upper_cp1257_lithuanian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2153,7 +2154,7 @@ uchar to_upper_cp1257_lithuanian_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uchar sort_order_cp1257_lithuanian_ci[] = { +static const uchar sort_order_cp1257_lithuanian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2172,7 +2173,7 @@ uchar sort_order_cp1257_lithuanian_ci[] = { 0x5A,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x5E,0xFF,0xFF,0x5D,0xFF,0xFF,0xFF,0xFF }; -uint16 to_uni_cp1257_lithuanian_ci[] = { +static const uint16 to_uni_cp1257_lithuanian_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -2210,7 +2211,7 @@ uint16 to_uni_cp1257_lithuanian_ci[] = { #endif #ifdef HAVE_CHARSET_latin5 -uchar ctype_latin5_turkish_ci[] = { +static const uchar ctype_latin5_turkish_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -2230,7 +2231,7 @@ uchar ctype_latin5_turkish_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 }; -uchar to_lower_latin5_turkish_ci[] = { +static const uchar to_lower_latin5_turkish_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2249,7 +2250,7 @@ uchar to_lower_latin5_turkish_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_latin5_turkish_ci[] = { +static const uchar to_upper_latin5_turkish_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2268,7 +2269,7 @@ uchar to_upper_latin5_turkish_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0x49,0xDE,0xFF }; -uchar sort_order_latin5_turkish_ci[] = { +static const uchar sort_order_latin5_turkish_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2287,7 +2288,7 @@ uchar sort_order_latin5_turkish_ci[] = { 0x49,0x51,0x52,0x52,0x52,0x52,0x53,0xFA,0x52,0x5A,0x5A,0x5A,0x5B,0x4B,0x58,0x5F }; -uint16 to_uni_latin5_turkish_ci[] = { +static const uint16 to_uni_latin5_turkish_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -2325,7 +2326,7 @@ uint16 to_uni_latin5_turkish_ci[] = { #endif #ifdef HAVE_CHARSET_armscii8 -uchar ctype_armscii8_general_ci[] = { +static const uchar ctype_armscii8_general_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -2345,7 +2346,7 @@ uchar ctype_armscii8_general_ci[] = { 0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x10,0x10 }; -uchar to_lower_armscii8_general_ci[] = { +static const uchar to_lower_armscii8_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2364,7 +2365,7 @@ uchar to_lower_armscii8_general_ci[] = { 0xF1,0xF1,0xF3,0xF3,0xF5,0xF5,0xF7,0xF7,0xF9,0xF9,0xFB,0xFB,0xFD,0xFD,0xFE,0xFF }; -uchar to_upper_armscii8_general_ci[] = { +static const uchar to_upper_armscii8_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2383,7 +2384,7 @@ uchar to_upper_armscii8_general_ci[] = { 0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xFA,0xFA,0xFC,0xFC,0xFE,0xFF }; -uchar sort_order_armscii8_general_ci[] = { +static const uchar sort_order_armscii8_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2402,7 +2403,7 @@ uchar sort_order_armscii8_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_armscii8_general_ci[] = { +static const uint16 to_uni_armscii8_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -2440,7 +2441,7 @@ uint16 to_uni_armscii8_general_ci[] = { #endif #ifdef HAVE_CHARSET_cp866 -uchar ctype_cp866_general_ci[] = { +static const uchar ctype_cp866_general_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -2460,7 +2461,7 @@ uchar ctype_cp866_general_ci[] = { 0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48 }; -uchar to_lower_cp866_general_ci[] = { +static const uchar to_lower_cp866_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2479,7 +2480,7 @@ uchar to_lower_cp866_general_ci[] = { 0xF1,0xF1,0xF3,0xF3,0xF5,0xF5,0xF7,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp866_general_ci[] = { +static const uchar to_upper_cp866_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2498,7 +2499,7 @@ uchar to_upper_cp866_general_ci[] = { 0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar sort_order_cp866_general_ci[] = { +static const uchar sort_order_cp866_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2517,7 +2518,7 @@ uchar sort_order_cp866_general_ci[] = { 0x81,0x81,0x83,0x83,0x8B,0x8B,0xA3,0xA3,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2 }; -uint16 to_uni_cp866_general_ci[] = { +static const uint16 to_uni_cp866_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -2555,7 +2556,7 @@ uint16 to_uni_cp866_general_ci[] = { #endif #ifdef HAVE_CHARSET_keybcs2 -uchar ctype_keybcs2_general_ci[] = { +static const uchar ctype_keybcs2_general_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -2575,7 +2576,7 @@ uchar ctype_keybcs2_general_ci[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48 }; -uchar to_lower_keybcs2_general_ci[] = { +static const uchar to_lower_keybcs2_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2594,7 +2595,7 @@ uchar to_lower_keybcs2_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_keybcs2_general_ci[] = { +static const uchar to_upper_keybcs2_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2613,7 +2614,7 @@ uchar to_upper_keybcs2_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar sort_order_keybcs2_general_ci[] = { +static const uchar sort_order_keybcs2_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2632,7 +2633,7 @@ uchar sort_order_keybcs2_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_keybcs2_general_ci[] = { +static const uint16 to_uni_keybcs2_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -2670,7 +2671,7 @@ uint16 to_uni_keybcs2_general_ci[] = { #endif #ifdef HAVE_CHARSET_macce -uchar ctype_macce_general_ci[] = { +static const uchar ctype_macce_general_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -2690,7 +2691,7 @@ uchar ctype_macce_general_ci[] = { 0x02,0x01,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x02,0x01,0x01,0x02,0x01,0x00 }; -uchar to_lower_macce_general_ci[] = { +static const uchar to_lower_macce_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2709,7 +2710,7 @@ uchar to_lower_macce_general_ci[] = { 0xF0,0xF3,0x9C,0xF3,0xF5,0xF5,0xF7,0xF7,0xF9,0xF9,0xFA,0xFD,0xB8,0xFD,0xAE,0xFF }; -uchar to_upper_macce_general_ci[] = { +static const uchar to_upper_macce_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2728,7 +2729,7 @@ uchar to_upper_macce_general_ci[] = { 0xED,0xF1,0xF2,0xF1,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xB5,0xFB,0xFC,0xFB,0xFE,0xFF }; -uchar sort_order_macce_general_ci[] = { +static const uchar sort_order_macce_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2747,7 +2748,7 @@ uchar sort_order_macce_general_ci[] = { 0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x81,0x8B,0x8B,0x5B,0x8D,0x5D,0x8D,0x53,0xFF }; -uint16 to_uni_macce_general_ci[] = { +static const uint16 to_uni_macce_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -2785,7 +2786,7 @@ uint16 to_uni_macce_general_ci[] = { #endif #ifdef HAVE_CHARSET_macroman -uchar ctype_macroman_general_ci[] = { +static const uchar ctype_macroman_general_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -2805,7 +2806,7 @@ uchar ctype_macroman_general_ci[] = { 0x00,0x01,0x01,0x01,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -uchar to_lower_macroman_general_ci[] = { +static const uchar to_lower_macroman_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2824,7 +2825,7 @@ uchar to_lower_macroman_general_ci[] = { 0xF0,0x98,0x9C,0x9E,0x9D,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_macroman_general_ci[] = { +static const uchar to_upper_macroman_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2843,7 +2844,7 @@ uchar to_upper_macroman_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar sort_order_macroman_general_ci[] = { +static const uchar sort_order_macroman_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2862,7 +2863,7 @@ uchar sort_order_macroman_general_ci[] = { 0xF0,0x72,0x85,0x85,0x85,0x61,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_macroman_general_ci[] = { +static const uint16 to_uni_macroman_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -2900,7 +2901,7 @@ uint16 to_uni_macroman_general_ci[] = { #endif #ifdef HAVE_CHARSET_cp852 -uchar ctype_cp852_general_ci[] = { +static const uchar ctype_cp852_general_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -2920,7 +2921,7 @@ uchar ctype_cp852_general_ci[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x02,0x00,0x48 }; -uchar to_lower_cp852_general_ci[] = { +static const uchar to_lower_cp852_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2939,7 +2940,7 @@ uchar to_lower_cp852_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp852_general_ci[] = { +static const uchar to_upper_cp852_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2958,7 +2959,7 @@ uchar to_upper_cp852_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xEB,0xFC,0xFC,0xFE,0xFF }; -uchar sort_order_cp852_general_ci[] = { +static const uchar sort_order_cp852_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -2977,7 +2978,7 @@ uchar sort_order_cp852_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0x74,0x69,0x69,0xFE,0xFF }; -uint16 to_uni_cp852_general_ci[] = { +static const uint16 to_uni_cp852_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -3015,7 +3016,7 @@ uint16 to_uni_cp852_general_ci[] = { #endif #ifdef HAVE_CHARSET_latin7 -uchar ctype_latin7_general_ci[] = { +static const uchar ctype_latin7_general_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -3035,7 +3036,7 @@ uchar ctype_latin7_general_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 }; -uchar to_lower_latin7_general_ci[] = { +static const uchar to_lower_latin7_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3054,7 +3055,7 @@ uchar to_lower_latin7_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_latin7_general_ci[] = { +static const uchar to_upper_latin7_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3073,7 +3074,7 @@ uchar to_upper_latin7_general_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uchar sort_order_latin7_general_ci[] = { +static const uchar sort_order_latin7_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x30,0x32,0x33,0x34,0x35,0x36,0x37,0x2B,0x38,0x39,0x3A,0x5C,0x3B,0x2C,0x3C,0x3D, @@ -3092,7 +3093,7 @@ uchar sort_order_latin7_general_ci[] = { 0xE1,0xC4,0xC6,0xCA,0xCE,0xD0,0xCC,0x64,0xEC,0xBC,0xDE,0xEA,0xE8,0xFA,0xFC,0x52 }; -uint16 to_uni_latin7_general_ci[] = { +static const uint16 to_uni_latin7_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -3130,7 +3131,7 @@ uint16 to_uni_latin7_general_ci[] = { #endif #ifdef HAVE_CHARSET_latin7 -uchar ctype_latin7_general_cs[] = { +static const uchar ctype_latin7_general_cs[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -3150,7 +3151,7 @@ uchar ctype_latin7_general_cs[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 }; -uchar to_lower_latin7_general_cs[] = { +static const uchar to_lower_latin7_general_cs[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3169,7 +3170,7 @@ uchar to_lower_latin7_general_cs[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_latin7_general_cs[] = { +static const uchar to_upper_latin7_general_cs[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3188,7 +3189,7 @@ uchar to_upper_latin7_general_cs[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uchar sort_order_latin7_general_cs[] = { +static const uchar sort_order_latin7_general_cs[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x30,0x32,0x33,0x34,0x35,0x36,0x37,0x2B,0x38,0x39,0x3A,0x5C,0x3B,0x2C,0x3C,0x3D, @@ -3207,7 +3208,7 @@ uchar sort_order_latin7_general_cs[] = { 0xE2,0xC5,0xC7,0xCB,0xCF,0xD1,0xCD,0x64,0xED,0xBD,0xDF,0xEB,0xE9,0xFB,0xFD,0x52 }; -uint16 to_uni_latin7_general_cs[] = { +static const uint16 to_uni_latin7_general_cs[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -3245,7 +3246,7 @@ uint16 to_uni_latin7_general_cs[] = { #endif #ifdef HAVE_CHARSET_macce -uchar ctype_macce_bin[] = { +static const uchar ctype_macce_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -3265,7 +3266,7 @@ uchar ctype_macce_bin[] = { 0x02,0x01,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x02,0x01,0x01,0x02,0x01,0x00 }; -uchar to_lower_macce_bin[] = { +static const uchar to_lower_macce_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3284,7 +3285,7 @@ uchar to_lower_macce_bin[] = { 0xF0,0xF3,0x9C,0xF3,0xF5,0xF5,0xF7,0xF7,0xF9,0xF9,0xFA,0xFD,0xB8,0xFD,0xAE,0xFF }; -uchar to_upper_macce_bin[] = { +static const uchar to_upper_macce_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3303,7 +3304,7 @@ uchar to_upper_macce_bin[] = { 0xED,0xF1,0xF2,0xF1,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xB5,0xFB,0xFC,0xFB,0xFE,0xFF }; -uint16 to_uni_macce_bin[] = { +static const uint16 to_uni_macce_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -3341,7 +3342,7 @@ uint16 to_uni_macce_bin[] = { #endif #ifdef HAVE_CHARSET_cp1250 -uchar ctype_cp1250_croatian_ci[] = { +static const uchar ctype_cp1250_croatian_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -3361,7 +3362,7 @@ uchar ctype_cp1250_croatian_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 }; -uchar to_lower_cp1250_croatian_ci[] = { +static const uchar to_lower_cp1250_croatian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3380,7 +3381,7 @@ uchar to_lower_cp1250_croatian_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp1250_croatian_ci[] = { +static const uchar to_upper_cp1250_croatian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3399,7 +3400,7 @@ uchar to_upper_cp1250_croatian_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uchar sort_order_cp1250_croatian_ci[] = { +static const uchar sort_order_cp1250_croatian_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3418,7 +3419,7 @@ uchar sort_order_cp1250_croatian_ci[] = { 0x4A,0x57,0x57,0x59,0x59,0x59,0x59,0xC9,0x5D,0x64,0x64,0x64,0x64,0x69,0x62,0xFF }; -uint16 to_uni_cp1250_croatian_ci[] = { +static const uint16 to_uni_cp1250_croatian_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -3456,7 +3457,7 @@ uint16 to_uni_cp1250_croatian_ci[] = { #endif #ifdef HAVE_CHARSET_latin1 -uchar ctype_latin1_general_ci[] = { +static const uchar ctype_latin1_general_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -3476,7 +3477,7 @@ uchar ctype_latin1_general_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 }; -uchar to_lower_latin1_general_ci[] = { +static const uchar to_lower_latin1_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3495,7 +3496,7 @@ uchar to_lower_latin1_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_latin1_general_ci[] = { +static const uchar to_upper_latin1_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3514,7 +3515,7 @@ uchar to_upper_latin1_general_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uchar sort_order_latin1_general_ci[] = { +static const uchar sort_order_latin1_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3533,7 +3534,7 @@ uchar sort_order_latin1_general_ci[] = { 0x59,0x7F,0x83,0x85,0x87,0x89,0x8B,0xBE,0x8D,0x9C,0x9E,0xA0,0xA2,0xAC,0xB1,0xAE }; -uint16 to_uni_latin1_general_ci[] = { +static const uint16 to_uni_latin1_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -3571,7 +3572,7 @@ uint16 to_uni_latin1_general_ci[] = { #endif #ifdef HAVE_CHARSET_latin1 -uchar ctype_latin1_general_cs[] = { +static const uchar ctype_latin1_general_cs[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -3591,7 +3592,7 @@ uchar ctype_latin1_general_cs[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 }; -uchar to_lower_latin1_general_cs[] = { +static const uchar to_lower_latin1_general_cs[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3610,7 +3611,7 @@ uchar to_lower_latin1_general_cs[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_latin1_general_cs[] = { +static const uchar to_upper_latin1_general_cs[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3629,7 +3630,7 @@ uchar to_upper_latin1_general_cs[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uchar sort_order_latin1_general_cs[] = { +static const uchar sort_order_latin1_general_cs[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3648,7 +3649,7 @@ uchar sort_order_latin1_general_cs[] = { 0x5A,0x80,0x84,0x86,0x88,0x8A,0x8C,0xBE,0x8E,0x9D,0x9F,0xA1,0xA3,0xAD,0xB2,0xAE }; -uint16 to_uni_latin1_general_cs[] = { +static const uint16 to_uni_latin1_general_cs[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -3686,7 +3687,7 @@ uint16 to_uni_latin1_general_cs[] = { #endif #ifdef HAVE_CHARSET_cp1251 -uchar ctype_cp1251_bin[] = { +static const uchar ctype_cp1251_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -3706,7 +3707,7 @@ uchar ctype_cp1251_bin[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 }; -uchar to_lower_cp1251_bin[] = { +static const uchar to_lower_cp1251_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3725,7 +3726,7 @@ uchar to_lower_cp1251_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp1251_bin[] = { +static const uchar to_upper_cp1251_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3744,7 +3745,7 @@ uchar to_upper_cp1251_bin[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF }; -uint16 to_uni_cp1251_bin[] = { +static const uint16 to_uni_cp1251_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -3782,7 +3783,7 @@ uint16 to_uni_cp1251_bin[] = { #endif #ifdef HAVE_CHARSET_cp1251 -uchar ctype_cp1251_general_ci[] = { +static const uchar ctype_cp1251_general_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -3802,7 +3803,7 @@ uchar ctype_cp1251_general_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 }; -uchar to_lower_cp1251_general_ci[] = { +static const uchar to_lower_cp1251_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3821,7 +3822,7 @@ uchar to_lower_cp1251_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp1251_general_ci[] = { +static const uchar to_upper_cp1251_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3840,7 +3841,7 @@ uchar to_upper_cp1251_general_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF }; -uchar sort_order_cp1251_general_ci[] = { +static const uchar sort_order_cp1251_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3859,7 +3860,7 @@ uchar sort_order_cp1251_general_ci[] = { 0xAD,0xAF,0xB1,0xB5,0xB9,0xBB,0xBD,0xBF,0xC3,0xC5,0xC7,0xC9,0xCB,0xCD,0xCF,0xD1 }; -uint16 to_uni_cp1251_general_ci[] = { +static const uint16 to_uni_cp1251_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -3897,7 +3898,7 @@ uint16 to_uni_cp1251_general_ci[] = { #endif #ifdef HAVE_CHARSET_cp1251 -uchar ctype_cp1251_general_cs[] = { +static const uchar ctype_cp1251_general_cs[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -3917,7 +3918,7 @@ uchar ctype_cp1251_general_cs[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 }; -uchar to_lower_cp1251_general_cs[] = { +static const uchar to_lower_cp1251_general_cs[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3936,7 +3937,7 @@ uchar to_lower_cp1251_general_cs[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp1251_general_cs[] = { +static const uchar to_upper_cp1251_general_cs[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3955,7 +3956,7 @@ uchar to_upper_cp1251_general_cs[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF }; -uchar sort_order_cp1251_general_cs[] = { +static const uchar sort_order_cp1251_general_cs[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -3974,7 +3975,7 @@ uchar sort_order_cp1251_general_cs[] = { 0xAE,0xB0,0xB2,0xB6,0xBA,0xBC,0xBE,0xC0,0xC4,0xC6,0xC8,0xCA,0xCC,0xCE,0xD0,0xD2 }; -uint16 to_uni_cp1251_general_cs[] = { +static const uint16 to_uni_cp1251_general_cs[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -4012,7 +4013,7 @@ uint16 to_uni_cp1251_general_cs[] = { #endif #ifdef HAVE_CHARSET_macroman -uchar ctype_macroman_bin[] = { +static const uchar ctype_macroman_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -4032,7 +4033,7 @@ uchar ctype_macroman_bin[] = { 0x00,0x01,0x01,0x01,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -uchar to_lower_macroman_bin[] = { +static const uchar to_lower_macroman_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4051,7 +4052,7 @@ uchar to_lower_macroman_bin[] = { 0xF0,0x98,0x9C,0x9E,0x9D,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_macroman_bin[] = { +static const uchar to_upper_macroman_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4070,7 +4071,7 @@ uchar to_upper_macroman_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_macroman_bin[] = { +static const uint16 to_uni_macroman_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -4108,7 +4109,7 @@ uint16 to_uni_macroman_bin[] = { #endif #ifdef HAVE_CHARSET_cp1256 -uchar ctype_cp1256_general_ci[] = { +static const uchar ctype_cp1256_general_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -4128,7 +4129,7 @@ uchar ctype_cp1256_general_ci[] = { 0x03,0x03,0x03,0x03,0x02,0x03,0x03,0x00,0x03,0x02,0x03,0x02,0x02,0x00,0x00,0x00 }; -uchar to_lower_cp1256_general_ci[] = { +static const uchar to_lower_cp1256_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4147,7 +4148,7 @@ uchar to_lower_cp1256_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp1256_general_ci[] = { +static const uchar to_upper_cp1256_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4166,7 +4167,7 @@ uchar to_upper_cp1256_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar sort_order_cp1256_general_ci[] = { +static const uchar sort_order_cp1256_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4185,7 +4186,7 @@ uchar sort_order_cp1256_general_ci[] = { 0xAE,0xAF,0xB0,0xB1,0x69,0xB2,0xB3,0xFC,0xB4,0x78,0xB5,0x79,0x7A,0xFD,0xFE,0xFF }; -uint16 to_uni_cp1256_general_ci[] = { +static const uint16 to_uni_cp1256_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -4223,7 +4224,7 @@ uint16 to_uni_cp1256_general_ci[] = { #endif #ifdef HAVE_CHARSET_cp1257 -uchar ctype_cp1257_bin[] = { +static const uchar ctype_cp1257_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -4243,7 +4244,7 @@ uchar ctype_cp1257_bin[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00 }; -uchar to_lower_cp1257_bin[] = { +static const uchar to_lower_cp1257_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4262,7 +4263,7 @@ uchar to_lower_cp1257_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp1257_bin[] = { +static const uchar to_upper_cp1257_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4281,7 +4282,7 @@ uchar to_upper_cp1257_bin[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uint16 to_uni_cp1257_bin[] = { +static const uint16 to_uni_cp1257_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -4319,7 +4320,7 @@ uint16 to_uni_cp1257_bin[] = { #endif #ifdef HAVE_CHARSET_cp1257 -uchar ctype_cp1257_general_ci[] = { +static const uchar ctype_cp1257_general_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -4339,7 +4340,7 @@ uchar ctype_cp1257_general_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00 }; -uchar to_lower_cp1257_general_ci[] = { +static const uchar to_lower_cp1257_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4358,7 +4359,7 @@ uchar to_lower_cp1257_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp1257_general_ci[] = { +static const uchar to_upper_cp1257_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4377,7 +4378,7 @@ uchar to_upper_cp1257_general_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uchar sort_order_cp1257_general_ci[] = { +static const uchar sort_order_cp1257_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4396,7 +4397,7 @@ uchar sort_order_cp1257_general_ci[] = { 0x97,0x7D,0x7D,0x83,0x83,0x83,0x83,0xC3,0xA0,0x75,0x97,0xA0,0xA0,0xB0,0xB0,0xFF }; -uint16 to_uni_cp1257_general_ci[] = { +static const uint16 to_uni_cp1257_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -4434,7 +4435,7 @@ uint16 to_uni_cp1257_general_ci[] = { #endif #ifdef HAVE_CHARSET_armscii8 -uchar ctype_armscii8_bin[] = { +static const uchar ctype_armscii8_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -4454,7 +4455,7 @@ uchar ctype_armscii8_bin[] = { 0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x10,0x10 }; -uchar to_lower_armscii8_bin[] = { +static const uchar to_lower_armscii8_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4473,7 +4474,7 @@ uchar to_lower_armscii8_bin[] = { 0xF1,0xF1,0xF3,0xF3,0xF5,0xF5,0xF7,0xF7,0xF9,0xF9,0xFB,0xFB,0xFD,0xFD,0xFE,0xFF }; -uchar to_upper_armscii8_bin[] = { +static const uchar to_upper_armscii8_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4492,7 +4493,7 @@ uchar to_upper_armscii8_bin[] = { 0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xFA,0xFA,0xFC,0xFC,0xFE,0xFF }; -uint16 to_uni_armscii8_bin[] = { +static const uint16 to_uni_armscii8_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -4530,7 +4531,7 @@ uint16 to_uni_armscii8_bin[] = { #endif #ifdef HAVE_CHARSET_ascii -uchar ctype_ascii_bin[] = { +static const uchar ctype_ascii_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -4550,7 +4551,7 @@ uchar ctype_ascii_bin[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -uchar to_lower_ascii_bin[] = { +static const uchar to_lower_ascii_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4569,7 +4570,7 @@ uchar to_lower_ascii_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_ascii_bin[] = { +static const uchar to_upper_ascii_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4588,7 +4589,7 @@ uchar to_upper_ascii_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_ascii_bin[] = { +static const uint16 to_uni_ascii_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -4626,7 +4627,7 @@ uint16 to_uni_ascii_bin[] = { #endif #ifdef HAVE_CHARSET_cp1250 -uchar ctype_cp1250_bin[] = { +static const uchar ctype_cp1250_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -4646,7 +4647,7 @@ uchar ctype_cp1250_bin[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 }; -uchar to_lower_cp1250_bin[] = { +static const uchar to_lower_cp1250_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4665,7 +4666,7 @@ uchar to_lower_cp1250_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp1250_bin[] = { +static const uchar to_upper_cp1250_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4684,7 +4685,7 @@ uchar to_upper_cp1250_bin[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uint16 to_uni_cp1250_bin[] = { +static const uint16 to_uni_cp1250_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -4722,7 +4723,7 @@ uint16 to_uni_cp1250_bin[] = { #endif #ifdef HAVE_CHARSET_cp1256 -uchar ctype_cp1256_bin[] = { +static const uchar ctype_cp1256_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -4742,7 +4743,7 @@ uchar ctype_cp1256_bin[] = { 0x03,0x03,0x03,0x03,0x02,0x03,0x03,0x00,0x03,0x02,0x03,0x02,0x02,0x00,0x00,0x00 }; -uchar to_lower_cp1256_bin[] = { +static const uchar to_lower_cp1256_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4761,7 +4762,7 @@ uchar to_lower_cp1256_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp1256_bin[] = { +static const uchar to_upper_cp1256_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4780,7 +4781,7 @@ uchar to_upper_cp1256_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_cp1256_bin[] = { +static const uint16 to_uni_cp1256_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -4818,7 +4819,7 @@ uint16 to_uni_cp1256_bin[] = { #endif #ifdef HAVE_CHARSET_cp866 -uchar ctype_cp866_bin[] = { +static const uchar ctype_cp866_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -4838,7 +4839,7 @@ uchar ctype_cp866_bin[] = { 0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48 }; -uchar to_lower_cp866_bin[] = { +static const uchar to_lower_cp866_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4857,7 +4858,7 @@ uchar to_lower_cp866_bin[] = { 0xF1,0xF1,0xF3,0xF3,0xF5,0xF5,0xF7,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp866_bin[] = { +static const uchar to_upper_cp866_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4876,7 +4877,7 @@ uchar to_upper_cp866_bin[] = { 0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_cp866_bin[] = { +static const uint16 to_uni_cp866_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -4914,7 +4915,7 @@ uint16 to_uni_cp866_bin[] = { #endif #ifdef HAVE_CHARSET_dec8 -uchar ctype_dec8_bin[] = { +static const uchar ctype_dec8_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -4934,7 +4935,7 @@ uchar ctype_dec8_bin[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 }; -uchar to_lower_dec8_bin[] = { +static const uchar to_lower_dec8_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4953,7 +4954,7 @@ uchar to_lower_dec8_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_dec8_bin[] = { +static const uchar to_upper_dec8_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -4972,7 +4973,7 @@ uchar to_upper_dec8_bin[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uint16 to_uni_dec8_bin[] = { +static const uint16 to_uni_dec8_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -5010,7 +5011,7 @@ uint16 to_uni_dec8_bin[] = { #endif #ifdef HAVE_CHARSET_greek -uchar ctype_greek_bin[] = { +static const uchar ctype_greek_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -5030,7 +5031,7 @@ uchar ctype_greek_bin[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00 }; -uchar to_lower_greek_bin[] = { +static const uchar to_lower_greek_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5049,7 +5050,7 @@ uchar to_lower_greek_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_greek_bin[] = { +static const uchar to_upper_greek_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5068,7 +5069,7 @@ uchar to_upper_greek_bin[] = { 0xD0,0xD1,0xD3,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xCF,0xD5,0xD9,0xFF }; -uint16 to_uni_greek_bin[] = { +static const uint16 to_uni_greek_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -5106,7 +5107,7 @@ uint16 to_uni_greek_bin[] = { #endif #ifdef HAVE_CHARSET_hebrew -uchar ctype_hebrew_bin[] = { +static const uchar ctype_hebrew_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -5126,7 +5127,7 @@ uchar ctype_hebrew_bin[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x00,0x20,0x20,0x00 }; -uchar to_lower_hebrew_bin[] = { +static const uchar to_lower_hebrew_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5145,7 +5146,7 @@ uchar to_lower_hebrew_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_hebrew_bin[] = { +static const uchar to_upper_hebrew_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5164,7 +5165,7 @@ uchar to_upper_hebrew_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_hebrew_bin[] = { +static const uint16 to_uni_hebrew_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -5202,7 +5203,7 @@ uint16 to_uni_hebrew_bin[] = { #endif #ifdef HAVE_CHARSET_hp8 -uchar ctype_hp8_bin[] = { +static const uchar ctype_hp8_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -5222,7 +5223,7 @@ uchar ctype_hp8_bin[] = { 0x10,0x10,0x20,0x20,0x20,0x20,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20 }; -uchar to_lower_hp8_bin[] = { +static const uchar to_lower_hp8_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5241,7 +5242,7 @@ uchar to_lower_hp8_bin[] = { 0xF1,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_hp8_bin[] = { +static const uchar to_upper_hp8_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5260,7 +5261,7 @@ uchar to_upper_hp8_bin[] = { 0xF0,0xF0,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_hp8_bin[] = { +static const uint16 to_uni_hp8_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -5298,7 +5299,7 @@ uint16 to_uni_hp8_bin[] = { #endif #ifdef HAVE_CHARSET_keybcs2 -uchar ctype_keybcs2_bin[] = { +static const uchar ctype_keybcs2_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -5318,7 +5319,7 @@ uchar ctype_keybcs2_bin[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48 }; -uchar to_lower_keybcs2_bin[] = { +static const uchar to_lower_keybcs2_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5337,7 +5338,7 @@ uchar to_lower_keybcs2_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_keybcs2_bin[] = { +static const uchar to_upper_keybcs2_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5356,7 +5357,7 @@ uchar to_upper_keybcs2_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_keybcs2_bin[] = { +static const uint16 to_uni_keybcs2_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -5394,7 +5395,7 @@ uint16 to_uni_keybcs2_bin[] = { #endif #ifdef HAVE_CHARSET_koi8r -uchar ctype_koi8r_bin[] = { +static const uchar ctype_koi8r_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -5414,7 +5415,7 @@ uchar ctype_koi8r_bin[] = { 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01 }; -uchar to_lower_koi8r_bin[] = { +static const uchar to_lower_koi8r_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5433,7 +5434,7 @@ uchar to_lower_koi8r_bin[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF }; -uchar to_upper_koi8r_bin[] = { +static const uchar to_upper_koi8r_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5452,7 +5453,7 @@ uchar to_upper_koi8r_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_koi8r_bin[] = { +static const uint16 to_uni_koi8r_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -5490,7 +5491,7 @@ uint16 to_uni_koi8r_bin[] = { #endif #ifdef HAVE_CHARSET_koi8u -uchar ctype_koi8u_bin[] = { +static const uchar ctype_koi8u_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -5510,7 +5511,7 @@ uchar ctype_koi8u_bin[] = { 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01 }; -uchar to_lower_koi8u_bin[] = { +static const uchar to_lower_koi8u_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5529,7 +5530,7 @@ uchar to_lower_koi8u_bin[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF }; -uchar to_upper_koi8u_bin[] = { +static const uchar to_upper_koi8u_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5548,7 +5549,7 @@ uchar to_upper_koi8u_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_koi8u_bin[] = { +static const uint16 to_uni_koi8u_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -5586,7 +5587,7 @@ uint16 to_uni_koi8u_bin[] = { #endif #ifdef HAVE_CHARSET_latin2 -uchar ctype_latin2_bin[] = { +static const uchar ctype_latin2_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -5606,7 +5607,7 @@ uchar ctype_latin2_bin[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 }; -uchar to_lower_latin2_bin[] = { +static const uchar to_lower_latin2_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5625,7 +5626,7 @@ uchar to_lower_latin2_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_latin2_bin[] = { +static const uchar to_upper_latin2_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5644,7 +5645,7 @@ uchar to_upper_latin2_bin[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uint16 to_uni_latin2_bin[] = { +static const uint16 to_uni_latin2_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -5682,7 +5683,7 @@ uint16 to_uni_latin2_bin[] = { #endif #ifdef HAVE_CHARSET_latin5 -uchar ctype_latin5_bin[] = { +static const uchar ctype_latin5_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -5702,7 +5703,7 @@ uchar ctype_latin5_bin[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 }; -uchar to_lower_latin5_bin[] = { +static const uchar to_lower_latin5_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5721,7 +5722,7 @@ uchar to_lower_latin5_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_latin5_bin[] = { +static const uchar to_upper_latin5_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5740,7 +5741,7 @@ uchar to_upper_latin5_bin[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0x49,0xDE,0xFF }; -uint16 to_uni_latin5_bin[] = { +static const uint16 to_uni_latin5_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -5778,7 +5779,7 @@ uint16 to_uni_latin5_bin[] = { #endif #ifdef HAVE_CHARSET_latin7 -uchar ctype_latin7_bin[] = { +static const uchar ctype_latin7_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -5798,7 +5799,7 @@ uchar ctype_latin7_bin[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 }; -uchar to_lower_latin7_bin[] = { +static const uchar to_lower_latin7_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5817,7 +5818,7 @@ uchar to_lower_latin7_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_latin7_bin[] = { +static const uchar to_upper_latin7_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5836,7 +5837,7 @@ uchar to_upper_latin7_bin[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uint16 to_uni_latin7_bin[] = { +static const uint16 to_uni_latin7_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -5874,7 +5875,7 @@ uint16 to_uni_latin7_bin[] = { #endif #ifdef HAVE_CHARSET_cp850 -uchar ctype_cp850_bin[] = { +static const uchar ctype_cp850_bin[] = { 0x00, 0x20,0x30,0x30,0x30,0x30,0x30,0x30,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x30,0x30, 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x20,0x30,0x30,0x30,0x30,0x30, @@ -5894,7 +5895,7 @@ uchar ctype_cp850_bin[] = { 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x20 }; -uchar to_lower_cp850_bin[] = { +static const uchar to_lower_cp850_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5913,7 +5914,7 @@ uchar to_lower_cp850_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp850_bin[] = { +static const uchar to_upper_cp850_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -5932,7 +5933,7 @@ uchar to_upper_cp850_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_cp850_bin[] = { +static const uint16 to_uni_cp850_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -5970,7 +5971,7 @@ uint16 to_uni_cp850_bin[] = { #endif #ifdef HAVE_CHARSET_cp852 -uchar ctype_cp852_bin[] = { +static const uchar ctype_cp852_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -5990,7 +5991,7 @@ uchar ctype_cp852_bin[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x02,0x00,0x48 }; -uchar to_lower_cp852_bin[] = { +static const uchar to_lower_cp852_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -6009,7 +6010,7 @@ uchar to_lower_cp852_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp852_bin[] = { +static const uchar to_upper_cp852_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -6028,7 +6029,7 @@ uchar to_upper_cp852_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xEB,0xFC,0xFC,0xFE,0xFF }; -uint16 to_uni_cp852_bin[] = { +static const uint16 to_uni_cp852_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -6066,7 +6067,7 @@ uint16 to_uni_cp852_bin[] = { #endif #ifdef HAVE_CHARSET_swe7 -uchar ctype_swe7_bin[] = { +static const uchar ctype_swe7_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -6086,7 +6087,7 @@ uchar ctype_swe7_bin[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -uchar to_lower_swe7_bin[] = { +static const uchar to_lower_swe7_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -6105,7 +6106,7 @@ uchar to_lower_swe7_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_swe7_bin[] = { +static const uchar to_upper_swe7_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -6124,7 +6125,7 @@ uchar to_upper_swe7_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_swe7_bin[] = { +static const uint16 to_uni_swe7_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -6162,7 +6163,7 @@ uint16 to_uni_swe7_bin[] = { #endif #ifdef HAVE_CHARSET_geostd8 -uchar ctype_geostd8_general_ci[] = { +static const uchar ctype_geostd8_general_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -6182,7 +6183,7 @@ uchar ctype_geostd8_general_ci[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -uchar to_lower_geostd8_general_ci[] = { +static const uchar to_lower_geostd8_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -6201,7 +6202,7 @@ uchar to_lower_geostd8_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_geostd8_general_ci[] = { +static const uchar to_upper_geostd8_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -6220,7 +6221,7 @@ uchar to_upper_geostd8_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar sort_order_geostd8_general_ci[] = { +static const uchar sort_order_geostd8_general_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -6239,7 +6240,7 @@ uchar sort_order_geostd8_general_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_geostd8_general_ci[] = { +static const uint16 to_uni_geostd8_general_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -6277,7 +6278,7 @@ uint16 to_uni_geostd8_general_ci[] = { #endif #ifdef HAVE_CHARSET_geostd8 -uchar ctype_geostd8_bin[] = { +static const uchar ctype_geostd8_bin[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -6297,7 +6298,7 @@ uchar ctype_geostd8_bin[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -uchar to_lower_geostd8_bin[] = { +static const uchar to_lower_geostd8_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -6316,7 +6317,7 @@ uchar to_lower_geostd8_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_geostd8_bin[] = { +static const uchar to_upper_geostd8_bin[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -6335,7 +6336,7 @@ uchar to_upper_geostd8_bin[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uint16 to_uni_geostd8_bin[] = { +static const uint16 to_uni_geostd8_bin[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -6373,7 +6374,7 @@ uint16 to_uni_geostd8_bin[] = { #endif #ifdef HAVE_CHARSET_latin1 -uchar ctype_latin1_spanish_ci[] = { +static const uchar ctype_latin1_spanish_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -6393,7 +6394,7 @@ uchar ctype_latin1_spanish_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02 }; -uchar to_lower_latin1_spanish_ci[] = { +static const uchar to_lower_latin1_spanish_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -6412,7 +6413,7 @@ uchar to_lower_latin1_spanish_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_latin1_spanish_ci[] = { +static const uchar to_upper_latin1_spanish_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -6431,7 +6432,7 @@ uchar to_upper_latin1_spanish_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uchar sort_order_latin1_spanish_ci[] = { +static const uchar sort_order_latin1_spanish_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -6450,7 +6451,7 @@ uchar sort_order_latin1_spanish_ci[] = { 0x57,0x7F,0x81,0x81,0x81,0x81,0x81,0xBE,0x81,0x9A,0x9A,0x9A,0x9A,0xAA,0xB1,0xAA }; -uint16 to_uni_latin1_spanish_ci[] = { +static const uint16 to_uni_latin1_spanish_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -6488,7 +6489,7 @@ uint16 to_uni_latin1_spanish_ci[] = { #endif #ifdef HAVE_CHARSET_cp1250 -uchar ctype_cp1250_polish_ci[] = { +static const uchar ctype_cp1250_polish_ci[] = { 0x00, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x28,0x28,0x28,0x28,0x28,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, @@ -6508,7 +6509,7 @@ uchar ctype_cp1250_polish_ci[] = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x10 }; -uchar to_lower_cp1250_polish_ci[] = { +static const uchar to_lower_cp1250_polish_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -6527,7 +6528,7 @@ uchar to_lower_cp1250_polish_ci[] = { 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar to_upper_cp1250_polish_ci[] = { +static const uchar to_upper_cp1250_polish_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -6546,7 +6547,7 @@ uchar to_upper_cp1250_polish_ci[] = { 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF }; -uchar sort_order_cp1250_polish_ci[] = { +static const uchar sort_order_cp1250_polish_ci[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -6565,7 +6566,7 @@ uchar sort_order_cp1250_polish_ci[] = { 0x48,0x58,0x57,0x5A,0x59,0x59,0x59,0xC9,0x5D,0x64,0x64,0x64,0x64,0x69,0x62,0xFF }; -uint16 to_uni_cp1250_polish_ci[] = { +static const uint16 to_uni_cp1250_polish_ci[] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -6602,7 +6603,7 @@ uint16 to_uni_cp1250_polish_ci[] = { #endif -CHARSET_INFO compiled_charsets[] = { +struct charset_info_st compiled_charsets[] = { #ifdef HAVE_CHARSET_dec8 { 3,0,0, diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c index 0e2680110c6..b27ea67059d 100644 --- a/strings/ctype-gb2312.c +++ b/strings/ctype-gb2312.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,13 +24,12 @@ * .configure. mbmaxlen_gb2312=2 */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #ifdef HAVE_CHARSET_gb2312 -static uchar ctype_gb2312[257] = +static const uchar ctype_gb2312[257] = { 0, /* For standard library */ 32,32,32,32,32,32,32,32,32,40,40,40,40,40,32,32, @@ -50,7 +50,7 @@ static uchar ctype_gb2312[257] = 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0, }; -static uchar to_lower_gb2312[]= +static const uchar to_lower_gb2312[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -86,7 +86,7 @@ static uchar to_lower_gb2312[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uchar to_upper_gb2312[]= +static const uchar to_upper_gb2312[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -122,7 +122,7 @@ static uchar to_upper_gb2312[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uchar sort_order_gb2312[]= +static const uchar sort_order_gb2312[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -820,7 +820,7 @@ static MY_UNICASE_INFO *my_caseinfo_gb2312[256]= /* page 0 0x2121-0x2658 */ -static uint16 tab_gb2312_uni0[]={ +static const uint16 tab_gb2312_uni0[]={ 0x3000,0x3001,0x3002,0x30FB,0x02C9,0x02C7,0x00A8,0x3003, 0x3005,0x2015,0xFF5E,0x2016,0x2026,0x2018,0x2019,0x201C, 0x201D,0x3014,0x3015,0x3008,0x3009,0x300A,0x300B,0x300C, @@ -991,7 +991,7 @@ static uint16 tab_gb2312_uni0[]={ }; /* page 1 0x2721-0x296F */ -static uint16 tab_gb2312_uni1[]={ +static const uint16 tab_gb2312_uni1[]={ 0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0401,0x0416, 0x0417,0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E, 0x041F,0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426, @@ -1068,7 +1068,7 @@ static uint16 tab_gb2312_uni1[]={ 0x2545,0x2546,0x2547,0x2548,0x2549,0x254A,0x254B}; /* page 2 0x3021-0x777E */ -static uint16 tab_gb2312_uni2[]={ +static const uint16 tab_gb2312_uni2[]={ 0x554A,0x963F,0x57C3,0x6328,0x54CE,0x5509,0x54C0,0x7691, 0x764C,0x853C,0x77EE,0x827E,0x788D,0x7231,0x9698,0x978D, 0x6C28,0x5B89,0x4FFA,0x6309,0x6697,0x5CB8,0x80FA,0x6848, @@ -3366,7 +3366,7 @@ static int func_gb2312_uni_onechar(int code){ /* page 0 0x00A4-0x01DC */ -static uint16 tab_uni_gb23120[]={ +static const uint16 tab_uni_gb23120[]={ 0x2168, 0, 0,0x216C,0x2127, 0, 0, 0, 0, 0, 0, 0,0x2163,0x2140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -3409,7 +3409,7 @@ static uint16 tab_uni_gb23120[]={ 0x2838}; /* page 1 0x02C7-0x0451 */ -static uint16 tab_uni_gb23121[]={ +static const uint16 tab_uni_gb23121[]={ 0x2126, 0,0x2125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -3462,7 +3462,7 @@ static uint16 tab_uni_gb23121[]={ 0x2771, 0,0x2757}; /* page 2 0x2015-0x2312 */ -static uint16 tab_uni_gb23122[]={ +static const uint16 tab_uni_gb23122[]={ 0x212A,0x212C, 0,0x212E,0x212F, 0, 0,0x2130, 0x2131, 0, 0, 0, 0, 0, 0, 0, 0,0x212D, 0, 0, 0, 0, 0, 0, @@ -3561,7 +3561,7 @@ static uint16 tab_uni_gb23122[]={ 0, 0, 0, 0, 0,0x2150}; /* page 3 0x2460-0x2642 */ -static uint16 tab_uni_gb23123[]={ +static const uint16 tab_uni_gb23123[]={ 0x2259,0x225A,0x225B,0x225C,0x225D,0x225E,0x225F,0x2260, 0x2261,0x2262, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0x2245,0x2246,0x2247,0x2248, @@ -3625,7 +3625,7 @@ static uint16 tab_uni_gb23123[]={ 0x2162, 0,0x2161}; /* page 4 0x3000-0x3129 */ -static uint16 tab_uni_gb23124[]={ +static const uint16 tab_uni_gb23124[]={ 0x2121,0x2122,0x2123,0x2128, 0,0x2129, 0, 0, 0x2134,0x2135,0x2136,0x2137,0x2138,0x2139,0x213A,0x213B, 0x213E,0x213F, 0,0x217E,0x2132,0x2133,0x213C,0x213D, @@ -3666,12 +3666,12 @@ static uint16 tab_uni_gb23124[]={ 0x2868,0x2869}; /* page 5 0x3220-0x3229 */ -static uint16 tab_uni_gb23125[]={ +static const uint16 tab_uni_gb23125[]={ 0x2265,0x2266,0x2267,0x2268,0x2269,0x226A,0x226B,0x226C, 0x226D,0x226E}; /* page 6 0x4E00-0x9B54 */ -static uint16 tab_uni_gb23126[]={ +static const uint16 tab_uni_gb23126[]={ 0x523B,0x3621, 0,0x465F, 0, 0, 0,0x4D72, 0x5549,0x487D,0x494F,0x4F42,0x5822,0x323B,0x536B, 0, 0x5824,0x3373, 0,0x5728,0x4752,0x5827,0x4A40, 0, @@ -6149,7 +6149,7 @@ static uint16 tab_uni_gb23126[]={ 0,0x774E, 0, 0,0x4427}; /* page 7 0x9C7C-0x9CE2 */ -static uint16 tab_uni_gb23127[]={ +static const uint16 tab_uni_gb23127[]={ 0x5363, 0, 0,0x764F, 0,0x4233,0x7650, 0, 0,0x7651,0x7652,0x7653,0x7654, 0, 0,0x7656, 0,0x312B,0x7657, 0,0x7658,0x7659,0x765A, 0, @@ -6165,7 +6165,7 @@ static uint16 tab_uni_gb23127[]={ 0x772C,0x772D,0x415B,0x772E, 0, 0,0x772F}; /* page 8 0x9E1F-0x9FA0 */ -static uint16 tab_uni_gb23128[]={ +static const uint16 tab_uni_gb23128[]={ 0x4471,0x702F,0x3C26,0x7030,0x4379, 0,0x4538,0x513B, 0,0x7031,0x7032,0x7033,0x7034,0x7035,0x513C, 0, 0x516C, 0,0x7037,0x7036,0x5427, 0,0x4D52,0x7038, @@ -6217,7 +6217,7 @@ static uint16 tab_uni_gb23128[]={ 0x396A,0x595F}; /* page 9 0xFF01-0xFFE5 */ -static uint16 tab_uni_gb23129[]={ +static const uint16 tab_uni_gb23129[]={ 0x2321,0x2322,0x2323,0x2167,0x2325,0x2326,0x2327,0x2328, 0x2329,0x232A,0x232B,0x232C,0x232D,0x232E,0x232F,0x2330, 0x2331,0x2332,0x2333,0x2334,0x2335,0x2336,0x2337,0x2338, @@ -6407,7 +6407,7 @@ static MY_CHARSET_HANDLER my_charset_handler= }; -CHARSET_INFO my_charset_gb2312_chinese_ci= +struct charset_info_st my_charset_gb2312_chinese_ci= { 24,0,0, /* number */ MY_CS_COMPILED|MY_CS_PRIMARY, /* state */ @@ -6439,7 +6439,7 @@ CHARSET_INFO my_charset_gb2312_chinese_ci= &my_collation_ci_handler }; -CHARSET_INFO my_charset_gb2312_bin= +struct charset_info_st my_charset_gb2312_bin= { 86,0,0, /* number */ MY_CS_COMPILED|MY_CS_BINSORT, /* state */ diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c index a9558e56d1f..8b37de4a5e7 100644 --- a/strings/ctype-gbk.c +++ b/strings/ctype-gbk.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,10 +26,8 @@ * .configure. mbmaxlen_gbk=2 */ - -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #ifdef HAVE_CHARSET_gbk @@ -44,7 +43,7 @@ #define gbkhead(e) ((uchar)(e>>8)) #define gbktail(e) ((uchar)(e&0xff)) -static uchar ctype_gbk[257] = +static const uchar ctype_gbk[257] = { 0, /* For standard library */ 32,32,32,32,32,32,32,32,32,40,40,40,40,40,32,32, @@ -65,7 +64,7 @@ static uchar ctype_gbk[257] = 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0, }; -static uchar to_lower_gbk[]= +static const uchar to_lower_gbk[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -101,7 +100,7 @@ static uchar to_lower_gbk[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uchar to_upper_gbk[]= +static const uchar to_upper_gbk[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -137,7 +136,6 @@ static uchar to_upper_gbk[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; - static MY_UNICASE_INFO cA2[256]= { {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx00 */ @@ -993,9 +991,7 @@ static MY_UNICASE_INFO *my_caseinfo_gbk[256]= NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; - - -static uchar sort_order_gbk[]= +static const uchar sort_order_gbk[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -1031,7 +1027,7 @@ static uchar sort_order_gbk[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uint16 gbk_order[]= +static const uint16 gbk_order[]= { 8653,14277,17116,11482,11160,2751,14613,3913,13337,9827, 19496,1759,8105,7103,7836,5638,2223,21433,5878,8006, @@ -3560,7 +3556,7 @@ static uint mbcharlen_gbk(CHARSET_INFO *cs __attribute__((unused)),uint c) } /* page 0 0x8140-0xFE4F */ -static uint16 tab_gbk_uni0[]={ +static const uint16 tab_gbk_uni0[]={ 0x4E02,0x4E04,0x4E05,0x4E06,0x4E0F,0x4E12,0x4E17,0x4E1F, 0x4E20,0x4E21,0x4E23,0x4E26,0x4E29,0x4E2E,0x4E2F,0x4E31, 0x4E33,0x4E35,0x4E37,0x4E3C,0x4E40,0x4E41,0x4E42,0x4E44, @@ -7574,7 +7570,7 @@ static int func_gbk_uni_onechar(int code){ /* page 0 0x00A4-0x0451 */ -static uint16 tab_uni_gbk0[]={ +static const uint16 tab_uni_gbk0[]={ 0xA1E8, 0, 0,0xA1EC,0xA1A7, 0, 0, 0, 0, 0, 0, 0,0xA1E3,0xA1C0, 0, 0, 0, 0, 0,0xA1A4, 0, 0, 0, 0, @@ -7695,7 +7691,7 @@ static uint16 tab_uni_gbk0[]={ 0xA7EE,0xA7EF,0xA7F0,0xA7F1, 0,0xA7D7}; /* page 1 0x2010-0x2312 */ -static uint16 tab_uni_gbk1[]={ +static const uint16 tab_uni_gbk1[]={ 0xA95C, 0, 0,0xA843,0xA1AA,0xA844,0xA1AC, 0, 0xA1AE,0xA1AF, 0, 0,0xA1B0,0xA1B1, 0, 0, 0, 0, 0, 0, 0,0xA845,0xA1AD, 0, @@ -7795,7 +7791,7 @@ static uint16 tab_uni_gbk1[]={ 0, 0,0xA1D0}; /* page 2 0x2460-0x2642 */ -static uint16 tab_uni_gbk2[]={ +static const uint16 tab_uni_gbk2[]={ 0xA2D9,0xA2DA,0xA2DB,0xA2DC,0xA2DD,0xA2DE,0xA2DF,0xA2E0, 0xA2E1,0xA2E2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0xA2C5,0xA2C6,0xA2C7,0xA2C8, @@ -7859,7 +7855,7 @@ static uint16 tab_uni_gbk2[]={ 0xA1E2, 0,0xA1E1}; /* page 3 0x3000-0x3129 */ -static uint16 tab_uni_gbk3[]={ +static const uint16 tab_uni_gbk3[]={ 0xA1A1,0xA1A2,0xA1A3,0xA1A8, 0,0xA1A9,0xA965,0xA996, 0xA1B4,0xA1B5,0xA1B6,0xA1B7,0xA1B8,0xA1B9,0xA1BA,0xA1BB, 0xA1BE,0xA1BF,0xA893,0xA1FE,0xA1B2,0xA1B3,0xA1BC,0xA1BD, @@ -7900,7 +7896,7 @@ static uint16 tab_uni_gbk3[]={ 0xA8E8,0xA8E9}; /* page 4 0x3220-0x32A3 */ -static uint16 tab_uni_gbk4[]={ +static const uint16 tab_uni_gbk4[]={ 0xA2E5,0xA2E6,0xA2E7,0xA2E8,0xA2E9,0xA2EA,0xA2EB,0xA2EC, 0xA2ED,0xA2EE, 0, 0, 0, 0, 0, 0, 0,0xA95A, 0, 0, 0, 0, 0, 0, @@ -7920,7 +7916,7 @@ static uint16 tab_uni_gbk4[]={ 0, 0, 0,0xA949}; /* page 5 0x338E-0x33D5 */ -static uint16 tab_uni_gbk5[]={ +static const uint16 tab_uni_gbk5[]={ 0xA94A,0xA94B, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0xA94C,0xA94D, 0xA94E, 0, 0,0xA94F, 0, 0, 0, 0, @@ -7933,7 +7929,7 @@ static uint16 tab_uni_gbk5[]={ }; /* page 6 0x4E00-0x9FA5 */ -static uint16 tab_uni_gbk6[]={ +static const uint16 tab_uni_gbk6[]={ 0xD2BB,0xB6A1,0x8140,0xC6DF,0x8141,0x8142,0x8143,0xCDF2, 0xD5C9,0xC8FD,0xC9CF,0xCFC2,0xD8A2,0xB2BB,0xD3EB,0x8144, 0xD8A4,0xB3F3,0x8145,0xD7A8,0xC7D2,0xD8A7,0xCAC0,0x8146, @@ -10549,7 +10545,7 @@ static uint16 tab_uni_gbk6[]={ 0xD9DF,0xFD97,0xFD98,0xFD99,0xFD9A,0xFD9B}; /* page 7 0xF92C-0xFA29 */ -static uint16 tab_uni_gbk7[]={ +static const uint16 tab_uni_gbk7[]={ 0xFD9C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -10584,7 +10580,7 @@ static uint16 tab_uni_gbk7[]={ 0xFE4C, 0, 0,0xFE4D,0xFE4E,0xFE4F}; /* page 8 0xFE30-0xFFE5 */ -static uint16 tab_uni_gbk8[]={ +static const uint16 tab_uni_gbk8[]={ 0xA955,0xA6F2, 0,0xA6F4,0xA6F5,0xA6E0,0xA6E1,0xA6F0, 0xA6F1,0xA6E2,0xA6E3,0xA6EE,0xA6EF,0xA6E6,0xA6E7,0xA6E4, 0xA6E5,0xA6E8,0xA6E9,0xA6EA,0xA6EB, 0, 0, 0, @@ -10801,7 +10797,7 @@ static MY_CHARSET_HANDLER my_charset_handler= }; -CHARSET_INFO my_charset_gbk_chinese_ci= +struct charset_info_st my_charset_gbk_chinese_ci= { 28,0,0, /* number */ MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM, /* state */ @@ -10833,7 +10829,7 @@ CHARSET_INFO my_charset_gbk_chinese_ci= &my_collation_ci_handler }; -CHARSET_INFO my_charset_gbk_bin= +struct charset_info_st my_charset_gbk_bin= { 87,0,0, /* number */ MY_CS_COMPILED|MY_CS_BINSORT, /* state */ diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index 3a96a735d02..80ae11c82c2 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -1,4 +1,5 @@ /* Copyright (c) 2000, 2003-2007 MySQL AB, 2009 Sun Microsystems, Inc. + Copyright (c) 2009-2011, Monty Program Ab Use is subject to license terms. This program is free software; you can redistribute it and/or modify @@ -14,11 +15,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> -static uchar ctype_latin1[] = { +static const uchar ctype_latin1[] = { 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, @@ -38,7 +38,7 @@ static uchar ctype_latin1[] = { 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 2 }; -static uchar to_lower_latin1[] = { +static const uchar to_lower_latin1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, @@ -57,7 +57,7 @@ static uchar to_lower_latin1[] = { 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 }; -static uchar to_upper_latin1[] = { +static const uchar to_upper_latin1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, @@ -76,7 +76,7 @@ static uchar to_upper_latin1[] = { 208,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255 }; -static uchar sort_order_latin1[] = { +static const uchar sort_order_latin1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, @@ -117,7 +117,7 @@ static uchar sort_order_latin1[] = { output doesn't reproduce these undefined characters. */ -unsigned short cs_to_uni[256]={ +static unsigned const short cs_to_uni[256]={ 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -151,7 +151,7 @@ unsigned short cs_to_uni[256]={ 0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7, 0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF }; -uchar pl00[256]={ +static const uchar pl00[256]={ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, 0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17, @@ -185,7 +185,7 @@ uchar pl00[256]={ 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7, 0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF }; -uchar pl01[256]={ +static const uchar pl01[256]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -219,7 +219,7 @@ uchar pl01[256]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -uchar pl02[256]={ +static const uchar pl02[256]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -253,7 +253,7 @@ uchar pl02[256]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -uchar pl20[256]={ +static const uchar pl20[256]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x96,0x97,0x00,0x00,0x00, @@ -287,7 +287,7 @@ uchar pl20[256]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -uchar pl21[256]={ +static const uchar pl21[256]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -321,7 +321,7 @@ uchar pl21[256]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -uchar *uni_to_cs[256]={ +static const uchar *const uni_to_cs[256]={ pl00,pl01,pl02,NULL,NULL,NULL,NULL,NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, @@ -375,7 +375,7 @@ int my_wc_mb_latin1(CHARSET_INFO *cs __attribute__((unused)), uchar *str, uchar *end __attribute__((unused))) { - uchar *pl; + const uchar *pl; if (str >= end) return MY_CS_TOOSMALL; @@ -417,7 +417,7 @@ static MY_CHARSET_HANDLER my_charset_handler= }; -CHARSET_INFO my_charset_latin1= +struct charset_info_st my_charset_latin1= { 8,0,0, /* number */ MY_CS_COMPILED | MY_CS_PRIMARY, /* state */ @@ -472,7 +472,7 @@ CHARSET_INFO my_charset_latin1= * Ü, ü, Ö, ö, Ä, ä */ -static uchar sort_order_latin1_de[] = { +static const uchar sort_order_latin1_de[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, @@ -496,7 +496,7 @@ static uchar sort_order_latin1_de[] = { same as sort_order_latin_de, but maps ALL accented chars to unaccented ones */ -uchar combo1map[]={ +static const uchar combo1map[]={ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, @@ -515,7 +515,7 @@ uchar combo1map[]={ 68, 78, 79, 79, 79, 79, 79,247,216, 85, 85, 85, 85, 89,222, 89 }; -uchar combo2map[]={ +static const uchar combo2map[]={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -716,7 +716,7 @@ static MY_COLLATION_HANDLER my_collation_german2_ci_handler= }; -CHARSET_INFO my_charset_latin1_german2_ci= +struct charset_info_st my_charset_latin1_german2_ci= { 31,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */ @@ -749,7 +749,7 @@ CHARSET_INFO my_charset_latin1_german2_ci= }; -CHARSET_INFO my_charset_latin1_bin= +struct charset_info_st my_charset_latin1_bin= { 47,0,0, /* number */ MY_CS_COMPILED|MY_CS_BINSORT, /* state */ diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c index 102680d7c45..0c0332ea3da 100644 --- a/strings/ctype-mb.c +++ b/strings/ctype-mb.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,9 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <my_global.h> -#include "m_ctype.h" -#include "m_string.h" +#include "strings_def.h" +#include <m_ctype.h> #ifdef USE_MB @@ -23,7 +23,7 @@ size_t my_caseup_str_mb(CHARSET_INFO * cs, char *str) { register uint32 l; - register uchar *map= cs->to_upper; + register const uchar *map= cs->to_upper; char *str_orig= str; while (*str) @@ -44,7 +44,7 @@ size_t my_caseup_str_mb(CHARSET_INFO * cs, char *str) size_t my_casedn_str_mb(CHARSET_INFO * cs, char *str) { register uint32 l; - register uchar *map= cs->to_lower; + register const uchar *map= cs->to_lower; char *str_orig= str; while (*str) @@ -79,7 +79,7 @@ size_t my_caseup_mb(CHARSET_INFO * cs, char *src, size_t srclen, { register uint32 l; register char *srcend= src + srclen; - register uchar *map= cs->to_upper; + register const uchar *map= cs->to_upper; DBUG_ASSERT(cs->caseup_multiply == 1); DBUG_ASSERT(src == dst && srclen == dstlen); @@ -114,7 +114,7 @@ size_t my_casedn_mb(CHARSET_INFO * cs, char *src, size_t srclen, { register uint32 l; register char *srcend= src + srclen; - register uchar *map=cs->to_lower; + register const uchar *map=cs->to_lower; DBUG_ASSERT(cs->casedn_multiply == 1); DBUG_ASSERT(src == dst && srclen == dstlen); @@ -156,7 +156,7 @@ static size_t my_casefold_mb_varlen(CHARSET_INFO *cs, char *src, size_t srclen, char *dst, size_t dstlen __attribute__((unused)), - uchar *map, + const uchar *map, size_t is_upper) { char *srcend= src + srclen, *dst0= dst; @@ -219,7 +219,7 @@ my_caseup_mb_varlen(CHARSET_INFO * cs, char *src, size_t srclen, int my_strcasecmp_mb(CHARSET_INFO * cs,const char *s, const char *t) { register uint32 l; - register uchar *map=cs->to_upper; + register const uchar *map=cs->to_upper; while (*s && *t) { @@ -696,8 +696,7 @@ my_bool my_like_range_mb(CHARSET_INFO *cs, char *min_end= min_str + res_length; char *max_end= max_str + res_length; size_t maxcharlen= res_length / cs->mbmaxlen; - const char *contraction_flags= cs->contractions ? - ((const char*) cs->contractions) + 0x40*0x40 : NULL; + my_bool have_contractions= my_cs_have_contractions(cs); for (; ptr != end && min_str != min_end && maxcharlen ; maxcharlen--) { @@ -765,8 +764,8 @@ fill_max_and_min: 'ab\min\min\min\min' and 'ab\max\max\max\max'. */ - if (contraction_flags && ptr + 1 < end && - contraction_flags[(uchar) *ptr]) + if (have_contractions && ptr + 1 < end && + my_cs_can_be_contraction_head(cs, (uchar) *ptr)) { /* Ptr[0] is a contraction head. */ @@ -788,8 +787,8 @@ fill_max_and_min: is not a contraction, then we put only ptr[0], and continue with ptr[1] on the next loop. */ - if (contraction_flags[(uchar) ptr[1]] && - cs->contractions[(*ptr-0x40)*0x40 + ptr[1] - 0x40]) + if (my_cs_can_be_contraction_tail(cs, (uchar) ptr[1]) && + my_cs_contraction2_weight(cs, (uchar) ptr[0], (uchar) ptr[1])) { /* Contraction found */ if (maxcharlen == 1 || min_str + 1 >= min_end) @@ -926,7 +925,7 @@ my_like_range_generic(CHARSET_INFO *cs, my_cs_can_be_contraction_head(cs, wc) && (res= cs->cset->mb_wc(cs, &wc2, (uchar*) ptr, (uchar*) end)) > 0) { - uint16 *weight; + const uint16 *weight; if ((wc2 == (my_wc_t) w_one || wc2 == (my_wc_t) w_many)) { /* Contraction head followed by a wildcard */ @@ -1125,7 +1124,7 @@ my_wildcmp_mb_bin(CHARSET_INFO *cs, Data was produced from EastAsianWidth.txt using utt11-dump utility. */ -static char pg11[256]= +static const char pg11[256]= { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, @@ -1137,7 +1136,7 @@ static char pg11[256]= 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -static char pg23[256]= +static const char pg23[256]= { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -1149,7 +1148,7 @@ static char pg23[256]= 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -static char pg2E[256]= +static const char pg2E[256]= { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -1161,7 +1160,7 @@ static char pg2E[256]= 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0 }; -static char pg2F[256]= +static const char pg2F[256]= { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, @@ -1173,7 +1172,7 @@ static char pg2F[256]= 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0 }; -static char pg30[256]= +static const char pg30[256]= { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0, @@ -1185,7 +1184,7 @@ static char pg30[256]= 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 }; -static char pg31[256]= +static const char pg31[256]= { 0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, @@ -1197,7 +1196,7 @@ static char pg31[256]= 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 }; -static char pg32[256]= +static const char pg32[256]= { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, @@ -1209,7 +1208,7 @@ static char pg32[256]= 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 }; -static char pg4D[256]= +static const char pg4D[256]= { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, @@ -1221,7 +1220,7 @@ static char pg4D[256]= 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -static char pg9F[256]= +static const char pg9F[256]= { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, @@ -1233,7 +1232,7 @@ static char pg9F[256]= 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -static char pgA4[256]= +static const char pgA4[256]= { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, @@ -1245,7 +1244,7 @@ static char pgA4[256]= 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -static char pgD7[256]= +static const char pgD7[256]= { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, @@ -1257,7 +1256,7 @@ static char pgD7[256]= 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -static char pgFA[256]= +static const char pgFA[256]= { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, @@ -1269,7 +1268,7 @@ static char pgFA[256]= 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -static char pgFE[256]= +static const char pgFE[256]= { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, @@ -1281,7 +1280,7 @@ static char pgFE[256]= 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -static char pgFF[256]= +static const char pgFF[256]= { 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, @@ -1293,7 +1292,7 @@ static char pgFF[256]= 1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; -static struct {int page; char *p;} utr11_data[256]= +static const struct {int page; const char *p;} utr11_data[256]= { {0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL}, {0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL}, diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index 09ea5c08ccb..3cd6805158e 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -1,4 +1,6 @@ -/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2002-2007 MySQL AB, 2009 Sun Microsystems, Inc. + Copyright (c) 2009-2011, Monty Program Ab + Use is subject to license terms. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,9 +15,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #include "my_sys.h" /* Needed for MY_ERRNO_ERANGE */ #include <errno.h> @@ -75,7 +76,7 @@ size_t my_strnxfrm_simple(CHARSET_INFO * cs, uchar *dest, size_t len, const uchar *src, size_t srclen) { - uchar *map= cs->sort_order; + const uchar *map= cs->sort_order; size_t dstlen= len; set_if_smaller(len, srclen); if (dest != src) @@ -101,7 +102,7 @@ int my_strnncoll_simple(CHARSET_INFO * cs, const uchar *s, size_t slen, my_bool t_is_prefix) { size_t len = ( slen > tlen ) ? tlen : slen; - uchar *map= cs->sort_order; + const uchar *map= cs->sort_order; if (t_is_prefix && slen > tlen) slen=tlen; while (len--) @@ -195,7 +196,7 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, size_t a_length, size_t my_caseup_str_8bit(CHARSET_INFO * cs,char *str) { - register uchar *map= cs->to_upper; + register const uchar *map= cs->to_upper; char *str_orig= str; while ((*str= (char) map[(uchar) *str]) != 0) str++; @@ -205,7 +206,7 @@ size_t my_caseup_str_8bit(CHARSET_INFO * cs,char *str) size_t my_casedn_str_8bit(CHARSET_INFO * cs,char *str) { - register uchar *map= cs->to_lower; + register const uchar *map= cs->to_lower; char *str_orig= str; while ((*str= (char) map[(uchar) *str]) != 0) str++; @@ -218,7 +219,7 @@ size_t my_caseup_8bit(CHARSET_INFO * cs, char *src, size_t srclen, size_t dstlen __attribute__((unused))) { char *end= src + srclen; - register uchar *map= cs->to_upper; + register const uchar *map= cs->to_upper; DBUG_ASSERT(src == dst && srclen == dstlen); for ( ; src != end ; src++) *src= (char) map[(uchar) *src]; @@ -231,7 +232,7 @@ size_t my_casedn_8bit(CHARSET_INFO * cs, char *src, size_t srclen, size_t dstlen __attribute__((unused))) { char *end= src + srclen; - register uchar *map=cs->to_lower; + register const uchar *map=cs->to_lower; DBUG_ASSERT(src == dst && srclen == dstlen); for ( ; src != end ; src++) *src= (char) map[(uchar) *src]; @@ -240,7 +241,7 @@ size_t my_casedn_8bit(CHARSET_INFO * cs, char *src, size_t srclen, int my_strcasecmp_8bit(CHARSET_INFO * cs,const char *s, const char *t) { - register uchar *map=cs->to_upper; + register const uchar *map=cs->to_upper; while (map[(uchar) *s] == map[(uchar) *t++]) if (!*s++) return 0; return ((int) map[(uchar) s[0]] - (int) map[(uchar) t[-1]]); @@ -303,21 +304,26 @@ void my_hash_sort_simple(CHARSET_INFO *cs, const uchar *key, size_t len, ulong *nr1, ulong *nr2) { - register uchar *sort_order=cs->sort_order; + register const uchar *sort_order=cs->sort_order; const uchar *end; - + ulong n1, n2; + /* Remove end space. We have to do this to be able to compare 'A ' and 'A' as identical */ end= skip_trailing_space(key, len); - + + n1= *nr1; + n2= *nr2; for (; key < (uchar*) end ; key++) { - nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) * - ((uint) sort_order[(uint) *key])) + (nr1[0] << 8); - nr2[0]+=3; + n1^=(ulong) ((((uint) n1 & 63)+n2) * + ((uint) sort_order[(uint) *key])) + (n1 << 8); + n2+=3; } + *nr1= n1; + *nr2= n2; } @@ -1139,7 +1145,7 @@ skip: typedef struct { int nchars; - MY_UNI_IDX uidx; + struct my_uni_idx_st uidx; } uni_idx; #define PLANE_SIZE 0x100 @@ -1157,10 +1163,12 @@ static int pcmp(const void * f, const void * s) return res; } -static my_bool create_fromuni(CHARSET_INFO *cs, void *(*alloc)(size_t)) +static my_bool create_fromuni(struct charset_info_st *cs, + void *(*alloc)(size_t)) { uni_idx idx[PLANE_NUM]; int i,n; + struct my_uni_idx_st *tab_from_uni; /* Check that Unicode map is loaded. @@ -1201,16 +1209,18 @@ static my_bool create_fromuni(CHARSET_INFO *cs, void *(*alloc)(size_t)) for (i=0; i < PLANE_NUM; i++) { int ch,numchars; + uchar *tab; /* Skip empty plane */ if (!idx[i].nchars) break; numchars=idx[i].uidx.to-idx[i].uidx.from+1; - if (!(idx[i].uidx.tab=(uchar*) alloc(numchars * sizeof(*idx[i].uidx.tab)))) + if (!(idx[i].uidx.tab= tab= (uchar*) + alloc(numchars * sizeof(*idx[i].uidx.tab)))) return TRUE; - bzero(idx[i].uidx.tab,numchars*sizeof(*idx[i].uidx.tab)); + bzero(tab,numchars*sizeof(*tab)); for (ch=1; ch < PLANE_SIZE; ch++) { @@ -1218,25 +1228,27 @@ static my_bool create_fromuni(CHARSET_INFO *cs, void *(*alloc)(size_t)) if (wc >= idx[i].uidx.from && wc <= idx[i].uidx.to && wc) { int ofs= wc - idx[i].uidx.from; - idx[i].uidx.tab[ofs]= ch; + tab[ofs]= ch; } } } /* Allocate and fill reverse table for each plane */ n=i; - if (!(cs->tab_from_uni= (MY_UNI_IDX*) alloc(sizeof(MY_UNI_IDX)*(n+1)))) + if (!(cs->tab_from_uni= tab_from_uni= (struct my_uni_idx_st*) + alloc(sizeof(MY_UNI_IDX)*(n+1)))) return TRUE; for (i=0; i< n; i++) - cs->tab_from_uni[i]= idx[i].uidx; + tab_from_uni[i]= idx[i].uidx; /* Set end-of-list marker */ - bzero(&cs->tab_from_uni[i],sizeof(MY_UNI_IDX)); + bzero(&tab_from_uni[i],sizeof(MY_UNI_IDX)); return FALSE; } -static my_bool my_cset_init_8bit(CHARSET_INFO *cs, void *(*alloc)(size_t)) +static my_bool my_cset_init_8bit(struct charset_info_st *cs, + void *(*alloc)(size_t)) { cs->caseup_multiply= 1; cs->casedn_multiply= 1; @@ -1244,7 +1256,7 @@ static my_bool my_cset_init_8bit(CHARSET_INFO *cs, void *(*alloc)(size_t)) return create_fromuni(cs, alloc); } -static void set_max_sort_char(CHARSET_INFO *cs) +static void set_max_sort_char(struct charset_info_st *cs) { uchar max_char; uint i; @@ -1263,7 +1275,7 @@ static void set_max_sort_char(CHARSET_INFO *cs) } } -static my_bool my_coll_init_simple(CHARSET_INFO *cs, +static my_bool my_coll_init_simple(struct charset_info_st *cs, void *(*alloc)(size_t) __attribute__((unused))) { set_max_sort_char(cs); @@ -1430,7 +1442,7 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)), } } - digits= str - beg; + digits= (int) (str - beg); /* Continue to accumulate into ulonglong */ for (dot= NULL, ull= ul; str < end; str++) @@ -1467,7 +1479,7 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)), } else { - shift= dot - str; + shift= (int) (dot - str); for ( ; str < end && (ch= (uchar) (*str - '0')) < 10; str++); } goto exp; diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index c42fa8a4384..50756799a56 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,9 +17,8 @@ /* This file is for Shift JIS charset, and created by tommy@valley.ne.jp. */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #ifdef HAVE_CHARSET_sjis @@ -31,7 +31,7 @@ * .configure. mbmaxlen_sjis=2 */ -static uchar ctype_sjis[257] = +static const uchar ctype_sjis[257] = { 0, /* For standard library */ 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* NUL ^A - ^G */ @@ -68,7 +68,7 @@ static uchar ctype_sjis[257] = 0020, 0020, 0020, 0020, 0020, 0000, 0000, 0000 }; -static uchar to_lower_sjis[]= +static const uchar to_lower_sjis[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -104,7 +104,7 @@ static uchar to_lower_sjis[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' }; -static uchar to_upper_sjis[]= +static const uchar to_upper_sjis[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -140,7 +140,7 @@ static uchar to_upper_sjis[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' }; -static uchar sort_order_sjis[]= +static const uchar sort_order_sjis[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -34192,7 +34192,7 @@ static MY_CHARSET_HANDLER my_charset_handler= }; -CHARSET_INFO my_charset_sjis_japanese_ci= +struct charset_info_st my_charset_sjis_japanese_ci= { 13,0,0, /* number */ MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_NONASCII, /* state */ @@ -34224,7 +34224,7 @@ CHARSET_INFO my_charset_sjis_japanese_ci= &my_collation_ci_handler }; -CHARSET_INFO my_charset_sjis_bin= +struct charset_info_st my_charset_sjis_bin= { 88,0,0, /* number */ MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NONASCII, /* state */ diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index ed9d184ab17..d97f8e5ff08 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -1,19 +1,5 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - -/* +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab Copyright (C) 2003 by Sathit Jittanupat <jsat66@hotmail.com,jsat66@yahoo.com> * solving bug crash with long text field string @@ -47,11 +33,10 @@ * .configure. strxfrm_multiply_tis620=4 */ -#include <my_global.h> -#include <my_sys.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #include "t_ctype.h" +#include <my_sys.h> #ifdef HAVE_CHARSET_tis620 @@ -63,7 +48,7 @@ #define X L_MIDDLE -static int t_ctype[][TOT_LEVELS] = { +static const int t_ctype[][TOT_LEVELS] = { /*0x00*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, /*0x01*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, /*0x02*/ { IGNORE, IGNORE, IGNORE, IGNORE, X }, @@ -416,7 +401,7 @@ static uchar to_upper_tis620[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uchar sort_order_tis620[]= +static const uchar sort_order_tis620[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -476,7 +461,7 @@ static size_t thai2sortable(uchar *tstr, size_t len) if (isthai(c)) { - int *t_ctype0= t_ctype[c]; + const int *t_ctype0= t_ctype[c]; if (isconsnt(c)) l2bias -= 8; @@ -647,7 +632,7 @@ size_t my_strnxfrm_tis620(CHARSET_INFO *cs __attribute__((unused)), } -static unsigned short cs_to_uni[256]={ +static const unsigned short cs_to_uni[256]={ 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -681,7 +666,7 @@ static unsigned short cs_to_uni[256]={ 0x0E50,0x0E51,0x0E52,0x0E53,0x0E54,0x0E55,0x0E56,0x0E57, 0x0E58,0x0E59,0x0E5A,0x0E5B,0xFFFD,0xFFFD,0xFFFD,0xFFFD }; -static uchar pl00[256]={ +static const uchar pl00[256]={ 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -715,7 +700,7 @@ static uchar pl00[256]={ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 }; -static uchar pl0E[256]={ +static const uchar pl0E[256]={ 0x0000,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, 0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, 0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, @@ -749,7 +734,7 @@ static uchar pl0E[256]={ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 }; -static uchar plFF[256]={ +static const uchar plFF[256]={ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, @@ -783,7 +768,7 @@ static uchar plFF[256]={ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x00FF,0x0000,0x0000 }; -static uchar *uni_to_cs[256]={ +static const uchar *const uni_to_cs[256]={ pl00,NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL,NULL,NULL,NULL,NULL,NULL,pl0E,NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, @@ -838,7 +823,7 @@ int my_wc_mb_tis620(CHARSET_INFO *cs __attribute__((unused)), uchar *str, uchar *end __attribute__((unused))) { - uchar *pl; + const uchar *pl; if (str >= end) return MY_CS_TOOSMALL; @@ -897,7 +882,7 @@ static MY_CHARSET_HANDLER my_charset_handler= -CHARSET_INFO my_charset_tis620_thai_ci= +struct charset_info_st my_charset_tis620_thai_ci= { 18,0,0, /* number */ MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM, /* state */ @@ -929,7 +914,7 @@ CHARSET_INFO my_charset_tis620_thai_ci= &my_collation_ci_handler }; -CHARSET_INFO my_charset_tis620_bin= +struct charset_info_st my_charset_tis620_bin= { 89,0,0, /* number */ MY_CS_COMPILED|MY_CS_BINSORT, /* state */ diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index f0899f6b77e..0f464be607d 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. + Copyright (c) 2009, 2011, Monty Program Ab This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -31,10 +32,13 @@ - No combining marks processing is done */ +#include "strings_def.h" +#include <m_ctype.h> -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#define MY_UCA_CNT_FLAG_SIZE 4096 +#define MY_UCA_CNT_FLAG_MASK 4095 +#define MY_UCA_CNT_HEAD 1 +#define MY_UCA_CNT_TAIL 2 #ifdef HAVE_UCA_COLLATIONS @@ -44,7 +48,7 @@ #define MY_UCA_PSHIFT 8 #define MAX_UCA_CHAR_WITH_EXPLICIT_WEIGHT 0xFFFF -uint16 page000data[]= { /* 0000 (4 weights per char) */ +static const uint16 page000data[]= { /* 0000 (4 weights per char) */ 0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, @@ -175,7 +179,7 @@ uint16 page000data[]= { /* 0000 (4 weights per char) */ 0x1094,0x0000,0x0000,0x0000, 0x105E,0x0000,0x0000,0x0000 }; -uint16 page001data[]= { /* 0100 (3 weights per char) */ +static const uint16 page001data[]= { /* 0100 (3 weights per char) */ 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E60,0x0000,0x0000, 0x0E60,0x0000,0x0000, 0x0E60,0x0000,0x0000, @@ -263,7 +267,7 @@ uint16 page001data[]= { /* 0100 (3 weights per char) */ 0x0E38,0x0000,0x0000, 0x0E38,0x0000,0x0000, 0x0F8D,0x0000,0x0000, 0x0F8D,0x0000,0x0000 }; -uint16 page002data[]= { /* 0200 (3 weights per char) */ +static const uint16 page002data[]= { /* 0200 (3 weights per char) */ 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0EFB,0x0000,0x0000, @@ -351,7 +355,7 @@ uint16 page002data[]= { /* 0200 (3 weights per char) */ 0x0346,0x0000,0x0000, 0x0347,0x0000,0x0000, 0x0348,0x0000,0x0000, 0x0349,0x0000,0x0000 }; -uint16 page003data[]= { /* 0300 (4 weights per char) */ +static const uint16 page003data[]= { /* 0300 (4 weights per char) */ 0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000, @@ -482,7 +486,7 @@ uint16 page003data[]= { /* 0300 (4 weights per char) */ 0xFBC0,0x83FE,0x0000,0x0000, 0xFBC0,0x83FF,0x0000,0x0000 }; -uint16 page004data[]= { /* 0400 (3 weights per char) */ +static const uint16 page004data[]= { /* 0400 (3 weights per char) */ 0x1152,0x0000,0x0000, 0x1152,0x0000,0x0000, 0x1145,0x0000,0x0000, 0x114A,0x0000,0x0000, 0x115A,0x0000,0x0000, 0x1173,0x0000,0x0000, 0x1188,0x0000,0x0000, 0x118C,0x0000,0x0000, 0x1194,0x0000,0x0000, @@ -570,7 +574,7 @@ uint16 page004data[]= { /* 0400 (3 weights per char) */ 0xFBC0,0x84FC,0x0000, 0xFBC0,0x84FD,0x0000, 0xFBC0,0x84FE,0x0000, 0xFBC0,0x84FF,0x0000 }; -uint16 page005data[]= { /* 0500 (3 weights per char) */ +static const uint16 page005data[]= { /* 0500 (3 weights per char) */ 0x1144,0x0000,0x0000, 0x1144,0x0000,0x0000, 0x1149,0x0000,0x0000, 0x1149,0x0000,0x0000, 0x116E,0x0000,0x0000, 0x116E,0x0000,0x0000, 0x117B,0x0000,0x0000, 0x117B,0x0000,0x0000, 0x11BD,0x0000,0x0000, @@ -658,7 +662,7 @@ uint16 page005data[]= { /* 0500 (3 weights per char) */ 0xFBC0,0x85FC,0x0000, 0xFBC0,0x85FD,0x0000, 0xFBC0,0x85FE,0x0000, 0xFBC0,0x85FF,0x0000 }; -uint16 page006data[]= { /* 0600 (3 weights per char) */ +static const uint16 page006data[]= { /* 0600 (3 weights per char) */ 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0xFBC0,0x8604,0x0000, 0xFBC0,0x8605,0x0000, 0xFBC0,0x8606,0x0000, 0xFBC0,0x8607,0x0000, 0xFBC0,0x8608,0x0000, @@ -746,7 +750,7 @@ uint16 page006data[]= { /* 0600 (3 weights per char) */ 0x1392,0x0000,0x0000, 0x1347,0x0000,0x0000, 0x13B0,0x0000,0x0000, 0x13BB,0x0000,0x0000 }; -uint16 page007data[]= { /* 0700 (3 weights per char) */ +static const uint16 page007data[]= { /* 0700 (3 weights per char) */ 0x0270,0x0000,0x0000, 0x0260,0x0000,0x0000, 0x0261,0x0000,0x0000, 0x023F,0x0000,0x0000, 0x0240,0x0000,0x0000, 0x0241,0x0000,0x0000, 0x0242,0x0000,0x0000, 0x0243,0x0000,0x0000, 0x0244,0x0000,0x0000, @@ -834,7 +838,7 @@ uint16 page007data[]= { /* 0700 (3 weights per char) */ 0xFBC0,0x87FC,0x0000, 0xFBC0,0x87FD,0x0000, 0xFBC0,0x87FE,0x0000, 0xFBC0,0x87FF,0x0000 }; -uint16 page009data[]= { /* 0900 (3 weights per char) */ +static const uint16 page009data[]= { /* 0900 (3 weights per char) */ 0xFBC0,0x8900,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x155A,0x0000,0x0000, 0x155B,0x0000,0x0000, 0x155C,0x0000,0x0000, 0x155D,0x0000,0x0000, 0x155E,0x0000,0x0000, @@ -922,7 +926,7 @@ uint16 page009data[]= { /* 0900 (3 weights per char) */ 0xFBC0,0x89FC,0x0000, 0xFBC0,0x89FD,0x0000, 0xFBC0,0x89FE,0x0000, 0xFBC0,0x89FF,0x0000 }; -uint16 page00Adata[]= { /* 0A00 (3 weights per char) */ +static const uint16 page00Adata[]= { /* 0A00 (3 weights per char) */ 0xFBC0,0x8A00,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0xFBC0,0x8A04,0x0000, 0x15E7,0x0000,0x0000, 0x15E8,0x0000,0x0000, 0x15EC,0x0000,0x0000, 0x15ED,0x0000,0x0000, @@ -1010,7 +1014,7 @@ uint16 page00Adata[]= { /* 0A00 (3 weights per char) */ 0xFBC0,0x8AFC,0x0000, 0xFBC0,0x8AFD,0x0000, 0xFBC0,0x8AFE,0x0000, 0xFBC0,0x8AFF,0x0000 }; -uint16 page00Bdata[]= { /* 0B00 (3 weights per char) */ +static const uint16 page00Bdata[]= { /* 0B00 (3 weights per char) */ 0xFBC0,0x8B00,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0xFBC0,0x8B04,0x0000, 0x165D,0x0000,0x0000, 0x165E,0x0000,0x0000, 0x165F,0x0000,0x0000, 0x1660,0x0000,0x0000, @@ -1098,7 +1102,7 @@ uint16 page00Bdata[]= { /* 0B00 (3 weights per char) */ 0xFBC0,0x8BFC,0x0000, 0xFBC0,0x8BFD,0x0000, 0xFBC0,0x8BFE,0x0000, 0xFBC0,0x8BFF,0x0000 }; -uint16 page00Cdata[]= { /* 0C00 (3 weights per char) */ +static const uint16 page00Cdata[]= { /* 0C00 (3 weights per char) */ 0xFBC0,0x8C00,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0xFBC0,0x8C04,0x0000, 0x16CD,0x0000,0x0000, 0x16CE,0x0000,0x0000, 0x16CF,0x0000,0x0000, 0x16D0,0x0000,0x0000, @@ -1186,7 +1190,7 @@ uint16 page00Cdata[]= { /* 0C00 (3 weights per char) */ 0xFBC0,0x8CFC,0x0000, 0xFBC0,0x8CFD,0x0000, 0xFBC0,0x8CFE,0x0000, 0xFBC0,0x8CFF,0x0000 }; -uint16 page00Ddata[]= { /* 0D00 (3 weights per char) */ +static const uint16 page00Ddata[]= { /* 0D00 (3 weights per char) */ 0xFBC0,0x8D00,0x0000, 0xFBC0,0x8D01,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0xFBC0,0x8D04,0x0000, 0x1755,0x0000,0x0000, 0x1756,0x0000,0x0000, 0x1757,0x0000,0x0000, 0x1758,0x0000,0x0000, @@ -1274,7 +1278,7 @@ uint16 page00Ddata[]= { /* 0D00 (3 weights per char) */ 0xFBC0,0x8DFC,0x0000, 0xFBC0,0x8DFD,0x0000, 0xFBC0,0x8DFE,0x0000, 0xFBC0,0x8DFF,0x0000 }; -uint16 page00Edata[]= { /* 0E00 (3 weights per char) */ +static const uint16 page00Edata[]= { /* 0E00 (3 weights per char) */ 0xFBC0,0x8E00,0x0000, 0x17E4,0x0000,0x0000, 0x17E5,0x0000,0x0000, 0x17E6,0x0000,0x0000, 0x17E7,0x0000,0x0000, 0x17E8,0x0000,0x0000, 0x17E9,0x0000,0x0000, 0x17EA,0x0000,0x0000, 0x17EB,0x0000,0x0000, @@ -1362,7 +1366,7 @@ uint16 page00Edata[]= { /* 0E00 (3 weights per char) */ 0xFBC0,0x8EFC,0x0000, 0xFBC0,0x8EFD,0x0000, 0xFBC0,0x8EFE,0x0000, 0xFBC0,0x8EFF,0x0000 }; -uint16 page00Fdata[]= { /* 0F00 (3 weights per char) */ +static const uint16 page00Fdata[]= { /* 0F00 (3 weights per char) */ 0x189A,0x18AD,0x0000, 0x035A,0x0000,0x0000, 0x035B,0x0000,0x0000, 0x035C,0x0000,0x0000, 0x02FE,0x0000,0x0000, 0x02FF,0x0000,0x0000, 0x0300,0x0000,0x0000, 0x0301,0x0000,0x0000, 0x0302,0x0000,0x0000, @@ -1450,7 +1454,7 @@ uint16 page00Fdata[]= { /* 0F00 (3 weights per char) */ 0xFBC0,0x8FFC,0x0000, 0xFBC0,0x8FFD,0x0000, 0xFBC0,0x8FFE,0x0000, 0xFBC0,0x8FFF,0x0000 }; -uint16 page010data[]= { /* 1000 (3 weights per char) */ +static const uint16 page010data[]= { /* 1000 (3 weights per char) */ 0x1931,0x0000,0x0000, 0x1932,0x0000,0x0000, 0x1933,0x0000,0x0000, 0x1934,0x0000,0x0000, 0x1935,0x0000,0x0000, 0x1936,0x0000,0x0000, 0x1937,0x0000,0x0000, 0x1938,0x0000,0x0000, 0x1939,0x0000,0x0000, @@ -1538,7 +1542,7 @@ uint16 page010data[]= { /* 1000 (3 weights per char) */ 0xFBC0,0x90FC,0x0000, 0xFBC0,0x90FD,0x0000, 0xFBC0,0x90FE,0x0000, 0xFBC0,0x90FF,0x0000 }; -uint16 page011data[]= { /* 1100 (3 weights per char) */ +static const uint16 page011data[]= { /* 1100 (3 weights per char) */ 0x1D62,0x0000,0x0000, 0x1D63,0x0000,0x0000, 0x1D64,0x0000,0x0000, 0x1D65,0x0000,0x0000, 0x1D66,0x0000,0x0000, 0x1D67,0x0000,0x0000, 0x1D68,0x0000,0x0000, 0x1D69,0x0000,0x0000, 0x1D6A,0x0000,0x0000, @@ -1626,7 +1630,7 @@ uint16 page011data[]= { /* 1100 (3 weights per char) */ 0xFBC0,0x91FC,0x0000, 0xFBC0,0x91FD,0x0000, 0xFBC0,0x91FE,0x0000, 0xFBC0,0x91FF,0x0000 }; -uint16 page012data[]= { /* 1200 (3 weights per char) */ +static const uint16 page012data[]= { /* 1200 (3 weights per char) */ 0x141C,0x0000,0x0000, 0x141D,0x0000,0x0000, 0x141E,0x0000,0x0000, 0x141F,0x0000,0x0000, 0x1420,0x0000,0x0000, 0x1421,0x0000,0x0000, 0x1422,0x0000,0x0000, 0xFBC0,0x9207,0x0000, 0x1423,0x0000,0x0000, @@ -1714,7 +1718,7 @@ uint16 page012data[]= { /* 1200 (3 weights per char) */ 0x1500,0x0000,0x0000, 0x1501,0x0000,0x0000, 0x1502,0x0000,0x0000, 0x1503,0x0000,0x0000 }; -uint16 page013data[]= { /* 1300 (3 weights per char) */ +static const uint16 page013data[]= { /* 1300 (3 weights per char) */ 0x1504,0x0000,0x0000, 0x1505,0x0000,0x0000, 0x1506,0x0000,0x0000, 0x1507,0x0000,0x0000, 0x1508,0x0000,0x0000, 0x1509,0x0000,0x0000, 0x150A,0x0000,0x0000, 0x150B,0x0000,0x0000, 0x150C,0x0000,0x0000, @@ -1802,7 +1806,7 @@ uint16 page013data[]= { /* 1300 (3 weights per char) */ 0xFBC0,0x93FC,0x0000, 0xFBC0,0x93FD,0x0000, 0xFBC0,0x93FE,0x0000, 0xFBC0,0x93FF,0x0000 }; -uint16 page014data[]= { /* 1400 (3 weights per char) */ +static const uint16 page014data[]= { /* 1400 (3 weights per char) */ 0xFBC0,0x9400,0x0000, 0x1AAE,0x0000,0x0000, 0x1AAF,0x0000,0x0000, 0x1AB0,0x0000,0x0000, 0x1AB1,0x0000,0x0000, 0x1AB2,0x0000,0x0000, 0x1AB3,0x0000,0x0000, 0x1AB4,0x0000,0x0000, 0x1AB5,0x0000,0x0000, @@ -1890,7 +1894,7 @@ uint16 page014data[]= { /* 1400 (3 weights per char) */ 0x1BA9,0x0000,0x0000, 0x1BAA,0x0000,0x0000, 0x1BAB,0x0000,0x0000, 0x1BAC,0x0000,0x0000 }; -uint16 page015data[]= { /* 1500 (2 weights per char) */ +static const uint16 page015data[]= { /* 1500 (2 weights per char) */ 0x1BAD,0x0000, 0x1BAE,0x0000, 0x1BAF,0x0000, 0x1BB0,0x0000, 0x1BB1,0x0000, 0x1BB2,0x0000, 0x1BB3,0x0000, 0x1BB4,0x0000, 0x1BB5,0x0000, 0x1BB6,0x0000, 0x1BB7,0x0000, 0x1BB8,0x0000, @@ -1957,7 +1961,7 @@ uint16 page015data[]= { /* 1500 (2 weights per char) */ 0x1CB1,0x0000, 0x1CB2,0x0000, 0x1CB3,0x0000, 0x1CB4,0x0000 }; -uint16 page016data[]= { /* 1600 (3 weights per char) */ +static const uint16 page016data[]= { /* 1600 (3 weights per char) */ 0x1CB5,0x0000,0x0000, 0x1CB6,0x0000,0x0000, 0x1CB7,0x0000,0x0000, 0x1CB8,0x0000,0x0000, 0x1CB9,0x0000,0x0000, 0x1CBA,0x0000,0x0000, 0x1CBB,0x0000,0x0000, 0x1CBC,0x0000,0x0000, 0x1CBD,0x0000,0x0000, @@ -2045,7 +2049,7 @@ uint16 page016data[]= { /* 1600 (3 weights per char) */ 0xFBC0,0x96FC,0x0000, 0xFBC0,0x96FD,0x0000, 0xFBC0,0x96FE,0x0000, 0xFBC0,0x96FF,0x0000 }; -uint16 page017data[]= { /* 1700 (3 weights per char) */ +static const uint16 page017data[]= { /* 1700 (3 weights per char) */ 0x18E2,0x0000,0x0000, 0x18E3,0x0000,0x0000, 0x18E4,0x0000,0x0000, 0x18E5,0x0000,0x0000, 0x18E6,0x0000,0x0000, 0x18E7,0x0000,0x0000, 0x18E8,0x0000,0x0000, 0x18E9,0x0000,0x0000, 0x18EA,0x0000,0x0000, @@ -2133,7 +2137,7 @@ uint16 page017data[]= { /* 1700 (3 weights per char) */ 0xFBC0,0x97FC,0x0000, 0xFBC0,0x97FD,0x0000, 0xFBC0,0x97FE,0x0000, 0xFBC0,0x97FF,0x0000 }; -uint16 page018data[]= { /* 1800 (3 weights per char) */ +static const uint16 page018data[]= { /* 1800 (3 weights per char) */ 0x02F8,0x0000,0x0000, 0x025E,0x0000,0x0000, 0x0235,0x0000,0x0000, 0x0263,0x0000,0x0000, 0x024A,0x0000,0x0000, 0x024B,0x0000,0x0000, 0x0223,0x0000,0x0000, 0x0224,0x0000,0x0000, 0x0236,0x0000,0x0000, @@ -2221,7 +2225,7 @@ uint16 page018data[]= { /* 1800 (3 weights per char) */ 0xFBC0,0x98FC,0x0000, 0xFBC0,0x98FD,0x0000, 0xFBC0,0x98FE,0x0000, 0xFBC0,0x98FF,0x0000 }; -uint16 page019data[]= { /* 1900 (3 weights per char) */ +static const uint16 page019data[]= { /* 1900 (3 weights per char) */ 0x18B0,0x0000,0x0000, 0x18B1,0x0000,0x0000, 0x18B2,0x0000,0x0000, 0x18B3,0x0000,0x0000, 0x18B4,0x0000,0x0000, 0x18B5,0x0000,0x0000, 0x18B6,0x0000,0x0000, 0x18B7,0x0000,0x0000, 0x18B8,0x0000,0x0000, @@ -2309,7 +2313,7 @@ uint16 page019data[]= { /* 1900 (3 weights per char) */ 0x0397,0x0000,0x0000, 0x0398,0x0000,0x0000, 0x0399,0x0000,0x0000, 0x039A,0x0000,0x0000 }; -uint16 page01Ddata[]= { /* 1D00 (3 weights per char) */ +static const uint16 page01Ddata[]= { /* 1D00 (3 weights per char) */ 0x0E37,0x0000,0x0000, 0x0E3C,0x0000,0x0000, 0x0E3D,0x0000,0x0000, 0x0E57,0x0000,0x0000, 0x0E64,0x0000,0x0000, 0x0E71,0x0000,0x0000, 0x0E8A,0x0000,0x0000, 0x0E8F,0x0000,0x0000, 0x0EA8,0x0000,0x0000, @@ -2397,7 +2401,7 @@ uint16 page01Ddata[]= { /* 1D00 (3 weights per char) */ 0xFBC0,0x9DFC,0x0000, 0xFBC0,0x9DFD,0x0000, 0xFBC0,0x9DFE,0x0000, 0xFBC0,0x9DFF,0x0000 }; -uint16 page01Edata[]= { /* 1E00 (3 weights per char) */ +static const uint16 page01Edata[]= { /* 1E00 (3 weights per char) */ 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E4A,0x0000,0x0000, 0x0E4A,0x0000,0x0000, 0x0E4A,0x0000,0x0000, 0x0E4A,0x0000,0x0000, 0x0E4A,0x0000,0x0000, 0x0E4A,0x0000,0x0000, 0x0E60,0x0000,0x0000, @@ -2485,7 +2489,7 @@ uint16 page01Edata[]= { /* 1E00 (3 weights per char) */ 0xFBC0,0x9EFC,0x0000, 0xFBC0,0x9EFD,0x0000, 0xFBC0,0x9EFE,0x0000, 0xFBC0,0x9EFF,0x0000 }; -uint16 page01Fdata[]= { /* 1F00 (3 weights per char) */ +static const uint16 page01Fdata[]= { /* 1F00 (3 weights per char) */ 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, @@ -2573,7 +2577,7 @@ uint16 page01Fdata[]= { /* 1F00 (3 weights per char) */ 0x1109,0x0000,0x0000, 0x020D,0x0000,0x0000, 0x0218,0x0000,0x0000, 0xFBC0,0x9FFF,0x0000 }; -uint16 page020data[]= { /* 2000 (5 weights per char) */ +static const uint16 page020data[]= { /* 2000 (5 weights per char) */ 0x0209,0x0000,0x0000,0x0000,0x0000, 0x0209,0x0000,0x0000,0x0000,0x0000, 0x0209,0x0000,0x0000,0x0000,0x0000, @@ -2832,7 +2836,7 @@ uint16 page020data[]= { /* 2000 (5 weights per char) */ 0xFBC0,0xA0FF,0x0000,0x0000,0x0000 }; -uint16 page021data[]= { /* 2100 (5 weights per char) */ +static const uint16 page021data[]= { /* 2100 (5 weights per char) */ 0x0E33,0x02CC,0x0E60,0x0000,0x0000, 0x0E33,0x02CC,0x0FEA,0x0000,0x0000, 0x0E60,0x0000,0x0000,0x0000,0x0000, @@ -3091,7 +3095,7 @@ uint16 page021data[]= { /* 2100 (5 weights per char) */ 0x0417,0x0000,0x0000,0x0000,0x0000 }; -uint16 page022data[]= { /* 2200 (4 weights per char) */ +static const uint16 page022data[]= { /* 2200 (4 weights per char) */ 0x0418,0x0000,0x0000,0x0000, 0x0419,0x0000,0x0000,0x0000, 0x041A,0x0000,0x0000,0x0000, 0x041B,0x0000,0x0000,0x0000, 0x041B,0x0000,0x0000,0x0000, 0x041C,0x0000,0x0000,0x0000, @@ -3222,7 +3226,7 @@ uint16 page022data[]= { /* 2200 (4 weights per char) */ 0x04F9,0x0000,0x0000,0x0000, 0x04FA,0x0000,0x0000,0x0000 }; -uint16 page023data[]= { /* 2300 (3 weights per char) */ +static const uint16 page023data[]= { /* 2300 (3 weights per char) */ 0x04FB,0x0000,0x0000, 0x04FC,0x0000,0x0000, 0x04FD,0x0000,0x0000, 0x04FE,0x0000,0x0000, 0x04FF,0x0000,0x0000, 0x0500,0x0000,0x0000, 0x0501,0x0000,0x0000, 0x0502,0x0000,0x0000, 0x0503,0x0000,0x0000, @@ -3310,7 +3314,7 @@ uint16 page023data[]= { /* 2300 (3 weights per char) */ 0xFBC0,0xA3FC,0x0000, 0xFBC0,0xA3FD,0x0000, 0xFBC0,0xA3FE,0x0000, 0xFBC0,0xA3FF,0x0000 }; -uint16 page024data[]= { /* 2400 (5 weights per char) */ +static const uint16 page024data[]= { /* 2400 (5 weights per char) */ 0x05CA,0x0000,0x0000,0x0000,0x0000, 0x05CB,0x0000,0x0000,0x0000,0x0000, 0x05CC,0x0000,0x0000,0x0000,0x0000, @@ -3569,7 +3573,7 @@ uint16 page024data[]= { /* 2400 (5 weights per char) */ 0x0E29,0x0000,0x0000,0x0000,0x0000 }; -uint16 page025data[]= { /* 2500 (2 weights per char) */ +static const uint16 page025data[]= { /* 2500 (2 weights per char) */ 0x05FC,0x0000, 0x05FD,0x0000, 0x05FE,0x0000, 0x05FF,0x0000, 0x0600,0x0000, 0x0601,0x0000, 0x0602,0x0000, 0x0603,0x0000, 0x0604,0x0000, 0x0605,0x0000, 0x0606,0x0000, 0x0607,0x0000, @@ -3636,7 +3640,7 @@ uint16 page025data[]= { /* 2500 (2 weights per char) */ 0x06F8,0x0000, 0x06F9,0x0000, 0x06FA,0x0000, 0x06FB,0x0000 }; -uint16 page026data[]= { /* 2600 (3 weights per char) */ +static const uint16 page026data[]= { /* 2600 (3 weights per char) */ 0x06FC,0x0000,0x0000, 0x06FD,0x0000,0x0000, 0x06FE,0x0000,0x0000, 0x06FF,0x0000,0x0000, 0x0700,0x0000,0x0000, 0x0701,0x0000,0x0000, 0x0702,0x0000,0x0000, 0x0703,0x0000,0x0000, 0x0704,0x0000,0x0000, @@ -3724,7 +3728,7 @@ uint16 page026data[]= { /* 2600 (3 weights per char) */ 0xFBC0,0xA6FC,0x0000, 0xFBC0,0xA6FD,0x0000, 0xFBC0,0xA6FE,0x0000, 0xFBC0,0xA6FF,0x0000 }; -uint16 page027data[]= { /* 2700 (3 weights per char) */ +static const uint16 page027data[]= { /* 2700 (3 weights per char) */ 0xFBC0,0xA700,0x0000, 0x077C,0x0000,0x0000, 0x077D,0x0000,0x0000, 0x077E,0x0000,0x0000, 0x077F,0x0000,0x0000, 0xFBC0,0xA705,0x0000, 0x0780,0x0000,0x0000, 0x0781,0x0000,0x0000, 0x0782,0x0000,0x0000, @@ -3812,7 +3816,7 @@ uint16 page027data[]= { /* 2700 (3 weights per char) */ 0x0834,0x0000,0x0000, 0x0835,0x0000,0x0000, 0x0836,0x0000,0x0000, 0x0837,0x0000,0x0000 }; -uint16 page028data[]= { /* 2800 (2 weights per char) */ +static const uint16 page028data[]= { /* 2800 (2 weights per char) */ 0x0A29,0x0000, 0x0A2A,0x0000, 0x0A2B,0x0000, 0x0A2C,0x0000, 0x0A2D,0x0000, 0x0A2E,0x0000, 0x0A2F,0x0000, 0x0A30,0x0000, 0x0A31,0x0000, 0x0A32,0x0000, 0x0A33,0x0000, 0x0A34,0x0000, @@ -3879,7 +3883,7 @@ uint16 page028data[]= { /* 2800 (2 weights per char) */ 0x0B25,0x0000, 0x0B26,0x0000, 0x0B27,0x0000, 0x0B28,0x0000 }; -uint16 page029data[]= { /* 2900 (2 weights per char) */ +static const uint16 page029data[]= { /* 2900 (2 weights per char) */ 0x0838,0x0000, 0x0839,0x0000, 0x083A,0x0000, 0x083B,0x0000, 0x083C,0x0000, 0x083D,0x0000, 0x083E,0x0000, 0x083F,0x0000, 0x0840,0x0000, 0x0841,0x0000, 0x0842,0x0000, 0x0843,0x0000, @@ -3946,7 +3950,7 @@ uint16 page029data[]= { /* 2900 (2 weights per char) */ 0x0296,0x0000, 0x0297,0x0000, 0x091E,0x0000, 0x091F,0x0000 }; -uint16 page02Adata[]= { /* 2A00 (5 weights per char) */ +static const uint16 page02Adata[]= { /* 2A00 (5 weights per char) */ 0x0920,0x0000,0x0000,0x0000,0x0000, 0x0921,0x0000,0x0000,0x0000,0x0000, 0x0922,0x0000,0x0000,0x0000,0x0000, @@ -4205,7 +4209,7 @@ uint16 page02Adata[]= { /* 2A00 (5 weights per char) */ 0x0A1A,0x0000,0x0000,0x0000,0x0000 }; -uint16 page02Bdata[]= { /* 2B00 (3 weights per char) */ +static const uint16 page02Bdata[]= { /* 2B00 (3 weights per char) */ 0x0A1B,0x0000,0x0000, 0x0A1C,0x0000,0x0000, 0x0A1D,0x0000,0x0000, 0x0A1E,0x0000,0x0000, 0x0A1F,0x0000,0x0000, 0x0A20,0x0000,0x0000, 0x0A21,0x0000,0x0000, 0x0A22,0x0000,0x0000, 0x0A23,0x0000,0x0000, @@ -4293,7 +4297,7 @@ uint16 page02Bdata[]= { /* 2B00 (3 weights per char) */ 0xFBC0,0xABFC,0x0000, 0xFBC0,0xABFD,0x0000, 0xFBC0,0xABFE,0x0000, 0xFBC0,0xABFF,0x0000 }; -uint16 page02Edata[]= { /* 2E00 (3 weights per char) */ +static const uint16 page02Edata[]= { /* 2E00 (3 weights per char) */ 0xFBC0,0xAE00,0x0000, 0xFBC0,0xAE01,0x0000, 0xFBC0,0xAE02,0x0000, 0xFBC0,0xAE03,0x0000, 0xFBC0,0xAE04,0x0000, 0xFBC0,0xAE05,0x0000, 0xFBC0,0xAE06,0x0000, 0xFBC0,0xAE07,0x0000, 0xFBC0,0xAE08,0x0000, @@ -4381,7 +4385,7 @@ uint16 page02Edata[]= { /* 2E00 (3 weights per char) */ 0xFBC0,0xAEFC,0x0000, 0xFBC0,0xAEFD,0x0000, 0xFBC0,0xAEFE,0x0000, 0xFBC0,0xAEFF,0x0000 }; -uint16 page02Fdata[]= { /* 2F00 (3 weights per char) */ +static const uint16 page02Fdata[]= { /* 2F00 (3 weights per char) */ 0xFB40,0xCE00,0x0000, 0xFB40,0xCE28,0x0000, 0xFB40,0xCE36,0x0000, 0xFB40,0xCE3F,0x0000, 0xFB40,0xCE59,0x0000, 0xFB40,0xCE85,0x0000, 0xFB40,0xCE8C,0x0000, 0xFB40,0xCEA0,0x0000, 0xFB40,0xCEBA,0x0000, @@ -4469,7 +4473,7 @@ uint16 page02Fdata[]= { /* 2F00 (3 weights per char) */ 0xFBC0,0xAFFC,0x0000, 0xFBC0,0xAFFD,0x0000, 0xFBC0,0xAFFE,0x0000, 0xFBC0,0xAFFF,0x0000 }; -uint16 page030data[]= { /* 3000 (3 weights per char) */ +static const uint16 page030data[]= { /* 3000 (3 weights per char) */ 0x0209,0x0000,0x0000, 0x0237,0x0000,0x0000, 0x0266,0x0000,0x0000, 0x02E2,0x0000,0x0000, 0x0DBB,0x0000,0x0000, 0x0E05,0x0000,0x0000, 0x1E5D,0x1E73,0x0000, 0x0E29,0x0000,0x0000, 0x02AE,0x0000,0x0000, @@ -4557,7 +4561,7 @@ uint16 page030data[]= { /* 3000 (3 weights per char) */ 0x0E0B,0x0000,0x0000, 0x0E0C,0x0000,0x0000, 0x0E0C,0x0000,0x0000, 0x1E5B,0x1E65,0x0000 }; -uint16 page031data[]= { /* 3100 (3 weights per char) */ +static const uint16 page031data[]= { /* 3100 (3 weights per char) */ 0xFBC0,0xB100,0x0000, 0xFBC0,0xB101,0x0000, 0xFBC0,0xB102,0x0000, 0xFBC0,0xB103,0x0000, 0xFBC0,0xB104,0x0000, 0x1E82,0x0000,0x0000, 0x1E83,0x0000,0x0000, 0x1E84,0x0000,0x0000, 0x1E85,0x0000,0x0000, @@ -4645,7 +4649,7 @@ uint16 page031data[]= { /* 3100 (3 weights per char) */ 0x1E79,0x0000,0x0000, 0x1E7A,0x0000,0x0000, 0x1E7B,0x0000,0x0000, 0x1E7C,0x0000,0x0000 }; -uint16 page032data[]= { /* 3200 (8 weights per char) */ +static const uint16 page032data[]= { /* 3200 (8 weights per char) */ 0x0288,0x1D62,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0288,0x1D64,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0288,0x1D65,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000, @@ -4904,7 +4908,7 @@ uint16 page032data[]= { /* 3200 (8 weights per char) */ 0xFBC0,0xB2FF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 }; -uint16 page033data[]= { /* 3300 (9 weights per char) */ +static const uint16 page033data[]= { /* 3300 (9 weights per char) */ 0x1E52,0x1E6B,0x0E0B,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000, 0x1E52,0x1E7A,0x1E6D,0x1E52,0x0000,0x0000,0x0000,0x0000,0x0000, 0x1E52,0x1E81,0x1E6E,0x1E52,0x0000,0x0000,0x0000,0x0000,0x0000, @@ -5163,7 +5167,7 @@ uint16 page033data[]= { /* 3300 (9 weights per char) */ 0x0EC1,0x0E33,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 }; -uint16 page04Ddata[]= { /* 4D00 (3 weights per char) */ +static const uint16 page04Ddata[]= { /* 4D00 (3 weights per char) */ 0xFB80,0xCD00,0x0000, 0xFB80,0xCD01,0x0000, 0xFB80,0xCD02,0x0000, 0xFB80,0xCD03,0x0000, 0xFB80,0xCD04,0x0000, 0xFB80,0xCD05,0x0000, 0xFB80,0xCD06,0x0000, 0xFB80,0xCD07,0x0000, 0xFB80,0xCD08,0x0000, @@ -5251,7 +5255,7 @@ uint16 page04Ddata[]= { /* 4D00 (3 weights per char) */ 0x0B73,0x0000,0x0000, 0x0B74,0x0000,0x0000, 0x0B75,0x0000,0x0000, 0x0B76,0x0000,0x0000 }; -uint16 page0A0data[]= { /* A000 (2 weights per char) */ +static const uint16 page0A0data[]= { /* A000 (2 weights per char) */ 0x1EB1,0x0000, 0x1EB2,0x0000, 0x1EB3,0x0000, 0x1EB4,0x0000, 0x1EB5,0x0000, 0x1EB6,0x0000, 0x1EB7,0x0000, 0x1EB8,0x0000, 0x1EB9,0x0000, 0x1EBA,0x0000, 0x1EBB,0x0000, 0x1EBC,0x0000, @@ -5318,7 +5322,7 @@ uint16 page0A0data[]= { /* A000 (2 weights per char) */ 0x1FAD,0x0000, 0x1FAE,0x0000, 0x1FAF,0x0000, 0x1FB0,0x0000 }; -uint16 page0A1data[]= { /* A100 (2 weights per char) */ +static const uint16 page0A1data[]= { /* A100 (2 weights per char) */ 0x1FB1,0x0000, 0x1FB2,0x0000, 0x1FB3,0x0000, 0x1FB4,0x0000, 0x1FB5,0x0000, 0x1FB6,0x0000, 0x1FB7,0x0000, 0x1FB8,0x0000, 0x1FB9,0x0000, 0x1FBA,0x0000, 0x1FBB,0x0000, 0x1FBC,0x0000, @@ -5385,7 +5389,7 @@ uint16 page0A1data[]= { /* A100 (2 weights per char) */ 0x20AD,0x0000, 0x20AE,0x0000, 0x20AF,0x0000, 0x20B0,0x0000 }; -uint16 page0A2data[]= { /* A200 (2 weights per char) */ +static const uint16 page0A2data[]= { /* A200 (2 weights per char) */ 0x20B1,0x0000, 0x20B2,0x0000, 0x20B3,0x0000, 0x20B4,0x0000, 0x20B5,0x0000, 0x20B6,0x0000, 0x20B7,0x0000, 0x20B8,0x0000, 0x20B9,0x0000, 0x20BA,0x0000, 0x20BB,0x0000, 0x20BC,0x0000, @@ -5452,7 +5456,7 @@ uint16 page0A2data[]= { /* A200 (2 weights per char) */ 0x21AD,0x0000, 0x21AE,0x0000, 0x21AF,0x0000, 0x21B0,0x0000 }; -uint16 page0A3data[]= { /* A300 (2 weights per char) */ +static const uint16 page0A3data[]= { /* A300 (2 weights per char) */ 0x21B1,0x0000, 0x21B2,0x0000, 0x21B3,0x0000, 0x21B4,0x0000, 0x21B5,0x0000, 0x21B6,0x0000, 0x21B7,0x0000, 0x21B8,0x0000, 0x21B9,0x0000, 0x21BA,0x0000, 0x21BB,0x0000, 0x21BC,0x0000, @@ -5519,7 +5523,7 @@ uint16 page0A3data[]= { /* A300 (2 weights per char) */ 0x22AD,0x0000, 0x22AE,0x0000, 0x22AF,0x0000, 0x22B0,0x0000 }; -uint16 page0A4data[]= { /* A400 (3 weights per char) */ +static const uint16 page0A4data[]= { /* A400 (3 weights per char) */ 0x22B1,0x0000,0x0000, 0x22B2,0x0000,0x0000, 0x22B3,0x0000,0x0000, 0x22B4,0x0000,0x0000, 0x22B5,0x0000,0x0000, 0x22B6,0x0000,0x0000, 0x22B7,0x0000,0x0000, 0x22B8,0x0000,0x0000, 0x22B9,0x0000,0x0000, @@ -5607,7 +5611,7 @@ uint16 page0A4data[]= { /* A400 (3 weights per char) */ 0xFBC1,0xA4FC,0x0000, 0xFBC1,0xA4FD,0x0000, 0xFBC1,0xA4FE,0x0000, 0xFBC1,0xA4FF,0x0000 }; -uint16 page0F9data[]= { /* F900 (3 weights per char) */ +static const uint16 page0F9data[]= { /* F900 (3 weights per char) */ 0xFB41,0x8C48,0x0000, 0xFB40,0xE6F4,0x0000, 0xFB41,0x8ECA,0x0000, 0xFB41,0x8CC8,0x0000, 0xFB40,0xEED1,0x0000, 0xFB40,0xCE32,0x0000, 0xFB40,0xD3E5,0x0000, 0xFB41,0x9F9C,0x0000, 0xFB41,0x9F9C,0x0000, @@ -5695,7 +5699,7 @@ uint16 page0F9data[]= { /* F900 (3 weights per char) */ 0xFB41,0x8B58,0x0000, 0xFB40,0xCEC0,0x0000, 0xFB41,0x8336,0x0000, 0xFB40,0xD23A,0x0000 }; -uint16 page0FAdata[]= { /* FA00 (3 weights per char) */ +static const uint16 page0FAdata[]= { /* FA00 (3 weights per char) */ 0xFB40,0xD207,0x0000, 0xFB40,0xDEA6,0x0000, 0xFB40,0xE2D3,0x0000, 0xFB40,0xFCD6,0x0000, 0xFB40,0xDB85,0x0000, 0xFB40,0xED1E,0x0000, 0xFB40,0xE6B4,0x0000, 0xFB41,0x8F3B,0x0000, 0xFB41,0x884C,0x0000, @@ -5783,7 +5787,7 @@ uint16 page0FAdata[]= { /* FA00 (3 weights per char) */ 0xFBC1,0xFAFC,0x0000, 0xFBC1,0xFAFD,0x0000, 0xFBC1,0xFAFE,0x0000, 0xFBC1,0xFAFF,0x0000 }; -uint16 page0FBdata[]= { /* FB00 (4 weights per char) */ +static const uint16 page0FBdata[]= { /* FB00 (4 weights per char) */ 0x0EB9,0x0EB9,0x0000,0x0000, 0x0EB9,0x0EFB,0x0000,0x0000, 0x0EB9,0x0F2E,0x0000,0x0000, 0x0EB9,0x0EB9,0x0EFB,0x0000, 0x0EB9,0x0EB9,0x0F2E,0x0000, 0x0FEA,0x1002,0x0000,0x0000, @@ -5914,7 +5918,7 @@ uint16 page0FBdata[]= { /* FB00 (4 weights per char) */ 0x13C9,0x0000,0x0000,0x0000, 0x13C9,0x0000,0x0000,0x0000 }; -uint16 page0FCdata[]= { /* FC00 (3 weights per char) */ +static const uint16 page0FCdata[]= { /* FC00 (3 weights per char) */ 0x134F,0x135E,0x0000, 0x134F,0x1364,0x0000, 0x134F,0x13B0,0x0000, 0x134F,0x13C7,0x0000, 0x134F,0x13C8,0x0000, 0x1352,0x135E,0x0000, 0x1352,0x1364,0x0000, 0x1352,0x1365,0x0000, 0x1352,0x13B0,0x0000, @@ -6002,7 +6006,7 @@ uint16 page0FCdata[]= { /* FC00 (3 weights per char) */ 0x1381,0x13C8,0x0000, 0x1382,0x13C7,0x0000, 0x1382,0x13C8,0x0000, 0x1364,0x13C7,0x0000 }; -uint16 page0FDdata[]= { /* FD00 (9 weights per char) */ +static const uint16 page0FDdata[]= { /* FD00 (9 weights per char) */ 0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x135E,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, @@ -6261,7 +6265,7 @@ uint16 page0FDdata[]= { /* FD00 (9 weights per char) */ 0xFBC1,0xFDFF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 }; -uint16 page0FEdata[]= { /* FE00 (3 weights per char) */ +static const uint16 page0FEdata[]= { /* FE00 (3 weights per char) */ 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, @@ -6349,7 +6353,7 @@ uint16 page0FEdata[]= { /* FE00 (3 weights per char) */ 0x13AB,0x1350,0x0000, 0xFBC1,0xFEFD,0x0000, 0xFBC1,0xFEFE,0x0000, 0x0000,0x0000,0x0000 }; -uint16 page0FFdata[]= { /* FF00 (3 weights per char) */ +static const uint16 page0FFdata[]= { /* FF00 (3 weights per char) */ 0xFBC1,0xFF00,0x0000, 0x0251,0x0000,0x0000, 0x027E,0x0000,0x0000, 0x02D2,0x0000,0x0000, 0x0E0F,0x0000,0x0000, 0x02D3,0x0000,0x0000, 0x02CF,0x0000,0x0000, 0x0277,0x0000,0x0000, 0x0288,0x0000,0x0000, @@ -6437,7 +6441,7 @@ uint16 page0FFdata[]= { /* FF00 (3 weights per char) */ 0x0DC5,0x0000,0x0000, 0x0DC6,0x0000,0x0000, 0xFBC1,0xFFFE,0x0000, 0xFBC1,0xFFFF,0x0000 }; -uchar uca_length[256]={ +static const uchar uca_length[256]={ 4,3,3,4,3,3,3,3,0,3,3,3,3,3,3,3, 3,3,3,3,3,2,3,3,3,3,0,0,0,3,3,3, 5,5,4,3,5,2,3,3,2,2,5,3,0,0,3,3, @@ -6455,7 +6459,7 @@ uchar uca_length[256]={ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,3,3,4,3,9,3,3 }; -uint16 *uca_weight[256]={ +static const uint16 *const uca_weight[256]={ page000data,page001data,page002data,page003data, page004data,page005data,page006data,page007data, NULL ,page009data,page00Adata,page00Bdata, @@ -6742,6 +6746,16 @@ static const char sinhala[]= #endif +static const char croatian[]= + +"&C < \\u010D <<< \\u010C < \\u0107 <<< \\u0106 " +"&D < d\\u017E <<< \\u01C6 <<< D\\u017E <<< \\u01C5 <<< D\\u017D <<< \\u01C4 " +" < \\u0111 <<< \\u0110 " +"&L < lj <<< \\u01C9 <<< Lj <<< \\u01C8 <<< LJ <<< \\u01C7 " +"&N < nj <<< \\u01CC <<< Nj <<< \\u01CB <<< NJ <<< \\u01CA " +"&S < \\u0161 <<< \\u0160 " +"&Z < \\u017E <<< \\u017D"; + /* Unicode Collation Algorithm: Collation element (weight) scanner, @@ -6753,9 +6767,9 @@ typedef struct my_uca_scanner_st const uint16 *wbeg; /* Beginning of the current weight string */ const uchar *sbeg; /* Beginning of the input string */ const uchar *send; /* End of the input string */ - uchar *uca_length; - uint16 **uca_weight; - uint16 *contractions; + const uchar *uca_length; + const uint16 * const *uca_weight; + const MY_CONTRACTIONS *contractions; uint16 implicit[2]; int page; int code; @@ -6773,7 +6787,80 @@ typedef struct my_uca_scanner_handler_st int (*next)(my_uca_scanner *scanner); } my_uca_scanner_handler; -static uint16 nochar[]= {0,0}; +static const uint16 nochar[]= {0,0}; + +/********** Helper functions to handle contraction ************/ + + +/** + Mark a character as a contraction part + + @cs Pointer to CHARSET_INFO data + @wc Unicode code point + @flag flag: "is contraction head", "is contraction tail" +*/ + +static void +my_uca_add_contraction_flag(CHARSET_INFO *cs, my_wc_t wc, int flag) +{ + cs->contractions->flags[wc & MY_UCA_CNT_FLAG_MASK]|= flag; +} + + +/** + Add a new contraction into contraction list + + @cs Pointer to CHARSET_INFO data + @wc Unicode code points of the characters + @len Number of characters + + @return New contraction + @retval Pointer to a newly added contraction +*/ + +static MY_CONTRACTION * +my_uca_add_contraction(struct charset_info_st *cs, + my_wc_t *wc, int len __attribute__((unused))) +{ + MY_CONTRACTIONS *list= (MY_CONTRACTIONS*) cs->contractions; + MY_CONTRACTION *next= &list->item[list->nitems]; + DBUG_ASSERT(len == 2); /* We currently support only contraction2 */ + next->ch[0]= wc[0]; + next->ch[1]= wc[1]; + list->nitems++; + return next; +} + + +/** + Allocate and initialize memory for contraction list and flags + + @cs Pointer to CHARSET_INFO data + @alloc Memory allocation function (typically points to my_alloc_once) + @n Number of contractions + + @return Error code + @retval 0 - memory allocated successfully + @retval 1 - not enough memory +*/ + +static my_bool +my_uca_alloc_contractions(struct charset_info_st *cs, + void *(*alloc)(size_t), size_t n) +{ + uint size= n * sizeof(MY_CONTRACTION); + MY_CONTRACTIONS *contractions; + + if (!(cs->contractions= contractions= (*alloc)(sizeof(MY_CONTRACTIONS)))) + return 1; + bzero(contractions, sizeof(MY_CONTRACTIONS)); + if (!(contractions->item= (*alloc)(size)) || + !(contractions->flags= (char*) (*alloc)(MY_UCA_CNT_FLAG_SIZE))) + return 1; + bzero(contractions->item, size); + bzero(contractions->flags, MY_UCA_CNT_FLAG_SIZE); + return 0; +} #ifdef HAVE_CHARSET_ucs2 @@ -6795,7 +6882,7 @@ static uint16 nochar[]= {0,0}; */ static void my_uca_scanner_init_ucs2(my_uca_scanner *scanner, - CHARSET_INFO *cs __attribute__((unused)), + CHARSET_INFO *cs, const uchar *str, size_t length) { scanner->wbeg= nochar; @@ -6806,6 +6893,7 @@ static void my_uca_scanner_init_ucs2(my_uca_scanner *scanner, scanner->uca_length= cs->sort_order; scanner->uca_weight= cs->sort_order_big; scanner->contractions= cs->contractions; + scanner->cs= cs; return; } @@ -6882,8 +6970,8 @@ static int my_uca_scanner_next_ucs2(my_uca_scanner *scanner) do { - uint16 **ucaw= scanner->uca_weight; - uchar *ucal= scanner->uca_length; + const uint16 *const *ucaw= scanner->uca_weight; + const uchar *ucal= scanner->uca_length; if (scanner->sbeg > scanner->send) return -1; @@ -6894,18 +6982,23 @@ static int my_uca_scanner_next_ucs2(my_uca_scanner *scanner) if (scanner->contractions && (scanner->sbeg <= scanner->send)) { - int cweight; + my_wc_t wc1= ((scanner->page << 8) | scanner->code); - if (!scanner->page && !scanner->sbeg[0] && - (scanner->sbeg[1] > 0x40) && (scanner->sbeg[1] < 0x80) && - (scanner->code > 0x40) && (scanner->code < 0x80) && - (cweight= scanner->contractions[(scanner->code-0x40)*0x40+scanner->sbeg[1]-0x40])) + if (my_cs_can_be_contraction_head(scanner->cs, wc1)) + { + const uint16 *cweight; + my_wc_t wc2= (((my_wc_t) scanner->sbeg[0]) << 8) | scanner->sbeg[1]; + if (my_cs_can_be_contraction_tail(scanner->cs, wc2) && + (cweight= my_cs_contraction2_weight(scanner->cs, + scanner->code, + scanner->sbeg[1]))) { scanner->implicit[0]= 0; scanner->wbeg= scanner->implicit; scanner->sbeg+=2; - return cweight; + return *cweight; } + } } if (!ucaw[scanner->page]) @@ -6940,7 +7033,7 @@ static my_uca_scanner_handler my_ucs2_uca_scanner_handler= my_uca_scanner_next_ucs2 }; -#endif +#endif /* HAVE_CHARSET_ucs2 */ /* @@ -6974,8 +7067,8 @@ static int my_uca_scanner_next_any(my_uca_scanner *scanner) do { - uint16 **ucaw= scanner->uca_weight; - uchar *ucal= scanner->uca_length; + const uint16 *const *ucaw= scanner->uca_weight; + const uchar *ucal= scanner->uca_length; my_wc_t wc; int mb_len; @@ -6997,23 +7090,22 @@ static int my_uca_scanner_next_any(my_uca_scanner *scanner) scanner->code= wc & 0xFF; } - if (scanner->contractions && !scanner->page && - (scanner->code > 0x40) && (scanner->code < 0x80)) + if (my_cs_have_contractions(scanner->cs) && + my_cs_can_be_contraction_head(scanner->cs, wc)) { - uint page1, code1, cweight; + my_wc_t wc2; + const uint16 *cweight; - if (((mb_len= scanner->cs->cset->mb_wc(scanner->cs, &wc, + if (((mb_len= scanner->cs->cset->mb_wc(scanner->cs, &wc2, scanner->sbeg, scanner->send)) >=0) && - (!(page1= (wc >> 8))) && - ((code1= (wc & 0xFF)) > 0x40) && - (code1 < 0x80) && - (cweight= scanner->contractions[(scanner->code-0x40)*0x40 + code1-0x40])) + my_cs_can_be_contraction_tail(scanner->cs, wc2) && + (cweight= my_cs_contraction2_weight(scanner->cs, wc, wc2))) { scanner->implicit[0]= 0; scanner->wbeg= scanner->implicit; scanner->sbeg+= mb_len; - return cweight; + return *cweight; } } @@ -7050,6 +7142,7 @@ static my_uca_scanner_handler my_any_uca_scanner_handler= my_uca_scanner_next_any }; + /* Compares two strings according to the collation @@ -7336,12 +7429,12 @@ static size_t my_strnxfrm_uca(CHARSET_INFO *cs, or NULL if this page does not have implicit weights. */ -static inline uint16 * +static inline const uint16 * my_char_weight_addr(CHARSET_INFO *cs, uint wc) { uint page, ofst; - uchar *ucal= cs->sort_order; - uint16 **ucaw= cs->sort_order_big; + const uchar *ucal= cs->sort_order; + const uint16 * const *ucaw= cs->sort_order_big; return wc > MAX_UCA_CHAR_WITH_EXPLICIT_WEIGHT ? NULL : (ucaw[page= (wc >> 8)] ? @@ -7361,8 +7454,8 @@ my_char_weight_addr(CHARSET_INFO *cs, uint wc) static int my_uca_charcmp(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2) { size_t length1, length2; - uint16 *weight1= my_char_weight_addr(cs, wc1); - uint16 *weight2= my_char_weight_addr(cs, wc2); + const uint16 *weight1= my_char_weight_addr(cs, wc1); + const uint16 *weight2= my_char_weight_addr(cs, wc2); if (!weight1 || !weight2) return wc1 != wc2; @@ -7402,10 +7495,8 @@ int my_wildcmp_uca_impl(CHARSET_INFO *cs, int result= -1; /* Not found, using wildcards */ my_wc_t s_wc, w_wc; int scan; - int (*mb_wc)(struct charset_info_st *, my_wc_t *, - const uchar *, const uchar *); - mb_wc= cs->cset->mb_wc; - + my_charset_conv_mb_wc mb_wc= cs->cset->mb_wc; + if (my_string_stack_guard && my_string_stack_guard(recurse_level)) return 1; while (wildstr != wildend) @@ -7770,8 +7861,8 @@ ex: typedef struct my_coll_rule_item_st { - uint base; /* Base character */ - uint curr[2]; /* Current character */ + my_wc_t base; /* Base character */ + my_wc_t curr[2]; /* Current character */ int diff[3]; /* Primary, Secondary and Tertiary difference */ } MY_COLL_RULE; @@ -7922,14 +8013,16 @@ static int my_coll_rule_parse(MY_COLL_RULE *rule, size_t mitems, default weights. */ -static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(size_t)) +static my_bool create_tailoring(struct charset_info_st *cs, + void *(*alloc)(size_t)) { MY_COLL_RULE rule[MY_MAX_COLL_RULE]; + MY_COLL_RULE *r, *rfirst, *rlast; char errstr[128]; uchar *newlengths; uint16 **newweights; const uchar *deflengths= uca_length; - uint16 **defweights= uca_weight; + const uint16 *const *defweights= uca_weight; int rc, i; int ncontractions= 0; @@ -7949,6 +8042,9 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(size_t)) return 1; } + rfirst= rule; + rlast= rule + rc; + if (!cs->caseinfo) cs->caseinfo= my_unicase_default; @@ -8027,54 +8123,31 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(size_t)) for (i= 0; i < 256 ; i++) { if (!newweights[i]) - newweights[i]= defweights[i]; + ((const uint16**) newweights)[i]= defweights[i]; } cs->sort_order= newlengths; - cs->sort_order_big= newweights; + cs->sort_order_big= (const uint16**) newweights; cs->contractions= NULL; /* Now process contractions */ if (ncontractions) { - /* - 8K for weights for basic latin letter pairs, - plus 256 bytes for "is contraction part" flags. - */ - uint size= 0x40*0x40*sizeof(uint16) + 256; - char *contraction_flags; - if (!(cs->contractions= (uint16*) (*alloc)(size))) - return 1; - bzero((void*)cs->contractions, size); - contraction_flags= ((char*) cs->contractions) + 0x40*0x40; - for (i=0; i < rc; i++) + if (my_uca_alloc_contractions(cs, alloc, ncontractions)) + return 1; + for (r= rfirst; r < rlast; r++) { - if (rule[i].curr[1]) + uint16 *to; + if (r->curr[1]) /* Contraction */ { - uint pageb= (rule[i].base >> 8) & 0xFF; - uint chb= rule[i].base & 0xFF; - uint16 *offsb= defweights[pageb] + chb*deflengths[pageb]; - uint offsc; - - if (offsb[1] || - rule[i].curr[0] < 0x40 || rule[i].curr[0] > 0x7f || - rule[i].curr[1] < 0x40 || rule[i].curr[1] > 0x7f) - { - /* - TODO: add error reporting; - We support only basic latin letters contractions at this point. - Also, We don't support contractions with weight longer than one. - Otherwise, we'd need much more memory. - */ - return 1; - } - offsc= (rule[i].curr[0]-0x40)*0x40+(rule[i].curr[1]-0x40); - - /* Copy base weight applying primary difference */ - cs->contractions[offsc]= offsb[0] + rule[i].diff[0]; - /* Mark both letters as "is contraction part */ - contraction_flags[rule[i].curr[0]]= 1; - contraction_flags[rule[i].curr[1]]= 1; + /* Mark both letters as "is contraction part" */ + my_uca_add_contraction_flag(cs, r->curr[0], MY_UCA_CNT_HEAD); + my_uca_add_contraction_flag(cs, r->curr[1], MY_UCA_CNT_TAIL); + to= my_uca_add_contraction(cs, r->curr, 2)->weight; + /* Copy weight from the reset character */ + to[0]= my_char_weight_addr(cs, r->base)[0]; + /* Apply primary difference */ + to[0]+= r->diff[0]; } } } @@ -8088,7 +8161,8 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(size_t)) Should work for any character set. */ -static my_bool my_coll_init_uca(CHARSET_INFO *cs, void *(*alloc)(size_t)) +static my_bool my_coll_init_uca(struct charset_info_st *cs, + void *(*alloc)(size_t)) { cs->pad_char= ' '; cs->ctype= my_charset_utf8_unicode_ci.ctype; @@ -8183,7 +8257,7 @@ MY_COLLATION_HANDLER my_collation_ucs2_uca_handler = my_propagate_complex }; -CHARSET_INFO my_charset_ucs2_unicode_ci= +struct charset_info_st my_charset_ucs2_unicode_ci= { 128,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -8215,7 +8289,7 @@ CHARSET_INFO my_charset_ucs2_unicode_ci= &my_collation_ucs2_uca_handler }; -CHARSET_INFO my_charset_ucs2_icelandic_uca_ci= +struct charset_info_st my_charset_ucs2_icelandic_uca_ci= { 129,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -8247,7 +8321,7 @@ CHARSET_INFO my_charset_ucs2_icelandic_uca_ci= &my_collation_ucs2_uca_handler }; -CHARSET_INFO my_charset_ucs2_latvian_uca_ci= +struct charset_info_st my_charset_ucs2_latvian_uca_ci= { 130,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -8279,7 +8353,7 @@ CHARSET_INFO my_charset_ucs2_latvian_uca_ci= &my_collation_ucs2_uca_handler }; -CHARSET_INFO my_charset_ucs2_romanian_uca_ci= +struct charset_info_st my_charset_ucs2_romanian_uca_ci= { 131,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -8311,7 +8385,7 @@ CHARSET_INFO my_charset_ucs2_romanian_uca_ci= &my_collation_ucs2_uca_handler }; -CHARSET_INFO my_charset_ucs2_slovenian_uca_ci= +struct charset_info_st my_charset_ucs2_slovenian_uca_ci= { 132,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -8343,7 +8417,7 @@ CHARSET_INFO my_charset_ucs2_slovenian_uca_ci= &my_collation_ucs2_uca_handler }; -CHARSET_INFO my_charset_ucs2_polish_uca_ci= +struct charset_info_st my_charset_ucs2_polish_uca_ci= { 133,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -8375,7 +8449,7 @@ CHARSET_INFO my_charset_ucs2_polish_uca_ci= &my_collation_ucs2_uca_handler }; -CHARSET_INFO my_charset_ucs2_estonian_uca_ci= +struct charset_info_st my_charset_ucs2_estonian_uca_ci= { 134,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -8407,7 +8481,7 @@ CHARSET_INFO my_charset_ucs2_estonian_uca_ci= &my_collation_ucs2_uca_handler }; -CHARSET_INFO my_charset_ucs2_spanish_uca_ci= +struct charset_info_st my_charset_ucs2_spanish_uca_ci= { 135,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -8439,7 +8513,7 @@ CHARSET_INFO my_charset_ucs2_spanish_uca_ci= &my_collation_ucs2_uca_handler }; -CHARSET_INFO my_charset_ucs2_swedish_uca_ci= +struct charset_info_st my_charset_ucs2_swedish_uca_ci= { 136,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -8471,7 +8545,7 @@ CHARSET_INFO my_charset_ucs2_swedish_uca_ci= &my_collation_ucs2_uca_handler }; -CHARSET_INFO my_charset_ucs2_turkish_uca_ci= +struct charset_info_st my_charset_ucs2_turkish_uca_ci= { 137,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -8503,7 +8577,7 @@ CHARSET_INFO my_charset_ucs2_turkish_uca_ci= &my_collation_ucs2_uca_handler }; -CHARSET_INFO my_charset_ucs2_czech_uca_ci= +struct charset_info_st my_charset_ucs2_czech_uca_ci= { 138,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -8536,7 +8610,7 @@ CHARSET_INFO my_charset_ucs2_czech_uca_ci= }; -CHARSET_INFO my_charset_ucs2_danish_uca_ci= +struct charset_info_st my_charset_ucs2_danish_uca_ci= { 139,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -8568,7 +8642,7 @@ CHARSET_INFO my_charset_ucs2_danish_uca_ci= &my_collation_ucs2_uca_handler }; -CHARSET_INFO my_charset_ucs2_lithuanian_uca_ci= +struct charset_info_st my_charset_ucs2_lithuanian_uca_ci= { 140,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -8600,7 +8674,7 @@ CHARSET_INFO my_charset_ucs2_lithuanian_uca_ci= &my_collation_ucs2_uca_handler }; -CHARSET_INFO my_charset_ucs2_slovak_uca_ci= +struct charset_info_st my_charset_ucs2_slovak_uca_ci= { 141,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -8632,7 +8706,7 @@ CHARSET_INFO my_charset_ucs2_slovak_uca_ci= &my_collation_ucs2_uca_handler }; -CHARSET_INFO my_charset_ucs2_spanish2_uca_ci= +struct charset_info_st my_charset_ucs2_spanish2_uca_ci= { 142,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -8665,7 +8739,7 @@ CHARSET_INFO my_charset_ucs2_spanish2_uca_ci= }; -CHARSET_INFO my_charset_ucs2_roman_uca_ci= +struct charset_info_st my_charset_ucs2_roman_uca_ci= { 143,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -8698,7 +8772,7 @@ CHARSET_INFO my_charset_ucs2_roman_uca_ci= }; -CHARSET_INFO my_charset_ucs2_persian_uca_ci= +struct charset_info_st my_charset_ucs2_persian_uca_ci= { 144,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -8731,7 +8805,7 @@ CHARSET_INFO my_charset_ucs2_persian_uca_ci= }; -CHARSET_INFO my_charset_ucs2_esperanto_uca_ci= +struct charset_info_st my_charset_ucs2_esperanto_uca_ci= { 145,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -8764,7 +8838,7 @@ CHARSET_INFO my_charset_ucs2_esperanto_uca_ci= }; -CHARSET_INFO my_charset_ucs2_hungarian_uca_ci= +struct charset_info_st my_charset_ucs2_hungarian_uca_ci= { 146,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -8796,11 +8870,10 @@ CHARSET_INFO my_charset_ucs2_hungarian_uca_ci= &my_collation_ucs2_uca_handler }; - -CHARSET_INFO my_charset_ucs2_sinhala_uca_ci= +struct charset_info_st my_charset_ucs2_sinhala_uca_ci= { 147,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* csname */ "ucs2_sinhala_ci", /* name */ "", /* comment */ @@ -8829,6 +8902,37 @@ CHARSET_INFO my_charset_ucs2_sinhala_uca_ci= &my_collation_ucs2_uca_handler }; +struct charset_info_st my_charset_ucs2_croatian_uca_ci= +{ + 149,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + "ucs2", /* cs name */ + "ucs2_croatian_ci", /* name */ + "", /* comment */ + croatian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; #endif @@ -8879,7 +8983,7 @@ extern MY_CHARSET_HANDLER my_charset_utf8_handler; #define MY_CS_UTF8MB3_UCA_FLAGS (MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE) -CHARSET_INFO my_charset_utf8_unicode_ci= +struct charset_info_st my_charset_utf8_unicode_ci= { 192,0,0, /* number */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ @@ -8912,10 +9016,10 @@ CHARSET_INFO my_charset_utf8_unicode_ci= }; -CHARSET_INFO my_charset_utf8_icelandic_uca_ci= +struct charset_info_st my_charset_utf8_icelandic_uca_ci= { 193,0,0, /* number */ - MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_icelandic_ci",/* name */ "", /* comment */ @@ -8944,7 +9048,7 @@ CHARSET_INFO my_charset_utf8_icelandic_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8_latvian_uca_ci= +struct charset_info_st my_charset_utf8_latvian_uca_ci= { 194,0,0, /* number */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ @@ -8976,7 +9080,7 @@ CHARSET_INFO my_charset_utf8_latvian_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8_romanian_uca_ci= +struct charset_info_st my_charset_utf8_romanian_uca_ci= { 195,0,0, /* number */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ @@ -9008,7 +9112,7 @@ CHARSET_INFO my_charset_utf8_romanian_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8_slovenian_uca_ci= +struct charset_info_st my_charset_utf8_slovenian_uca_ci= { 196,0,0, /* number */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ @@ -9040,7 +9144,7 @@ CHARSET_INFO my_charset_utf8_slovenian_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8_polish_uca_ci= +struct charset_info_st my_charset_utf8_polish_uca_ci= { 197,0,0, /* number */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ @@ -9072,7 +9176,7 @@ CHARSET_INFO my_charset_utf8_polish_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8_estonian_uca_ci= +struct charset_info_st my_charset_utf8_estonian_uca_ci= { 198,0,0, /* number */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ @@ -9104,7 +9208,7 @@ CHARSET_INFO my_charset_utf8_estonian_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8_spanish_uca_ci= +struct charset_info_st my_charset_utf8_spanish_uca_ci= { 199,0,0, /* number */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ @@ -9136,7 +9240,7 @@ CHARSET_INFO my_charset_utf8_spanish_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8_swedish_uca_ci= +struct charset_info_st my_charset_utf8_swedish_uca_ci= { 200,0,0, /* number */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ @@ -9168,7 +9272,7 @@ CHARSET_INFO my_charset_utf8_swedish_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8_turkish_uca_ci= +struct charset_info_st my_charset_utf8_turkish_uca_ci= { 201,0,0, /* number */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ @@ -9200,7 +9304,7 @@ CHARSET_INFO my_charset_utf8_turkish_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8_czech_uca_ci= +struct charset_info_st my_charset_utf8_czech_uca_ci= { 202,0,0, /* number */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ @@ -9233,7 +9337,7 @@ CHARSET_INFO my_charset_utf8_czech_uca_ci= }; -CHARSET_INFO my_charset_utf8_danish_uca_ci= +struct charset_info_st my_charset_utf8_danish_uca_ci= { 203,0,0, /* number */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ @@ -9265,7 +9369,7 @@ CHARSET_INFO my_charset_utf8_danish_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8_lithuanian_uca_ci= +struct charset_info_st my_charset_utf8_lithuanian_uca_ci= { 204,0,0, /* number */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ @@ -9297,7 +9401,7 @@ CHARSET_INFO my_charset_utf8_lithuanian_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8_slovak_uca_ci= +struct charset_info_st my_charset_utf8_slovak_uca_ci= { 205,0,0, /* number */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ @@ -9329,7 +9433,7 @@ CHARSET_INFO my_charset_utf8_slovak_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8_spanish2_uca_ci= +struct charset_info_st my_charset_utf8_spanish2_uca_ci= { 206,0,0, /* number */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ @@ -9361,7 +9465,7 @@ CHARSET_INFO my_charset_utf8_spanish2_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8_roman_uca_ci= +struct charset_info_st my_charset_utf8_roman_uca_ci= { 207,0,0, /* number */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ @@ -9393,7 +9497,7 @@ CHARSET_INFO my_charset_utf8_roman_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8_persian_uca_ci= +struct charset_info_st my_charset_utf8_persian_uca_ci= { 208,0,0, /* number */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ @@ -9425,7 +9529,7 @@ CHARSET_INFO my_charset_utf8_persian_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8_esperanto_uca_ci= +struct charset_info_st my_charset_utf8_esperanto_uca_ci= { 209,0,0, /* number */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ @@ -9457,7 +9561,7 @@ CHARSET_INFO my_charset_utf8_esperanto_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8_hungarian_uca_ci= +struct charset_info_st my_charset_utf8_hungarian_uca_ci= { 210,0,0, /* number */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ @@ -9489,7 +9593,7 @@ CHARSET_INFO my_charset_utf8_hungarian_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8_sinhala_uca_ci= +struct charset_info_st my_charset_utf8_sinhala_uca_ci= { 211,0,0, /* number */ MY_CS_UTF8MB3_UCA_FLAGS,/* flags */ @@ -9521,6 +9625,38 @@ CHARSET_INFO my_charset_utf8_sinhala_uca_ci= &my_collation_any_uca_handler }; +struct charset_info_st my_charset_utf8_croatian_uca_ci= +{ + 213,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "utf8", /* cs name */ + "utf8_croatian_ci", /* name */ + "", /* comment */ + croatian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + &my_charset_utf8_handler, + &my_collation_any_uca_handler +}; + #endif /* HAVE_CHARSET_utf8 */ @@ -9530,7 +9666,7 @@ extern MY_CHARSET_HANDLER my_charset_utf8mb4_handler; #define MY_CS_UTF8MB4_UCA_FLAGS (MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_UNICODE_SUPPLEMENT) -CHARSET_INFO my_charset_utf8mb4_unicode_ci= +struct charset_info_st my_charset_utf8mb4_unicode_ci= { 224,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -9563,7 +9699,7 @@ CHARSET_INFO my_charset_utf8mb4_unicode_ci= }; -CHARSET_INFO my_charset_utf8mb4_icelandic_uca_ci= +struct charset_info_st my_charset_utf8mb4_icelandic_uca_ci= { 225,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -9595,7 +9731,7 @@ CHARSET_INFO my_charset_utf8mb4_icelandic_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8mb4_latvian_uca_ci= +struct charset_info_st my_charset_utf8mb4_latvian_uca_ci= { 226,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -9627,7 +9763,7 @@ CHARSET_INFO my_charset_utf8mb4_latvian_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8mb4_romanian_uca_ci= +struct charset_info_st my_charset_utf8mb4_romanian_uca_ci= { 227,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -9659,7 +9795,7 @@ CHARSET_INFO my_charset_utf8mb4_romanian_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8mb4_slovenian_uca_ci= +struct charset_info_st my_charset_utf8mb4_slovenian_uca_ci= { 228,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -9691,7 +9827,7 @@ CHARSET_INFO my_charset_utf8mb4_slovenian_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8mb4_polish_uca_ci= +struct charset_info_st my_charset_utf8mb4_polish_uca_ci= { 229,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -9723,7 +9859,7 @@ CHARSET_INFO my_charset_utf8mb4_polish_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8mb4_estonian_uca_ci= +struct charset_info_st my_charset_utf8mb4_estonian_uca_ci= { 230,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -9755,7 +9891,7 @@ CHARSET_INFO my_charset_utf8mb4_estonian_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8mb4_spanish_uca_ci= +struct charset_info_st my_charset_utf8mb4_spanish_uca_ci= { 231,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -9787,7 +9923,7 @@ CHARSET_INFO my_charset_utf8mb4_spanish_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8mb4_swedish_uca_ci= +struct charset_info_st my_charset_utf8mb4_swedish_uca_ci= { 232,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -9819,7 +9955,7 @@ CHARSET_INFO my_charset_utf8mb4_swedish_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8mb4_turkish_uca_ci= +struct charset_info_st my_charset_utf8mb4_turkish_uca_ci= { 233,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -9851,7 +9987,7 @@ CHARSET_INFO my_charset_utf8mb4_turkish_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8mb4_czech_uca_ci= +struct charset_info_st my_charset_utf8mb4_czech_uca_ci= { 234,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -9884,7 +10020,7 @@ CHARSET_INFO my_charset_utf8mb4_czech_uca_ci= }; -CHARSET_INFO my_charset_utf8mb4_danish_uca_ci= +struct charset_info_st my_charset_utf8mb4_danish_uca_ci= { 235,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -9916,7 +10052,7 @@ CHARSET_INFO my_charset_utf8mb4_danish_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8mb4_lithuanian_uca_ci= +struct charset_info_st my_charset_utf8mb4_lithuanian_uca_ci= { 236,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -9948,7 +10084,7 @@ CHARSET_INFO my_charset_utf8mb4_lithuanian_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8mb4_slovak_uca_ci= +struct charset_info_st my_charset_utf8mb4_slovak_uca_ci= { 237,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -9980,7 +10116,7 @@ CHARSET_INFO my_charset_utf8mb4_slovak_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8mb4_spanish2_uca_ci= +struct charset_info_st my_charset_utf8mb4_spanish2_uca_ci= { 238,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -10012,7 +10148,7 @@ CHARSET_INFO my_charset_utf8mb4_spanish2_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8mb4_roman_uca_ci= +struct charset_info_st my_charset_utf8mb4_roman_uca_ci= { 239,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -10044,7 +10180,7 @@ CHARSET_INFO my_charset_utf8mb4_roman_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8mb4_persian_uca_ci= +struct charset_info_st my_charset_utf8mb4_persian_uca_ci= { 240,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -10076,7 +10212,7 @@ CHARSET_INFO my_charset_utf8mb4_persian_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8mb4_esperanto_uca_ci= +struct charset_info_st my_charset_utf8mb4_esperanto_uca_ci= { 241,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -10108,7 +10244,7 @@ CHARSET_INFO my_charset_utf8mb4_esperanto_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8mb4_hungarian_uca_ci= +struct charset_info_st my_charset_utf8mb4_hungarian_uca_ci= { 242,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -10140,7 +10276,7 @@ CHARSET_INFO my_charset_utf8mb4_hungarian_uca_ci= &my_collation_any_uca_handler }; -CHARSET_INFO my_charset_utf8mb4_sinhala_uca_ci= +struct charset_info_st my_charset_utf8mb4_sinhala_uca_ci= { 243,0,0, /* number */ MY_CS_UTF8MB4_UCA_FLAGS,/* state */ @@ -10172,6 +10308,38 @@ CHARSET_INFO my_charset_utf8mb4_sinhala_uca_ci= &my_collation_any_uca_handler }; +struct charset_info_st my_charset_utf8mb4_croatian_uca_ci= +{ + 245,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + MY_UTF8MB4, /* csname */ + MY_UTF8MB4 "_croatian_ci",/* name */ + "", /* comment */ + croatian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 1, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + #endif /* HAVE_CHARSET_utf8mb4 */ @@ -10196,7 +10364,7 @@ extern MY_CHARSET_HANDLER my_charset_utf32_handler; #define MY_CS_UTF32_UCA_FLAGS (MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII) -CHARSET_INFO my_charset_utf32_unicode_ci= +struct charset_info_st my_charset_utf32_unicode_ci= { 160,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10229,7 +10397,7 @@ CHARSET_INFO my_charset_utf32_unicode_ci= }; -CHARSET_INFO my_charset_utf32_icelandic_uca_ci= +struct charset_info_st my_charset_utf32_icelandic_uca_ci= { 161,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10261,7 +10429,7 @@ CHARSET_INFO my_charset_utf32_icelandic_uca_ci= &my_collation_utf32_uca_handler }; -CHARSET_INFO my_charset_utf32_latvian_uca_ci= +struct charset_info_st my_charset_utf32_latvian_uca_ci= { 162,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10293,7 +10461,7 @@ CHARSET_INFO my_charset_utf32_latvian_uca_ci= &my_collation_utf32_uca_handler }; -CHARSET_INFO my_charset_utf32_romanian_uca_ci= +struct charset_info_st my_charset_utf32_romanian_uca_ci= { 163,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10325,7 +10493,7 @@ CHARSET_INFO my_charset_utf32_romanian_uca_ci= &my_collation_utf32_uca_handler }; -CHARSET_INFO my_charset_utf32_slovenian_uca_ci= +struct charset_info_st my_charset_utf32_slovenian_uca_ci= { 164,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10357,7 +10525,7 @@ CHARSET_INFO my_charset_utf32_slovenian_uca_ci= &my_collation_utf32_uca_handler }; -CHARSET_INFO my_charset_utf32_polish_uca_ci= +struct charset_info_st my_charset_utf32_polish_uca_ci= { 165,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10389,7 +10557,7 @@ CHARSET_INFO my_charset_utf32_polish_uca_ci= &my_collation_utf32_uca_handler }; -CHARSET_INFO my_charset_utf32_estonian_uca_ci= +struct charset_info_st my_charset_utf32_estonian_uca_ci= { 166,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10421,7 +10589,7 @@ CHARSET_INFO my_charset_utf32_estonian_uca_ci= &my_collation_utf32_uca_handler }; -CHARSET_INFO my_charset_utf32_spanish_uca_ci= +struct charset_info_st my_charset_utf32_spanish_uca_ci= { 167,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10453,7 +10621,7 @@ CHARSET_INFO my_charset_utf32_spanish_uca_ci= &my_collation_utf32_uca_handler }; -CHARSET_INFO my_charset_utf32_swedish_uca_ci= +struct charset_info_st my_charset_utf32_swedish_uca_ci= { 168,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10485,7 +10653,7 @@ CHARSET_INFO my_charset_utf32_swedish_uca_ci= &my_collation_utf32_uca_handler }; -CHARSET_INFO my_charset_utf32_turkish_uca_ci= +struct charset_info_st my_charset_utf32_turkish_uca_ci= { 169,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10517,7 +10685,7 @@ CHARSET_INFO my_charset_utf32_turkish_uca_ci= &my_collation_utf32_uca_handler }; -CHARSET_INFO my_charset_utf32_czech_uca_ci= +struct charset_info_st my_charset_utf32_czech_uca_ci= { 170,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10550,7 +10718,7 @@ CHARSET_INFO my_charset_utf32_czech_uca_ci= }; -CHARSET_INFO my_charset_utf32_danish_uca_ci= +struct charset_info_st my_charset_utf32_danish_uca_ci= { 171,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10582,7 +10750,7 @@ CHARSET_INFO my_charset_utf32_danish_uca_ci= &my_collation_utf32_uca_handler }; -CHARSET_INFO my_charset_utf32_lithuanian_uca_ci= +struct charset_info_st my_charset_utf32_lithuanian_uca_ci= { 172,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10614,7 +10782,7 @@ CHARSET_INFO my_charset_utf32_lithuanian_uca_ci= &my_collation_utf32_uca_handler }; -CHARSET_INFO my_charset_utf32_slovak_uca_ci= +struct charset_info_st my_charset_utf32_slovak_uca_ci= { 173,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10646,7 +10814,7 @@ CHARSET_INFO my_charset_utf32_slovak_uca_ci= &my_collation_utf32_uca_handler }; -CHARSET_INFO my_charset_utf32_spanish2_uca_ci= +struct charset_info_st my_charset_utf32_spanish2_uca_ci= { 174,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10678,7 +10846,7 @@ CHARSET_INFO my_charset_utf32_spanish2_uca_ci= &my_collation_utf32_uca_handler }; -CHARSET_INFO my_charset_utf32_roman_uca_ci= +struct charset_info_st my_charset_utf32_roman_uca_ci= { 175,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10710,7 +10878,7 @@ CHARSET_INFO my_charset_utf32_roman_uca_ci= &my_collation_utf32_uca_handler }; -CHARSET_INFO my_charset_utf32_persian_uca_ci= +struct charset_info_st my_charset_utf32_persian_uca_ci= { 176,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10742,7 +10910,7 @@ CHARSET_INFO my_charset_utf32_persian_uca_ci= &my_collation_utf32_uca_handler }; -CHARSET_INFO my_charset_utf32_esperanto_uca_ci= +struct charset_info_st my_charset_utf32_esperanto_uca_ci= { 177,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10774,7 +10942,7 @@ CHARSET_INFO my_charset_utf32_esperanto_uca_ci= &my_collation_utf32_uca_handler }; -CHARSET_INFO my_charset_utf32_hungarian_uca_ci= +struct charset_info_st my_charset_utf32_hungarian_uca_ci= { 178,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10806,7 +10974,7 @@ CHARSET_INFO my_charset_utf32_hungarian_uca_ci= &my_collation_utf32_uca_handler }; -CHARSET_INFO my_charset_utf32_sinhala_uca_ci= +struct charset_info_st my_charset_utf32_sinhala_uca_ci= { 179,0,0, /* number */ MY_CS_UTF32_UCA_FLAGS,/* state */ @@ -10838,6 +11006,37 @@ CHARSET_INFO my_charset_utf32_sinhala_uca_ci= &my_collation_utf32_uca_handler }; +struct charset_info_st my_charset_utf32_croatian_uca_ci= +{ + 214,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS /* state */, + "utf32", /* cs name */ + "utf32_croatian_ci", /* name */ + "", /* comment */ + croatian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 4, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; #endif /* HAVE_CHARSET_utf32 */ @@ -10863,7 +11062,7 @@ extern MY_CHARSET_HANDLER my_charset_utf16_handler; #define MY_CS_UTF16_UCA_FLAGS (MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII) -CHARSET_INFO my_charset_utf16_unicode_ci= +struct charset_info_st my_charset_utf16_unicode_ci= { 101,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -10896,7 +11095,7 @@ CHARSET_INFO my_charset_utf16_unicode_ci= }; -CHARSET_INFO my_charset_utf16_icelandic_uca_ci= +struct charset_info_st my_charset_utf16_icelandic_uca_ci= { 102,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -10928,7 +11127,7 @@ CHARSET_INFO my_charset_utf16_icelandic_uca_ci= &my_collation_utf16_uca_handler }; -CHARSET_INFO my_charset_utf16_latvian_uca_ci= +struct charset_info_st my_charset_utf16_latvian_uca_ci= { 103,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -10960,7 +11159,7 @@ CHARSET_INFO my_charset_utf16_latvian_uca_ci= &my_collation_utf16_uca_handler }; -CHARSET_INFO my_charset_utf16_romanian_uca_ci= +struct charset_info_st my_charset_utf16_romanian_uca_ci= { 104,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -10992,7 +11191,7 @@ CHARSET_INFO my_charset_utf16_romanian_uca_ci= &my_collation_utf16_uca_handler }; -CHARSET_INFO my_charset_utf16_slovenian_uca_ci= +struct charset_info_st my_charset_utf16_slovenian_uca_ci= { 105,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -11024,7 +11223,7 @@ CHARSET_INFO my_charset_utf16_slovenian_uca_ci= &my_collation_utf16_uca_handler }; -CHARSET_INFO my_charset_utf16_polish_uca_ci= +struct charset_info_st my_charset_utf16_polish_uca_ci= { 106,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -11056,7 +11255,7 @@ CHARSET_INFO my_charset_utf16_polish_uca_ci= &my_collation_utf16_uca_handler }; -CHARSET_INFO my_charset_utf16_estonian_uca_ci= +struct charset_info_st my_charset_utf16_estonian_uca_ci= { 107,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -11088,7 +11287,7 @@ CHARSET_INFO my_charset_utf16_estonian_uca_ci= &my_collation_utf16_uca_handler }; -CHARSET_INFO my_charset_utf16_spanish_uca_ci= +struct charset_info_st my_charset_utf16_spanish_uca_ci= { 108,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -11120,7 +11319,7 @@ CHARSET_INFO my_charset_utf16_spanish_uca_ci= &my_collation_utf16_uca_handler }; -CHARSET_INFO my_charset_utf16_swedish_uca_ci= +struct charset_info_st my_charset_utf16_swedish_uca_ci= { 109,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -11152,7 +11351,7 @@ CHARSET_INFO my_charset_utf16_swedish_uca_ci= &my_collation_utf16_uca_handler }; -CHARSET_INFO my_charset_utf16_turkish_uca_ci= +struct charset_info_st my_charset_utf16_turkish_uca_ci= { 110,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -11184,7 +11383,7 @@ CHARSET_INFO my_charset_utf16_turkish_uca_ci= &my_collation_utf16_uca_handler }; -CHARSET_INFO my_charset_utf16_czech_uca_ci= +struct charset_info_st my_charset_utf16_czech_uca_ci= { 111,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -11217,7 +11416,7 @@ CHARSET_INFO my_charset_utf16_czech_uca_ci= }; -CHARSET_INFO my_charset_utf16_danish_uca_ci= +struct charset_info_st my_charset_utf16_danish_uca_ci= { 112,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -11249,7 +11448,7 @@ CHARSET_INFO my_charset_utf16_danish_uca_ci= &my_collation_utf16_uca_handler }; -CHARSET_INFO my_charset_utf16_lithuanian_uca_ci= +struct charset_info_st my_charset_utf16_lithuanian_uca_ci= { 113,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -11281,7 +11480,7 @@ CHARSET_INFO my_charset_utf16_lithuanian_uca_ci= &my_collation_utf16_uca_handler }; -CHARSET_INFO my_charset_utf16_slovak_uca_ci= +struct charset_info_st my_charset_utf16_slovak_uca_ci= { 114,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -11313,7 +11512,7 @@ CHARSET_INFO my_charset_utf16_slovak_uca_ci= &my_collation_utf16_uca_handler }; -CHARSET_INFO my_charset_utf16_spanish2_uca_ci= +struct charset_info_st my_charset_utf16_spanish2_uca_ci= { 115,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -11345,7 +11544,7 @@ CHARSET_INFO my_charset_utf16_spanish2_uca_ci= &my_collation_utf16_uca_handler }; -CHARSET_INFO my_charset_utf16_roman_uca_ci= +struct charset_info_st my_charset_utf16_roman_uca_ci= { 116,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -11377,7 +11576,7 @@ CHARSET_INFO my_charset_utf16_roman_uca_ci= &my_collation_utf16_uca_handler }; -CHARSET_INFO my_charset_utf16_persian_uca_ci= +struct charset_info_st my_charset_utf16_persian_uca_ci= { 117,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -11409,7 +11608,7 @@ CHARSET_INFO my_charset_utf16_persian_uca_ci= &my_collation_utf16_uca_handler }; -CHARSET_INFO my_charset_utf16_esperanto_uca_ci= +struct charset_info_st my_charset_utf16_esperanto_uca_ci= { 118,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -11441,7 +11640,7 @@ CHARSET_INFO my_charset_utf16_esperanto_uca_ci= &my_collation_utf16_uca_handler }; -CHARSET_INFO my_charset_utf16_hungarian_uca_ci= +struct charset_info_st my_charset_utf16_hungarian_uca_ci= { 119,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -11473,7 +11672,7 @@ CHARSET_INFO my_charset_utf16_hungarian_uca_ci= &my_collation_utf16_uca_handler }; -CHARSET_INFO my_charset_utf16_sinhala_uca_ci= +struct charset_info_st my_charset_utf16_sinhala_uca_ci= { 120,0,0, /* number */ MY_CS_UTF16_UCA_FLAGS,/* state */ @@ -11505,8 +11704,114 @@ CHARSET_INFO my_charset_utf16_sinhala_uca_ci= &my_collation_utf16_uca_handler }; +struct charset_info_st my_charset_utf16_croatian_uca_ci= +{ + 215,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS /* state */, + "utf16", /* cs name */ + "utf16_croatian_ci", /* name */ + "", /* comment */ + croatian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + my_unicase_default, /* caseinfo */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* caseup_multiply */ + 1, /* casedn_multiply */ + 2, /* mbminlen */ + 4, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; #endif /* HAVE_CHARSET_utf16 */ #endif /* HAVE_UCA_COLLATIONS */ + +/** + Check if UCA data has contractions (public version) + + @cs Pointer to CHARSET_INFO data + @retval 0 - no contraction, 1 - have contractions. +*/ + +my_bool +my_cs_have_contractions(CHARSET_INFO *cs) +{ + return cs->contractions != NULL; +} + +/** + Check if a character can be contraction head + + @cs Pointer to CHARSET_INFO data + @wc Code point + + @retval 0 - cannot be contraction head + @retval 1 - can be contraction head +*/ + +my_bool +my_cs_can_be_contraction_head(CHARSET_INFO *cs, my_wc_t wc) +{ + return cs->contractions->flags[wc & MY_UCA_CNT_FLAG_MASK] & MY_UCA_CNT_HEAD; +} + + +/** + Check if a character can be contraction tail + + @cs Pointer to CHARSET_INFO data + @wc Code point + + @retval 0 - cannot be contraction tail + @retval 1 - can be contraction tail +*/ + +my_bool +my_cs_can_be_contraction_tail(CHARSET_INFO *cs, my_wc_t wc) +{ + return cs->contractions->flags[wc & MY_UCA_CNT_FLAG_MASK] & MY_UCA_CNT_TAIL; +} + + +/** + Find a contraction and return its weight array + + @cs Pointer to CHARSET data + @wc1 First character + @wc2 Second character + + @return Weight array + @retval NULL - no contraction found + @retval ptr - contraction weight array +*/ + +const uint16 * +my_cs_contraction2_weight(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2) +{ + const MY_CONTRACTIONS *list= cs->contractions; + const MY_CONTRACTION *c, *last; + for (c= list->item, last= &list->item[list->nitems]; c < last; c++) + { + if (c->ch[0] == wc1 && c->ch[1] == wc2) + { + return c->weight; + } + } + return NULL; +} + diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index cecd4424108..6ebbae8fb5a 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1,5 +1,6 @@ -/* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - +/* Copyright (c) 2003, 2012, Oracle and/or its affiliates + Copyright (c) 2009, 2011, Monty Program Ab + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; version 2 @@ -17,11 +18,9 @@ /* UCS2 support. Written by Alexander Barkov <bar@mysql.com> */ -#include <my_global.h> +#include "strings_def.h" +#include <m_ctype.h> #include <my_sys.h> -#include "m_string.h" -#include "m_ctype.h" -#include <errno.h> #include <stdarg.h> @@ -47,9 +46,10 @@ #define LFACTOR1 ULL(10000000000) #define LFACTOR2 ULL(100000000000) +#if defined(HAVE_CHARSET_utf32) || defined(HAVE_CHARSET_mb2) static unsigned long lfactor[9]= { 1L, 10L, 100L, 1000L, 10000L, 100000L, 1000000L, 10000000L, 100000000L }; - +#endif #ifdef HAVE_CHARSET_mb2_or_mb4 @@ -1096,7 +1096,7 @@ my_uni_utf16(CHARSET_INFO *cs __attribute__((unused)), static inline void -my_tolower_utf16(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) +my_tolower_utf16(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc) { int page= *wc >> 8; if (page < 256 && uni_plane[page]) @@ -1105,7 +1105,7 @@ my_tolower_utf16(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) static inline void -my_toupper_utf16(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) +my_toupper_utf16(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc) { int page= *wc >> 8; if (page < 256 && uni_plane[page]) @@ -1114,7 +1114,7 @@ my_toupper_utf16(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) static inline void -my_tosort_utf16(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) +my_tosort_utf16(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc) { int page= *wc >> 8; if (page < 256) @@ -1137,7 +1137,7 @@ my_caseup_utf16(CHARSET_INFO *cs, char *src, size_t srclen, my_wc_t wc; int res; char *srcend= src + srclen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; DBUG_ASSERT(src == dst && srclen == dstlen); while ((src < srcend) && @@ -1159,7 +1159,7 @@ my_hash_sort_utf16(CHARSET_INFO *cs, const uchar *s, size_t slen, my_wc_t wc; int res; const uchar *e= s+slen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; while (e > s + 1 && e[-1] == ' ' && e[-2] == '\0') e-= 2; @@ -1184,7 +1184,7 @@ my_casedn_utf16(CHARSET_INFO *cs, char *src, size_t srclen, my_wc_t wc; int res; char *srcend= src + srclen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; DBUG_ASSERT(src == dst && srclen == dstlen); while ((src < srcend) && @@ -1209,7 +1209,7 @@ my_strnncoll_utf16(CHARSET_INFO *cs, my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc); const uchar *se= s + slen; const uchar *te= t + tlen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; while (s < se && t < te) { @@ -1272,7 +1272,7 @@ my_strnncollsp_utf16(CHARSET_INFO *cs, int res; my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc); const uchar *se= s + slen, *te= t + tlen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; DBUG_ASSERT((slen % 2) == 0); DBUG_ASSERT((tlen % 2) == 0); @@ -1424,7 +1424,7 @@ my_wildcmp_utf16_ci(CHARSET_INFO *cs, const char *wildstr,const char *wildend, int escape, int w_one, int w_many) { - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; return my_wildcmp_unicode(cs, str, str_end, wildstr, wildend, escape, w_one, w_many, uni_plane); } @@ -1628,7 +1628,7 @@ MY_CHARSET_HANDLER my_charset_utf16_handler= }; -CHARSET_INFO my_charset_utf16_general_ci= +struct charset_info_st my_charset_utf16_general_ci= { 54,0,0, /* number */ MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -1661,7 +1661,7 @@ CHARSET_INFO my_charset_utf16_general_ci= }; -CHARSET_INFO my_charset_utf16_bin= +struct charset_info_st my_charset_utf16_bin= { 55,0,0, /* number */ MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE|MY_CS_NONASCII, @@ -1725,7 +1725,7 @@ my_uni_utf32(CHARSET_INFO *cs __attribute__((unused)), static inline void -my_tolower_utf32(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) +my_tolower_utf32(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc) { int page= *wc >> 8; if (page < 256 && uni_plane[page]) @@ -1734,7 +1734,7 @@ my_tolower_utf32(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) static inline void -my_toupper_utf32(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) +my_toupper_utf32(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc) { int page= *wc >> 8; if (page < 256 && uni_plane[page]) @@ -1743,7 +1743,7 @@ my_toupper_utf32(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) static inline void -my_tosort_utf32(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) +my_tosort_utf32(MY_UNICASE_INFO *const* uni_plane, my_wc_t *wc) { int page= *wc >> 8; if (page < 256) @@ -1766,7 +1766,7 @@ my_caseup_utf32(CHARSET_INFO *cs, char *src, size_t srclen, my_wc_t wc; int res; char *srcend= src + srclen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; DBUG_ASSERT(src == dst && srclen == dstlen); while ((src < srcend) && @@ -1796,7 +1796,7 @@ my_hash_sort_utf32(CHARSET_INFO *cs, const uchar *s, size_t slen, my_wc_t wc; int res; const uchar *e= s + slen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; /* Skip trailing spaces */ while (e > s + 3 && e[-1] == ' ' && !e[-2] && !e[-3] && !e[-4]) @@ -1822,7 +1822,7 @@ my_casedn_utf32(CHARSET_INFO *cs, char *src, size_t srclen, my_wc_t wc; int res; char *srcend= src + srclen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; DBUG_ASSERT(src == dst && srclen == dstlen); while ((res= my_utf32_uni(cs, &wc, (uchar*) src, (uchar*) srcend)) > 0) @@ -1845,7 +1845,7 @@ my_strnncoll_utf32(CHARSET_INFO *cs, my_wc_t UNINIT_VAR(s_wc),UNINIT_VAR(t_wc); const uchar *se= s + slen; const uchar *te= t + tlen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; while (s < se && t < te) { @@ -1909,7 +1909,7 @@ my_strnncollsp_utf32(CHARSET_INFO *cs, int res; my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc); const uchar *se= s + slen, *te= t + tlen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; DBUG_ASSERT((slen % 4) == 0); DBUG_ASSERT((tlen % 4) == 0); @@ -2318,13 +2318,18 @@ void my_fill_utf32(CHARSET_INFO *cs, char *s, size_t slen, int fill) { char buf[10]; +#ifndef DBUG_OFF uint buflen; +#endif char *e= s + slen; DBUG_ASSERT((slen % 4) == 0); - buflen= cs->cset->wc_mb(cs, (my_wc_t) fill, (uchar*) buf, - (uchar*) buf + sizeof(buf)); +#ifndef DBUG_OFF + buflen= +#endif + cs->cset->wc_mb(cs, (my_wc_t) fill, (uchar*) buf, + (uchar*) buf + sizeof(buf)); DBUG_ASSERT(buflen == 4); while (s < e) { @@ -2352,7 +2357,7 @@ my_wildcmp_utf32_ci(CHARSET_INFO *cs, const char *wildstr, const char *wildend, int escape, int w_one, int w_many) { - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; return my_wildcmp_unicode(cs, str, str_end, wildstr, wildend, escape, w_one, w_many, uni_plane); } @@ -2548,7 +2553,7 @@ MY_CHARSET_HANDLER my_charset_utf32_handler= }; -CHARSET_INFO my_charset_utf32_general_ci= +struct charset_info_st my_charset_utf32_general_ci= { 60,0,0, /* number */ MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -2581,7 +2586,7 @@ CHARSET_INFO my_charset_utf32_general_ci= }; -CHARSET_INFO my_charset_utf32_bin= +struct charset_info_st my_charset_utf32_bin= { 61,0,0, /* number */ MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE|MY_CS_NONASCII, @@ -2619,7 +2624,7 @@ CHARSET_INFO my_charset_utf32_bin= #ifdef HAVE_CHARSET_ucs2 -static uchar ctype_ucs2[] = { +static const uchar ctype_ucs2[] = { 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, @@ -2639,7 +2644,7 @@ static uchar ctype_ucs2[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -static uchar to_lower_ucs2[] = { +static const uchar to_lower_ucs2[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, @@ -2658,7 +2663,7 @@ static uchar to_lower_ucs2[] = { 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 }; -static uchar to_upper_ucs2[] = { +static const uchar to_upper_ucs2[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, @@ -2710,7 +2715,7 @@ static size_t my_caseup_ucs2(CHARSET_INFO *cs, char *src, size_t srclen, my_wc_t wc; int res; char *srcend= src + srclen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; DBUG_ASSERT(src == dst && srclen == dstlen); while ((src < srcend) && @@ -2732,7 +2737,7 @@ static void my_hash_sort_ucs2(CHARSET_INFO *cs, const uchar *s, size_t slen, my_wc_t wc; int res; const uchar *e=s+slen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; while (e > s+1 && e[-1] == ' ' && e[-2] == '\0') e-= 2; @@ -2757,7 +2762,7 @@ static size_t my_casedn_ucs2(CHARSET_INFO *cs, char *src, size_t srclen, my_wc_t wc; int res; char *srcend= src + srclen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; DBUG_ASSERT(src == dst && srclen == dstlen); while ((src < srcend) && @@ -2782,7 +2787,7 @@ static int my_strnncoll_ucs2(CHARSET_INFO *cs, my_wc_t UNINIT_VAR(s_wc),UNINIT_VAR(t_wc); const uchar *se=s+slen; const uchar *te=t+tlen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; while ( s < se && t < te ) { @@ -2846,7 +2851,7 @@ static int my_strnncollsp_ucs2(CHARSET_INFO *cs __attribute__((unused)), { const uchar *se, *te; size_t minlen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; /* extra safety to make sure the lengths are even numbers */ slen&= ~1; @@ -2942,7 +2947,7 @@ int my_wildcmp_ucs2_ci(CHARSET_INFO *cs, const char *wildstr,const char *wildend, int escape, int w_one, int w_many) { - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; return my_wildcmp_unicode(cs,str,str_end,wildstr,wildend, escape,w_one,w_many,uni_plane); } @@ -3122,7 +3127,7 @@ MY_CHARSET_HANDLER my_charset_ucs2_handler= }; -CHARSET_INFO my_charset_ucs2_general_ci= +struct charset_info_st my_charset_ucs2_general_ci= { 35,0,0, /* number */ MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, @@ -3155,7 +3160,7 @@ CHARSET_INFO my_charset_ucs2_general_ci= }; -CHARSET_INFO my_charset_ucs2_general_mysql500_ci= +struct charset_info_st my_charset_ucs2_general_mysql500_ci= { 159, 0, 0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, /* state */ @@ -3188,7 +3193,7 @@ CHARSET_INFO my_charset_ucs2_general_mysql500_ci= }; -CHARSET_INFO my_charset_ucs2_bin= +struct charset_info_st my_charset_ucs2_bin= { 90,0,0, /* number */ MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE|MY_CS_NONASCII, diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c index 13f96be2e72..2743efc4087 100644 --- a/strings/ctype-ujis.c +++ b/strings/ctype-ujis.c @@ -1,4 +1,6 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. & tommy@valley.ne.jp. +/* Copyright tommy@valley.ne.jp. + Copyright (c) 2002, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -25,14 +27,13 @@ * .configure. mbmaxlen_ujis=3 */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #ifdef HAVE_CHARSET_ujis -static uchar ctype_ujis[257] = +static const uchar ctype_ujis[257] = { 0, /* For standard library */ 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* NUL ^A - ^G */ @@ -69,7 +70,7 @@ static uchar ctype_ujis[257] = 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0000, }; -static uchar to_lower_ujis[]= +static const uchar to_lower_ujis[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -105,7 +106,7 @@ static uchar to_lower_ujis[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' }; -static uchar to_upper_ujis[]= +static const uchar to_upper_ujis[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -141,7 +142,7 @@ static uchar to_upper_ujis[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' }; -static uchar sort_order_ujis[]= +static const uchar sort_order_ujis[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -67172,7 +67173,7 @@ static size_t my_casefold_ujis(CHARSET_INFO *cs, char *src, size_t srclen, char *dst, size_t dstlen __attribute__((unused)), - uchar *map, + const uchar * const map, size_t is_upper) { char *srcend= src + srclen, *dst0= dst; @@ -67291,7 +67292,7 @@ static MY_CHARSET_HANDLER my_charset_handler= -CHARSET_INFO my_charset_ujis_japanese_ci= +struct charset_info_st my_charset_ujis_japanese_ci= { 12,0,0, /* number */ MY_CS_COMPILED|MY_CS_PRIMARY, /* state */ @@ -67324,7 +67325,7 @@ CHARSET_INFO my_charset_ujis_japanese_ci= }; -CHARSET_INFO my_charset_ujis_bin= +struct charset_info_st my_charset_ujis_bin= { 91,0,0, /* number */ MY_CS_COMPILED|MY_CS_BINSORT, /* state */ diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 4976a9cf31a..28fa6163dfe 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. + Copyright (c) 2009, 2013, Monty Program Ab This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -18,10 +19,8 @@ /* UTF8 according RFC 2279 */ /* Written by Alexander Barkov <bar@udm.net> */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" -#include <errno.h> +#include "strings_def.h" +#include <m_ctype.h> #ifndef EILSEQ #define EILSEQ ENOENT @@ -1639,7 +1638,7 @@ static MY_UNICASE_INFO planeFF[]={ {0xFFFE,0xFFFE,0xFFFE}, {0xFFFF,0xFFFF,0xFFFF} }; -MY_UNICASE_INFO *my_unicase_default[256]={ +MY_UNICASE_INFO *const my_unicase_default[256]={ plane00, plane01, plane02, plane03, plane04, plane05, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -1679,7 +1678,7 @@ MY_UNICASE_INFO *my_unicase_default[256]={ /* Reproduce old utf8_general_ci behaviour before we fixed Bug#27877. */ -MY_UNICASE_INFO *my_unicase_mysql500[256]={ +MY_UNICASE_INFO *const my_unicase_mysql500[256]={ plane00_mysql500, plane01, plane02, plane03, plane04, plane05, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -1859,7 +1858,7 @@ static MY_UNICASE_INFO turk00[]= -MY_UNICASE_INFO *my_unicase_turkish[256]= +MY_UNICASE_INFO *const my_unicase_turkish[256]= { turk00, plane01, plane02, plane03, plane04, plane05, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -1897,7 +1896,7 @@ MY_UNICASE_INFO *my_unicase_turkish[256]= static inline void -my_tosort_unicode(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) +my_tosort_unicode(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc) { int page= *wc >> 8; if (page < 256) @@ -1926,12 +1925,12 @@ int my_wildcmp_unicode_impl(CHARSET_INFO *cs, const char *str,const char *str_end, const char *wildstr,const char *wildend, int escape, int w_one, int w_many, - MY_UNICASE_INFO **weights, int recurse_level) + MY_UNICASE_INFO *const *weights, int recurse_level) { int result= -1; /* Not found, using wildcards */ my_wc_t s_wc, w_wc; int scan; - int (*mb_wc)(struct charset_info_st *, my_wc_t *, + int (*mb_wc)(CHARSET_INFO *, my_wc_t *, const uchar *, const uchar *); mb_wc= cs->cset->mb_wc; @@ -2075,7 +2074,7 @@ my_wildcmp_unicode(CHARSET_INFO *cs, const char *str,const char *str_end, const char *wildstr,const char *wildend, int escape, int w_one, int w_many, - MY_UNICASE_INFO **weights) + MY_UNICASE_INFO *const *weights) { return my_wildcmp_unicode_impl(cs, str, str_end, wildstr, wildend, @@ -2095,15 +2094,14 @@ my_strnxfrm_unicode(CHARSET_INFO *cs, uchar *dst, size_t dstlen, const uchar *src, size_t srclen) { - my_wc_t wc; + my_wc_t UNINIT_VAR(wc); int res; uchar *de= dst + dstlen; uchar *de_beg= de - 1; const uchar *se = src + srclen; - MY_UNICASE_INFO **uni_plane= (cs->state & MY_CS_BINSORT) ? - NULL : cs->caseinfo; - LINT_INIT(wc); - DBUG_ASSERT(src); + MY_UNICASE_INFO * const*uni_plane= (cs->state & MY_CS_BINSORT) ? + NULL : cs->caseinfo; + DBUG_ASSERT(!srclen || src); while (dst < de_beg) { @@ -2147,7 +2145,7 @@ my_strnxfrm_unicode_full_bin(CHARSET_INFO *cs, const uchar *se = src + srclen; LINT_INIT(wc); - DBUG_ASSERT(src); + DBUG_ASSERT(!srclen || src); DBUG_ASSERT(cs->state & MY_CS_BINSORT); while (dst < de_beg) @@ -2196,7 +2194,7 @@ my_strnxfrmlen_unicode_full_bin(CHARSET_INFO *cs, size_t len) expressions. Note, there is no need to mark byte 255 as a letter, it is illegal byte in UTF8. */ -static uchar ctype_utf8[] = { +static const uchar ctype_utf8[] = { 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, @@ -2218,7 +2216,7 @@ static uchar ctype_utf8[] = { /* The below are taken from usa7 implementation */ -static uchar to_lower_utf8[] = { +static const uchar to_lower_utf8[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, @@ -2237,7 +2235,7 @@ static uchar to_lower_utf8[] = { 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 }; -static uchar to_upper_utf8[] = { +static const uchar to_upper_utf8[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, @@ -2497,7 +2495,7 @@ static size_t my_caseup_utf8(CHARSET_INFO *cs, char *src, size_t srclen, my_wc_t wc; int srcres, dstres; char *srcend= src + srclen, *dstend= dst + dstlen, *dst0= dst; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; DBUG_ASSERT(src != dst || cs->caseup_multiply == 1); while ((src < srcend) && @@ -2520,7 +2518,7 @@ static void my_hash_sort_utf8(CHARSET_INFO *cs, const uchar *s, size_t slen, my_wc_t wc; int res; const uchar *e=s+slen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; /* Remove end space. We have to do this to be able to compare @@ -2547,7 +2545,7 @@ static size_t my_caseup_str_utf8(CHARSET_INFO *cs, char *src) my_wc_t wc; int srcres, dstres; char *dst= src, *dst0= src; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; DBUG_ASSERT(cs->caseup_multiply == 1); while (*src && @@ -2571,7 +2569,7 @@ static size_t my_casedn_utf8(CHARSET_INFO *cs, char *src, size_t srclen, my_wc_t wc; int srcres, dstres; char *srcend= src + srclen, *dstend= dst + dstlen, *dst0= dst; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; DBUG_ASSERT(src != dst || cs->casedn_multiply == 1); while ((src < srcend) && @@ -2593,7 +2591,7 @@ static size_t my_casedn_str_utf8(CHARSET_INFO *cs, char *src) my_wc_t wc; int srcres, dstres; char *dst= src, *dst0= src; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; DBUG_ASSERT(cs->casedn_multiply == 1); while (*src && @@ -2633,10 +2631,10 @@ static int my_strnncoll_utf8(CHARSET_INFO *cs, my_bool t_is_prefix) { int s_res,t_res; - my_wc_t UNINIT_VAR(s_wc), t_wc; + my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc); const uchar *se=s+slen; const uchar *te=t+tlen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; while ( s < se && t < te ) { @@ -2703,9 +2701,9 @@ static int my_strnncollsp_utf8(CHARSET_INFO *cs, my_bool diff_if_only_endspace_difference) { int s_res, t_res, res; - my_wc_t UNINIT_VAR(s_wc),t_wc; + my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc); const uchar *se= s+slen, *te= t+tlen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; #ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE diff_if_only_endspace_difference= 0; @@ -2793,7 +2791,7 @@ static int my_strnncollsp_utf8(CHARSET_INFO *cs, static int my_strcasecmp_utf8(CHARSET_INFO *cs, const char *s, const char *t) { - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; while (s[0] && t[0]) { my_wc_t s_wc,t_wc; @@ -2878,7 +2876,7 @@ int my_wildcmp_utf8(CHARSET_INFO *cs, const char *wildstr,const char *wildend, int escape, int w_one, int w_many) { - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; return my_wildcmp_unicode(cs,str,str_end,wildstr,wildend, escape,w_one,w_many,uni_plane); } @@ -2891,7 +2889,6 @@ size_t my_strnxfrmlen_utf8(CHARSET_INFO *cs __attribute__((unused)), return (len * 2 + 2) / 3; } - static uint my_ismbchar_utf8(CHARSET_INFO *cs,const char *b, const char *e) { my_wc_t wc; @@ -2970,7 +2967,7 @@ MY_CHARSET_HANDLER my_charset_utf8_handler= -CHARSET_INFO my_charset_utf8_general_ci= +struct charset_info_st my_charset_utf8_general_ci= { 33,0,0, /* number */ MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE, /* state */ @@ -3003,7 +3000,7 @@ CHARSET_INFO my_charset_utf8_general_ci= }; -CHARSET_INFO my_charset_utf8_general_mysql500_ci= +struct charset_info_st my_charset_utf8_general_mysql500_ci= { 223,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, /* state */ @@ -3036,7 +3033,7 @@ CHARSET_INFO my_charset_utf8_general_mysql500_ci= }; -CHARSET_INFO my_charset_utf8_bin= +struct charset_info_st my_charset_utf8_bin= { 83,0,0, /* number */ MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE, /* state */ @@ -3088,7 +3085,7 @@ static int my_strnncoll_utf8_cs(CHARSET_INFO *cs, const uchar *te=t+tlen; int save_diff = 0; int diff; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; while ( s < se && t < te ) { @@ -3133,7 +3130,7 @@ static int my_strnncollsp_utf8_cs(CHARSET_INFO *cs, const uchar *se= s + slen; const uchar *te= t + tlen; int save_diff= 0; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; #ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE diff_if_only_endspace_difference= 0; @@ -3219,7 +3216,7 @@ static MY_COLLATION_HANDLER my_collation_cs_handler = my_propagate_simple }; -CHARSET_INFO my_charset_utf8_general_cs= +struct charset_info_st my_charset_utf8_general_cs= { 254,0,0, /* number */ MY_CS_COMPILED|MY_CS_UNICODE, /* state */ @@ -3277,7 +3274,7 @@ All other characters are encoded using five bytes: */ -static uint16 touni[5994]= +static const uint16 touni[5994]= { 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, @@ -4033,7 +4030,7 @@ static uint16 touni[5994]= /* 00C0-05FF */ -static uint16 uni_0C00_05FF[1344]= +static const uint16 uni_0C00_05FF[1344]= { 0x0017,0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E, 0x001F,0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026, @@ -4277,7 +4274,7 @@ static uint16 uni_1E00_1FFF[512]= /* 2160-217F */ -static uint16 uni_2160_217F[32]= +static const uint16 uni_2160_217F[32]= { 0x0739,0x0789,0x07D9,0x0829,0x0879,0x08C9,0x0919,0x0969, 0x09B9,0x0A09,0x0A59,0x0AA9,0x0AF9,0x0B49,0x0B99,0x0BE9, @@ -4287,7 +4284,7 @@ static uint16 uni_2160_217F[32]= /* 24B0-24EF */ -static uint16 uni_24B0_24EF[64]= +static const uint16 uni_24B0_24EF[64]= { 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0511,0x0512, 0x0513,0x0514,0x0515,0x0516,0x0517,0x0518,0x0519,0x051A, @@ -4301,7 +4298,7 @@ static uint16 uni_24B0_24EF[64]= /* FF20-FF5F */ -static uint16 uni_FF20_FF5F[64]= +static const uint16 uni_FF20_FF5F[64]= { 0x0000,0x0560,0x05B0,0x0600,0x0650,0x06A0,0x06F0,0x0740, 0x0790,0x07E0,0x0830,0x0880,0x08D0,0x0920,0x0970,0x09C0, @@ -4325,7 +4322,7 @@ static uint16 uni_FF20_FF5F[64]= static int hexlo(int x) { - static char hex_lo_digit[256]= + static const char hex_lo_digit[256]= { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* ................ */ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* ................ */ @@ -4356,7 +4353,7 @@ static int hexlo(int x) 0..9 digits _ underscore */ -static char filename_safe_char[128]= +static const char filename_safe_char[128]= { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ................ */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ................ */ @@ -4370,6 +4367,10 @@ static char filename_safe_char[128]= #define MY_FILENAME_ESCAPE '@' +/* + note, that we cannot trust 'e' here, it's may be fake, + see strconvert() +*/ static int my_mb_wc_filename(CHARSET_INFO *cs __attribute__((unused)), my_wc_t *pwc, const uchar *s, const uchar *e) @@ -4418,7 +4419,7 @@ my_mb_wc_filename(CHARSET_INFO *cs __attribute__((unused)), (byte2= hexlo(byte2)) >= 0) { int byte3= hexlo(s[3]); - int byte4= hexlo(s[4]); + int byte4= hexlo(s[3] ? s[4] : 0); if (byte3 >=0 && byte4 >=0) { *pwc= (byte1 << 12) + (byte2 << 8) + (byte3 << 4) + byte4; @@ -4521,7 +4522,7 @@ static MY_CHARSET_HANDLER my_charset_filename_handler= -CHARSET_INFO my_charset_filename= +struct charset_info_st my_charset_filename= { 17,0,0, /* number */ MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_HIDDEN|MY_CS_NONASCII, @@ -4899,7 +4900,7 @@ my_wc_mb_utf8mb4_no_range(CHARSET_INFO *cs __attribute__((unused)), static inline void -my_tolower_utf8mb4(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) +my_tolower_utf8mb4(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc) { int page= *wc >> 8; if (page < 256 && uni_plane[page]) @@ -4908,7 +4909,7 @@ my_tolower_utf8mb4(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) static inline void -my_toupper_utf8mb4(MY_UNICASE_INFO **uni_plane, my_wc_t *wc) +my_toupper_utf8mb4(MY_UNICASE_INFO * const* uni_plane, my_wc_t *wc) { int page= *wc >> 8; if (page < 256 && uni_plane[page]) @@ -4923,7 +4924,7 @@ my_caseup_utf8mb4(CHARSET_INFO *cs, char *src, size_t srclen, my_wc_t wc; int srcres, dstres; char *srcend= src + srclen, *dstend= dst + dstlen, *dst0= dst; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO * const* uni_plane= cs->caseinfo; DBUG_ASSERT(src != dst || cs->caseup_multiply == 1); while ((src < srcend) && @@ -4955,7 +4956,7 @@ my_hash_sort_utf8mb4(CHARSET_INFO *cs, const uchar *s, size_t slen, my_wc_t wc; int res; const uchar *e= s + slen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO * const* uni_plane= cs->caseinfo; /* Remove end space. We do this to be able to compare @@ -4991,7 +4992,7 @@ my_caseup_str_utf8mb4(CHARSET_INFO *cs, char *src) my_wc_t wc; int srcres, dstres; char *dst= src, *dst0= src; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO * const* uni_plane= cs->caseinfo; DBUG_ASSERT(cs->caseup_multiply == 1); while (*src && @@ -5016,7 +5017,7 @@ my_casedn_utf8mb4(CHARSET_INFO *cs, my_wc_t wc; int srcres, dstres; char *srcend= src + srclen, *dstend= dst + dstlen, *dst0= dst; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO * const* uni_plane= cs->caseinfo; DBUG_ASSERT(src != dst || cs->casedn_multiply == 1); while ((src < srcend) && @@ -5039,7 +5040,7 @@ my_casedn_str_utf8mb4(CHARSET_INFO *cs, char *src) my_wc_t wc; int srcres, dstres; char *dst= src, *dst0= src; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO * const* uni_plane= cs->caseinfo; DBUG_ASSERT(cs->casedn_multiply == 1); while (*src && @@ -5081,7 +5082,7 @@ my_strnncoll_utf8mb4(CHARSET_INFO *cs, my_wc_t s_wc,t_wc; const uchar *se= s + slen; const uchar *te= t + tlen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO * const* uni_plane= cs->caseinfo; LINT_INIT(s_wc); LINT_INIT(t_wc); @@ -5148,7 +5149,7 @@ my_strnncollsp_utf8mb4(CHARSET_INFO *cs, int res; my_wc_t s_wc, t_wc; const uchar *se= s + slen, *te= t + tlen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO * const* uni_plane= cs->caseinfo; LINT_INIT(s_wc); LINT_INIT(t_wc); @@ -5232,7 +5233,7 @@ my_strnncollsp_utf8mb4(CHARSET_INFO *cs, static int my_strcasecmp_utf8mb4(CHARSET_INFO *cs, const char *s, const char *t) { - MY_UNICASE_INFO **uni_plane= cs->caseinfo; + MY_UNICASE_INFO * const* uni_plane= cs->caseinfo; while (s[0] && t[0]) { my_wc_t s_wc,t_wc; @@ -5399,7 +5400,7 @@ MY_CHARSET_HANDLER my_charset_utf8mb4_handler= -CHARSET_INFO my_charset_utf8mb4_general_ci= +struct charset_info_st my_charset_utf8mb4_general_ci= { 45,0,0, /* number */ MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_UNICODE_SUPPLEMENT, /* state */ @@ -5432,7 +5433,7 @@ CHARSET_INFO my_charset_utf8mb4_general_ci= }; -CHARSET_INFO my_charset_utf8mb4_bin= +struct charset_info_st my_charset_utf8mb4_bin= { 46,0,0, /* number */ MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE|MY_CS_UNICODE_SUPPLEMENT, /* state */ diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index a8181afa776..ef54101cf7f 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -1,4 +1,6 @@ -/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2001 Jan Pazdziora. + Copyright (c) 2002-2007 MySQL AB + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -39,9 +41,8 @@ #define REAL_MYSQL #ifdef REAL_MYSQL -#include "my_global.h" -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #else @@ -53,7 +54,7 @@ #ifdef HAVE_CHARSET_cp1250 -static uint16 tab_cp1250_uni[256]={ +static const uint16 tab_cp1250_uni[256]={ 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, @@ -90,7 +91,7 @@ static uint16 tab_cp1250_uni[256]={ /* 0000-00FD , 254 chars */ -static uchar tab_uni_cp1250_plane00[]={ +static const uchar tab_uni_cp1250_plane00[]={ 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F, 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F, 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F, @@ -109,7 +110,7 @@ static uchar tab_uni_cp1250_plane00[]={ 0x00,0x00,0x00,0xF3,0xF4,0x00,0xF6,0xF7,0x00,0x00,0xFA,0x00,0xFC,0xFD}; /* 0102-017E , 125 chars */ -static uchar tab_uni_cp1250_plane01[]={ +static const uchar tab_uni_cp1250_plane01[]={ 0xC3,0xE3,0xA5,0xB9,0xC6,0xE6,0x00,0x00,0x00,0x00,0xC8,0xE8,0xCF,0xEF,0xD0,0xF0, 0x00,0x00,0x00,0x00,0x00,0x00,0xCA,0xEA,0xCC,0xEC,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -120,7 +121,7 @@ static uchar tab_uni_cp1250_plane01[]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8F,0x9F,0xAF,0xBF,0x8E,0x9E}; /* 2013-20AC , 154 chars */ -static uchar tab_uni_cp1250_plane20[]={ +static const uchar tab_uni_cp1250_plane20[]={ 0x96,0x97,0x00,0x00,0x00,0x91,0x92,0x82,0x00,0x93,0x94,0x84,0x00,0x86,0x87,0x95, 0x00,0x00,0x00,0x85,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x89,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x8B,0x9B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -133,12 +134,12 @@ static uchar tab_uni_cp1250_plane20[]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80}; /* 02C7-02DD , 23 chars */ -static uchar tab_uni_cp1250_plane02[]={ +static const uchar tab_uni_cp1250_plane02[]={ 0xA1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0xA2,0xFF,0x00,0xB2,0x00,0xBD}; /* 2122-2122 , 1 chars */ -static uchar tab_uni_cp1250_plane21[]={ +static const uchar tab_uni_cp1250_plane21[]={ 0x99}; @@ -152,7 +153,7 @@ static MY_UNI_IDX idx_uni_cp1250[]={ }; -static uchar ctype_win1250ch[] = { +static const uchar ctype_win1250ch[] = { 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x28, 0x28, 0x28, 0x28, 0x20, 0x20, @@ -188,7 +189,7 @@ static uchar ctype_win1250ch[] = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x10 }; -static uchar to_lower_win1250ch[] = { +static const uchar to_lower_win1250ch[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, @@ -223,7 +224,7 @@ static uchar to_lower_win1250ch[] = { 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; -static uchar to_upper_win1250ch[] = { +static const uchar to_upper_win1250ch[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, @@ -260,7 +261,7 @@ static uchar to_upper_win1250ch[] = { -static uchar sort_order_win1250ch[] = { +static const uchar sort_order_win1250ch[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, @@ -279,7 +280,7 @@ static uchar sort_order_win1250ch[] = { 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 }; -static uchar _sort_order_win1250ch1[] = { +static const uchar _sort_order_win1250ch1[] = { 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, @@ -404,7 +405,7 @@ struct wordvalue { uchar pass1; uchar pass2; }; -static struct wordvalue doubles[] = { +static const struct wordvalue doubles[] = { { (uchar*) "ch", 0xad, 0x03 }, { (uchar*) "c", 0xa6, 0x02 }, { (uchar*) "Ch", 0xad, 0x02 }, @@ -513,7 +514,7 @@ static size_t my_strnxfrm_win1250ch(CHARSET_INFO * cs __attribute__((unused)), #ifdef REAL_MYSQL -static uchar like_range_prefix_min_win1250ch[]= +static const uchar like_range_prefix_min_win1250ch[]= { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, @@ -677,7 +678,7 @@ static MY_COLLATION_HANDLER my_collation_czech_ci_handler = }; -CHARSET_INFO my_charset_cp1250_czech_ci = +struct charset_info_st my_charset_cp1250_czech_ci = { 34,0,0, /* number */ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_CSSORT, /* state */ diff --git a/strings/ctype.c b/strings/ctype.c index d3ec0f5dc34..23f18b6617b 100644 --- a/strings/ctype.c +++ b/strings/ctype.c @@ -1,5 +1,7 @@ /* Copyright (c) 2000-2007 MySQL AB, 2008, 2009 Sun Microsystems, Inc. + Copyright (c) 2009-2011, Monty Program Ab Use is subject to license terms. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -14,13 +16,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <my_global.h> +#include "strings_def.h" #include <m_ctype.h> #include <my_xml.h> -#ifndef SCO -#include <m_string.h> -#endif - /* @@ -80,7 +78,7 @@ struct my_cs_file_section_st #define _CS_IDENTICAL 22 -static struct my_cs_file_section_st sec[] = +static const struct my_cs_file_section_st sec[] = { {_CS_MISC, "xml"}, {_CS_MISC, "xml/version"}, @@ -116,9 +114,10 @@ static struct my_cs_file_section_st sec[] = {0, NULL} }; -static struct my_cs_file_section_st * cs_file_sec(const char *attr, size_t len) +static const struct my_cs_file_section_st +*cs_file_sec(const char *attr, size_t len) { - struct my_cs_file_section_st *s; + const struct my_cs_file_section_st *s; for (s=sec; s->str; s++) { if (!strncmp(attr,s->str,len)) @@ -142,8 +141,8 @@ typedef struct my_cs_file_info char comment[MY_CS_CSDESCR_SIZE]; char tailoring[MY_CS_TAILORING_SIZE]; size_t tailoring_length; - CHARSET_INFO cs; - int (*add_collation)(CHARSET_INFO *cs); + struct charset_info_st cs; + int (*add_collation)(struct charset_info_st *cs); } MY_CHARSET_LOADER; @@ -186,7 +185,7 @@ static int fill_uint16(uint16 *a,uint size,const char *str, size_t len) static int cs_enter(MY_XML_PARSER *st,const char *attr, size_t len) { struct my_cs_file_info *i= (struct my_cs_file_info *)st->user_data; - struct my_cs_file_section_st *s= cs_file_sec(attr,len); + const struct my_cs_file_section_st *s= cs_file_sec(attr,len); if ( s && (s->state == _CS_CHARSET)) bzero(&i->cs,sizeof(i->cs)); @@ -201,7 +200,7 @@ static int cs_enter(MY_XML_PARSER *st,const char *attr, size_t len) static int cs_leave(MY_XML_PARSER *st,const char *attr, size_t len) { struct my_cs_file_info *i= (struct my_cs_file_info *)st->user_data; - struct my_cs_file_section_st *s= cs_file_sec(attr,len); + const struct my_cs_file_section_st *s= cs_file_sec(attr,len); int state= s ? s->state : 0; int rc; @@ -219,9 +218,9 @@ static int cs_leave(MY_XML_PARSER *st,const char *attr, size_t len) static int cs_value(MY_XML_PARSER *st,const char *attr, size_t len) { struct my_cs_file_info *i= (struct my_cs_file_info *)st->user_data; - struct my_cs_file_section_st *s; - int state= (int)((s=cs_file_sec(st->attr, strlen(st->attr))) ? s->state : - 0); + const struct my_cs_file_section_st *s; + int state= (int)((s= cs_file_sec(st->attr, strlen(st->attr))) ? s->state : + 0); switch (state) { case _CS_ID: @@ -297,7 +296,7 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, size_t len) my_bool my_parse_charset_xml(const char *buf, size_t len, - int (*add_collation)(CHARSET_INFO *cs)) + int (*add_collation)(struct charset_info_st *cs)) { MY_XML_PARSER p; struct my_cs_file_info i; diff --git a/strings/decimal.c b/strings/decimal.c index 39dff0723b9..b36025ee8fc 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. + Copyright (c) 2009, 2011, Monty Program Ab. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,7 +29,7 @@ integer that determines the number of significant digits in a particular radix R, where R is either 2 or 10. S is a non-negative integer. Every value of an exact numeric type of scale S is of the - form n*10^{-S}, where n is an integer such that -R^P <= n <= R^P. + form n*10^{-S}, where n is an integer such that -R^P <= n <= R^P. [...] @@ -97,11 +98,10 @@ implementation-defined. */ -#include <my_global.h> +#include "strings_def.h" #include <m_ctype.h> #include <myisampack.h> #include <my_sys.h> /* for my_alloca */ -#include <m_string.h> #include <decimal.h> /* @@ -136,7 +136,7 @@ static const dec1 frac_max[DIG_PER_DEC1-1]={ 999900000, 999990000, 999999000, 999999900, 999999990 }; -#ifdef HAVE_purify +#ifdef HAVE_valgrind #define sanity(d) DBUG_ASSERT((d)->len > 0) #else #define sanity(d) DBUG_ASSERT((d)->len >0 && ((d)->buf[0] | \ @@ -298,7 +298,7 @@ int decimal_actual_fraction(decimal_t *from) { for (i= DIG_PER_DEC1 - ((frac - 1) % DIG_PER_DEC1); *buf0 % powers10[i++] == 0; - frac--) ; + frac--) {} } return frac; } @@ -339,7 +339,7 @@ int decimal2string(const decimal_t *from, char *to, int *to_len, char *s=to; dec1 *buf, *buf0=from->buf, tmp; - DBUG_ASSERT(*to_len >= 2+from->sign); + DBUG_ASSERT(*to_len >= 2+ (int) from->sign); /* removing leading zeroes */ buf0= remove_leading_zeroes(from, &intg); @@ -493,7 +493,7 @@ static void digits_bounds(decimal_t *from, int *start_result, int *end_result) stop= (int) ((buf_end - from->buf + 1) * DIG_PER_DEC1); i= 1; } - for (; *buf_end % powers10[i++] == 0; stop--) ; + for (; *buf_end % powers10[i++] == 0; stop--) {} *end_result= stop; /* index of position after last decimal digit (from 0) */ } @@ -669,7 +669,7 @@ int decimal_shift(decimal_t *dec, int shift) if (do_left) { do_mini_left_shift(dec, l_mini_shift, beg, end); - mini_shift=- l_mini_shift; + mini_shift= -l_mini_shift; } else { @@ -993,7 +993,7 @@ static int ull2dec(ulonglong from, decimal_t *to) sanity(to); - for (intg1=1; from >= DIG_BASE; intg1++, from/=DIG_BASE) ; + for (intg1=1; from >= DIG_BASE; intg1++, from/=DIG_BASE) {} if (unlikely(intg1 > to->len)) { intg1=to->len; @@ -1024,7 +1024,7 @@ int longlong2decimal(longlong from, decimal_t *to) return ull2dec(from, to); } -int decimal2ulonglong(decimal_t *from, ulonglong *to) +int decimal2ulonglong(const decimal_t *from, ulonglong *to) { dec1 *buf=from->buf; ulonglong x=0; @@ -1053,7 +1053,7 @@ int decimal2ulonglong(decimal_t *from, ulonglong *to) return E_DEC_OK; } -int decimal2longlong(decimal_t *from, longlong *to) +int decimal2longlong(const decimal_t *from, longlong *to) { dec1 *buf=from->buf; longlong x=0; @@ -1172,7 +1172,7 @@ int decimal2longlong(decimal_t *from, longlong *to) 7E F2 04 C7 2D FB 2D */ -int decimal2bin(decimal_t *from, uchar *to, int precision, int frac) +int decimal2bin(const decimal_t *from, uchar *to, int precision, int frac) { dec1 mask=from->sign ? -1 : 0, *buf1=from->buf, *stop1; int error=E_DEC_OK, intg=precision-frac, @@ -1445,7 +1445,9 @@ int decimal_bin_size(int precision, int scale) intg0=intg/DIG_PER_DEC1, frac0=scale/DIG_PER_DEC1, intg0x=intg-intg0*DIG_PER_DEC1, frac0x=scale-frac0*DIG_PER_DEC1; - DBUG_ASSERT(scale >= 0 && precision > 0 && scale <= precision); + DBUG_ASSERT(scale >= 0); + DBUG_ASSERT(precision > 0); + DBUG_ASSERT(scale <= precision); return intg0*sizeof(dec1)+dig2bytes[intg0x]+ frac0*sizeof(dec1)+dig2bytes[frac0x]; } @@ -1795,7 +1797,8 @@ static int do_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to) int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg), frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac); int frac0=max(frac1, frac2), error; - dec1 *buf1, *buf2, *buf0, *stop1, *stop2, *start1, *start2, carry=0; + dec1 *buf1, *buf2, *buf0, *stop1, *stop2, *start1, *start2; + my_bool carry=0; /* let carry:=1 if from2 > from1 */ start1=buf1=from1->buf; stop1=buf1+intg1; @@ -1863,7 +1866,7 @@ static int do_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to) swap_variables(dec1 *,start1, start2); swap_variables(int,intg1,intg2); swap_variables(int,frac1,frac2); - to->sign= 1 - to->sign; + to->sign= !to->sign; } FIX_INTG_FRAC_ERROR(to->len, intg1, frac0, error); @@ -1989,45 +1992,44 @@ int decimal_mul(const decimal_t *from1, const decimal_t *from2, decimal_t *to) int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg), frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac), intg0=ROUND_UP(from1->intg+from2->intg), - frac0=frac1+frac2, error, iii, jjj, d_to_move; + frac0=frac1+frac2, error, i, j, d_to_move; dec1 *buf1=from1->buf+intg1, *buf2=from2->buf+intg2, *buf0, *start2, *stop2, *stop1, *start0, carry; sanity(to); - iii= intg0; /* save 'ideal' values */ - jjj= frac0; + i=intg0; /* save 'ideal' values */ + j=frac0; FIX_INTG_FRAC_ERROR(to->len, intg0, frac0, error); /* bound size */ - to->sign= from1->sign != from2->sign; - to->frac= from1->frac + from2->frac; /* store size in digits */ - set_if_smaller(to->frac, NOT_FIXED_DEC); + to->sign=from1->sign != from2->sign; + to->frac=from1->frac+from2->frac; /* store size in digits */ to->intg=intg0*DIG_PER_DEC1; if (unlikely(error)) { set_if_smaller(to->frac, frac0*DIG_PER_DEC1); set_if_smaller(to->intg, intg0*DIG_PER_DEC1); - if (unlikely(iii > intg0)) /* bounded integer-part */ + if (unlikely(i > intg0)) /* bounded integer-part */ { - iii-=intg0; - jjj= iii >> 1; - intg1-= jjj; - intg2-=iii-jjj; + i-=intg0; + j=i >> 1; + intg1-= j; + intg2-=i-j; frac1=frac2=0; /* frac0 is already 0 here */ } else /* bounded fract part */ { - jjj-=frac0; - iii=jjj >> 1; + j-=frac0; + i=j >> 1; if (frac1 <= frac2) { - frac1-= iii; - frac2-=jjj-iii; + frac1-= i; + frac2-=j-i; } else { - frac2-= iii; - frac1-=jjj-iii; + frac2-= i; + frac1-=j-i; } } } @@ -2293,7 +2295,11 @@ static int do_div_mod(const decimal_t *from1, const decimal_t *from2, DBUG_ASSERT(buf0 < to->buf + to->len); *buf0=(dec1)guess; } +#ifdef WORKAROUND_GCC_4_3_2_BUG + dcarry= *(volatile dec1 *)start1; +#else dcarry= *start1; +#endif start1++; } if (mod) diff --git a/strings/do_ctype.c b/strings/do_ctype.c index a624638971f..55e319a2295 100644 --- a/strings/do_ctype.c +++ b/strings/do_ctype.c @@ -1,4 +1,6 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000-2002, 2006, 2007 MySQL AB + Copyright (c) 2009-2011, Monty Program Ab + Use is subject to license terms. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,10 +22,9 @@ #undef DBUG_OFF #endif -#include <my_global.h> +#include "strings_def.h" #include <ctype.h> #include <my_sys.h> -#include "m_string.h" uchar to_upper[256]; uchar to_lower[256], sort_order[256]; diff --git a/strings/dtoa.c b/strings/dtoa.c index 4086bf412fe..6b216056f66 100644 --- a/strings/dtoa.c +++ b/strings/dtoa.c @@ -36,9 +36,8 @@ ***************************************************************/ +#include "strings_def.h" #include <my_base.h> /* for EOVERFLOW on Windows */ -#include <my_global.h> -#include <m_string.h> /* for memcpy and NOT_FIXED_DEC */ /** Appears to suffice to not call malloc() in most cases. @@ -1413,30 +1412,23 @@ static double my_strtod_int(const char *s00, char **se, int *error, char *buf, s nd0= nd; if (s < end - 1 && c == '.') { - c= *++s; + ++s; if (!nd) { - for (; s < end; ++s) - { - c= *s; - if (c != '0') - break; + for (; s < end && (c= *s) == '0'; ++s) nz++; - } - if (s < end && c > '0' && c <= '9') + if (s < end && (c= *s) > '0' && c <= '9') { s0= s; nf+= nz; nz= 0; + goto have_dig; } - else - goto dig_done; + goto dig_done; } - for (; s < end; ++s) + for (; s < end && (c= *s) >= '0' && c <= '9'; ++s) { - c= *s; - if (c < '0' || c > '9') - break; + have_dig: /* Here we are parsing the fractional part. We can stop counting digits after a while: the extra digits diff --git a/strings/dump_map.c b/strings/dump_map.c index b5bb3d66251..debc44d6f5f 100644 --- a/strings/dump_map.c +++ b/strings/dump_map.c @@ -1,5 +1,7 @@ /* Copyright (c) 2003, 2004, 2006 MySQL AB + Copyright (c) 2009-2011, Monty Program Ab Use is subject to license terms. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/int2str.c b/strings/int2str.c index 73a0484e2bc..9d099d2e7d1 100644 --- a/strings/int2str.c +++ b/strings/int2str.c @@ -1,27 +1,39 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. +*/ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" /* _dig_vec arrays are public because they are used in several outer places. */ -char _dig_vec_upper[] = +const char _dig_vec_upper[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; -char _dig_vec_lower[] = +const char _dig_vec_lower[] = "0123456789abcdefghijklmnopqrstuvwxyz"; @@ -56,7 +68,7 @@ int2str(register long int val, register char *dst, register int radix, char buffer[65]; register char *p; long int new_val; - char *dig_vec= upcase ? _dig_vec_upper : _dig_vec_lower; + const char *dig_vec= upcase ? _dig_vec_upper : _dig_vec_lower; ulong uval= (ulong) val; if (radix < 0) diff --git a/strings/is_prefix.c b/strings/is_prefix.c index 05ca82844f8..2933577b5ab 100644 --- a/strings/is_prefix.c +++ b/strings/is_prefix.c @@ -1,18 +1,30 @@ -/* Copyright (c) 2000, 2001, 2006 MySQL AB - Use is subject to license terms. +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. +*/ /* File : is_prefix.c Author : Michael Widenius @@ -22,8 +34,7 @@ A empty t is allways a prefix. */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" int is_prefix(register const char *s, register const char *t) { diff --git a/strings/llstr.c b/strings/llstr.c index 5d904af59d1..3525cab79ca 100644 --- a/strings/llstr.c +++ b/strings/llstr.c @@ -1,18 +1,30 @@ -/* Copyright (c) 2000, 2001, 2004, 2006, 2007 MySQL AB - Use is subject to license terms. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. +*/ /* Defines: llstr(); @@ -25,8 +37,7 @@ */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" char *llstr(longlong value,char *buff) { @@ -39,3 +50,4 @@ char *ullstr(longlong value,char *buff) longlong10_to_str(value,buff,10); return buff; } + diff --git a/strings/longlong2str.c b/strings/longlong2str.c index 18bc1daa0ba..4be380207a4 100644 --- a/strings/longlong2str.c +++ b/strings/longlong2str.c @@ -1,18 +1,30 @@ -/* Copyright (c) 2000, 2001, 2004, 2006, 2007 MySQL AB, 2009 Sun Microsystems, Inc. - Use is subject to license terms. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. +*/ /* Defines: longlong2str(); @@ -38,8 +50,7 @@ itoa assumes that 10 -base numbers are allways signed and other arn't. */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" #ifndef ll2str @@ -52,7 +63,7 @@ char *ll2str(longlong val,char *dst,int radix, int upcase) char buffer[65]; register char *p; long long_val; - char *dig_vec= upcase ? _dig_vec_upper : _dig_vec_lower; + const char *dig_vec= upcase ? _dig_vec_upper : _dig_vec_lower; ulonglong uval= (ulonglong) val; if (radix < 0) diff --git a/strings/my_strchr.c b/strings/my_strchr.c index df1e85254b6..0305ef89542 100644 --- a/strings/my_strchr.c +++ b/strings/my_strchr.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,9 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #define NEQ(A, B) ((A) != (B)) #define EQU(A, B) ((A) == (B)) diff --git a/strings/my_strtoll10.c b/strings/my_strtoll10.c index ce935077e4a..89450f15c9f 100644 --- a/strings/my_strtoll10.c +++ b/strings/my_strtoll10.c @@ -1,21 +1,33 @@ -/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +/* Copyright (c) 2003 TXT DataKonsult Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. +*/ -#include <my_global.h> +#include "strings_def.h" #include <my_sys.h> /* Needed for MY_ERRNO_ERANGE */ -#include <m_string.h> #define MAX_NEGATIVE_NUMBER ((ulonglong) LL(0x8000000000000000)) #define INIT_CNT 9 diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c index b0fd83451a6..3ac4156da22 100644 --- a/strings/my_vsnprintf.c +++ b/strings/my_vsnprintf.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,10 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <my_global.h> -#include <m_string.h> -#include <stdarg.h> +#include "strings_def.h" #include <m_ctype.h> +#include <stdarg.h> #define MAX_ARGS 32 /* max positional args count*/ @@ -681,3 +681,66 @@ size_t my_snprintf(char* to, size_t n, const char* fmt, ...) return result; } + +/** + Writes output to the stream according to a format string. + + @param stream file to write to + @param format string format + @param args list of parameters + + @retval + number of the characters written. +*/ + +int my_vfprintf(FILE *stream, const char* format, va_list args) +{ + char cvtbuf[1024]; + int alloc= 0; + char *p= cvtbuf; + size_t cur_len= sizeof(cvtbuf); + int ret; + + /* + We do not know how much buffer we need. + So start with a reasonably-sized stack-allocated buffer, and increase + it exponentially until it is big enough. + */ + for (;;) + { + size_t new_len; + size_t actual= my_vsnprintf(p, cur_len, format, args); + if (actual < cur_len - 1) + break; + /* + Not enough space (or just enough with nothing to spare - but we cannot + distinguish this case from the return value). Allocate a bigger buffer + and try again. + */ + if (alloc) + (*my_str_free)(p); + else + alloc= 1; + new_len= cur_len*2; + if (new_len < cur_len) + return 0; /* Overflow */ + cur_len= new_len; + p= (*my_str_malloc)(cur_len); + if (!p) + return 0; + } + ret= fprintf(stream, "%s", p); + if (alloc) + (*my_str_free)(p); + return ret; +} + +int my_fprintf(FILE *stream, const char* format, ...) +{ + int result; + va_list args; + va_start(args, format); + result= my_vfprintf(stream, format, args); + va_end(args); + return result; +} diff --git a/strings/str2int.c b/strings/str2int.c index 6dfa64a2dbe..64d4e169891 100644 --- a/strings/str2int.c +++ b/strings/str2int.c @@ -1,18 +1,30 @@ -/* Copyright (c) 2000-2003, 2006 MySQL AB - Use is subject to license terms. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. +*/ /* str2int(src, radix, lower, upper, &val) @@ -38,9 +50,8 @@ call has no problems. */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #include "my_sys.h" /* defines errno */ #include <errno.h> diff --git a/strings/str_alloc.c b/strings/str_alloc.c index 5d79a266fa4..17139e7b773 100644 --- a/strings/str_alloc.c +++ b/strings/str_alloc.c @@ -1,5 +1,7 @@ -/* Copyright (c) 2000, 2005, 2006 MySQL AB +/* Copyright (c) 2005, 2006 MySQL AB + Copyright (c) 2009-2011, Monty Program Ab Use is subject to license terms. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -14,8 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <my_global.h> -#include <m_string.h> +#include "strings_def.h" static void *my_str_malloc_default(size_t size) { diff --git a/strings/strappend.c b/strings/strappend.c index 469c03e9dc7..2d04f009a60 100644 --- a/strings/strappend.c +++ b/strings/strappend.c @@ -1,18 +1,30 @@ -/* Copyright (c) 2000, 2001, 2006, 2007 MySQL AB - Use is subject to license terms. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. +*/ /* File : strappend.c Author : Monty @@ -24,9 +36,7 @@ trunked. The des+len character is allways set to NULL. */ -#include <my_global.h> -#include "m_string.h" - +#include "strings_def.h" void strappend(register char *s, size_t len, pchar fill) { diff --git a/strings/strcend.c b/strings/strcend.c index 76d40dce0f5..55b05bfcefa 100644 --- a/strings/strcend.c +++ b/strings/strcend.c @@ -1,17 +1,30 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. +*/ /* File : strcend.c Author : Michael Widenius: ifdef MC68000 @@ -22,8 +35,7 @@ occurs, or a pointer to the end-null of s if c does not occur in s. */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" char *strcend(register const char *s, register pchar c) { diff --git a/strings/strcont.c b/strings/strcont.c index f3baf591d82..514d1a1d62f 100644 --- a/strings/strcont.c +++ b/strings/strcont.c @@ -1,18 +1,30 @@ -/* Copyright (c) 2000, 2001, 2006, 2007 MySQL AB - Use is subject to license terms. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. +*/ /* File : strcont.c Author : Monty @@ -25,8 +37,7 @@ */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" char * strcont(reg1 const char *str,reg2 const char *set) { diff --git a/strings/strend.c b/strings/strend.c index 257ffe9b425..33abcad49b3 100644 --- a/strings/strend.c +++ b/strings/strend.c @@ -1,19 +1,31 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; version 2 - of the License. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - MA 02110-1301, USA */ +/* Copyright Richard A. O'Keefe. + Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. +*/ /* File : strend.c Author : Richard A. O'Keefe. @@ -26,8 +38,7 @@ be used instead, but this is clearer and faster. */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" char *strend(register const char *s) { diff --git a/strings/strfill.c b/strings/strfill.c index 9fbb0c2e019..377f9b85e36 100644 --- a/strings/strfill.c +++ b/strings/strfill.c @@ -1,18 +1,30 @@ -/* Copyright (c) 2000, 2001, 2006, 2007 MySQL AB - Use is subject to license terms. +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. +*/ /* File : strfill.c Author : Monty @@ -24,8 +36,7 @@ strfill() returns pointer to dest+len; */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" char * strfill(char *s, size_t len, pchar fill) { diff --git a/strings/strings_def.h b/strings/strings_def.h new file mode 100644 index 00000000000..6bd8e8f5575 --- /dev/null +++ b/strings/strings_def.h @@ -0,0 +1,103 @@ +#ifndef STRINGS_DEF_INCLUDED +#define STRINGS_DEF_INCLUDED +/* Copyright (C) 2011 Monty Program Ab + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* This file is to be include first in all files in the string directory */ + +#include <my_global.h> /* Define standar vars */ +#include "m_string.h" /* Exernal defintions of string functions */ + +/* + We can't use the original DBUG_ASSERT() (which includes _db_flush()) + in the strings library as libdbug is compiled after the the strings + library and we don't want to have strings depending on libdbug which + depends on mysys and strings. +*/ + +#if !defined(DBUG_OFF) +#undef DBUG_ASSERT +#define DBUG_ASSERT(A) assert(A) +#endif + +/* SPACE_INT is a word that contains only spaces */ +#if SIZEOF_INT == 4 +#define SPACE_INT 0x20202020 +#elif SIZEOF_INT == 8 +#define SPACE_INT 0x2020202020202020 +#else +#error define the appropriate constant for a word full of spaces +#endif + +/** + Skip trailing space. + + On most systems reading memory in larger chunks (ideally equal to the size of + the chinks that the machine physically reads from memory) causes fewer memory + access loops and hence increased performance. + This is why the 'int' type is used : it's closest to that (according to how + it's defined in C). + So when we determine the amount of whitespace at the end of a string we do + the following : + 1. We divide the string into 3 zones : + a) from the start of the string (__start) to the first multiple + of sizeof(int) (__start_words) + b) from the end of the string (__end) to the last multiple of sizeof(int) + (__end_words) + c) a zone that is aligned to sizeof(int) and can be safely accessed + through an int * + 2. We start comparing backwards from (c) char-by-char. If all we find is + space then we continue + 3. If there are elements in zone (b) we compare them as unsigned ints to a + int mask (SPACE_INT) consisting of all spaces + 4. Finally we compare the remaining part (a) of the string char by char. + This covers for the last non-space unsigned int from 3. (if any) + + This algorithm works well for relatively larger strings, but it will slow + the things down for smaller strings (because of the additional calculations + and checks compared to the naive method). Thus the barrier of length 20 + is added. + + @param ptr pointer to the input string + @param len the length of the string + @return the last non-space character +*/ + +static inline const uchar *skip_trailing_space(const uchar *ptr,size_t len) +{ + const uchar *end= ptr + len; + + if (len > 20) + { + const uchar *end_words= (const uchar *)(intptr) + (((ulonglong)(intptr)end) / SIZEOF_INT * SIZEOF_INT); + const uchar *start_words= (const uchar *)(intptr) + ((((ulonglong)(intptr)ptr) + SIZEOF_INT - 1) / SIZEOF_INT * SIZEOF_INT); + + DBUG_ASSERT(((ulonglong)(intptr)ptr) >= SIZEOF_INT); + if (end_words > ptr) + { + while (end > end_words && end[-1] == 0x20) + end--; + if (end[-1] == 0x20 && start_words < end_words) + while (end > start_words && ((unsigned *)end)[-1] == SPACE_INT) + end -= SIZEOF_INT; + } + } + while (end > ptr && end[-1] == 0x20) + end--; + return (end); +} +#endif diff --git a/strings/strmake.c b/strings/strmake.c index 5a062e4df4f..951a589e360 100644 --- a/strings/strmake.c +++ b/strings/strmake.c @@ -1,5 +1,7 @@ -/* Copyright (c) 2000, 2001, 2003, 2006-2008 MySQL AB, 2009 Sun Microsystems, Inc. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab Use is subject to license terms. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,31 +27,42 @@ strmake() returns pointer to closing null */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" char *strmake(register char *dst, register const char *src, size_t length) { -#ifdef EXTRA_DEBUG - /* - 'length' is the maximum length of the string; the buffer needs - to be one character larger to accomodate the terminating '\0'. - This is easy to get wrong, so we make sure we write to the - entire length of the buffer to identify incorrect buffer-sizes. - We only initialise the "unused" part of the buffer here, a) for - efficiency, and b) because dst==src is allowed, so initialising - the entire buffer would overwrite the source-string. Also, we - write a character rather than '\0' as this makes spotting these - problems in the results easier. - */ - uint n= 0; - while (n < length && src[n++]); - memset(dst + n, (int) 'Z', length - n + 1); -#endif - while (length--) + { if (! (*dst++ = *src++)) + { +#ifdef EXTRA_DEBUG + /* + 'length' is the maximum length of the string; the buffer needs + to be one character larger to accommodate the terminating + '\0'. This is easy to get wrong, so we make sure we write to + the entire length of the buffer to identify incorrect + buffer-sizes. We only initialism the "unused" part of the + buffer here, a) for efficiency, and b) because dst==src is + allowed, so initializing the entire buffer would overwrite the + source-string. Also, we write a character rather than '\0' as + this makes spotting these problems in the results easier. + + If we are using purify/valgrind, we only set one character at + end to be able to detect also wrong accesses after the end of + dst. + */ + if (length) + { +#ifdef HAVE_valgrind + dst[length-1]= 'Z'; +#else + bfill(dst, length-1, (int) 'Z'); +#endif /* HAVE_valgrind */ + } +#endif /* EXTRA_DEBUG */ return dst-1; + } + } *dst=0; return dst; } diff --git a/strings/strmov.c b/strings/strmov.c index 84dd358c34e..b38d5db5d6e 100644 --- a/strings/strmov.c +++ b/strings/strmov.c @@ -1,17 +1,30 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. +*/ /* strmov(dst, src) moves all the characters of src (including the @@ -21,13 +34,9 @@ into dst, which seems useful. */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" -#ifdef strmov -#undef strmov -#define strmov strmov_overlapp -#endif +#ifndef strmov char *strmov(register char *dst, register const char *src) { @@ -35,3 +44,4 @@ char *strmov(register char *dst, register const char *src) return dst-1; } +#endif /* strmov */ diff --git a/strings/strmov_overlapp.c b/strings/strmov_overlapp.c new file mode 100644 index 00000000000..59d980fc7c4 --- /dev/null +++ b/strings/strmov_overlapp.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2000 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "strings_def.h" + +/* A trivial implementation */ +char *strmov_overlapp(char *dst, const char *src) +{ + size_t len= strlen(src); + memmove(dst, src, len+1); + return dst+len; +} + diff --git a/strings/strnlen.c b/strings/strnlen.c index 162cc9768f3..c831d63243e 100644 --- a/strings/strnlen.c +++ b/strings/strnlen.c @@ -1,18 +1,31 @@ -/* Copyright (c) 2000, 2001, 2006, 2007 MySQL AB - Use is subject to license terms. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +/* Copyright Richard A. O'Keefe. + Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. +*/ /* File : strnlen.c Author : Michael Widenius @@ -21,8 +34,7 @@ strnlen(s, len) returns the length of s or len if s is longer than len. */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" #ifndef HAVE_STRNLEN diff --git a/strings/strnmov.c b/strings/strnmov.c index 19f752fa93b..41d772c6819 100644 --- a/strings/strnmov.c +++ b/strings/strnmov.c @@ -1,18 +1,30 @@ -/* Copyright (c) 2000, 2001, 2006, 2007 MySQL AB - Use is subject to license terms. +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. +*/ /* strnmov(dst,src,length) moves length characters, or until end, of src to @@ -21,8 +33,7 @@ truncated. */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" char *strnmov(register char *dst, register const char *src, size_t n) { diff --git a/strings/strxmov.c b/strings/strxmov.c index de4e2fa60af..6338832a1a0 100644 --- a/strings/strxmov.c +++ b/strings/strxmov.c @@ -1,20 +1,31 @@ -/* Copyright (c) 2000-2002, 2006 MySQL AB - Use is subject to license terms. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; version 2 - of the License. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - MA 02110-1301, USA */ +/* Copyright Richard A. O'Keefe. + Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. +*/ /* File : strxmov.c Author : Richard A. O'Keefe. @@ -31,9 +42,7 @@ character pointer, or not the same bit pattern as NullS. */ -#include <my_global.h> -#include "m_string.h" -#include <stdarg.h> +#include "strings_def.h" char *strxmov(char *dst,const char *src, ...) { diff --git a/strings/strxnmov.c b/strings/strxnmov.c index 5e70b54902a..20058b84259 100644 --- a/strings/strxnmov.c +++ b/strings/strxnmov.c @@ -1,20 +1,31 @@ -/* Copyright (c) 2000-2002, 2005-2007 MySQL AB - Use is subject to license terms. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; version 2 - of the License. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - MA 02110-1301, USA */ +/* Copyright Richard A. O'Keefe. + Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. +*/ /* File : strxnmov.c Author : Richard A. O'Keefe. @@ -36,8 +47,7 @@ if total-string-length >= length then dst[length] will be set to \0 */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" #include <stdarg.h> char *strxnmov(char *dst, size_t len, const char *src, ...) diff --git a/strings/uca-dump.c b/strings/uca-dump.c index 066981f02f5..d5c20854636 100644 --- a/strings/uca-dump.c +++ b/strings/uca-dump.c @@ -1,5 +1,7 @@ /* Copyright (c) 2004, 2006 MySQL AB + Copyright (c) 2009-2011, Monty Program Ab Use is subject to license terms. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/uctypedump.c b/strings/uctypedump.c index 9f85d66f3f6..ed3c64969d5 100644 --- a/strings/uctypedump.c +++ b/strings/uctypedump.c @@ -14,15 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -/* -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -*/ -#include <my_global.h> -#include <m_string.h> +#include "strings_def.h" #include <m_ctype.h> -#include "m_ctype.h" typedef struct my_ctype_name_st @@ -205,7 +198,7 @@ int main(int ac, char ** av) int charnum=0; int num=0; - printf("static unsigned char uctype_page%02X[256]=\n{\n",plane); + printf("static unsigned char uctype_page%02X[256]=\n{\n", (uint) plane); for(charnum=0;charnum<256;charnum++) { @@ -232,7 +225,7 @@ int main(int ac, char ** av) { char plane_name[128]="NULL"; if(uctype[plane].ctype){ - sprintf(plane_name,"uctype_page%02X",plane); + sprintf(plane_name,"uctype_page%02X",(uint) plane); } printf("\t{%d,%s}%s\n",uctype[plane].pctype,plane_name,plane<255?",":""); } diff --git a/strings/utr11-dump.c b/strings/utr11-dump.c index 54c1de7b7b8..0806b3ba0cd 100644 --- a/strings/utr11-dump.c +++ b/strings/utr11-dump.c @@ -1,5 +1,7 @@ /* Copyright (c) 2004, 2006 MySQL AB + Copyright (c) 2009-2011, Monty Program Ab Use is subject to license terms. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/xml.c b/strings/xml.c index 303212fab53..3b2c278f553 100644 --- a/strings/xml.c +++ b/strings/xml.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. + Copyright (c) 2011 Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,8 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "my_global.h" -#include "m_string.h" +#include "strings_def.h" #include "my_xml.h" |