Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
70a52d6b
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
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看板
提交
70a52d6b
编写于
1月 22, 2019
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Convert all other enum class consts to static constexpr
Fixes
https://github.com/harfbuzz/harfbuzz/issues/1553
上级
5d4b0377
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
20 addition
and
20 deletion
+20
-20
src/hb-cff-interp-common.hh
src/hb-cff-interp-common.hh
+1
-1
src/hb-iter.hh
src/hb-iter.hh
+1
-1
src/hb-machinery.hh
src/hb-machinery.hh
+6
-6
src/hb-open-type.hh
src/hb-open-type.hh
+4
-4
src/hb-set-digest.hh
src/hb-set-digest.hh
+2
-2
src/hb-set.hh
src/hb-set.hh
+5
-5
src/hb-vector.hh
src/hb-vector.hh
+1
-1
未找到文件。
src/hb-cff-interp-common.hh
浏览文件 @
70a52d6b
...
...
@@ -477,7 +477,7 @@ struct stack_t
unsigned
int
get_count
()
const
{
return
count
;
}
bool
is_empty
()
const
{
return
count
==
0
;
}
enum
{
kSizeLimit
=
LIMIT
}
;
static
constexpr
unsigned
kSizeLimit
=
LIMIT
;
protected:
bool
error
;
...
...
src/hb-iter.hh
浏览文件 @
70a52d6b
...
...
@@ -48,7 +48,7 @@ struct hb_iter_t
typedef
Iter
iter_t
;
typedef
iter_t
const_iter_t
;
typedef
Item
item_t
;
enum
{
item_size
=
hb_static_size
(
Item
)
}
;
static
constexpr
unsigned
item_size
=
hb_static_size
(
Item
)
;
private:
/* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */
...
...
src/hb-machinery.hh
浏览文件 @
70a52d6b
...
...
@@ -97,19 +97,19 @@ static inline Type& StructAfter(TObject &X)
#define DEFINE_SIZE_STATIC(size) \
DEFINE_INSTANCE_ASSERTION (sizeof (*this) == (size)) \
unsigned int get_size () const { return (size); } \
enum { null_size = (size) }
; \
enum { min_size = (size) }
; \
static constexpr unsigned null_size = (size)
; \
static constexpr unsigned min_size = (size)
; \
enum { static_size = (size) }
#define DEFINE_SIZE_UNION(size, _member) \
DEFINE_COMPILES_ASSERTION ((void) this->u._member.static_size) \
DEFINE_INSTANCE_ASSERTION (sizeof(this->u._member) == (size)) \
enum { null_size = (size) }
; \
static constexpr unsigned null_size = (size)
; \
enum { min_size = (size) }
#define DEFINE_SIZE_MIN(size) \
DEFINE_INSTANCE_ASSERTION (sizeof (*this) >= (size)) \
enum { null_size = (size) }
; \
static constexpr unsigned null_size = (size)
; \
enum { min_size = (size) }
#define DEFINE_SIZE_UNBOUNDED(size) \
...
...
@@ -119,7 +119,7 @@ static inline Type& StructAfter(TObject &X)
#define DEFINE_SIZE_ARRAY(size, array) \
DEFINE_COMPILES_ASSERTION ((void) (array)[0].static_size) \
DEFINE_INSTANCE_ASSERTION (sizeof (*this) == (size) + VAR * sizeof ((array)[0])) \
enum { null_size = (size) }
; \
static constexpr unsigned null_size = (size)
; \
enum { min_size = (size) }
#define DEFINE_SIZE_ARRAY_SIZED(size, array) \
...
...
@@ -134,7 +134,7 @@ static inline Type& StructAfter(TObject &X)
template
<
typename
Context
,
typename
Return
,
unsigned
int
MaxDebugDepth
>
struct
hb_dispatch_context_t
{
enum
{
max_debug_depth
=
MaxDebugDepth
}
;
static
constexpr
unsigned
max_debug_depth
=
MaxDebugDepth
;
typedef
Return
return_t
;
template
<
typename
T
,
typename
F
>
bool
may_dispatch
(
const
T
*
obj
HB_UNUSED
,
const
F
*
format
HB_UNUSED
)
{
return
true
;
}
...
...
src/hb-open-type.hh
浏览文件 @
70a52d6b
...
...
@@ -356,7 +356,7 @@ template <typename Type>
struct
UnsizedArrayOf
{
typedef
Type
item_t
;
enum
{
item_size
=
hb_static_size
(
Type
)
}
;
static
constexpr
unsigned
item_size
=
hb_static_size
(
Type
)
;
HB_NO_CREATE_COPY_ASSIGN_TEMPLATE
(
UnsizedArrayOf
,
Type
);
...
...
@@ -512,7 +512,7 @@ template <typename Type, typename LenType=HBUINT16>
struct
ArrayOf
{
typedef
Type
item_t
;
enum
{
item_size
=
hb_static_size
(
Type
)
}
;
static
constexpr
unsigned
item_size
=
hb_static_size
(
Type
)
;
HB_NO_CREATE_COPY_ASSIGN_TEMPLATE2
(
ArrayOf
,
Type
,
LenType
);
...
...
@@ -682,7 +682,7 @@ struct OffsetListOf : OffsetArrayOf<Type>
template
<
typename
Type
,
typename
LenType
=
HBUINT16
>
struct
HeadlessArrayOf
{
enum
{
item_size
=
Type
::
static_size
}
;
static
constexpr
unsigned
item_size
=
Type
::
static_size
;
HB_NO_CREATE_COPY_ASSIGN_TEMPLATE2
(
HeadlessArrayOf
,
Type
,
LenType
);
...
...
@@ -891,7 +891,7 @@ struct VarSizedBinSearchHeader
template
<
typename
Type
>
struct
VarSizedBinSearchArrayOf
{
enum
{
item_size
=
Type
::
static_size
}
;
static
constexpr
unsigned
item_size
=
Type
::
static_size
;
HB_NO_CREATE_COPY_ASSIGN_TEMPLATE
(
VarSizedBinSearchArrayOf
,
Type
);
...
...
src/hb-set-digest.hh
浏览文件 @
70a52d6b
...
...
@@ -48,8 +48,8 @@
template
<
typename
mask_t
,
unsigned
int
shift
>
struct
hb_set_digest_lowest_bits_t
{
enum
{
mask_bytes
=
sizeof
(
mask_t
)
}
;
enum
{
mask_bits
=
sizeof
(
mask_t
)
*
8
}
;
static
constexpr
unsigned
mask_bytes
=
sizeof
(
mask_t
)
;
static
constexpr
unsigned
mask_bits
=
sizeof
(
mask_t
)
*
8
;
enum
{
num_bits
=
0
+
(
mask_bytes
>=
1
?
3
:
0
)
+
(
mask_bytes
>=
2
?
1
:
0
)
...
...
src/hb-set.hh
浏览文件 @
70a52d6b
...
...
@@ -161,7 +161,7 @@ struct hb_set_t
}
typedef
unsigned
long
long
elt_t
;
enum
{
PAGE_BITS
=
512
}
;
static
constexpr
unsigned
PAGE_BITS
=
512
;
static_assert
((
PAGE_BITS
&
((
PAGE_BITS
)
-
1
))
==
0
,
""
);
static
unsigned
int
elt_get_min
(
const
elt_t
&
elt
)
{
return
hb_ctz
(
elt
);
}
...
...
@@ -169,10 +169,10 @@ struct hb_set_t
typedef
hb_vector_size_t
<
elt_t
,
PAGE_BITS
/
8
>
vector_t
;
enum
{
ELT_BITS
=
sizeof
(
elt_t
)
*
8
}
;
enum
{
ELT_MASK
=
ELT_BITS
-
1
}
;
enum
{
BITS
=
sizeof
(
vector_t
)
*
8
}
;
enum
{
MASK
=
BITS
-
1
}
;
static
constexpr
unsigned
ELT_BITS
=
sizeof
(
elt_t
)
*
8
;
static
constexpr
unsigned
ELT_MASK
=
ELT_BITS
-
1
;
static
constexpr
unsigned
BITS
=
sizeof
(
vector_t
)
*
8
;
static
constexpr
unsigned
MASK
=
BITS
-
1
;
static_assert
((
unsigned
)
PAGE_BITS
==
(
unsigned
)
BITS
,
""
);
elt_t
&
elt
(
hb_codepoint_t
g
)
{
return
v
[(
g
&
MASK
)
/
ELT_BITS
];
}
...
...
src/hb-vector.hh
浏览文件 @
70a52d6b
...
...
@@ -36,7 +36,7 @@ template <typename Type>
struct
hb_vector_t
{
typedef
Type
item_t
;
enum
{
item_size
=
hb_static_size
(
Type
)
}
;
static
constexpr
unsigned
item_size
=
hb_static_size
(
Type
)
;
HB_NO_COPY_ASSIGN_TEMPLATE
(
hb_vector_t
,
Type
);
hb_vector_t
()
{
init
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录