Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
08e280fd
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
08e280fd
编写于
5月 08, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename hb_string_t to hb_bytes_t
上级
bd021a67
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
17 deletion
+17
-17
src/hb-ot-post-table.hh
src/hb-ot-post-table.hh
+8
-8
src/hb-private.hh
src/hb-private.hh
+6
-6
src/hb-string-array.hh
src/hb-string-array.hh
+3
-3
未找到文件。
src/hb-ot-post-table.hh
浏览文件 @
08e280fd
...
@@ -141,7 +141,7 @@ struct post
...
@@ -141,7 +141,7 @@ struct post
inline
bool
get_glyph_name
(
hb_codepoint_t
glyph
,
inline
bool
get_glyph_name
(
hb_codepoint_t
glyph
,
char
*
buf
,
unsigned
int
buf_len
)
const
char
*
buf
,
unsigned
int
buf_len
)
const
{
{
hb_
string
_t
s
=
find_glyph_name
(
glyph
);
hb_
bytes
_t
s
=
find_glyph_name
(
glyph
);
if
(
!
s
.
len
)
if
(
!
s
.
len
)
return
false
;
return
false
;
if
(
!
buf_len
)
if
(
!
buf_len
)
...
@@ -185,7 +185,7 @@ struct post
...
@@ -185,7 +185,7 @@ struct post
}
}
}
}
hb_
string
_t
st
(
name
,
len
);
hb_
bytes
_t
st
(
name
,
len
);
const
uint16_t
*
gid
=
(
const
uint16_t
*
)
hb_bsearch_r
(
&
st
,
gids
,
count
,
sizeof
(
gids
[
0
]),
cmp_key
,
(
void
*
)
this
);
const
uint16_t
*
gid
=
(
const
uint16_t
*
)
hb_bsearch_r
(
&
st
,
gids
,
count
,
sizeof
(
gids
[
0
]),
cmp_key
,
(
void
*
)
this
);
if
(
gid
)
if
(
gid
)
{
{
...
@@ -220,23 +220,23 @@ struct post
...
@@ -220,23 +220,23 @@ struct post
static
inline
int
cmp_key
(
const
void
*
pk
,
const
void
*
po
,
void
*
arg
)
static
inline
int
cmp_key
(
const
void
*
pk
,
const
void
*
po
,
void
*
arg
)
{
{
const
accelerator_t
*
thiz
=
(
const
accelerator_t
*
)
arg
;
const
accelerator_t
*
thiz
=
(
const
accelerator_t
*
)
arg
;
const
hb_
string_t
*
key
=
(
const
hb_string
_t
*
)
pk
;
const
hb_
bytes_t
*
key
=
(
const
hb_bytes
_t
*
)
pk
;
uint16_t
o
=
*
(
const
uint16_t
*
)
po
;
uint16_t
o
=
*
(
const
uint16_t
*
)
po
;
return
thiz
->
find_glyph_name
(
o
).
cmp
(
*
key
);
return
thiz
->
find_glyph_name
(
o
).
cmp
(
*
key
);
}
}
inline
hb_
string
_t
find_glyph_name
(
hb_codepoint_t
glyph
)
const
inline
hb_
bytes
_t
find_glyph_name
(
hb_codepoint_t
glyph
)
const
{
{
if
(
version
==
0x00010000
)
if
(
version
==
0x00010000
)
{
{
if
(
glyph
>=
NUM_FORMAT1_NAMES
)
if
(
glyph
>=
NUM_FORMAT1_NAMES
)
return
hb_
string
_t
();
return
hb_
bytes
_t
();
return
format1_names
(
glyph
);
return
format1_names
(
glyph
);
}
}
if
(
version
!=
0x00020000
||
glyph
>=
glyphNameIndex
->
len
)
if
(
version
!=
0x00020000
||
glyph
>=
glyphNameIndex
->
len
)
return
hb_
string
_t
();
return
hb_
bytes
_t
();
unsigned
int
index
=
glyphNameIndex
->
array
[
glyph
];
unsigned
int
index
=
glyphNameIndex
->
array
[
glyph
];
if
(
index
<
NUM_FORMAT1_NAMES
)
if
(
index
<
NUM_FORMAT1_NAMES
)
...
@@ -244,14 +244,14 @@ struct post
...
@@ -244,14 +244,14 @@ struct post
index
-=
NUM_FORMAT1_NAMES
;
index
-=
NUM_FORMAT1_NAMES
;
if
(
index
>=
index_to_offset
.
len
)
if
(
index
>=
index_to_offset
.
len
)
return
hb_
string
_t
();
return
hb_
bytes
_t
();
unsigned
int
offset
=
index_to_offset
.
array
[
index
];
unsigned
int
offset
=
index_to_offset
.
array
[
index
];
const
uint8_t
*
data
=
pool
+
offset
;
const
uint8_t
*
data
=
pool
+
offset
;
unsigned
int
name_length
=
*
data
;
unsigned
int
name_length
=
*
data
;
data
++
;
data
++
;
return
hb_
string
_t
((
const
char
*
)
data
,
name_length
);
return
hb_
bytes
_t
((
const
char
*
)
data
,
name_length
);
}
}
private:
private:
...
...
src/hb-private.hh
浏览文件 @
08e280fd
...
@@ -1052,12 +1052,12 @@ hb_options (void)
...
@@ -1052,12 +1052,12 @@ hb_options (void)
/* String type. */
/* String type. */
struct
hb_
string
_t
struct
hb_
bytes
_t
{
{
inline
hb_
string
_t
(
void
)
:
bytes
(
nullptr
),
len
(
0
)
{}
inline
hb_
bytes
_t
(
void
)
:
bytes
(
nullptr
),
len
(
0
)
{}
inline
hb_
string
_t
(
const
char
*
bytes_
,
unsigned
int
len_
)
:
bytes
(
bytes_
),
len
(
len_
)
{}
inline
hb_
bytes
_t
(
const
char
*
bytes_
,
unsigned
int
len_
)
:
bytes
(
bytes_
),
len
(
len_
)
{}
inline
int
cmp
(
const
hb_
string
_t
&
a
)
const
inline
int
cmp
(
const
hb_
bytes
_t
&
a
)
const
{
{
if
(
len
!=
a
.
len
)
if
(
len
!=
a
.
len
)
return
(
int
)
a
.
len
-
(
int
)
len
;
return
(
int
)
a
.
len
-
(
int
)
len
;
...
@@ -1066,8 +1066,8 @@ struct hb_string_t
...
@@ -1066,8 +1066,8 @@ struct hb_string_t
}
}
static
inline
int
cmp
(
const
void
*
pa
,
const
void
*
pb
)
static
inline
int
cmp
(
const
void
*
pa
,
const
void
*
pb
)
{
{
hb_
string_t
*
a
=
(
hb_string
_t
*
)
pa
;
hb_
bytes_t
*
a
=
(
hb_bytes
_t
*
)
pa
;
hb_
string_t
*
b
=
(
hb_string
_t
*
)
pb
;
hb_
bytes_t
*
b
=
(
hb_bytes
_t
*
)
pb
;
return
b
->
cmp
(
*
a
);
return
b
->
cmp
(
*
a
);
}
}
...
...
src/hb-string-array.hh
浏览文件 @
08e280fd
...
@@ -66,12 +66,12 @@ static const unsigned int HB_STRING_ARRAY_OFFS_NAME[] =
...
@@ -66,12 +66,12 @@ static const unsigned int HB_STRING_ARRAY_OFFS_NAME[] =
sizeof
(
HB_STRING_ARRAY_TYPE_NAME
)
sizeof
(
HB_STRING_ARRAY_TYPE_NAME
)
};
};
static
inline
hb_
string
_t
static
inline
hb_
bytes
_t
HB_STRING_ARRAY_NAME
(
unsigned
int
i
)
HB_STRING_ARRAY_NAME
(
unsigned
int
i
)
{
{
assert
(
i
<
ARRAY_LENGTH
(
HB_STRING_ARRAY_OFFS_NAME
)
-
1
);
assert
(
i
<
ARRAY_LENGTH
(
HB_STRING_ARRAY_OFFS_NAME
)
-
1
);
return
hb_
string
_t
(
HB_STRING_ARRAY_POOL_NAME
.
str
+
HB_STRING_ARRAY_OFFS_NAME
[
i
],
return
hb_
bytes
_t
(
HB_STRING_ARRAY_POOL_NAME
.
str
+
HB_STRING_ARRAY_OFFS_NAME
[
i
],
HB_STRING_ARRAY_OFFS_NAME
[
i
+
1
]
-
HB_STRING_ARRAY_OFFS_NAME
[
i
]
-
1
);
HB_STRING_ARRAY_OFFS_NAME
[
i
+
1
]
-
HB_STRING_ARRAY_OFFS_NAME
[
i
]
-
1
);
}
}
#undef HB_STRING_ARRAY_TYPE_NAME
#undef HB_STRING_ARRAY_TYPE_NAME
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录