Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
54ece299
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看板
提交
54ece299
编写于
4月 16, 2019
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use type aliasing for meta-functions, ie. those returning a type
上级
1ce11b44
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
19 addition
and
18 deletion
+19
-18
src/hb-algs.hh
src/hb-algs.hh
+2
-1
src/hb-array.hh
src/hb-array.hh
+3
-3
src/hb-atomic.hh
src/hb-atomic.hh
+1
-1
src/hb-blob.hh
src/hb-blob.hh
+1
-1
src/hb-common.cc
src/hb-common.cc
+1
-1
src/hb-ft.cc
src/hb-ft.cc
+1
-1
src/hb-iter.hh
src/hb-iter.hh
+1
-1
src/hb-meta.hh
src/hb-meta.hh
+6
-6
src/hb-null.hh
src/hb-null.hh
+3
-3
未找到文件。
src/hb-algs.hh
浏览文件 @
54ece299
...
...
@@ -42,7 +42,8 @@ struct
//{ return hb_deref_pointer (v).hash (); }
/* Instead, the following ugly soution: */
template
<
typename
T
,
hb_enable_if
(
!
hb_is_integer
(
hb_remove_const
(
hb_remove_reference
(
T
)))
&&
!
hb_is_pointer
(
T
))>
hb_enable_if
(
!
hb_is_integer
(
hb_remove_const
<
hb_remove_reference
<
T
>
>
)
&&
!
hb_is_pointer
(
T
))
>
uint32_t
operator
()
(
T
&&
v
)
const
{
return
v
.
hash
();
}
template
<
typename
T
>
...
...
src/hb-array.hh
浏览文件 @
54ece299
...
...
@@ -47,13 +47,13 @@ struct hb_array_t : hb_iter_with_fallback_t<hb_array_t<Type>, Type&>
hb_iter_with_fallback_t
<
hb_array_t
<
Type
>
,
Type
&>
(),
arrayZ
(
o
.
arrayZ
),
length
(
o
.
length
)
{}
template
<
typename
U
=
Type
,
hb_enable_if
(
hb_is_const
(
U
))>
hb_array_t
(
const
hb_array_t
<
hb_remove_const
(
Type
)
>
&
o
)
:
arrayZ
(
o
.
arrayZ
),
length
(
o
.
length
)
{}
hb_array_t
(
const
hb_array_t
<
hb_remove_const
<
Type
>
>
&
o
)
:
arrayZ
(
o
.
arrayZ
),
length
(
o
.
length
)
{}
hb_array_t
(
Type
*
array_
,
unsigned
int
length_
)
:
arrayZ
(
array_
),
length
(
length_
)
{}
template
<
unsigned
int
length_
>
hb_array_t
(
Type
(
&
array_
)[
length_
])
:
arrayZ
(
array_
),
length
(
length_
)
{}
template
<
typename
U
=
Type
,
hb_enable_if
(
hb_is_const
(
U
))>
hb_array_t
&
operator
=
(
const
hb_array_t
<
hb_remove_const
(
Type
)
>
&
o
)
hb_array_t
&
operator
=
(
const
hb_array_t
<
hb_remove_const
<
Type
>
>
&
o
)
{
arrayZ
=
o
.
arrayZ
;
length
=
o
.
length
;
return
*
this
;
}
hb_array_t
&
operator
=
(
const
hb_array_t
&
o
)
{
arrayZ
=
o
.
arrayZ
;
length
=
o
.
length
;
return
*
this
;
}
...
...
@@ -214,7 +214,7 @@ struct hb_sorted_array_t :
hb_sorted_array_t
()
:
hb_array_t
<
Type
>
()
{}
hb_sorted_array_t
(
const
hb_array_t
<
Type
>
&
o
)
:
hb_array_t
<
Type
>
(
o
)
{}
template
<
typename
U
=
Type
,
hb_enable_if
(
hb_is_const
(
U
))>
hb_sorted_array_t
(
const
hb_sorted_array_t
<
hb_remove_const
(
Type
)
>
&
o
)
:
hb_array_t
<
Type
>
(
o
)
{}
hb_sorted_array_t
(
const
hb_sorted_array_t
<
hb_remove_const
<
Type
>
>
&
o
)
:
hb_array_t
<
Type
>
(
o
)
{}
hb_sorted_array_t
(
Type
*
array_
,
unsigned
int
length_
)
:
hb_array_t
<
Type
>
(
array_
,
length_
)
{}
template
<
unsigned
int
length_
>
hb_sorted_array_t
(
Type
(
&
array_
)[
length_
])
:
hb_array_t
<
Type
>
(
array_
)
{}
...
...
src/hb-atomic.hh
浏览文件 @
54ece299
...
...
@@ -283,7 +283,7 @@ struct hb_atomic_int_t
template
<
typename
P
>
struct
hb_atomic_ptr_t
{
typedef
hb_remove_pointer
(
P
)
T
;
typedef
hb_remove_pointer
<
P
>
T
;
void
init
(
T
*
v_
=
nullptr
)
{
set_relaxed
(
v_
);
}
void
set_relaxed
(
T
*
v_
)
{
hb_atomic_ptr_impl_set_relaxed
(
&
v
,
v_
);
}
...
...
src/hb-blob.hh
浏览文件 @
54ece299
...
...
@@ -81,7 +81,7 @@ struct hb_blob_t
template
<
typename
P
>
struct
hb_blob_ptr_t
{
typedef
hb_remove_pointer
(
P
)
T
;
typedef
hb_remove_pointer
<
P
>
T
;
hb_blob_ptr_t
(
hb_blob_t
*
b_
=
nullptr
)
:
b
(
b_
)
{}
hb_blob_t
*
operator
=
(
hb_blob_t
*
b_
)
{
return
b
=
b_
;
}
...
...
src/hb-common.cc
浏览文件 @
54ece299
...
...
@@ -783,7 +783,7 @@ parse_uint32 (const char **pp, const char *end, uint32_t *pv)
static
void
free_static_C_locale
();
#endif
static
struct
hb_C_locale_lazy_loader_t
:
hb_lazy_loader_t
<
hb_remove_pointer
(
HB_LOCALE_T
)
,
static
struct
hb_C_locale_lazy_loader_t
:
hb_lazy_loader_t
<
hb_remove_pointer
<
HB_LOCALE_T
>
,
hb_C_locale_lazy_loader_t
>
{
static
HB_LOCALE_T
create
()
...
...
src/hb-ft.cc
浏览文件 @
54ece299
...
...
@@ -748,7 +748,7 @@ hb_ft_font_create_referenced (FT_Face ft_face)
static
void
free_static_ft_library
();
#endif
static
struct
hb_ft_library_lazy_loader_t
:
hb_lazy_loader_t
<
hb_remove_pointer
(
FT_Library
)
,
static
struct
hb_ft_library_lazy_loader_t
:
hb_lazy_loader_t
<
hb_remove_pointer
<
FT_Library
>
,
hb_ft_library_lazy_loader_t
>
{
static
FT_Library
create
()
...
...
src/hb-iter.hh
浏览文件 @
54ece299
...
...
@@ -78,7 +78,7 @@ struct hb_iter_t
* it will be returning pointer to temporary rvalue. */
template
<
typename
T
=
item_t
,
hb_enable_if
(
hb_is_reference
(
T
))>
hb_remove_reference
(
item_t
)
*
operator
->
()
const
{
return
hb_addressof
(
**
thiz
());
}
hb_remove_reference
<
item_t
>
*
operator
->
()
const
{
return
hb_addressof
(
**
thiz
());
}
item_t
operator
*
()
const
{
return
thiz
()
->
__item__
();
}
item_t
operator
*
()
{
return
thiz
()
->
__item__
();
}
item_t
operator
[]
(
unsigned
i
)
const
{
return
thiz
()
->
__item_at__
(
i
);
}
...
...
src/hb-meta.hh
浏览文件 @
54ece299
...
...
@@ -56,15 +56,15 @@ template <typename T> static inline T hb_declval ();
template
<
typename
T
>
struct
hb_match_const
{
typedef
T
type
;
enum
{
value
=
false
};
};
template
<
typename
T
>
struct
hb_match_const
<
const
T
>
{
typedef
T
type
;
enum
{
value
=
true
};
};
#define hb_remove_const(T) typename hb_match_const<T>::type
template
<
typename
T
>
using
hb_remove_const
=
typename
hb_match_const
<
T
>::
type
;
#define hb_is_const(T) hb_match_const<T>::value
template
<
typename
T
>
struct
hb_match_reference
{
typedef
T
type
;
enum
{
value
=
false
};
};
template
<
typename
T
>
struct
hb_match_reference
<
T
&>
{
typedef
T
type
;
enum
{
value
=
true
};
};
#define hb_remove_reference(T) typename hb_match_reference<T>::type
template
<
typename
T
>
using
hb_remove_reference
=
typename
hb_match_reference
<
T
>::
type
;
#define hb_is_reference(T) hb_match_reference<T>::value
template
<
typename
T
>
struct
hb_match_pointer
{
typedef
T
type
;
enum
{
value
=
false
};
};
template
<
typename
T
>
struct
hb_match_pointer
<
T
*>
{
typedef
T
type
;
enum
{
value
=
true
};
};
#define hb_remove_pointer(T) typename hb_match_pointer<T>::type
template
<
typename
T
>
using
hb_remove_pointer
=
typename
hb_match_pointer
<
T
>::
type
;
#define hb_is_pointer(T) hb_match_pointer<T>::value
struct
...
...
@@ -79,12 +79,12 @@ struct
/* std::move and std::forward */
template
<
typename
T
>
static
hb_remove_reference
(
T
)
&&
hb_move
(
T
&&
t
)
{
return
(
hb_remove_reference
(
T
)
&&
)
(
t
);
}
static
hb_remove_reference
<
T
>&&
hb_move
(
T
&&
t
)
{
return
(
hb_remove_reference
<
T
>
&&
)
(
t
);
}
template
<
typename
T
>
static
T
&&
hb_forward
(
hb_remove_reference
(
T
)
&
t
)
{
return
(
T
&&
)
t
;
}
static
T
&&
hb_forward
(
hb_remove_reference
<
T
>
&
t
)
{
return
(
T
&&
)
t
;
}
template
<
typename
T
>
static
T
&&
hb_forward
(
hb_remove_reference
(
T
)
&&
t
)
{
return
(
T
&&
)
t
;
}
static
T
&&
hb_forward
(
hb_remove_reference
<
T
>
&&
t
)
{
return
(
T
&&
)
t
;
}
/* Void! For when we need a expression-type of void. */
...
...
src/hb-null.hh
浏览文件 @
54ece299
...
...
@@ -95,7 +95,7 @@ struct Null {
template
<
typename
QType
>
struct
NullHelper
{
typedef
hb_remove_const
(
hb_remove_reference
(
QType
))
Type
;
typedef
hb_remove_const
<
hb_remove_reference
<
QType
>
>
Type
;
static
const
Type
&
get_null
()
{
return
Null
<
Type
>::
get_null
();
}
};
#define Null(Type) NullHelper<Type>::get_null ()
...
...
@@ -148,7 +148,7 @@ static inline Type& Crap () {
template
<
typename
QType
>
struct
CrapHelper
{
typedef
hb_remove_const
(
hb_remove_reference
(
QType
))
Type
;
typedef
hb_remove_const
<
hb_remove_reference
<
QType
>
>
Type
;
static
Type
&
get_crap
()
{
return
Crap
<
Type
>
();
}
};
#define Crap(Type) CrapHelper<Type>::get_crap ()
...
...
@@ -171,7 +171,7 @@ struct CrapOrNullHelper<const Type> {
template
<
typename
P
>
struct
hb_nonnull_ptr_t
{
typedef
hb_remove_pointer
(
P
)
T
;
typedef
hb_remove_pointer
<
P
>
T
;
hb_nonnull_ptr_t
(
T
*
v_
=
nullptr
)
:
v
(
v_
)
{}
T
*
operator
=
(
T
*
v_
)
{
return
v
=
v_
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录