Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
c3448e8d
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,发现更多精彩内容 >>
提交
c3448e8d
编写于
10月 15, 2017
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use static_assert instead of custom ASSERT_STATIC
上级
76dcbf8b
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
50 addition
and
53 deletion
+50
-53
src/hb-buffer-private.hh
src/hb-buffer-private.hh
+2
-2
src/hb-buffer.cc
src/hb-buffer.cc
+1
-1
src/hb-cache-private.hh
src/hb-cache-private.hh
+2
-2
src/hb-coretext.cc
src/hb-coretext.cc
+1
-1
src/hb-open-type-private.hh
src/hb-open-type-private.hh
+3
-3
src/hb-ot-layout-common-private.hh
src/hb-ot-layout-common-private.hh
+1
-1
src/hb-ot-layout-gdef-table.hh
src/hb-ot-layout-gdef-table.hh
+3
-3
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+7
-7
src/hb-ot-map.cc
src/hb-ot-map.cc
+1
-1
src/hb-ot-math-table.hh
src/hb-ot-math-table.hh
+2
-2
src/hb-ot-shape-complex-arabic-fallback.hh
src/hb-ot-shape-complex-arabic-fallback.hh
+3
-3
src/hb-ot-shape-complex-indic.cc
src/hb-ot-shape-complex-indic.cc
+1
-1
src/hb-ot-shape-complex-use.cc
src/hb-ot-shape-complex-use.cc
+1
-1
src/hb-private.hh
src/hb-private.hh
+15
-19
src/hb-set-private.hh
src/hb-set-private.hh
+4
-4
src/hb-uniscribe.cc
src/hb-uniscribe.cc
+1
-1
util/options.cc
util/options.cc
+2
-1
未找到文件。
src/hb-buffer-private.hh
浏览文件 @
c3448e8d
...
...
@@ -45,8 +45,8 @@
#define HB_BUFFER_MAX_LEN_DEFAULT 0x3FFFFFFF
/* Shaping more than a billion chars? Let us know! */
#endif
ASSERT_STATIC
(
sizeof
(
hb_glyph_info_t
)
==
20
);
ASSERT_STATIC
(
sizeof
(
hb_glyph_info_t
)
==
sizeof
(
hb_glyph_position_t
)
);
static_assert
((
sizeof
(
hb_glyph_info_t
)
==
20
),
""
);
static_assert
((
sizeof
(
hb_glyph_info_t
)
==
sizeof
(
hb_glyph_position_t
)),
""
);
HB_MARK_AS_FLAG_T
(
hb_buffer_flags_t
);
HB_MARK_AS_FLAG_T
(
hb_buffer_serialize_flags_t
);
...
...
src/hb-buffer.cc
浏览文件 @
c3448e8d
...
...
@@ -130,7 +130,7 @@ hb_buffer_t::enlarge (unsigned int size)
while
(
size
>=
new_allocated
)
new_allocated
+=
(
new_allocated
>>
1
)
+
32
;
ASSERT_STATIC
(
sizeof
(
info
[
0
])
==
sizeof
(
pos
[
0
])
);
static_assert
((
sizeof
(
info
[
0
])
==
sizeof
(
pos
[
0
])),
""
);
if
(
unlikely
(
_hb_unsigned_int_mul_overflows
(
new_allocated
,
sizeof
(
info
[
0
]))))
goto
done
;
...
...
src/hb-cache-private.hh
浏览文件 @
c3448e8d
...
...
@@ -35,8 +35,8 @@
template
<
unsigned
int
key_bits
,
unsigned
int
value_bits
,
unsigned
int
cache_bits
>
struct
hb_cache_t
{
ASSERT_STATIC
(
key_bits
>=
cache_bits
);
ASSERT_STATIC
(
key_bits
+
value_bits
-
cache_bits
<
8
*
sizeof
(
unsigned
int
)
);
static_assert
((
key_bits
>=
cache_bits
),
""
);
static_assert
((
key_bits
+
value_bits
-
cache_bits
<
8
*
sizeof
(
unsigned
int
)),
""
);
inline
void
clear
(
void
)
{
...
...
src/hb-coretext.cc
浏览文件 @
c3448e8d
...
...
@@ -678,7 +678,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
CFNumberCreate
(
kCFAllocatorDefault
,
kCFNumberIntType
,
&
active_features
[
j
].
rec
.
feature
),
CFNumberCreate
(
kCFAllocatorDefault
,
kCFNumberIntType
,
&
active_features
[
j
].
rec
.
setting
)
};
ASSERT_STATIC
(
ARRAY_LENGTH
(
keys
)
==
ARRAY_LENGTH
(
values
)
);
static_assert
((
ARRAY_LENGTH
(
keys
)
==
ARRAY_LENGTH
(
values
)),
""
);
CFDictionaryRef
dict
=
CFDictionaryCreate
(
kCFAllocatorDefault
,
(
const
void
**
)
keys
,
(
const
void
**
)
values
,
...
...
src/hb-open-type-private.hh
浏览文件 @
c3448e8d
...
...
@@ -85,7 +85,7 @@ static inline Type& StructAfter(TObject &X)
#define _DEFINE_INSTANCE_ASSERTION1(_line, _assertion) \
inline void _instance_assertion_on_line_##_line (void) const \
{ \
ASSERT_STATIC (_assertion
); \
static_assert ((_assertion), ""
); \
ASSERT_INSTANCE_POD (*this);
/* Make sure it's POD. */
\
}
# define _DEFINE_INSTANCE_ASSERTION0(_line, _assertion) _DEFINE_INSTANCE_ASSERTION1 (_line, _assertion)
...
...
@@ -136,7 +136,7 @@ static const void *_NullPool[(256+8) / sizeof (void *)];
/* Generic nul-content Null objects. */
template
<
typename
Type
>
static
inline
const
Type
&
Null
(
void
)
{
ASSERT_STATIC
(
sizeof
(
Type
)
<=
sizeof
(
_NullPool
)
);
static_assert
((
sizeof
(
Type
)
<=
sizeof
(
_NullPool
)),
""
);
return
*
CastP
<
Type
>
(
_NullPool
);
}
...
...
@@ -147,7 +147,7 @@ template <> \
/*static*/
inline const Type& Null<Type> (void) { \
return *CastP<Type> (_Null##Type); \
}
/* The following line really exists such that we end in a place needing semicolon */
\
ASSERT_STATIC (Type::min_size + 1 <= sizeof (_Null##Type)
)
static_assert (Type::min_size + 1 <= sizeof (_Null##Type), "Null pool too small. Enlarge."
)
/* Accessor macro. */
#define Null(Type) Null<Type>()
...
...
src/hb-ot-layout-common-private.hh
浏览文件 @
c3448e8d
...
...
@@ -690,7 +690,7 @@ struct CoverageFormat1
inline
unsigned
int
get_coverage
(
hb_codepoint_t
glyph_id
)
const
{
int
i
=
glyphArray
.
bsearch
(
glyph_id
);
ASSERT_STATIC
(((
unsigned
int
)
-
1
)
==
NOT_COVERED
);
static_assert
((((
unsigned
int
)
-
1
)
==
NOT_COVERED
),
""
);
return
i
;
}
...
...
src/hb-ot-layout-gdef-table.hh
浏览文件 @
c3448e8d
...
...
@@ -404,9 +404,9 @@ struct GDEF
{
unsigned
int
klass
=
get_glyph_class
(
glyph
);
ASSERT_STATIC
((
unsigned
int
)
HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH
==
(
unsigned
int
)
LookupFlag
::
IgnoreBaseGlyphs
);
ASSERT_STATIC
((
unsigned
int
)
HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE
==
(
unsigned
int
)
LookupFlag
::
IgnoreLigatures
);
ASSERT_STATIC
((
unsigned
int
)
HB_OT_LAYOUT_GLYPH_PROPS_MARK
==
(
unsigned
int
)
LookupFlag
::
IgnoreMarks
);
static_assert
(((
unsigned
int
)
HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH
==
(
unsigned
int
)
LookupFlag
::
IgnoreBaseGlyphs
),
""
);
static_assert
(((
unsigned
int
)
HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE
==
(
unsigned
int
)
LookupFlag
::
IgnoreLigatures
),
""
);
static_assert
(((
unsigned
int
)
HB_OT_LAYOUT_GLYPH_PROPS_MARK
==
(
unsigned
int
)
LookupFlag
::
IgnoreMarks
),
""
);
switch
(
klass
)
{
default:
return
0
;
...
...
src/hb-ot-layout.cc
浏览文件 @
c3448e8d
...
...
@@ -321,7 +321,7 @@ hb_ot_layout_table_find_script (hb_face_t *face,
hb_tag_t
script_tag
,
unsigned
int
*
script_index
)
{
ASSERT_STATIC
(
OT
::
Index
::
NOT_FOUND_INDEX
==
HB_OT_LAYOUT_NO_SCRIPT_INDEX
);
static_assert
((
OT
::
Index
::
NOT_FOUND_INDEX
==
HB_OT_LAYOUT_NO_SCRIPT_INDEX
),
""
);
const
OT
::
GSUBGPOS
&
g
=
get_gsubgpos_table
(
face
,
table_tag
);
if
(
g
.
find_script_index
(
script_tag
,
script_index
))
...
...
@@ -352,7 +352,7 @@ hb_ot_layout_table_choose_script (hb_face_t *face,
unsigned
int
*
script_index
,
hb_tag_t
*
chosen_script
)
{
ASSERT_STATIC
(
OT
::
Index
::
NOT_FOUND_INDEX
==
HB_OT_LAYOUT_NO_SCRIPT_INDEX
);
static_assert
((
OT
::
Index
::
NOT_FOUND_INDEX
==
HB_OT_LAYOUT_NO_SCRIPT_INDEX
),
""
);
const
OT
::
GSUBGPOS
&
g
=
get_gsubgpos_table
(
face
,
table_tag
);
while
(
*
script_tags
)
...
...
@@ -411,7 +411,7 @@ hb_ot_layout_table_find_feature (hb_face_t *face,
hb_tag_t
feature_tag
,
unsigned
int
*
feature_index
)
{
ASSERT_STATIC
(
OT
::
Index
::
NOT_FOUND_INDEX
==
HB_OT_LAYOUT_NO_FEATURE_INDEX
);
static_assert
((
OT
::
Index
::
NOT_FOUND_INDEX
==
HB_OT_LAYOUT_NO_FEATURE_INDEX
),
""
);
const
OT
::
GSUBGPOS
&
g
=
get_gsubgpos_table
(
face
,
table_tag
);
unsigned
int
num_features
=
g
.
get_feature_count
();
...
...
@@ -448,7 +448,7 @@ hb_ot_layout_script_find_language (hb_face_t *face,
hb_tag_t
language_tag
,
unsigned
int
*
language_index
)
{
ASSERT_STATIC
(
OT
::
Index
::
NOT_FOUND_INDEX
==
HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX
);
static_assert
((
OT
::
Index
::
NOT_FOUND_INDEX
==
HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX
),
""
);
const
OT
::
Script
&
s
=
get_gsubgpos_table
(
face
,
table_tag
).
get_script
(
script_index
);
if
(
s
.
find_lang_sys_index
(
language_tag
,
language_index
))
...
...
@@ -527,7 +527,7 @@ hb_ot_layout_language_get_feature_tags (hb_face_t *face,
const
OT
::
GSUBGPOS
&
g
=
get_gsubgpos_table
(
face
,
table_tag
);
const
OT
::
LangSys
&
l
=
g
.
get_script
(
script_index
).
get_lang_sys
(
language_index
);
ASSERT_STATIC
(
sizeof
(
unsigned
int
)
==
sizeof
(
hb_tag_t
)
);
static_assert
((
sizeof
(
unsigned
int
)
==
sizeof
(
hb_tag_t
)),
""
);
unsigned
int
ret
=
l
.
get_feature_indexes
(
start_offset
,
feature_count
,
(
unsigned
int
*
)
feature_tags
);
if
(
feature_tags
)
{
...
...
@@ -548,7 +548,7 @@ hb_ot_layout_language_find_feature (hb_face_t *face,
hb_tag_t
feature_tag
,
unsigned
int
*
feature_index
)
{
ASSERT_STATIC
(
OT
::
Index
::
NOT_FOUND_INDEX
==
HB_OT_LAYOUT_NO_FEATURE_INDEX
);
static_assert
((
OT
::
Index
::
NOT_FOUND_INDEX
==
HB_OT_LAYOUT_NO_FEATURE_INDEX
),
""
);
const
OT
::
GSUBGPOS
&
g
=
get_gsubgpos_table
(
face
,
table_tag
);
const
OT
::
LangSys
&
l
=
g
.
get_script
(
script_index
).
get_lang_sys
(
language_index
);
...
...
@@ -859,7 +859,7 @@ hb_ot_layout_feature_with_variations_get_lookups (hb_face_t *face,
unsigned
int
*
lookup_count
/* IN/OUT */
,
unsigned
int
*
lookup_indexes
/* OUT */
)
{
ASSERT_STATIC
(
OT
::
FeatureVariations
::
NOT_FOUND_INDEX
==
HB_OT_LAYOUT_NO_VARIATIONS_INDEX
);
static_assert
((
OT
::
FeatureVariations
::
NOT_FOUND_INDEX
==
HB_OT_LAYOUT_NO_VARIATIONS_INDEX
),
""
);
const
OT
::
GSUBGPOS
&
g
=
get_gsubgpos_table
(
face
,
table_tag
);
const
OT
::
Feature
&
f
=
g
.
get_feature_variation
(
feature_index
,
variations_index
);
...
...
src/hb-ot-map.cc
浏览文件 @
c3448e8d
...
...
@@ -138,7 +138,7 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m,
const
int
*
coords
,
unsigned
int
num_coords
)
{
ASSERT_STATIC
(
!
(
HB_GLYPH_FLAG_DEFINED
&
(
HB_GLYPH_FLAG_DEFINED
+
1
))
);
static_assert
((
!
(
HB_GLYPH_FLAG_DEFINED
&
(
HB_GLYPH_FLAG_DEFINED
+
1
))),
""
);
unsigned
int
global_bit_mask
=
HB_GLYPH_FLAG_DEFINED
+
1
;
unsigned
int
global_bit_shift
=
_hb_popcount32
(
HB_GLYPH_FLAG_DEFINED
);
...
...
src/hb-ot-math-table.hh
浏览文件 @
c3448e8d
...
...
@@ -463,8 +463,8 @@ struct MathGlyphPartRecord
out
.
end_connector_length
=
font
->
em_scale
(
endConnectorLength
,
scale
);
out
.
full_advance
=
font
->
em_scale
(
fullAdvance
,
scale
);
ASSERT_STATIC
((
unsigned
int
)
HB_MATH_GLYPH_PART_FLAG_EXTENDER
==
(
unsigned
int
)
PartFlags
::
Extender
);
static_assert
((
unsigned
int
)
HB_MATH_GLYPH_PART_FLAG_EXTENDER
==
(
unsigned
int
)
PartFlags
::
Extender
,
""
);
out
.
flags
=
(
hb_ot_math_glyph_part_flags_t
)
(
unsigned
int
)
...
...
src/hb-ot-shape-complex-arabic-fallback.hh
浏览文件 @
c3448e8d
...
...
@@ -237,8 +237,8 @@ arabic_fallback_plan_init_win1256 (arabic_fallback_plan_t *fallback_plan,
return
false
;
const
Manifest
&
manifest
=
reinterpret_cast
<
const
Manifest
&>
(
arabic_win1256_gsub_lookups
.
manifest
);
ASSERT_STATIC
(
sizeof
(
arabic_win1256_gsub_lookups
.
manifestData
)
/
sizeof
(
ManifestLookup
)
<=
ARABIC_FALLBACK_MAX_LOOKUPS
);
static_assert
(
sizeof
(
arabic_win1256_gsub_lookups
.
manifestData
)
/
sizeof
(
ManifestLookup
)
<=
ARABIC_FALLBACK_MAX_LOOKUPS
,
""
);
/* TODO sanitize the table? */
unsigned
j
=
0
;
...
...
@@ -271,7 +271,7 @@ arabic_fallback_plan_init_unicode (arabic_fallback_plan_t *fallback_plan,
const
hb_ot_shape_plan_t
*
plan
,
hb_font_t
*
font
)
{
ASSERT_STATIC
(
ARRAY_LENGTH_CONST
(
arabic_fallback_features
)
<=
ARABIC_FALLBACK_MAX_LOOKUPS
);
static_assert
((
ARRAY_LENGTH_CONST
(
arabic_fallback_features
)
<=
ARABIC_FALLBACK_MAX_LOOKUPS
),
""
);
unsigned
int
j
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
arabic_fallback_features
)
;
i
++
)
{
...
...
src/hb-ot-shape-complex-indic.cc
浏览文件 @
c3448e8d
...
...
@@ -198,7 +198,7 @@ set_indic_properties (hb_glyph_info_t &info)
0x1CEEu
,
0x1CF1u
)))
{
cat
=
OT_Symbol
;
ASSERT_STATIC
((
int
)
INDIC_SYLLABIC_CATEGORY_AVAGRAHA
==
OT_Symbol
);
static_assert
(((
int
)
INDIC_SYLLABIC_CATEGORY_AVAGRAHA
==
OT_Symbol
),
""
);
}
else
if
(
unlikely
(
hb_in_range
<
hb_codepoint_t
>
(
u
,
0x17CDu
,
0x17D1u
)
||
u
==
0x17CBu
||
u
==
0x17D3u
||
u
==
0x17DDu
))
/* Khmer Various signs */
...
...
src/hb-ot-shape-complex-use.cc
浏览文件 @
c3448e8d
...
...
@@ -292,7 +292,7 @@ setup_topographical_masks (const hb_ot_shape_plan_t *plan,
if
(
use_plan
->
arabic_plan
)
return
;
ASSERT_STATIC
(
INIT
<
4
&&
ISOL
<
4
&&
MEDI
<
4
&&
FINA
<
4
);
static_assert
((
INIT
<
4
&&
ISOL
<
4
&&
MEDI
<
4
&&
FINA
<
4
),
""
);
hb_mask_t
masks
[
4
],
all_masks
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
4
;
i
++
)
{
...
...
src/hb-private.hh
浏览文件 @
c3448e8d
...
...
@@ -100,7 +100,7 @@ private:
#define _PASTE1(a,b) a##b
#define _PASTE(a,b) _PASTE1(a,b)
#define static_assert(e, msg) \
HB_UNUSED typedef
char _PASTE(
assertion_failed_at_line_, __LINE__) [(e) ? 1 : -1]
HB_UNUSED typedef
int _PASTE(static_
assertion_failed_at_line_, __LINE__) [(e) ? 1 : -1]
#endif // static_assert
#endif // __cplusplus < 201103L
...
...
@@ -267,10 +267,6 @@ static inline unsigned int ARRAY_LENGTH (const Type (&)[n]) { return n; }
#define HB_STMT_START do
#define HB_STMT_END while (0)
#define _ASSERT_STATIC1(_line, _cond) HB_UNUSED typedef int _static_assert_on_line_##_line##_failed[(_cond)?1:-1]
#define _ASSERT_STATIC0(_line, _cond) _ASSERT_STATIC1 (_line, (_cond))
#define ASSERT_STATIC(_cond) _ASSERT_STATIC0 (__LINE__, (_cond))
template
<
unsigned
int
cond
>
class
hb_assert_constant_t
;
template
<
>
class
hb_assert_constant_t
<
1
>
{};
...
...
@@ -278,19 +274,19 @@ template <> class hb_assert_constant_t<1> {};
/* Lets assert int types. Saves trouble down the road. */
ASSERT_STATIC
(
sizeof
(
int8_t
)
==
1
);
ASSERT_STATIC
(
sizeof
(
uint8_t
)
==
1
);
ASSERT_STATIC
(
sizeof
(
int16_t
)
==
2
);
ASSERT_STATIC
(
sizeof
(
uint16_t
)
==
2
);
ASSERT_STATIC
(
sizeof
(
int32_t
)
==
4
);
ASSERT_STATIC
(
sizeof
(
uint32_t
)
==
4
);
ASSERT_STATIC
(
sizeof
(
int64_t
)
==
8
);
ASSERT_STATIC
(
sizeof
(
uint64_t
)
==
8
);
static_assert
((
sizeof
(
int8_t
)
==
1
),
""
);
static_assert
((
sizeof
(
uint8_t
)
==
1
),
""
);
static_assert
((
sizeof
(
int16_t
)
==
2
),
""
);
static_assert
((
sizeof
(
uint16_t
)
==
2
),
""
);
static_assert
((
sizeof
(
int32_t
)
==
4
),
""
);
static_assert
((
sizeof
(
uint32_t
)
==
4
),
""
);
static_assert
((
sizeof
(
int64_t
)
==
8
),
""
);
static_assert
((
sizeof
(
uint64_t
)
==
8
),
""
);
ASSERT_STATIC
(
sizeof
(
hb_codepoint_t
)
==
4
);
ASSERT_STATIC
(
sizeof
(
hb_position_t
)
==
4
);
ASSERT_STATIC
(
sizeof
(
hb_mask_t
)
==
4
);
ASSERT_STATIC
(
sizeof
(
hb_var_int_t
)
==
4
);
static_assert
((
sizeof
(
hb_codepoint_t
)
==
4
),
""
);
static_assert
((
sizeof
(
hb_position_t
)
==
4
),
""
);
static_assert
((
sizeof
(
hb_mask_t
)
==
4
),
""
);
static_assert
((
sizeof
(
hb_var_int_t
)
==
4
),
""
);
/* We like our types POD */
...
...
@@ -912,7 +908,7 @@ hb_in_range (T u, T lo, T hi)
* one right now. Declaring a variable won't work as HB_UNUSED
* is unusable on some platforms and unused types are less likely
* to generate a warning than unused variables. */
ASSERT_STATIC
(
sizeof
(
hb_assert_unsigned_t
<
T
>
)
>=
0
);
static_assert
((
sizeof
(
hb_assert_unsigned_t
<
T
>
)
>=
0
),
""
);
/* The casts below are important as if T is smaller than int,
* the subtract results will become a signed int! */
...
...
@@ -1027,7 +1023,7 @@ union hb_options_union_t {
unsigned
int
i
;
hb_options_t
opts
;
};
ASSERT_STATIC
(
sizeof
(
int
)
==
sizeof
(
hb_options_union_t
)
);
static_assert
((
sizeof
(
int
)
==
sizeof
(
hb_options_union_t
)),
""
);
HB_INTERNAL
void
_hb_options_init
(
void
);
...
...
src/hb-set-private.hh
浏览文件 @
c3448e8d
...
...
@@ -62,8 +62,8 @@ struct hb_set_digest_lowest_bits_t
+
(
mask_bytes
>=
16
?
1
:
0
)
+
0
;
ASSERT_STATIC
(
shift
<
sizeof
(
hb_codepoint_t
)
*
8
);
ASSERT_STATIC
(
shift
+
num_bits
<=
sizeof
(
hb_codepoint_t
)
*
8
);
static_assert
((
shift
<
sizeof
(
hb_codepoint_t
)
*
8
),
""
);
static_assert
((
shift
+
num_bits
<=
sizeof
(
hb_codepoint_t
)
*
8
),
""
);
inline
void
init
(
void
)
{
mask
=
0
;
...
...
@@ -341,8 +341,8 @@ struct hb_set_t
elt_t
elts
[
ELTS
];
/* XXX 8kb */
ASSERT_STATIC
(
sizeof
(
elt_t
)
*
8
==
BITS
);
ASSERT_STATIC
(
sizeof
(
elt_t
)
*
8
*
ELTS
>
MAX_G
);
static_assert
((
sizeof
(
elt_t
)
*
8
==
BITS
),
""
);
static_assert
((
sizeof
(
elt_t
)
*
8
*
ELTS
>
MAX_G
),
""
);
};
struct
hb_frozen_set_t
...
...
src/hb-uniscribe.cc
浏览文件 @
c3448e8d
...
...
@@ -316,7 +316,7 @@ _hb_generate_unique_face_name (wchar_t *face_name, unsigned int *plen)
const
char
*
enc
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-"
;
UUID
id
;
UuidCreate
((
UUID
*
)
&
id
);
ASSERT_STATIC
(
2
+
3
*
(
16
/
2
)
<
LF_FACESIZE
);
static_assert
((
2
+
3
*
(
16
/
2
)
<
LF_FACESIZE
),
""
);
unsigned
int
name_str_len
=
0
;
face_name
[
name_str_len
++
]
=
'F'
;
face_name
[
name_str_len
++
]
=
'_'
;
...
...
util/options.cc
浏览文件 @
c3448e8d
...
...
@@ -486,7 +486,8 @@ font_options_t::add_options (option_parser_t *parser)
char
*
text
=
NULL
;
{
ASSERT_STATIC
(
ARRAY_LENGTH_CONST
(
supported_font_funcs
)
>
0
);
static_assert
((
ARRAY_LENGTH_CONST
(
supported_font_funcs
)
>
0
),
"No supported font-funcs found."
);
GString
*
s
=
g_string_new
(
NULL
);
g_string_printf
(
s
,
"Set font functions implementation to use (default: %s)
\n\n
Supported font function implementations are: %s"
,
supported_font_funcs
[
0
].
name
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录