Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
4acaffd7
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
1 年多 前同步成功
通知
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看板
提交
4acaffd7
编写于
5月 18, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[HB] Don't use G_LIKELY!
上级
3dcb12f1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
17 deletion
+17
-17
src/hb-ot-layout-gsub-private.h
src/hb-ot-layout-gsub-private.h
+6
-6
src/hb-ot-layout-gsubgpos-private.h
src/hb-ot-layout-gsubgpos-private.h
+6
-6
src/hb-ot-layout-open-private.h
src/hb-ot-layout-open-private.h
+2
-2
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+3
-3
未找到文件。
src/hb-ot-layout-gsub-private.h
浏览文件 @
4acaffd7
...
...
@@ -49,7 +49,7 @@ struct SingleSubstFormat1 {
inline
bool
single_substitute
(
hb_codepoint_t
&
glyph_id
)
const
{
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
if
(
G
_LIKELY
(
index
==
NOT_COVERED
))
if
(
HB
_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
glyph_id
+=
deltaGlyphID
;
...
...
@@ -76,10 +76,10 @@ struct SingleSubstFormat2 {
inline
bool
single_substitute
(
hb_codepoint_t
&
glyph_id
)
const
{
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
if
(
G
_LIKELY
(
index
==
NOT_COVERED
))
if
(
HB
_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
if
(
G
_UNLIKELY
(
index
>=
substitute
.
len
))
if
(
HB
_UNLIKELY
(
index
>=
substitute
.
len
))
return
false
;
glyph_id
=
substitute
[
index
];
...
...
@@ -189,7 +189,7 @@ struct MultipleSubstFormat1 {
inline
bool
substitute
(
LOOKUP_ARGS_DEF
)
const
{
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
if
(
G
_LIKELY
(
index
==
NOT_COVERED
))
if
(
HB
_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
return
(
this
+
sequence
[
index
]).
substitute_sequence
(
LOOKUP_ARGS
);
...
...
@@ -243,7 +243,7 @@ struct AlternateSubstFormat1 {
hb_codepoint_t
glyph_id
=
IN_CURGLYPH
();
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
if
(
G
_LIKELY
(
index
==
NOT_COVERED
))
if
(
HB
_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
const
AlternateSet
&
alt_set
=
this
+
alternateSet
[
index
];
...
...
@@ -426,7 +426,7 @@ struct LigatureSubstFormat1 {
property
&
LookupFlag
::
MarkAttachmentType
);
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
if
(
G
_LIKELY
(
index
==
NOT_COVERED
))
if
(
HB
_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
const
LigatureSet
&
lig_set
=
this
+
ligatureSet
[
index
];
...
...
src/hb-ot-layout-gsubgpos-private.h
浏览文件 @
4acaffd7
...
...
@@ -293,7 +293,7 @@ struct ContextFormat1 {
inline
bool
apply
(
LOOKUP_ARGS_DEF
,
apply_lookup_func_t
apply_func
)
const
{
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
if
(
G
_LIKELY
(
index
==
NOT_COVERED
))
if
(
HB
_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
const
RuleSet
&
rule_set
=
this
+
ruleSet
[
index
];
...
...
@@ -324,7 +324,7 @@ struct ContextFormat2 {
inline
bool
apply
(
LOOKUP_ARGS_DEF
,
apply_lookup_func_t
apply_func
)
const
{
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
if
(
G
_LIKELY
(
index
==
NOT_COVERED
))
if
(
HB
_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
const
ClassDef
&
class_def
=
this
+
classDef
;
...
...
@@ -363,7 +363,7 @@ struct ContextFormat3 {
inline
bool
apply
(
LOOKUP_ARGS_DEF
,
apply_lookup_func_t
apply_func
)
const
{
unsigned
int
index
=
(
this
+
coverage
[
0
])
(
IN_CURGLYPH
());
if
(
G
_LIKELY
(
index
==
NOT_COVERED
))
if
(
HB
_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
const
LookupRecord
*
lookupRecord
=
(
const
LookupRecord
*
)
...
...
@@ -531,7 +531,7 @@ struct ChainContextFormat1 {
inline
bool
apply
(
LOOKUP_ARGS_DEF
,
apply_lookup_func_t
apply_func
)
const
{
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
if
(
G
_LIKELY
(
index
==
NOT_COVERED
))
if
(
HB
_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
const
ChainRuleSet
&
rule_set
=
this
+
ruleSet
[
index
];
...
...
@@ -560,7 +560,7 @@ struct ChainContextFormat2 {
inline
bool
apply
(
LOOKUP_ARGS_DEF
,
apply_lookup_func_t
apply_func
)
const
{
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
if
(
G
_LIKELY
(
index
==
NOT_COVERED
))
if
(
HB
_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
const
ClassDef
&
backtrack_class_def
=
this
+
backtrackClassDef
;
...
...
@@ -619,7 +619,7 @@ struct ChainContextFormat3 {
((
const
char
*
)
&
backtrack
+
backtrack
.
get_size
());
unsigned
int
index
=
(
this
+
input
[
0
])
(
IN_CURGLYPH
());
if
(
G
_LIKELY
(
index
==
NOT_COVERED
))
if
(
HB
_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
const
OffsetArrayOf
<
Coverage
>
&
lookahead
=
*
(
const
OffsetArrayOf
<
Coverage
>
*
)
...
...
src/hb-ot-layout-open-private.h
浏览文件 @
4acaffd7
...
...
@@ -490,11 +490,11 @@ struct OpenTypeFontFile {
private:
inline
const
char
*
operator
[]
(
const
OpenTypeTable
&
table
)
const
{
if
(
G
_UNLIKELY
(
table
.
offset
==
0
))
return
NULL
;
if
(
HB
_UNLIKELY
(
table
.
offset
==
0
))
return
NULL
;
return
((
const
char
*
)
this
)
+
table
.
offset
;
}
inline
char
*
operator
[]
(
const
OpenTypeTable
&
table
)
{
if
(
G
_UNLIKELY
(
table
.
offset
==
0
))
return
NULL
;
if
(
HB
_UNLIKELY
(
table
.
offset
==
0
))
return
NULL
;
return
((
char
*
)
this
)
+
table
.
offset
;
}
...
...
src/hb-ot-layout.cc
浏览文件 @
4acaffd7
...
...
@@ -216,7 +216,7 @@ hb_ot_layout_set_glyph_class (hb_ot_layout_t *layout,
hb_ot_layout_class_t
gdef_klass
;
int
len
=
layout
->
new_gdef
.
len
;
if
(
G
_UNLIKELY
(
glyph
>
65535
))
if
(
HB
_UNLIKELY
(
glyph
>
65535
))
return
;
if
(
glyph
>=
len
)
{
...
...
@@ -228,7 +228,7 @@ hb_ot_layout_set_glyph_class (hb_ot_layout_t *layout,
new_len
=
65535
;
new_klasses
=
(
unsigned
char
*
)
realloc
(
layout
->
new_gdef
.
klasses
,
new_len
*
sizeof
(
unsigned
char
));
if
(
G
_UNLIKELY
(
!
new_klasses
))
if
(
HB
_UNLIKELY
(
!
new_klasses
))
return
;
memset
(
new_klasses
+
len
,
0
,
new_len
-
len
);
...
...
@@ -257,7 +257,7 @@ hb_ot_layout_build_glyph_classes (hb_ot_layout_t *layout,
unsigned
char
*
klasses
,
uint16_t
count
)
{
if
(
G
_UNLIKELY
(
!
count
||
!
glyphs
||
!
klasses
))
if
(
HB
_UNLIKELY
(
!
count
||
!
glyphs
||
!
klasses
))
return
;
if
(
layout
->
new_gdef
.
len
==
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录