Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
f8160a49
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
10 个月 前同步成功
通知
0
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
f8160a49
编写于
7月 21, 2015
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add FLAG_SAFE() for values known to be small-enough
And add check to FLAG()
上级
366aeaad
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
12 addition
and
11 deletion
+12
-11
src/hb-ot-shape-complex-arabic.cc
src/hb-ot-shape-complex-arabic.cc
+1
-1
src/hb-ot-shape-complex-indic.cc
src/hb-ot-shape-complex-indic.cc
+6
-6
src/hb-ot-shape-complex-myanmar.cc
src/hb-ot-shape-complex-myanmar.cc
+1
-1
src/hb-private.hh
src/hb-private.hh
+3
-2
src/hb-unicode-private.hh
src/hb-unicode-private.hh
+1
-1
未找到文件。
src/hb-ot-shape-complex-arabic.cc
浏览文件 @
f8160a49
...
...
@@ -61,7 +61,7 @@ static unsigned int get_joining_type (hb_codepoint_t u, hb_unicode_general_categ
if
(
likely
(
j_type
!=
JOINING_TYPE_X
))
return
j_type
;
return
(
FLAG
(
gen_cat
)
&
return
(
FLAG
_SAFE
(
gen_cat
)
&
(
FLAG
(
HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK
)
|
FLAG
(
HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK
)
|
FLAG
(
HB_UNICODE_GENERAL_CATEGORY_FORMAT
))
...
...
src/hb-ot-shape-complex-indic.cc
浏览文件 @
f8160a49
...
...
@@ -142,7 +142,7 @@ is_one_of (const hb_glyph_info_t &info, unsigned int flags)
{
/* If it ligated, all bets are off. */
if
(
_hb_glyph_info_ligated
(
&
info
))
return
false
;
return
!!
(
FLAG
(
info
.
indic_category
())
&
flags
);
return
!!
(
FLAG
_SAFE
(
info
.
indic_category
())
&
flags
);
}
static
inline
bool
...
...
@@ -237,7 +237,7 @@ set_indic_properties (hb_glyph_info_t &info)
* Re-assign position.
*/
if
((
FLAG
(
cat
)
&
CONSONANT_FLAGS
))
if
((
FLAG
_SAFE
(
cat
)
&
CONSONANT_FLAGS
))
{
pos
=
POS_BASE_C
;
if
(
is_ra
(
u
))
...
...
@@ -247,7 +247,7 @@ set_indic_properties (hb_glyph_info_t &info)
{
pos
=
matra_position
(
u
,
pos
);
}
else
if
((
FLAG
(
cat
)
&
(
FLAG
(
OT_SM
)
|
FLAG
(
OT_VD
)
|
FLAG
(
OT_A
)
|
FLAG
(
OT_Symbol
))))
else
if
((
FLAG
_SAFE
(
cat
)
&
(
FLAG
(
OT_SM
)
|
FLAG
(
OT_VD
)
|
FLAG
(
OT_A
)
|
FLAG
(
OT_Symbol
))))
{
pos
=
POS_SMVD
;
}
...
...
@@ -963,7 +963,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
indic_position_t
last_pos
=
POS_START
;
for
(
unsigned
int
i
=
start
;
i
<
end
;
i
++
)
{
if
((
FLAG
(
info
[
i
].
indic_category
())
&
(
JOINER_FLAGS
|
FLAG
(
OT_N
)
|
FLAG
(
OT_RS
)
|
MEDIAL_FLAGS
|
HALANT_OR_COENG_FLAGS
)))
if
((
FLAG
_SAFE
(
info
[
i
].
indic_category
())
&
(
JOINER_FLAGS
|
FLAG
(
OT_N
)
|
FLAG
(
OT_RS
)
|
MEDIAL_FLAGS
|
HALANT_OR_COENG_FLAGS
)))
{
info
[
i
].
indic_position
()
=
last_pos
;
if
(
unlikely
(
info
[
i
].
indic_category
()
==
OT_H
&&
...
...
@@ -1550,7 +1550,7 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
{
new_reph_pos
=
base
;
while
(
new_reph_pos
<
end
&&
!
(
FLAG
(
info
[
new_reph_pos
+
1
].
indic_position
())
&
(
FLAG
(
POS_POST_C
)
|
FLAG
(
POS_AFTER_POST
)
|
FLAG
(
POS_SMVD
))))
!
(
FLAG
_SAFE
(
info
[
new_reph_pos
+
1
].
indic_position
())
&
(
FLAG
(
POS_POST_C
)
|
FLAG
(
POS_AFTER_POST
)
|
FLAG
(
POS_SMVD
))))
new_reph_pos
++
;
if
(
new_reph_pos
<
end
)
goto
reph_move
;
...
...
@@ -1701,7 +1701,7 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
/* Apply 'init' to the Left Matra if it's a word start. */
if
(
info
[
start
].
indic_position
()
==
POS_PRE_M
&&
(
!
start
||
!
(
FLAG
(
_hb_glyph_info_get_general_category
(
&
info
[
start
-
1
]))
&
!
(
FLAG
_SAFE
(
_hb_glyph_info_get_general_category
(
&
info
[
start
-
1
]))
&
FLAG_RANGE
(
HB_UNICODE_GENERAL_CATEGORY_FORMAT
,
HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK
))))
info
[
start
].
mask
|=
indic_plan
->
mask_array
[
INIT
];
...
...
src/hb-ot-shape-complex-myanmar.cc
浏览文件 @
f8160a49
...
...
@@ -154,7 +154,7 @@ is_one_of (const hb_glyph_info_t &info, unsigned int flags)
{
/* If it ligated, all bets are off. */
if
(
_hb_glyph_info_ligated
(
&
info
))
return
false
;
return
!!
(
FLAG
(
info
.
myanmar_category
())
&
flags
);
return
!!
(
FLAG
_SAFE
(
info
.
myanmar_category
())
&
flags
);
}
static
inline
bool
...
...
src/hb-private.hh
浏览文件 @
f8160a49
...
...
@@ -846,9 +846,10 @@ hb_in_ranges (T u, T lo1, T hi1, T lo2, T hi2, T lo3, T hi3)
/* Useful for set-operations on small enums.
* For example, for testing "x ∈ {x1, x2, x3}" use:
* (FLAG(x) & (FLAG(x1) | FLAG(x2) | FLAG(x3)))
* (FLAG
_SAFE
(x) & (FLAG(x1) | FLAG(x2) | FLAG(x3)))
*/
#define FLAG(x) (1U<<(x))
#define FLAG(x) (ASSERT_STATIC_EXPR_ZERO ((x) < 32) + (1U << (x)))
#define FLAG_SAFE(x) (1U << (x))
#define FLAG_RANGE(x,y) (ASSERT_STATIC_EXPR_ZERO ((x) < (y)) + FLAG(y+1) - FLAG(x))
...
...
src/hb-unicode-private.hh
浏览文件 @
f8160a49
...
...
@@ -308,7 +308,7 @@ extern HB_INTERNAL const hb_unicode_funcs_t _hb_unicode_funcs_nil;
/* Misc */
#define HB_UNICODE_GENERAL_CATEGORY_IS_MARK(gen_cat) \
(FLAG (gen_cat) & \
(FLAG
_SAFE
(gen_cat) & \
(FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \
FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | \
FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录