Tune BIDIType to Uint16 instead of unsigned int

This commit is contained in:
Vincent Wei
2019-03-07 12:40:37 +08:00
parent 83207ca329
commit 90e4ee91fe
5 changed files with 49 additions and 44 deletions
+2 -2
View File
@@ -470,7 +470,7 @@ static unsigned int iso8859_6_char_type (Achar32 chv)
return ch_type;
}
static Uint32 __mg_iso8859_68x_type[] = {
static Uint16 __mg_iso8859_68x_type[] = {
/*0x00~0x0f*/
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
@@ -588,7 +588,7 @@ static Uint32 __mg_iso8859_68x_type[] = {
BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL, BIDI_TYPE_AL,
};
static unsigned int iso8859_6_bidi_char_type (Achar32 chv)
static Uint16 iso8859_6_bidi_char_type (Achar32 chv)
{
return __mg_iso8859_68x_type[REAL_ACHAR(chv)];
}
+4 -4
View File
@@ -948,7 +948,7 @@ static const unsigned char* iso8859_8_get_next_word (const unsigned char* mstr,
//return sb_get_next_word(mstr, mstrlen, word_info);
}
static Uint32 __mg_iso8859_8_type[] = {
static Uint16 __mg_iso8859_8_type[] = {
/*0x00~0x0f*/
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
@@ -1046,7 +1046,7 @@ static Uint32 __mg_iso8859_8_type[] = {
BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN, BIDI_TYPE_BN,
};
static unsigned int iso8859_8_bidi_char_type (Achar32 chv)
static Uint16 iso8859_8_bidi_char_type (Achar32 chv)
{
return __mg_iso8859_8_type [REAL_ACHAR(chv)];
}
@@ -3568,7 +3568,7 @@ static unsigned int unicode_char_type (Achar32 chv)
#include "unicode-bidi-tables.h"
static unsigned int unicode_bidi_char_type (Achar32 chv)
static Uint16 unicode_bidi_char_type (Achar32 chv)
{
Achar32 chv_first = 0;
Achar32 chv_last = (Achar32)TABLESIZE (__mg_unicode_bidi_char_type_map);
@@ -4401,7 +4401,7 @@ UCharBreakType GUIAPI UCharGetBreakType(Uchar32 uc)
}
/** The function determines the BIDI type of a UNICODE character. */
unsigned int GUIAPI UCharGetBIDIType(Uchar32 uc)
Uint16 GUIAPI UCharGetBIDIType(Uchar32 uc)
{
return unicode_bidi_char_type(uc);
}
+1 -1
View File
@@ -42,7 +42,7 @@
typedef struct _bidichar_type_map
{
Uint32 type; // Type of Unicode characters
Uint16 type; // Type of Unicode characters
Uchar32 chv; // Starting index of Unicode character
Uint8 count; // Total number of Unicode characters of same type starting from glyphn
} BIDICHAR_TYPE_MAP;
+1 -1
View File
@@ -227,7 +227,7 @@ struct _CHARSETOPS
int (*pos_first_char) (const unsigned char* mstr, int mstrlen);
/** The method to get the BIDI type of one character. */
unsigned int (*bidi_char_type) (Achar32 chv);
Uint16 (*bidi_char_type) (Achar32 chv);
/** Get mirrored character */
BOOL (*bidi_mirror_char) (Achar32 chv, Achar32* mirrored);