Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
b4715901
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看板
提交
b4715901
编写于
9月 29, 2015
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Define return_trace()
Not functional change (expected!).
上级
c917965b
变更
16
展开全部
隐藏空白更改
内联
并排
Showing
16 changed file
with
575 addition
and
546 deletion
+575
-546
src/hb-open-file-private.hh
src/hb-open-file-private.hh
+10
-10
src/hb-open-type-private.hh
src/hb-open-type-private.hh
+31
-31
src/hb-ot-cmap-table.hh
src/hb-ot-cmap-table.hh
+28
-28
src/hb-ot-glyf-table.hh
src/hb-ot-glyf-table.hh
+2
-2
src/hb-ot-head-table.hh
src/hb-ot-head-table.hh
+1
-1
src/hb-ot-hhea-table.hh
src/hb-ot-hhea-table.hh
+1
-1
src/hb-ot-hmtx-table.hh
src/hb-ot-hmtx-table.hh
+1
-1
src/hb-ot-layout-common-private.hh
src/hb-ot-layout-common-private.hh
+54
-54
src/hb-ot-layout-gdef-table.hh
src/hb-ot-layout-gdef-table.hh
+22
-22
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gpos-table.hh
+130
-122
src/hb-ot-layout-gsub-table.hh
src/hb-ot-layout-gsub-table.hh
+160
-144
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+104
-101
src/hb-ot-layout-jstf-table.hh
src/hb-ot-layout-jstf-table.hh
+18
-17
src/hb-ot-maxp-table.hh
src/hb-ot-maxp-table.hh
+3
-2
src/hb-ot-name-table.hh
src/hb-ot-name-table.hh
+7
-7
src/hb-private.hh
src/hb-private.hh
+3
-3
未找到文件。
src/hb-open-file-private.hh
浏览文件 @
b4715901
...
...
@@ -56,7 +56,7 @@ typedef struct TableRecord
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
return
_trace
(
c
->
check_struct
(
this
));
}
Tag
tag
;
/* 4-byte identifier. */
...
...
@@ -106,7 +106,7 @@ typedef struct OffsetTable
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
c
->
check_array
(
tables
,
TableRecord
::
static_size
,
numTables
));
return
_trace
(
c
->
check_struct
(
this
)
&&
c
->
check_array
(
tables
,
TableRecord
::
static_size
,
numTables
));
}
protected:
...
...
@@ -135,7 +135,7 @@ struct TTCHeaderVersion1
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
table
.
sanitize
(
c
,
this
));
return
_trace
(
table
.
sanitize
(
c
,
this
));
}
protected:
...
...
@@ -175,11 +175,11 @@ struct TTCHeader
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
u
.
header
.
version
.
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
u
.
header
.
version
.
sanitize
(
c
)))
return
_trace
(
false
);
switch
(
u
.
header
.
version
.
major
)
{
case
2
:
/* version 2 is compatible with version 1 */
case
1
:
return
TRACE_RETURN
(
u
.
version1
.
sanitize
(
c
));
default:
return
TRACE_RETURN
(
true
);
case
1
:
return
_trace
(
u
.
version1
.
sanitize
(
c
));
default:
return
_trace
(
true
);
}
}
...
...
@@ -240,14 +240,14 @@ struct OpenTypeFontFile
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
u
.
tag
.
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
u
.
tag
.
sanitize
(
c
)))
return
_trace
(
false
);
switch
(
u
.
tag
)
{
case
CFFTag
:
/* All the non-collection tags */
case
TrueTag
:
case
Typ1Tag
:
case
TrueTypeTag
:
return
TRACE_RETURN
(
u
.
fontFace
.
sanitize
(
c
));
case
TTCTag
:
return
TRACE_RETURN
(
u
.
ttcHeader
.
sanitize
(
c
));
default:
return
TRACE_RETURN
(
true
);
case
TrueTypeTag
:
return
_trace
(
u
.
fontFace
.
sanitize
(
c
));
case
TTCTag
:
return
_trace
(
u
.
ttcHeader
.
sanitize
(
c
));
default:
return
_trace
(
true
);
}
}
...
...
src/hb-open-type-private.hh
浏览文件 @
b4715901
...
...
@@ -624,7 +624,7 @@ struct IntType
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
likely
(
c
->
check_struct
(
this
)));
return
_trace
(
likely
(
c
->
check_struct
(
this
)));
}
protected:
BEInt
<
Type
,
Size
>
v
;
...
...
@@ -652,7 +652,7 @@ struct LONGDATETIME
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
likely
(
c
->
check_struct
(
this
)));
return
_trace
(
likely
(
c
->
check_struct
(
this
)));
}
protected:
LONG
major
;
...
...
@@ -729,7 +729,7 @@ struct FixedVersion
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
return
_trace
(
c
->
check_struct
(
this
));
}
USHORT
major
;
...
...
@@ -765,21 +765,21 @@ struct OffsetTo : Offset<OffsetType>
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
const
void
*
base
)
const
{
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
c
->
check_struct
(
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
check_struct
(
this
)))
return
_trace
(
false
);
unsigned
int
offset
=
*
this
;
if
(
unlikely
(
!
offset
))
return
TRACE_RETURN
(
true
);
if
(
unlikely
(
!
offset
))
return
_trace
(
true
);
const
Type
&
obj
=
StructAtOffset
<
Type
>
(
base
,
offset
);
return
TRACE_RETURN
(
likely
(
obj
.
sanitize
(
c
))
||
neuter
(
c
));
return
_trace
(
likely
(
obj
.
sanitize
(
c
))
||
neuter
(
c
));
}
template
<
typename
T
>
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
const
void
*
base
,
T
user_data
)
const
{
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
c
->
check_struct
(
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
check_struct
(
this
)))
return
_trace
(
false
);
unsigned
int
offset
=
*
this
;
if
(
unlikely
(
!
offset
))
return
TRACE_RETURN
(
true
);
if
(
unlikely
(
!
offset
))
return
_trace
(
true
);
const
Type
&
obj
=
StructAtOffset
<
Type
>
(
base
,
offset
);
return
TRACE_RETURN
(
likely
(
obj
.
sanitize
(
c
,
user_data
))
||
neuter
(
c
));
return
_trace
(
likely
(
obj
.
sanitize
(
c
,
user_data
))
||
neuter
(
c
));
}
/* Set the offset to Null */
...
...
@@ -830,10 +830,10 @@ struct ArrayOf
unsigned
int
items_len
)
{
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
_trace
(
false
);
len
.
set
(
items_len
);
/* TODO(serialize) Overflow? */
if
(
unlikely
(
!
c
->
extend
(
*
this
)))
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
(
true
);
if
(
unlikely
(
!
c
->
extend
(
*
this
)))
return
_trace
(
false
);
return
_trace
(
true
);
}
inline
bool
serialize
(
hb_serialize_context_t
*
c
,
...
...
@@ -841,17 +841,17 @@ struct ArrayOf
unsigned
int
items_len
)
{
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
serialize
(
c
,
items_len
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
serialize
(
c
,
items_len
)))
return
_trace
(
false
);
for
(
unsigned
int
i
=
0
;
i
<
items_len
;
i
++
)
array
[
i
]
=
items
[
i
];
items
.
advance
(
items_len
);
return
TRACE_RETURN
(
true
);
return
_trace
(
true
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return
_trace
(
false
);
/* Note: for structs that do not reference other structs,
* we do not need to call their sanitize() as we already did
...
...
@@ -862,28 +862,28 @@ struct ArrayOf
*/
(
void
)
(
false
&&
array
[
0
].
sanitize
(
c
));
return
TRACE_RETURN
(
true
);
return
_trace
(
true
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
const
void
*
base
)
const
{
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return
_trace
(
false
);
unsigned
int
count
=
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
if
(
unlikely
(
!
array
[
i
].
sanitize
(
c
,
base
)))
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
(
true
);
return
_trace
(
false
);
return
_trace
(
true
);
}
template
<
typename
T
>
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
const
void
*
base
,
T
user_data
)
const
{
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return
_trace
(
false
);
unsigned
int
count
=
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
if
(
unlikely
(
!
array
[
i
].
sanitize
(
c
,
base
,
user_data
)))
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
(
true
);
return
_trace
(
false
);
return
_trace
(
true
);
}
template
<
typename
SearchType
>
...
...
@@ -900,7 +900,7 @@ struct ArrayOf
inline
bool
sanitize_shallow
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
c
->
check_array
(
this
,
Type
::
static_size
,
len
));
return
_trace
(
c
->
check_struct
(
this
)
&&
c
->
check_array
(
this
,
Type
::
static_size
,
len
));
}
public:
...
...
@@ -927,13 +927,13 @@ struct OffsetListOf : OffsetArrayOf<Type>
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
OffsetArrayOf
<
Type
>::
sanitize
(
c
,
this
));
return
_trace
(
OffsetArrayOf
<
Type
>::
sanitize
(
c
,
this
));
}
template
<
typename
T
>
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
T
user_data
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
OffsetArrayOf
<
Type
>::
sanitize
(
c
,
this
,
user_data
));
return
_trace
(
OffsetArrayOf
<
Type
>::
sanitize
(
c
,
this
,
user_data
));
}
};
...
...
@@ -955,14 +955,14 @@ struct HeadlessArrayOf
unsigned
int
items_len
)
{
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
_trace
(
false
);
len
.
set
(
items_len
);
/* TODO(serialize) Overflow? */
if
(
unlikely
(
!
items_len
))
return
TRACE_RETURN
(
true
);
if
(
unlikely
(
!
c
->
extend
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
items_len
))
return
_trace
(
true
);
if
(
unlikely
(
!
c
->
extend
(
*
this
)))
return
_trace
(
false
);
for
(
unsigned
int
i
=
0
;
i
<
items_len
-
1
;
i
++
)
array
[
i
]
=
items
[
i
];
items
.
advance
(
items_len
-
1
);
return
TRACE_RETURN
(
true
);
return
_trace
(
true
);
}
inline
bool
sanitize_shallow
(
hb_sanitize_context_t
*
c
)
const
...
...
@@ -974,7 +974,7 @@ struct HeadlessArrayOf
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return
_trace
(
false
);
/* Note: for structs that do not reference other structs,
* we do not need to call their sanitize() as we already did
...
...
@@ -985,7 +985,7 @@ struct HeadlessArrayOf
*/
(
void
)
(
false
&&
array
[
0
].
sanitize
(
c
));
return
TRACE_RETURN
(
true
);
return
_trace
(
true
);
}
LenType
len
;
...
...
src/hb-ot-cmap-table.hh
浏览文件 @
b4715901
...
...
@@ -54,7 +54,7 @@ struct CmapSubtableFormat0
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
return
_trace
(
c
->
check_struct
(
this
));
}
protected:
...
...
@@ -130,7 +130,7 @@ struct CmapSubtableFormat4
{
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
c
->
check_struct
(
this
)))
return
TRACE_RETURN
(
false
);
return
_trace
(
false
);
if
(
unlikely
(
!
c
->
check_range
(
this
,
length
)))
{
...
...
@@ -141,10 +141,10 @@ struct CmapSubtableFormat4
(
uintptr_t
)
(
c
->
end
-
(
char
*
)
this
));
if
(
!
c
->
try_set
(
&
length
,
new_length
))
return
TRACE_RETURN
(
false
);
return
_trace
(
false
);
}
return
TRACE_RETURN
(
16
+
4
*
(
unsigned
int
)
segCountX2
<=
length
);
return
_trace
(
16
+
4
*
(
unsigned
int
)
segCountX2
<=
length
);
}
protected:
...
...
@@ -187,7 +187,7 @@ struct CmapSubtableLongGroup
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
return
_trace
(
c
->
check_struct
(
this
));
}
private:
...
...
@@ -215,7 +215,7 @@ struct CmapSubtableTrimmed
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
glyphIdArray
.
sanitize
(
c
));
return
_trace
(
c
->
check_struct
(
this
)
&&
glyphIdArray
.
sanitize
(
c
));
}
protected:
...
...
@@ -248,7 +248,7 @@ struct CmapSubtableLongSegmented
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
groups
.
sanitize
(
c
));
return
_trace
(
c
->
check_struct
(
this
)
&&
groups
.
sanitize
(
c
));
}
protected:
...
...
@@ -295,7 +295,7 @@ struct UnicodeValueRange
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
return
_trace
(
c
->
check_struct
(
this
));
}
UINT24
startUnicodeValue
;
/* First value in this range. */
...
...
@@ -317,7 +317,7 @@ struct UVSMapping
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
return
_trace
(
c
->
check_struct
(
this
));
}
UINT24
unicodeValue
;
/* Base Unicode value of the UVS */
...
...
@@ -357,9 +357,9 @@ struct VariationSelectorRecord
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
const
void
*
base
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
defaultUVS
.
sanitize
(
c
,
base
)
&&
nonDefaultUVS
.
sanitize
(
c
,
base
));
return
_trace
(
c
->
check_struct
(
this
)
&&
defaultUVS
.
sanitize
(
c
,
base
)
&&
nonDefaultUVS
.
sanitize
(
c
,
base
));
}
UINT24
varSelector
;
/* Variation selector. */
...
...
@@ -383,8 +383,8 @@ struct CmapSubtableFormat14
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
record
.
sanitize
(
c
,
this
));
return
_trace
(
c
->
check_struct
(
this
)
&&
record
.
sanitize
(
c
,
this
));
}
protected:
...
...
@@ -429,16 +429,16 @@ struct CmapSubtable
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
_trace
(
false
);
switch
(
u
.
format
)
{
case
0
:
return
TRACE_RETURN
(
u
.
format0
.
sanitize
(
c
));
case
4
:
return
TRACE_RETURN
(
u
.
format4
.
sanitize
(
c
));
case
6
:
return
TRACE_RETURN
(
u
.
format6
.
sanitize
(
c
));
case
10
:
return
TRACE_RETURN
(
u
.
format10
.
sanitize
(
c
));
case
12
:
return
TRACE_RETURN
(
u
.
format12
.
sanitize
(
c
));
case
13
:
return
TRACE_RETURN
(
u
.
format13
.
sanitize
(
c
));
case
14
:
return
TRACE_RETURN
(
u
.
format14
.
sanitize
(
c
));
default:
return
TRACE_RETURN
(
true
);
case
0
:
return
_trace
(
u
.
format0
.
sanitize
(
c
));
case
4
:
return
_trace
(
u
.
format4
.
sanitize
(
c
));
case
6
:
return
_trace
(
u
.
format6
.
sanitize
(
c
));
case
10
:
return
_trace
(
u
.
format10
.
sanitize
(
c
));
case
12
:
return
_trace
(
u
.
format12
.
sanitize
(
c
));
case
13
:
return
_trace
(
u
.
format13
.
sanitize
(
c
));
case
14
:
return
_trace
(
u
.
format14
.
sanitize
(
c
));
default:
return
_trace
(
true
);
}
}
...
...
@@ -473,8 +473,8 @@ struct EncodingRecord
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
const
void
*
base
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
subtable
.
sanitize
(
c
,
base
));
return
_trace
(
c
->
check_struct
(
this
)
&&
subtable
.
sanitize
(
c
,
base
));
}
USHORT
platformID
;
/* Platform ID. */
...
...
@@ -509,9 +509,9 @@ struct cmap
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
likely
(
version
==
0
)
&&
encodingRecord
.
sanitize
(
c
,
this
));
return
_trace
(
c
->
check_struct
(
this
)
&&
likely
(
version
==
0
)
&&
encodingRecord
.
sanitize
(
c
,
this
));
}
USHORT
version
;
/* Table version number (0). */
...
...
src/hb-ot-glyf-table.hh
浏览文件 @
b4715901
...
...
@@ -47,7 +47,7 @@ struct loca
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
true
);
return
_trace
(
true
);
}
public:
...
...
@@ -75,7 +75,7 @@ struct glyf
TRACE_SANITIZE
(
this
);
/* We don't check for anything specific here. The users of the
* struct do all the hard work... */
return
TRACE_RETURN
(
true
);
return
_trace
(
true
);
}
public:
...
...
src/hb-ot-head-table.hh
浏览文件 @
b4715901
...
...
@@ -55,7 +55,7 @@ struct head
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
likely
(
version
.
major
==
1
));
return
_trace
(
c
->
check_struct
(
this
)
&&
likely
(
version
.
major
==
1
));
}
protected:
...
...
src/hb-ot-hhea-table.hh
浏览文件 @
b4715901
...
...
@@ -52,7 +52,7 @@ struct _hea
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
likely
(
version
.
major
==
1
));
return
_trace
(
c
->
check_struct
(
this
)
&&
likely
(
version
.
major
==
1
));
}
public:
...
...
src/hb-ot-hmtx-table.hh
浏览文件 @
b4715901
...
...
@@ -62,7 +62,7 @@ struct _mtx
TRACE_SANITIZE
(
this
);
/* We don't check for anything specific here. The users of the
* struct do all the hard work... */
return
TRACE_RETURN
(
true
);
return
_trace
(
true
);
}
public:
...
...
src/hb-ot-layout-common-private.hh
浏览文件 @
b4715901
...
...
@@ -75,7 +75,7 @@ struct Record
{
TRACE_SANITIZE
(
this
);
const
sanitize_closure_t
closure
=
{
tag
,
base
};
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
offset
.
sanitize
(
c
,
base
,
&
closure
));
return
_trace
(
c
->
check_struct
(
this
)
&&
offset
.
sanitize
(
c
,
base
,
&
closure
));
}
Tag
tag
;
/* 4-byte Tag identifier */
...
...
@@ -131,7 +131,7 @@ struct RecordListOf : RecordArrayOf<Type>
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
RecordArrayOf
<
Type
>::
sanitize
(
c
,
this
));
return
_trace
(
RecordArrayOf
<
Type
>::
sanitize
(
c
,
this
));
}
};
...
...
@@ -145,7 +145,7 @@ struct RangeRecord
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
return
_trace
(
c
->
check_struct
(
this
));
}
inline
bool
intersects
(
const
hb_set_t
*
glyphs
)
const
{
...
...
@@ -211,7 +211,7 @@ struct LangSys
const
Record
<
LangSys
>::
sanitize_closure_t
*
=
NULL
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
featureIndex
.
sanitize
(
c
));
return
_trace
(
c
->
check_struct
(
this
)
&&
featureIndex
.
sanitize
(
c
));
}
Offset
<>
lookupOrderZ
;
/* = Null (reserved for an offset to a
...
...
@@ -251,7 +251,7 @@ struct Script
const
Record
<
Script
>::
sanitize_closure_t
*
=
NULL
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
defaultLangSys
.
sanitize
(
c
,
this
)
&&
langSys
.
sanitize
(
c
,
this
));
return
_trace
(
defaultLangSys
.
sanitize
(
c
,
this
)
&&
langSys
.
sanitize
(
c
,
this
));
}
protected:
...
...
@@ -274,7 +274,7 @@ struct FeatureParamsSize
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
c
->
check_struct
(
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
check_struct
(
this
)))
return
_trace
(
false
);
/* This subtable has some "history", if you will. Some earlier versions of
* Adobe tools calculated the offset of the FeatureParams sutable from the
...
...
@@ -326,19 +326,19 @@ struct FeatureParamsSize
*/
if
(
!
designSize
)
return
TRACE_RETURN
(
false
);
return
_trace
(
false
);
else
if
(
subfamilyID
==
0
&&
subfamilyNameID
==
0
&&
rangeStart
==
0
&&
rangeEnd
==
0
)
return
TRACE_RETURN
(
true
);
return
_trace
(
true
);
else
if
(
designSize
<
rangeStart
||
designSize
>
rangeEnd
||
subfamilyNameID
<
256
||
subfamilyNameID
>
32767
)
return
TRACE_RETURN
(
false
);
return
_trace
(
false
);
else
return
TRACE_RETURN
(
true
);
return
_trace
(
true
);
}
USHORT
designSize
;
/* Represents the design size in 720/inch
...
...
@@ -388,7 +388,7 @@ struct FeatureParamsStylisticSet
TRACE_SANITIZE
(
this
);
/* Right now minorVersion is at zero. Which means, any table supports
* the uiNameID field. */
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
return
_trace
(
c
->
check_struct
(
this
));
}
USHORT
version
;
/* (set to 0): This corresponds to a “minor”
...
...
@@ -420,8 +420,8 @@ struct FeatureParamsCharacterVariants
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
characters
.
sanitize
(
c
));
return
_trace
(
c
->
check_struct
(
this
)
&&
characters
.
sanitize
(
c
));
}
USHORT
format
;
/* Format number is set to 0. */
...
...
@@ -462,12 +462,12 @@ struct FeatureParams
{
TRACE_SANITIZE
(
this
);
if
(
tag
==
HB_TAG
(
's'
,
'i'
,
'z'
,
'e'
))
return
TRACE_RETURN
(
u
.
size
.
sanitize
(
c
));
return
_trace
(
u
.
size
.
sanitize
(
c
));
if
((
tag
&
0xFFFF0000u
)
==
HB_TAG
(
's'
,
's'
,
'\0'
,
'\0'
))
/* ssXX */
return
TRACE_RETURN
(
u
.
stylisticSet
.
sanitize
(
c
));
return
_trace
(
u
.
stylisticSet
.
sanitize
(
c
));
if
((
tag
&
0xFFFF0000u
)
==
HB_TAG
(
'c'
,
'v'
,
'\0'
,
'\0'
))
/* cvXX */
return
TRACE_RETURN
(
u
.
characterVariants
.
sanitize
(
c
));
return
TRACE_RETURN
(
true
);
return
_trace
(
u
.
characterVariants
.
sanitize
(
c
));
return
_trace
(
true
);
}
inline
const
FeatureParamsSize
&
get_size_params
(
hb_tag_t
tag
)
const
...
...
@@ -505,7 +505,7 @@ struct Feature
{
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
(
c
->
check_struct
(
this
)
&&
lookupIndex
.
sanitize
(
c
))))
return
TRACE_RETURN
(
false
);
return
_trace
(
false
);
/* Some earlier versions of Adobe tools calculated the offset of the
* FeatureParams subtable from the beginning of the FeatureList table!
...
...
@@ -520,10 +520,10 @@ struct Feature
OffsetTo
<
FeatureParams
>
orig_offset
=
featureParams
;
if
(
unlikely
(
!
featureParams
.
sanitize
(
c
,
this
,
closure
?
closure
->
tag
:
HB_TAG_NONE
)))
return
TRACE_RETURN
(
false
);
return
_trace
(
false
);
if
(
likely
(
orig_offset
.
is_null
()))
return
TRACE_RETURN
(
true
);
return
_trace
(
true
);
if
(
featureParams
==
0
&&
closure
&&
closure
->
tag
==
HB_TAG
(
's'
,
'i'
,
'z'
,
'e'
)
&&
...
...
@@ -538,10 +538,10 @@ struct Feature
if
(
new_offset
==
new_offset_int
&&
c
->
try_set
(
&
featureParams
,
new_offset
)
&&
!
featureParams
.
sanitize
(
c
,
this
,
closure
?
closure
->
tag
:
HB_TAG_NONE
))
return
TRACE_RETURN
(
false
);
return
_trace
(
false
);
}
return
TRACE_RETURN
(
true
);
return
_trace
(
true
);
}
OffsetTo
<
FeatureParams
>
...
...
@@ -613,9 +613,9 @@ struct Lookup
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
typename
context_t
::
return_t
r
=
get_subtable
<
SubTableType
>
(
i
).
dispatch
(
c
,
lookup_type
);
if
(
c
->
stop_sublookup_iteration
(
r
))
return
TRACE_RETURN
(
r
);
return
_trace
(
r
);
}
return
TRACE_RETURN
(
c
->
default_return_value
());
return
_trace
(
c
->
default_return_value
());
}
inline
bool
serialize
(
hb_serialize_context_t
*
c
,
...
...
@@ -624,29 +624,29 @@ struct Lookup
unsigned
int
num_subtables
)
{
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
_trace
(
false
);
lookupType
.
set
(
lookup_type
);
lookupFlag
.
set
(
lookup_props
&
0xFFFFu
);
if
(
unlikely
(
!
subTable
.
serialize
(
c
,
num_subtables
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
subTable
.
serialize
(
c
,
num_subtables
)))
return
_trace
(
false
);
if
(
lookupFlag
&
LookupFlag
::
UseMarkFilteringSet
)
{
USHORT
&
markFilteringSet
=
StructAfter
<
USHORT
>
(
subTable
);
markFilteringSet
.
set
(
lookup_props
>>
16
);
}
return
TRACE_RETURN
(
true
);
return
_trace
(
true
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
/* Real sanitize of the subtables is done by GSUB/GPOS/... */
if
(
!
(
c
->
check_struct
(
this
)
&&
subTable
.
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
if
(
!
(
c
->
check_struct
(
this
)
&&
subTable
.
sanitize
(
c
)))
return
_trace
(
false
);
if
(
lookupFlag
&
LookupFlag
::
UseMarkFilteringSet
)
{
const
USHORT
&
markFilteringSet
=
StructAfter
<
USHORT
>
(
subTable
);
if
(
!
markFilteringSet
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
markFilteringSet
.
sanitize
(
c
))
return
_trace
(
false
);
}
return
TRACE_RETURN
(
true
);
return
_trace
(
true
);
}
private:
...
...
@@ -685,19 +685,19 @@ struct CoverageFormat1
unsigned
int
num_glyphs
)
{
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
_trace
(
false
);
glyphArray
.
len
.
set
(
num_glyphs
);
if
(
unlikely
(
!
c
->
extend
(
glyphArray
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend
(
glyphArray
)))
return
_trace
(
false
);
for
(
unsigned
int
i
=
0
;
i
<
num_glyphs
;
i
++
)
glyphArray
[
i
]
=
glyphs
[
i
];
glyphs
.
advance
(
num_glyphs
);
return
TRACE_RETURN
(
true
);
return
_trace
(
true
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
glyphArray
.
sanitize
(
c
));
return
_trace
(
glyphArray
.
sanitize
(
c
));
}
inline
bool
intersects_coverage
(
const
hb_set_t
*
glyphs
,
unsigned
int
index
)
const
{
...
...
@@ -754,16 +754,16 @@ struct CoverageFormat2
unsigned
int
num_glyphs
)
{
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
_trace
(
false
);
if
(
unlikely
(
!
num_glyphs
))
return
TRACE_RETURN
(
true
);
if
(
unlikely
(
!
num_glyphs
))
return
_trace
(
true
);
unsigned
int
num_ranges
=
1
;
for
(
unsigned
int
i
=
1
;
i
<
num_glyphs
;
i
++
)
if
(
glyphs
[
i
-
1
]
+
1
!=
glyphs
[
i
])
num_ranges
++
;
rangeRecord
.
len
.
set
(
num_ranges
);
if
(
unlikely
(
!
c
->
extend
(
rangeRecord
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend
(
rangeRecord
)))
return
_trace
(
false
);
unsigned
int
range
=
0
;
rangeRecord
[
range
].
start
=
glyphs
[
0
];
...
...
@@ -778,13 +778,13 @@ struct CoverageFormat2
rangeRecord
[
range
].
end
=
glyphs
[
i
];
}
glyphs
.
advance
(
num_glyphs
);
return
TRACE_RETURN
(
true
);
return
_trace
(
true
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
rangeRecord
.
sanitize
(
c
));
return
_trace
(
rangeRecord
.
sanitize
(
c
));
}
inline
bool
intersects_coverage
(
const
hb_set_t
*
glyphs
,
unsigned
int
index
)
const
{
...
...
@@ -864,27 +864,27 @@ struct Coverage
unsigned
int
num_glyphs
)
{
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
_trace
(
false
);
unsigned
int
num_ranges
=
1
;
for
(
unsigned
int
i
=
1
;
i
<
num_glyphs
;
i
++
)
if
(
glyphs
[
i
-
1
]
+
1
!=
glyphs
[
i
])
num_ranges
++
;
u
.
format
.
set
(
num_glyphs
*
2
<
num_ranges
*
3
?
1
:
2
);
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
serialize
(
c
,
glyphs
,
num_glyphs
));
case
2
:
return
TRACE_RETURN
(
u
.
format2
.
serialize
(
c
,
glyphs
,
num_glyphs
));
default:
return
TRACE_RETURN
(
false
);
case
1
:
return
_trace
(
u
.
format1
.
serialize
(
c
,
glyphs
,
num_glyphs
));
case
2
:
return
_trace
(
u
.
format2
.
serialize
(
c
,
glyphs
,
num_glyphs
));
default:
return
_trace
(
false
);
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
_trace
(
false
);
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
2
:
return
TRACE_RETURN
(
u
.
format2
.
sanitize
(
c
));
default:
return
TRACE_RETURN
(
true
);
case
1
:
return
_trace
(
u
.
format1
.
sanitize
(
c
));
case
2
:
return
_trace
(
u
.
format2
.
sanitize
(
c
));
default:
return
_trace
(
true
);
}
}
...
...
@@ -993,7 +993,7 @@ struct ClassDefFormat1
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
classValue
.
sanitize
(
c
));
return
_trace
(
c
->
check_struct
(
this
)
&&
classValue
.
sanitize
(
c
));
}
template
<
typename
set_t
>
...
...
@@ -1050,7 +1050,7 @@ struct ClassDefFormat2
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
rangeRecord
.
sanitize
(
c
));
return
_trace
(
rangeRecord
.
sanitize
(
c
));
}
template
<
typename
set_t
>
...
...
@@ -1108,11 +1108,11 @@ struct ClassDef
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
_trace
(
false
);
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
2
:
return
TRACE_RETURN
(
u
.
format2
.
sanitize
(
c
));
default:
return
TRACE_RETURN
(
true
);
case
1
:
return
_trace
(
u
.
format1
.
sanitize
(
c
));
case
2
:
return
_trace
(
u
.
format2
.
sanitize
(
c
));
default:
return
_trace
(
true
);
}
}
...
...
@@ -1201,7 +1201,7 @@ struct Device
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
c
->
check_range
(
this
,
this
->
get_size
()));
return
_trace
(
c
->
check_struct
(
this
)
&&
c
->
check_range
(
this
,
this
->
get_size
()));
}
protected:
...
...
src/hb-ot-layout-gdef-table.hh
浏览文件 @
b4715901
...
...
@@ -74,7 +74,7 @@ struct AttachList
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
attachPoint
.
sanitize
(
c
,
this
));
return
_trace
(
coverage
.
sanitize
(
c
,
this
)
&&
attachPoint
.
sanitize
(
c
,
this
));
}
protected:
...
...
@@ -105,7 +105,7 @@ struct CaretValueFormat1
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
return
_trace
(
c
->
check_struct
(
this
));
}
protected:
...
...
@@ -132,7 +132,7 @@ struct CaretValueFormat2
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
return
_trace
(
c
->
check_struct
(
this
));
}
protected:
...
...
@@ -156,7 +156,7 @@ struct CaretValueFormat3
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
deviceTable
.
sanitize
(
c
,
this
));
return
_trace
(
c
->
check_struct
(
this
)
&&
deviceTable
.
sanitize
(
c
,
this
));
}
protected:
...
...
@@ -185,12 +185,12 @@ struct CaretValue
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
_trace
(
false
);
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
2
:
return
TRACE_RETURN
(
u
.
format2
.
sanitize
(
c
));
case
3
:
return
TRACE_RETURN
(
u
.
format3
.
sanitize
(
c
));
default:
return
TRACE_RETURN
(
true
);
case
1
:
return
_trace
(
u
.
format1
.
sanitize
(
c
));
case
2
:
return
_trace
(
u
.
format2
.
sanitize
(
c
));
case
3
:
return
_trace
(
u
.
format3
.
sanitize
(
c
));
default:
return
_trace
(
true
);
}
}
...
...
@@ -227,7 +227,7 @@ struct LigGlyph
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
carets
.
sanitize
(
c
,
this
));
return
_trace
(
carets
.
sanitize
(
c
,
this
));
}
protected:
...
...
@@ -262,7 +262,7 @@ struct LigCaretList
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
ligGlyph
.
sanitize
(
c
,
this
));
return
_trace
(
coverage
.
sanitize
(
c
,
this
)
&&
ligGlyph
.
sanitize
(
c
,
this
));
}
protected:
...
...
@@ -285,7 +285,7 @@ struct MarkGlyphSetsFormat1
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
));
return
_trace
(
coverage
.
sanitize
(
c
,
this
));
}
protected:
...
...
@@ -310,10 +310,10 @@ struct MarkGlyphSets
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
_trace
(
false
);
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
default:
return
TRACE_RETURN
(
true
);
case
1
:
return
_trace
(
u
.
format1
.
sanitize
(
c
));
default:
return
_trace
(
true
);
}
}
...
...
@@ -376,13 +376,13 @@ struct GDEF
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
version
.
sanitize
(
c
)
&&
likely
(
version
.
major
==
1
)
&&
glyphClassDef
.
sanitize
(
c
,
this
)
&&
attachList
.
sanitize
(
c
,
this
)
&&
ligCaretList
.
sanitize
(
c
,
this
)
&&
markAttachClassDef
.
sanitize
(
c
,
this
)
&&
(
version
.
to_int
()
<
0x00010002u
||
markGlyphSetsDef
[
0
].
sanitize
(
c
,
this
)));
return
_trace
(
version
.
sanitize
(
c
)
&&
likely
(
version
.
major
==
1
)
&&
glyphClassDef
.
sanitize
(
c
,
this
)
&&
attachList
.
sanitize
(
c
,
this
)
&&
ligCaretList
.
sanitize
(
c
,
this
)
&&
markAttachClassDef
.
sanitize
(
c
,
this
)
&&
(
version
.
to_int
()
<
0x00010002u
||
markGlyphSetsDef
[
0
].
sanitize
(
c
,
this
)));
}
...
...
src/hb-ot-layout-gpos-table.hh
浏览文件 @
b4715901
此差异已折叠。
点击以展开。
src/hb-ot-layout-gsub-table.hh
浏览文件 @
b4715901
此差异已折叠。
点击以展开。
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
b4715901
此差异已折叠。
点击以展开。
src/hb-ot-layout-jstf-table.hh
浏览文件 @
b4715901
...
...
@@ -57,17 +57,17 @@ struct JstfPriority
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
shrinkageEnableGSUB
.
sanitize
(
c
,
this
)
&&
shrinkageDisableGSUB
.
sanitize
(
c
,
this
)
&&
shrinkageEnableGPOS
.
sanitize
(
c
,
this
)
&&
shrinkageDisableGPOS
.
sanitize
(
c
,
this
)
&&
shrinkageJstfMax
.
sanitize
(
c
,
this
)
&&
extensionEnableGSUB
.
sanitize
(
c
,
this
)
&&
extensionDisableGSUB
.
sanitize
(
c
,
this
)
&&
extensionEnableGPOS
.
sanitize
(
c
,
this
)
&&
extensionDisableGPOS
.
sanitize
(
c
,
this
)
&&
extensionJstfMax
.
sanitize
(
c
,
this
));
return
_trace
(
c
->
check_struct
(
this
)
&&
shrinkageEnableGSUB
.
sanitize
(
c
,
this
)
&&
shrinkageDisableGSUB
.
sanitize
(
c
,
this
)
&&
shrinkageEnableGPOS
.
sanitize
(
c
,
this
)
&&
shrinkageDisableGPOS
.
sanitize
(
c
,
this
)
&&
shrinkageJstfMax
.
sanitize
(
c
,
this
)
&&
extensionEnableGSUB
.
sanitize
(
c
,
this
)
&&
extensionDisableGSUB
.
sanitize
(
c
,
this
)
&&
extensionEnableGPOS
.
sanitize
(
c
,
this
)
&&
extensionDisableGPOS
.
sanitize
(
c
,
this
)
&&
extensionJstfMax
.
sanitize
(
c
,
this
));
}
protected:
...
...
@@ -127,7 +127,7 @@ struct JstfLangSys : OffsetListOf<JstfPriority>
const
Record
<
JstfLangSys
>::
sanitize_closure_t
*
=
NULL
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
OffsetListOf
<
JstfPriority
>::
sanitize
(
c
));
return
_trace
(
OffsetListOf
<
JstfPriority
>::
sanitize
(
c
));
}
};
...
...
@@ -168,9 +168,9 @@ struct JstfScript
const
Record
<
JstfScript
>::
sanitize_closure_t
*
=
NULL
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
extenderGlyphs
.
sanitize
(
c
,
this
)
&&
defaultLangSys
.
sanitize
(
c
,
this
)
&&
langSys
.
sanitize
(
c
,
this
));
return
_trace
(
extenderGlyphs
.
sanitize
(
c
,
this
)
&&
defaultLangSys
.
sanitize
(
c
,
this
)
&&
langSys
.
sanitize
(
c
,
this
));
}
protected:
...
...
@@ -212,8 +212,9 @@ struct JSTF
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
version
.
sanitize
(
c
)
&&
likely
(
version
.
major
==
1
)
&&
scriptList
.
sanitize
(
c
,
this
));
return_trace
(
version
.
sanitize
(
c
)
&&
likely
(
version
.
major
==
1
)
&&
scriptList
.
sanitize
(
c
,
this
));
}
protected:
...
...
src/hb-ot-maxp-table.hh
浏览文件 @
b4715901
...
...
@@ -51,8 +51,9 @@ struct maxp
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
likely
(
version
.
major
==
1
||
(
version
.
major
==
0
&&
version
.
minor
==
0x5000u
)));
return_trace
(
c
->
check_struct
(
this
)
&&
likely
(
version
.
major
==
1
||
(
version
.
major
==
0
&&
version
.
minor
==
0x5000u
)));
}
/* We only implement version 0.5 as none of the extra fields in version 1.0 are useful. */
...
...
src/hb-ot-name-table.hh
浏览文件 @
b4715901
...
...
@@ -60,7 +60,7 @@ struct NameRecord
{
TRACE_SANITIZE
(
this
);
/* We can check from base all the way up to the end of string... */
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
c
->
check_range
((
char
*
)
base
,
(
unsigned
int
)
length
+
offset
));
return
_trace
(
c
->
check_struct
(
this
)
&&
c
->
check_range
((
char
*
)
base
,
(
unsigned
int
)
length
+
offset
));
}
USHORT
platformID
;
/* Platform ID. */
...
...
@@ -107,17 +107,17 @@ struct name
char
*
string_pool
=
(
char
*
)
this
+
stringOffset
;
unsigned
int
_count
=
count
;
for
(
unsigned
int
i
=
0
;
i
<
_count
;
i
++
)
if
(
!
nameRecord
[
i
].
sanitize
(
c
,
string_pool
))
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
(
true
);
if
(
!
nameRecord
[
i
].
sanitize
(
c
,
string_pool
))
return
_trace
(
false
);
return
_trace
(
true
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
likely
(
format
==
0
||
format
==
1
)
&&
c
->
check_array
(
nameRecord
,
nameRecord
[
0
].
static_size
,
count
)
&&
sanitize_records
(
c
));
return
_trace
(
c
->
check_struct
(
this
)
&&
likely
(
format
==
0
||
format
==
1
)
&&
c
->
check_array
(
nameRecord
,
nameRecord
[
0
].
static_size
,
count
)
&&
sanitize_records
(
c
));
}
/* We only implement format 0 for now. */
...
...
src/hb-private.hh
浏览文件 @
b4715901
...
...
@@ -740,7 +740,7 @@ template <typename T>
static
inline
void
_hb_warn_no_return
(
bool
returned
)
{
if
(
unlikely
(
!
returned
))
{
fprintf
(
stderr
,
"OUCH, returned with no call to
TRACE_RETURN
. This is a bug, please report.
\n
"
);
fprintf
(
stderr
,
"OUCH, returned with no call to
return_trace()
. This is a bug, please report.
\n
"
);
}
}
template
<
>
...
...
@@ -775,7 +775,7 @@ struct hb_auto_trace_t {
inline
ret_t
ret
(
ret_t
v
,
unsigned
int
line
=
0
)
{
if
(
unlikely
(
returned
))
{
fprintf
(
stderr
,
"OUCH, double calls to
TRACE_RETURN
. This is a bug, please report.
\n
"
);
fprintf
(
stderr
,
"OUCH, double calls to
return_trace()
. This is a bug, please report.
\n
"
);
return
v
;
}
...
...
@@ -806,7 +806,7 @@ struct hb_auto_trace_t<0, ret_t> {
inline
ret_t
ret
(
ret_t
v
,
unsigned
int
line
HB_UNUSED
=
0
)
{
return
v
;
}
};
#define
TRACE_RETURN(RET)
trace.ret (RET, __LINE__)
#define
return_trace(RET) return
trace.ret (RET, __LINE__)
/* Misc */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录