Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
9e53b083
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看板
提交
9e53b083
编写于
7月 10, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move hb_stable_sort to hb-dsalgs.hh
Also, include hb-dsalgs.hh from end of hb-pricate.hh
上级
39f11d8e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
53 addition
and
51 deletion
+53
-51
src/hb-dsalgs.hh
src/hb-dsalgs.hh
+51
-0
src/hb-ot-os2-unicode-ranges.hh
src/hb-ot-os2-unicode-ranges.hh
+0
-1
src/hb-ot-post-table.hh
src/hb-ot-post-table.hh
+0
-1
src/hb-private.hh
src/hb-private.hh
+2
-49
未找到文件。
src/hb-dsalgs.hh
浏览文件 @
9e53b083
...
...
@@ -158,4 +158,55 @@ static inline void hb_sort_r(void *base, size_t nel, size_t width,
sort_r_simple
(
base
,
nel
,
width
,
compar
,
arg
);
}
template
<
typename
T
,
typename
T2
>
static
inline
void
hb_stable_sort
(
T
*
array
,
unsigned
int
len
,
int
(
*
compar
)(
const
T
*
,
const
T
*
),
T2
*
array2
)
{
for
(
unsigned
int
i
=
1
;
i
<
len
;
i
++
)
{
unsigned
int
j
=
i
;
while
(
j
&&
compar
(
&
array
[
j
-
1
],
&
array
[
i
])
>
0
)
j
--
;
if
(
i
==
j
)
continue
;
/* Move item i to occupy place for item j, shift what's in between. */
{
T
t
=
array
[
i
];
memmove
(
&
array
[
j
+
1
],
&
array
[
j
],
(
i
-
j
)
*
sizeof
(
T
));
array
[
j
]
=
t
;
}
if
(
array2
)
{
T2
t
=
array2
[
i
];
memmove
(
&
array2
[
j
+
1
],
&
array2
[
j
],
(
i
-
j
)
*
sizeof
(
T2
));
array2
[
j
]
=
t
;
}
}
}
template
<
typename
T
>
static
inline
void
hb_stable_sort
(
T
*
array
,
unsigned
int
len
,
int
(
*
compar
)(
const
T
*
,
const
T
*
))
{
hb_stable_sort
(
array
,
len
,
compar
,
(
int
*
)
nullptr
);
}
static
inline
hb_bool_t
hb_codepoint_parse
(
const
char
*
s
,
unsigned
int
len
,
int
base
,
hb_codepoint_t
*
out
)
{
/* Pain because we don't know whether s is nul-terminated. */
char
buf
[
64
];
len
=
MIN
(
ARRAY_LENGTH
(
buf
)
-
1
,
len
);
strncpy
(
buf
,
s
,
len
);
buf
[
len
]
=
'\0'
;
char
*
end
;
errno
=
0
;
unsigned
long
v
=
strtoul
(
buf
,
&
end
,
base
);
if
(
errno
)
return
false
;
if
(
*
end
)
return
false
;
*
out
=
v
;
return
true
;
}
#endif
/* HB_DSALGS_HH */
src/hb-ot-os2-unicode-ranges.hh
浏览文件 @
9e53b083
...
...
@@ -28,7 +28,6 @@
#define HB_OT_OS2_UNICODE_RANGES_HH
#include "hb-private.hh"
#include "hb-dsalgs.hh"
namespace
OT
{
...
...
src/hb-ot-post-table.hh
浏览文件 @
9e53b083
...
...
@@ -28,7 +28,6 @@
#define HB_OT_POST_TABLE_HH
#include "hb-open-type-private.hh"
#include "hb-dsalgs.hh"
#include "hb-subset-plan.hh"
#define HB_STRING_ARRAY_NAME format1_names
...
...
src/hb-private.hh
浏览文件 @
9e53b083
...
...
@@ -1059,55 +1059,6 @@ hb_in_ranges (T u, T lo1, T hi1, T lo2, T hi2, T lo3, T hi3)
#define FLAG_RANGE(x,y) (ASSERT_STATIC_EXPR_ZERO ((x) < (y)) + FLAG(y+1) - FLAG(x))
template
<
typename
T
,
typename
T2
>
static
inline
void
hb_stable_sort
(
T
*
array
,
unsigned
int
len
,
int
(
*
compar
)(
const
T
*
,
const
T
*
),
T2
*
array2
)
{
for
(
unsigned
int
i
=
1
;
i
<
len
;
i
++
)
{
unsigned
int
j
=
i
;
while
(
j
&&
compar
(
&
array
[
j
-
1
],
&
array
[
i
])
>
0
)
j
--
;
if
(
i
==
j
)
continue
;
/* Move item i to occupy place for item j, shift what's in between. */
{
T
t
=
array
[
i
];
memmove
(
&
array
[
j
+
1
],
&
array
[
j
],
(
i
-
j
)
*
sizeof
(
T
));
array
[
j
]
=
t
;
}
if
(
array2
)
{
T2
t
=
array2
[
i
];
memmove
(
&
array2
[
j
+
1
],
&
array2
[
j
],
(
i
-
j
)
*
sizeof
(
T2
));
array2
[
j
]
=
t
;
}
}
}
template
<
typename
T
>
static
inline
void
hb_stable_sort
(
T
*
array
,
unsigned
int
len
,
int
(
*
compar
)(
const
T
*
,
const
T
*
))
{
hb_stable_sort
(
array
,
len
,
compar
,
(
int
*
)
nullptr
);
}
static
inline
hb_bool_t
hb_codepoint_parse
(
const
char
*
s
,
unsigned
int
len
,
int
base
,
hb_codepoint_t
*
out
)
{
/* Pain because we don't know whether s is nul-terminated. */
char
buf
[
64
];
len
=
MIN
(
ARRAY_LENGTH
(
buf
)
-
1
,
len
);
strncpy
(
buf
,
s
,
len
);
buf
[
len
]
=
'\0'
;
char
*
end
;
errno
=
0
;
unsigned
long
v
=
strtoul
(
buf
,
&
end
,
base
);
if
(
errno
)
return
false
;
if
(
*
end
)
return
false
;
*
out
=
v
;
return
true
;
}
/* Vectorization */
...
...
@@ -1311,5 +1262,7 @@ _hb_memalign(void **memptr, size_t alignment, size_t size)
#endif
#include "hb-dsalgs.hh"
#endif
/* HB_PRIVATE_HH */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录