1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

fix typos.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-09-16 16:59:08 +00:00
parent a67d4fa01c
commit b3d772643e
2 changed files with 9 additions and 9 deletions

View file

@ -31,7 +31,7 @@ Wed Sep 17 01:33:11 2008 Tanaka Akira <akr@fsij.org>
* regexec.c (string_cmp_ic): add text_end argument.
(match_at): check end of character after exact string matches.
* enc/utf_8.c (graphme_table): defined for extended graphme cluster
* enc/utf_8.c (grapheme_table): defined for extended grapheme cluster
boundary.
(grapheme_cmp): defined.
(get_grapheme_properties): defined.
@ -41,7 +41,7 @@ Wed Sep 17 01:33:11 2008 Tanaka Akira <akr@fsij.org>
(mbc_to_code0): extracted from mbc_to_code.
(mbc_to_code): use mbc_to_code0.
(left_adjust_combchar_head): defined.
(utf_8): use a extended graphme cluster as a unit.
(utf_8): use a extended grapheme cluster as a unit.
* enc/unicode.c (onigenc_unicode_mbc_case_fold): use
ONIGENC_MBC_PRECISE_CODEPOINT to extract codepoints.

View file

@ -255,11 +255,11 @@ static OnigCodePoint mbc_to_code(const UChar* p, const UChar* end, int *precise_
#define GRAPHEME_BIT_T 0x040
#define GRAPHEME_BIT_LV 0x080
#define GRAPHEME_BIT_LVT 0x100
const struct graphme_table_t { /* codepoint_min <= c < codepoint_min+num_codepoints */
const struct grapheme_table_t { /* codepoint_min <= c < codepoint_min+num_codepoints */
OnigCodePoint codepoint_min;
unsigned short num_codepoints;
unsigned short properties;
} graphme_table[] = {
} grapheme_table[] = {
{0x00000,32,0x001}, {0x0007F,33,0x001},
{0x000AD,1,0x001}, {0x00300,112,0x002},
{0x00483,7,0x002}, {0x00591,45,0x002},
@ -801,8 +801,8 @@ const struct graphme_table_t { /* codepoint_min <= c < codepoint_min+num_codepoi
static int
grapheme_cmp(const void *p1, const void *p2)
{
const struct graphme_table_t *k = p1;
const struct graphme_table_t *v = p2;
const struct grapheme_table_t *k = p1;
const struct grapheme_table_t *v = p2;
OnigCodePoint c = k->codepoint_min;
if (c < v->codepoint_min)
return -1;
@ -814,10 +814,10 @@ grapheme_cmp(const void *p1, const void *p2)
static unsigned int
get_grapheme_properties(OnigCodePoint c)
{
struct graphme_table_t key, *found;
struct grapheme_table_t key, *found;
key.codepoint_min = c;
found = bsearch(&key, graphme_table, sizeof(graphme_table)/sizeof(*graphme_table),
sizeof(*graphme_table), grapheme_cmp);
found = bsearch(&key, grapheme_table, sizeof(grapheme_table)/sizeof(*grapheme_table),
sizeof(*grapheme_table), grapheme_cmp);
if (found)
return found->properties;
return 0;