Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
3f806673
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看板
未验证
提交
3f806673
编写于
6月 29, 2019
作者:
E
Ebrahim Byagowi
提交者:
GitHub
6月 29, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Apply some minor improves on CFFIndex
上级
ddd29e55
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
25 deletion
+13
-25
src/hb-ot-cff-common.hh
src/hb-ot-cff-common.hh
+13
-25
未找到文件。
src/hb-ot-cff-common.hh
浏览文件 @
3f806673
...
...
@@ -92,10 +92,8 @@ struct CFFIndex
static
unsigned
int
calculate_serialized_size
(
unsigned
int
offSize_
,
unsigned
int
count
,
unsigned
int
dataSize
)
{
if
(
count
==
0
)
return
COUNT
::
static_size
;
else
return
min_size
+
calculate_offset_array_size
(
offSize_
,
count
)
+
dataSize
;
if
(
count
==
0
)
return
COUNT
::
static_size
;
return
min_size
+
calculate_offset_array_size
(
offSize_
,
count
)
+
dataSize
;
}
bool
serialize
(
hb_serialize_context_t
*
c
,
const
CFFIndex
&
src
)
...
...
@@ -159,9 +157,7 @@ struct CFFIndex
byteArray
.
init
();
byteArray
.
resize
(
buffArray
.
length
);
for
(
unsigned
int
i
=
0
;
i
<
byteArray
.
length
;
i
++
)
{
byteArray
[
i
]
=
byte_str_t
(
buffArray
[
i
].
arrayZ
,
buffArray
[
i
].
length
);
}
bool
result
=
this
->
serialize
(
c
,
offSize_
,
byteArray
);
byteArray
.
fini
();
return
result
;
...
...
@@ -192,43 +188,35 @@ struct CFFIndex
unsigned
int
length_at
(
unsigned
int
index
)
const
{
if
(
likely
((
offset_at
(
index
+
1
)
>=
offset_at
(
index
))
&&
(
offset_at
(
index
+
1
)
<=
offset_at
(
count
))))
return
offset_at
(
index
+
1
)
-
offset_at
(
index
);
else
if
(
unlikely
((
offset_at
(
index
+
1
)
<
offset_at
(
index
))
||
(
offset_at
(
index
+
1
)
>
offset_at
(
count
))))
return
0
;
return
offset_at
(
index
+
1
)
-
offset_at
(
index
);
}
const
unsigned
char
*
data_base
()
const
{
return
(
const
unsigned
char
*
)
this
+
min_size
+
offset_array_size
();
}
{
return
(
const
unsigned
char
*
)
this
+
min_size
+
offset_array_size
();
}
unsigned
int
data_size
()
const
{
return
HBINT8
::
static_size
;
}
byte_str_t
operator
[]
(
unsigned
int
index
)
const
{
if
(
likely
(
index
<
count
))
return
byte_str_t
(
data_base
()
+
offset_at
(
index
)
-
1
,
length_at
(
index
));
else
return
Null
(
byte_str_t
);
if
(
unlikely
(
index
>=
count
))
return
Null
(
byte_str_t
);
return
byte_str_t
(
data_base
()
+
offset_at
(
index
)
-
1
,
length_at
(
index
));
}
unsigned
int
get_size
()
const
{
if
(
this
!=
&
Null
(
CFFIndex
))
{
if
(
count
>
0
)
return
min_size
+
offset_array_size
()
+
(
offset_at
(
count
)
-
1
);
else
return
count
.
static_size
;
/* empty CFFIndex contains count only */
}
else
return
0
;
if
(
this
==
&
Null
(
CFFIndex
))
return
0
;
if
(
count
>
0
)
return
min_size
+
offset_array_size
()
+
(
offset_at
(
count
)
-
1
);
return
count
.
static_size
;
/* empty CFFIndex contains count only */
}
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
likely
((
c
ount
.
sanitize
(
c
)
&&
count
==
0
)
||
/* empty INDEX */
return_trace
(
likely
((
c
->
check_struct
(
this
)
&&
count
==
0
)
||
/* empty INDEX */
(
c
->
check_struct
(
this
)
&&
offSize
>=
1
&&
offSize
<=
4
&&
c
->
check_array
(
offsets
,
offSize
,
count
+
1
)
&&
c
->
check_array
((
const
HBUINT8
*
)
data_base
(),
1
,
max_offset
()
-
1
))));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录