1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

CHARSET_INFO structure reorganization for easier maintainance

This commit is contained in:
unknown
2003-05-23 17:45:52 +05:00
parent f461dea4d7
commit 5aae66c101
27 changed files with 633 additions and 557 deletions

View File

@ -97,13 +97,13 @@ bool String::set(longlong num, CHARSET_INFO *cs)
if (alloc(l))
return TRUE;
if (cs->snprintf == my_snprintf_8bit)
if (cs->cset->snprintf == my_snprintf_8bit)
{
str_length=(uint32) (longlong10_to_str(num,Ptr,-10)-Ptr);
}
else
{
str_length=cs->snprintf(cs,Ptr,l,"%d",num);
str_length=cs->cset->snprintf(cs,Ptr,l,"%d",num);
}
str_charset=cs;
return FALSE;
@ -115,13 +115,13 @@ bool String::set(ulonglong num, CHARSET_INFO *cs)
if (alloc(l))
return TRUE;
if (cs->snprintf == my_snprintf_8bit)
if (cs->cset->snprintf == my_snprintf_8bit)
{
str_length=(uint32) (longlong10_to_str(num,Ptr,10)-Ptr);
}
else
{
str_length=cs->snprintf(cs,Ptr,l,"%d",num);
str_length=cs->cset->snprintf(cs,Ptr,l,"%d",num);
}
str_charset=cs;
return FALSE;
@ -255,7 +255,7 @@ bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *from, CHARSET
for (str_length=new_length ; s < se && d < de ; )
{
if ((cnvres=from->mb_wc(from,&wc,s,se)) > 0 )
if ((cnvres=from->cset->mb_wc(from,&wc,s,se)) > 0 )
{
s+=cnvres;
}
@ -268,7 +268,7 @@ bool String::copy(const char *str,uint32 arg_length, CHARSET_INFO *from, CHARSET
break;
outp:
if((cnvres=to->wc_mb(to,wc,d,de)) >0 )
if((cnvres=to->cset->wc_mb(to,wc,d,de)) >0 )
{
d+=cnvres;
}