Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
be218c68
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看板
提交
be218c68
编写于
11月 23, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Pass this object to trace macros
上级
902cc8ac
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
208 addition
and
208 deletion
+208
-208
src/hb-open-file-private.hh
src/hb-open-file-private.hh
+5
-5
src/hb-open-type-private.hh
src/hb-open-type-private.hh
+17
-17
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
+18
-18
src/hb-ot-layout-gdef-table.hh
src/hb-ot-layout-gdef-table.hh
+10
-10
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gpos-table.hh
+40
-40
src/hb-ot-layout-gsub-table.hh
src/hb-ot-layout-gsub-table.hh
+61
-61
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+50
-50
src/hb-ot-maxp-table.hh
src/hb-ot-maxp-table.hh
+1
-1
src/hb-ot-name-table.hh
src/hb-ot-name-table.hh
+3
-3
未找到文件。
src/hb-open-file-private.hh
浏览文件 @
be218c68
...
@@ -54,7 +54,7 @@ struct TTCHeader;
...
@@ -54,7 +54,7 @@ struct TTCHeader;
typedef
struct
TableRecord
typedef
struct
TableRecord
{
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
}
}
...
@@ -103,7 +103,7 @@ typedef struct OffsetTable
...
@@ -103,7 +103,7 @@ typedef struct OffsetTable
public:
public:
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
c
->
check_array
(
tables
,
TableRecord
::
static_size
,
numTables
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
c
->
check_array
(
tables
,
TableRecord
::
static_size
,
numTables
));
}
}
...
@@ -131,7 +131,7 @@ struct TTCHeaderVersion1
...
@@ -131,7 +131,7 @@ struct TTCHeaderVersion1
inline
const
OpenTypeFontFace
&
get_face
(
unsigned
int
i
)
const
{
return
this
+
table
[
i
];
}
inline
const
OpenTypeFontFace
&
get_face
(
unsigned
int
i
)
const
{
return
this
+
table
[
i
];
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
table
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
table
.
sanitize
(
c
,
this
));
}
}
...
@@ -170,7 +170,7 @@ struct TTCHeader
...
@@ -170,7 +170,7 @@ struct TTCHeader
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
u
.
header
.
version
.
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
u
.
header
.
version
.
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
switch
(
u
.
header
.
version
.
major
)
{
switch
(
u
.
header
.
version
.
major
)
{
case
2
:
/* version 2 is compatible with version 1 */
case
2
:
/* version 2 is compatible with version 1 */
...
@@ -232,7 +232,7 @@ struct OpenTypeFontFile
...
@@ -232,7 +232,7 @@ struct OpenTypeFontFile
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
u
.
tag
.
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
u
.
tag
.
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
switch
(
u
.
tag
)
{
switch
(
u
.
tag
)
{
case
CFFTag
:
/* All the non-collection tags */
case
CFFTag
:
/* All the non-collection tags */
...
...
src/hb-open-type-private.hh
浏览文件 @
be218c68
...
@@ -166,7 +166,7 @@ ASSERT_STATIC (Type::min_size + 1 <= sizeof (_Null##Type))
...
@@ -166,7 +166,7 @@ ASSERT_STATIC (Type::min_size + 1 <= sizeof (_Null##Type))
#endif
#endif
#define TRACE_SANITIZE() \
#define TRACE_SANITIZE(
this
) \
hb_auto_trace_t<HB_DEBUG_SANITIZE, bool> trace \
hb_auto_trace_t<HB_DEBUG_SANITIZE, bool> trace \
(&c->debug_depth, "SANITIZE", this, HB_FUNC, \
(&c->debug_depth, "SANITIZE", this, HB_FUNC, \
"");
"");
...
@@ -342,7 +342,7 @@ struct Sanitizer
...
@@ -342,7 +342,7 @@ struct Sanitizer
#endif
#endif
#define TRACE_SERIALIZE() \
#define TRACE_SERIALIZE(
this
) \
hb_auto_trace_t<HB_DEBUG_SERIALIZE, bool> trace \
hb_auto_trace_t<HB_DEBUG_SERIALIZE, bool> trace \
(&c->debug_depth, "SERIALIZE", c, HB_FUNC, \
(&c->debug_depth, "SERIALIZE", c, HB_FUNC, \
"");
"");
...
@@ -539,7 +539,7 @@ struct IntType
...
@@ -539,7 +539,7 @@ struct IntType
inline
int
cmp
(
IntType
<
Type
>
va
)
const
{
Type
a
=
va
;
Type
b
=
v
;
return
a
<
b
?
-
1
:
a
==
b
?
0
:
+
1
;
}
inline
int
cmp
(
IntType
<
Type
>
va
)
const
{
Type
a
=
va
;
Type
b
=
v
;
return
a
<
b
?
-
1
:
a
==
b
?
0
:
+
1
;
}
inline
int
cmp
(
Type
a
)
const
{
Type
b
=
v
;
return
a
<
b
?
-
1
:
a
==
b
?
0
:
+
1
;
}
inline
int
cmp
(
Type
a
)
const
{
Type
b
=
v
;
return
a
<
b
?
-
1
:
a
==
b
?
0
:
+
1
;
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
likely
(
c
->
check_struct
(
this
)));
return
TRACE_RETURN
(
likely
(
c
->
check_struct
(
this
)));
}
}
protected:
protected:
...
@@ -564,7 +564,7 @@ typedef USHORT UFWORD;
...
@@ -564,7 +564,7 @@ typedef USHORT UFWORD;
struct
LONGDATETIME
struct
LONGDATETIME
{
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
likely
(
c
->
check_struct
(
this
)));
return
TRACE_RETURN
(
likely
(
c
->
check_struct
(
this
)));
}
}
private:
private:
...
@@ -628,7 +628,7 @@ struct FixedVersion
...
@@ -628,7 +628,7 @@ struct FixedVersion
inline
uint32_t
to_int
(
void
)
const
{
return
(
major
<<
16
)
+
minor
;
}
inline
uint32_t
to_int
(
void
)
const
{
return
(
major
<<
16
)
+
minor
;
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
}
}
...
@@ -668,7 +668,7 @@ struct GenericOffsetTo : OffsetType
...
@@ -668,7 +668,7 @@ struct GenericOffsetTo : OffsetType
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
void
*
base
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
void
*
base
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
c
->
check_struct
(
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
check_struct
(
this
)))
return
TRACE_RETURN
(
false
);
unsigned
int
offset
=
*
this
;
unsigned
int
offset
=
*
this
;
if
(
unlikely
(
!
offset
))
return
TRACE_RETURN
(
true
);
if
(
unlikely
(
!
offset
))
return
TRACE_RETURN
(
true
);
...
@@ -677,7 +677,7 @@ struct GenericOffsetTo : OffsetType
...
@@ -677,7 +677,7 @@ struct GenericOffsetTo : OffsetType
}
}
template
<
typename
T
>
template
<
typename
T
>
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
void
*
base
,
T
user_data
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
void
*
base
,
T
user_data
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
c
->
check_struct
(
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
check_struct
(
this
)))
return
TRACE_RETURN
(
false
);
unsigned
int
offset
=
*
this
;
unsigned
int
offset
=
*
this
;
if
(
unlikely
(
!
offset
))
return
TRACE_RETURN
(
true
);
if
(
unlikely
(
!
offset
))
return
TRACE_RETURN
(
true
);
...
@@ -741,7 +741,7 @@ struct GenericArrayOf
...
@@ -741,7 +741,7 @@ struct GenericArrayOf
inline
bool
serialize
(
hb_serialize_context_t
*
c
,
inline
bool
serialize
(
hb_serialize_context_t
*
c
,
unsigned
int
items_len
)
unsigned
int
items_len
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
len
.
set
(
items_len
);
/* TODO(serialize) Overflow? */
len
.
set
(
items_len
);
/* TODO(serialize) Overflow? */
if
(
unlikely
(
!
c
->
extend
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend
(
*
this
)))
return
TRACE_RETURN
(
false
);
...
@@ -752,7 +752,7 @@ struct GenericArrayOf
...
@@ -752,7 +752,7 @@ struct GenericArrayOf
Supplier
<
Type
>
&
items
,
Supplier
<
Type
>
&
items
,
unsigned
int
items_len
)
unsigned
int
items_len
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
serialize
(
c
,
items_len
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
serialize
(
c
,
items_len
)))
return
TRACE_RETURN
(
false
);
for
(
unsigned
int
i
=
0
;
i
<
items_len
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
items_len
;
i
++
)
array
[
i
]
=
items
[
i
];
array
[
i
]
=
items
[
i
];
...
@@ -761,7 +761,7 @@ struct GenericArrayOf
...
@@ -761,7 +761,7 @@ struct GenericArrayOf
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return
TRACE_RETURN
(
false
);
/* Note: for structs that do not reference other structs,
/* Note: for structs that do not reference other structs,
...
@@ -776,7 +776,7 @@ struct GenericArrayOf
...
@@ -776,7 +776,7 @@ struct GenericArrayOf
return
TRACE_RETURN
(
true
);
return
TRACE_RETURN
(
true
);
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
void
*
base
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
void
*
base
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return
TRACE_RETURN
(
false
);
unsigned
int
count
=
len
;
unsigned
int
count
=
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
...
@@ -786,7 +786,7 @@ struct GenericArrayOf
...
@@ -786,7 +786,7 @@ struct GenericArrayOf
}
}
template
<
typename
T
>
template
<
typename
T
>
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
void
*
base
,
T
user_data
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
void
*
base
,
T
user_data
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return
TRACE_RETURN
(
false
);
unsigned
int
count
=
len
;
unsigned
int
count
=
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
...
@@ -797,7 +797,7 @@ struct GenericArrayOf
...
@@ -797,7 +797,7 @@ struct GenericArrayOf
private:
private:
inline
bool
sanitize_shallow
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize_shallow
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
c
->
check_array
(
this
,
Type
::
static_size
,
len
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
c
->
check_array
(
this
,
Type
::
static_size
,
len
));
}
}
...
@@ -839,12 +839,12 @@ struct OffsetListOf : OffsetArrayOf<Type>
...
@@ -839,12 +839,12 @@ struct OffsetListOf : OffsetArrayOf<Type>
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
OffsetArrayOf
<
Type
>::
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
OffsetArrayOf
<
Type
>::
sanitize
(
c
,
this
));
}
}
template
<
typename
T
>
template
<
typename
T
>
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
T
user_data
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
T
user_data
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
OffsetArrayOf
<
Type
>::
sanitize
(
c
,
this
,
user_data
));
return
TRACE_RETURN
(
OffsetArrayOf
<
Type
>::
sanitize
(
c
,
this
,
user_data
));
}
}
};
};
...
@@ -867,7 +867,7 @@ struct HeadlessArrayOf
...
@@ -867,7 +867,7 @@ struct HeadlessArrayOf
Supplier
<
Type
>
&
items
,
Supplier
<
Type
>
&
items
,
unsigned
int
items_len
)
unsigned
int
items_len
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
len
.
set
(
items_len
);
/* TODO(serialize) Overflow? */
len
.
set
(
items_len
);
/* TODO(serialize) Overflow? */
if
(
unlikely
(
!
items_len
))
return
TRACE_RETURN
(
true
);
if
(
unlikely
(
!
items_len
))
return
TRACE_RETURN
(
true
);
...
@@ -884,7 +884,7 @@ struct HeadlessArrayOf
...
@@ -884,7 +884,7 @@ struct HeadlessArrayOf
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return
TRACE_RETURN
(
false
);
/* Note: for structs that do not reference other structs,
/* Note: for structs that do not reference other structs,
...
...
src/hb-ot-head-table.hh
浏览文件 @
be218c68
...
@@ -52,7 +52,7 @@ struct head
...
@@ -52,7 +52,7 @@ struct head
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
likely
(
version
.
major
==
1
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
likely
(
version
.
major
==
1
));
}
}
...
...
src/hb-ot-hhea-table.hh
浏览文件 @
be218c68
...
@@ -45,7 +45,7 @@ struct hhea
...
@@ -45,7 +45,7 @@ struct hhea
static
const
hb_tag_t
Tag
=
HB_OT_TAG_hhea
;
static
const
hb_tag_t
Tag
=
HB_OT_TAG_hhea
;
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
likely
(
version
.
major
==
1
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
likely
(
version
.
major
==
1
));
}
}
...
...
src/hb-ot-hmtx-table.hh
浏览文件 @
be218c68
...
@@ -53,7 +53,7 @@ struct hmtx
...
@@ -53,7 +53,7 @@ struct hmtx
static
const
hb_tag_t
Tag
=
HB_OT_TAG_hmtx
;
static
const
hb_tag_t
Tag
=
HB_OT_TAG_hmtx
;
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
/* We don't check for anything specific here. The users of the
/* We don't check for anything specific here. The users of the
* struct do all the hard work... */
* struct do all the hard work... */
return
TRACE_RETURN
(
true
);
return
TRACE_RETURN
(
true
);
...
...
src/hb-ot-layout-common-private.hh
浏览文件 @
be218c68
...
@@ -61,7 +61,7 @@ struct Record
...
@@ -61,7 +61,7 @@ struct Record
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
void
*
base
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
void
*
base
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
offset
.
sanitize
(
c
,
base
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
offset
.
sanitize
(
c
,
base
));
}
}
...
@@ -115,7 +115,7 @@ struct RecordListOf : RecordArrayOf<Type>
...
@@ -115,7 +115,7 @@ struct RecordListOf : RecordArrayOf<Type>
{
return
this
+
RecordArrayOf
<
Type
>::
operator
[](
i
).
offset
;
}
{
return
this
+
RecordArrayOf
<
Type
>::
operator
[](
i
).
offset
;
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
RecordArrayOf
<
Type
>::
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
RecordArrayOf
<
Type
>::
sanitize
(
c
,
this
));
}
}
};
};
...
@@ -129,7 +129,7 @@ struct RangeRecord
...
@@ -129,7 +129,7 @@ struct RangeRecord
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
}
}
...
@@ -193,7 +193,7 @@ struct LangSys
...
@@ -193,7 +193,7 @@ struct LangSys
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
featureIndex
.
sanitize
(
c
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
featureIndex
.
sanitize
(
c
));
}
}
...
@@ -231,7 +231,7 @@ struct Script
...
@@ -231,7 +231,7 @@ struct Script
inline
const
LangSys
&
get_default_lang_sys
(
void
)
const
{
return
this
+
defaultLangSys
;
}
inline
const
LangSys
&
get_default_lang_sys
(
void
)
const
{
return
this
+
defaultLangSys
;
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
defaultLangSys
.
sanitize
(
c
,
this
)
&&
langSys
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
defaultLangSys
.
sanitize
(
c
,
this
)
&&
langSys
.
sanitize
(
c
,
this
));
}
}
...
@@ -261,7 +261,7 @@ struct Feature
...
@@ -261,7 +261,7 @@ struct Feature
{
return
lookupIndex
.
get_indexes
(
start_index
,
lookup_count
,
lookup_tags
);
}
{
return
lookupIndex
.
get_indexes
(
start_index
,
lookup_count
,
lookup_tags
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
lookupIndex
.
sanitize
(
c
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
lookupIndex
.
sanitize
(
c
));
}
}
...
@@ -318,7 +318,7 @@ struct Lookup
...
@@ -318,7 +318,7 @@ struct Lookup
uint32_t
lookup_props
,
uint32_t
lookup_props
,
unsigned
int
num_subtables
)
unsigned
int
num_subtables
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
lookupType
.
set
(
lookup_type
);
lookupType
.
set
(
lookup_type
);
lookupFlag
.
set
(
lookup_props
&
0xFFFF
);
lookupFlag
.
set
(
lookup_props
&
0xFFFF
);
...
@@ -332,7 +332,7 @@ struct Lookup
...
@@ -332,7 +332,7 @@ struct Lookup
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
/* Real sanitize of the subtables is done by GSUB/GPOS/... */
/* 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_RETURN
(
false
);
if
(
lookupFlag
&
LookupFlag
::
UseMarkFilteringSet
)
if
(
lookupFlag
&
LookupFlag
::
UseMarkFilteringSet
)
...
@@ -377,7 +377,7 @@ struct CoverageFormat1
...
@@ -377,7 +377,7 @@ struct CoverageFormat1
Supplier
<
GlyphID
>
&
glyphs
,
Supplier
<
GlyphID
>
&
glyphs
,
unsigned
int
num_glyphs
)
unsigned
int
num_glyphs
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
glyphArray
.
len
.
set
(
num_glyphs
);
glyphArray
.
len
.
set
(
num_glyphs
);
if
(
unlikely
(
!
c
->
extend
(
glyphArray
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend
(
glyphArray
)))
return
TRACE_RETURN
(
false
);
...
@@ -388,7 +388,7 @@ struct CoverageFormat1
...
@@ -388,7 +388,7 @@ struct CoverageFormat1
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
glyphArray
.
sanitize
(
c
));
return
TRACE_RETURN
(
glyphArray
.
sanitize
(
c
));
}
}
...
@@ -445,7 +445,7 @@ struct CoverageFormat2
...
@@ -445,7 +445,7 @@ struct CoverageFormat2
Supplier
<
GlyphID
>
&
glyphs
,
Supplier
<
GlyphID
>
&
glyphs
,
unsigned
int
num_glyphs
)
unsigned
int
num_glyphs
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
num_glyphs
))
return
TRACE_RETURN
(
true
);
if
(
unlikely
(
!
num_glyphs
))
return
TRACE_RETURN
(
true
);
...
@@ -474,7 +474,7 @@ struct CoverageFormat2
...
@@ -474,7 +474,7 @@ struct CoverageFormat2
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
rangeRecord
.
sanitize
(
c
));
return
TRACE_RETURN
(
rangeRecord
.
sanitize
(
c
));
}
}
...
@@ -556,7 +556,7 @@ struct Coverage
...
@@ -556,7 +556,7 @@ struct Coverage
Supplier
<
GlyphID
>
&
glyphs
,
Supplier
<
GlyphID
>
&
glyphs
,
unsigned
int
num_glyphs
)
unsigned
int
num_glyphs
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
unsigned
int
num_ranges
=
1
;
unsigned
int
num_ranges
=
1
;
for
(
unsigned
int
i
=
1
;
i
<
num_glyphs
;
i
++
)
for
(
unsigned
int
i
=
1
;
i
<
num_glyphs
;
i
++
)
...
@@ -571,7 +571,7 @@ struct Coverage
...
@@ -571,7 +571,7 @@ struct Coverage
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
...
@@ -682,7 +682,7 @@ struct ClassDefFormat1
...
@@ -682,7 +682,7 @@ struct ClassDefFormat1
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
classValue
.
sanitize
(
c
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
classValue
.
sanitize
(
c
));
}
}
...
@@ -725,7 +725,7 @@ struct ClassDefFormat2
...
@@ -725,7 +725,7 @@ struct ClassDefFormat2
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
rangeRecord
.
sanitize
(
c
));
return
TRACE_RETURN
(
rangeRecord
.
sanitize
(
c
));
}
}
...
@@ -768,7 +768,7 @@ struct ClassDef
...
@@ -768,7 +768,7 @@ struct ClassDef
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
...
@@ -860,7 +860,7 @@ struct Device
...
@@ -860,7 +860,7 @@ struct Device
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
c
->
check_range
(
this
,
this
->
get_size
()));
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
c
->
check_range
(
this
,
this
->
get_size
()));
}
}
...
...
src/hb-ot-layout-gdef-table.hh
浏览文件 @
be218c68
...
@@ -72,7 +72,7 @@ struct AttachList
...
@@ -72,7 +72,7 @@ struct AttachList
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
attachPoint
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
attachPoint
.
sanitize
(
c
,
this
));
}
}
...
@@ -102,7 +102,7 @@ struct CaretValueFormat1
...
@@ -102,7 +102,7 @@ struct CaretValueFormat1
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
}
}
...
@@ -128,7 +128,7 @@ struct CaretValueFormat2
...
@@ -128,7 +128,7 @@ struct CaretValueFormat2
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
}
}
...
@@ -151,7 +151,7 @@ struct CaretValueFormat3
...
@@ -151,7 +151,7 @@ struct CaretValueFormat3
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
deviceTable
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
deviceTable
.
sanitize
(
c
,
this
));
}
}
...
@@ -179,7 +179,7 @@ struct CaretValue
...
@@ -179,7 +179,7 @@ struct CaretValue
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
...
@@ -220,7 +220,7 @@ struct LigGlyph
...
@@ -220,7 +220,7 @@ struct LigGlyph
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
carets
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
carets
.
sanitize
(
c
,
this
));
}
}
...
@@ -254,7 +254,7 @@ struct LigCaretList
...
@@ -254,7 +254,7 @@ struct LigCaretList
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
ligGlyph
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
ligGlyph
.
sanitize
(
c
,
this
));
}
}
...
@@ -276,7 +276,7 @@ struct MarkGlyphSetsFormat1
...
@@ -276,7 +276,7 @@ struct MarkGlyphSetsFormat1
{
return
(
this
+
coverage
[
set_index
]).
get_coverage
(
glyph_id
)
!=
NOT_COVERED
;
}
{
return
(
this
+
coverage
[
set_index
]).
get_coverage
(
glyph_id
)
!=
NOT_COVERED
;
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
));
}
}
...
@@ -300,7 +300,7 @@ struct MarkGlyphSets
...
@@ -300,7 +300,7 @@ struct MarkGlyphSets
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
...
@@ -365,7 +365,7 @@ struct GDEF
...
@@ -365,7 +365,7 @@ struct GDEF
{
return
version
.
to_int
()
>=
0x00010002
&&
(
this
+
markGlyphSetsDef
[
0
]).
covers
(
set_index
,
glyph_id
);
}
{
return
version
.
to_int
()
>=
0x00010002
&&
(
this
+
markGlyphSetsDef
[
0
]).
covers
(
set_index
,
glyph_id
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
version
.
sanitize
(
c
)
&&
return
TRACE_RETURN
(
version
.
sanitize
(
c
)
&&
likely
(
version
.
major
==
1
)
&&
likely
(
version
.
major
==
1
)
&&
glyphClassDef
.
sanitize
(
c
,
this
)
&&
glyphClassDef
.
sanitize
(
c
,
this
)
&&
...
...
src/hb-ot-layout-gpos-table.hh
浏览文件 @
be218c68
...
@@ -172,12 +172,12 @@ struct ValueFormat : USHORT
...
@@ -172,12 +172,12 @@ struct ValueFormat : USHORT
}
}
inline
bool
sanitize_value
(
hb_sanitize_context_t
*
c
,
void
*
base
,
Value
*
values
)
{
inline
bool
sanitize_value
(
hb_sanitize_context_t
*
c
,
void
*
base
,
Value
*
values
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_range
(
values
,
get_size
())
&&
(
!
has_device
()
||
sanitize_value_devices
(
c
,
base
,
values
)));
return
TRACE_RETURN
(
c
->
check_range
(
values
,
get_size
())
&&
(
!
has_device
()
||
sanitize_value_devices
(
c
,
base
,
values
)));
}
}
inline
bool
sanitize_values
(
hb_sanitize_context_t
*
c
,
void
*
base
,
Value
*
values
,
unsigned
int
count
)
{
inline
bool
sanitize_values
(
hb_sanitize_context_t
*
c
,
void
*
base
,
Value
*
values
,
unsigned
int
count
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
unsigned
int
len
=
get_len
();
unsigned
int
len
=
get_len
();
if
(
!
c
->
check_array
(
values
,
get_size
(),
count
))
return
TRACE_RETURN
(
false
);
if
(
!
c
->
check_array
(
values
,
get_size
(),
count
))
return
TRACE_RETURN
(
false
);
...
@@ -195,7 +195,7 @@ struct ValueFormat : USHORT
...
@@ -195,7 +195,7 @@ struct ValueFormat : USHORT
/* Just sanitize referenced Device tables. Doesn't check the values themselves. */
/* Just sanitize referenced Device tables. Doesn't check the values themselves. */
inline
bool
sanitize_values_stride_unsafe
(
hb_sanitize_context_t
*
c
,
void
*
base
,
Value
*
values
,
unsigned
int
count
,
unsigned
int
stride
)
{
inline
bool
sanitize_values_stride_unsafe
(
hb_sanitize_context_t
*
c
,
void
*
base
,
Value
*
values
,
unsigned
int
count
,
unsigned
int
stride
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
has_device
())
return
TRACE_RETURN
(
true
);
if
(
!
has_device
())
return
TRACE_RETURN
(
true
);
...
@@ -220,7 +220,7 @@ struct AnchorFormat1
...
@@ -220,7 +220,7 @@ struct AnchorFormat1
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
}
}
...
@@ -249,7 +249,7 @@ struct AnchorFormat2
...
@@ -249,7 +249,7 @@ struct AnchorFormat2
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
}
}
...
@@ -277,7 +277,7 @@ struct AnchorFormat3
...
@@ -277,7 +277,7 @@ struct AnchorFormat3
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
xDeviceTable
.
sanitize
(
c
,
this
)
&&
yDeviceTable
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
xDeviceTable
.
sanitize
(
c
,
this
)
&&
yDeviceTable
.
sanitize
(
c
,
this
));
}
}
...
@@ -312,7 +312,7 @@ struct Anchor
...
@@ -312,7 +312,7 @@ struct Anchor
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
...
@@ -342,7 +342,7 @@ struct AnchorMatrix
...
@@ -342,7 +342,7 @@ struct AnchorMatrix
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
unsigned
int
cols
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
unsigned
int
cols
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
c
->
check_struct
(
this
))
return
TRACE_RETURN
(
false
);
if
(
!
c
->
check_struct
(
this
))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
rows
>
0
&&
cols
>=
((
unsigned
int
)
-
1
)
/
rows
))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
rows
>
0
&&
cols
>=
((
unsigned
int
)
-
1
)
/
rows
))
return
TRACE_RETURN
(
false
);
unsigned
int
count
=
rows
*
cols
;
unsigned
int
count
=
rows
*
cols
;
...
@@ -367,7 +367,7 @@ struct MarkRecord
...
@@ -367,7 +367,7 @@ struct MarkRecord
friend
struct
MarkArray
;
friend
struct
MarkArray
;
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
void
*
base
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
void
*
base
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
markAnchor
.
sanitize
(
c
,
base
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
markAnchor
.
sanitize
(
c
,
base
));
}
}
...
@@ -387,7 +387,7 @@ struct MarkArray : ArrayOf<MarkRecord> /* Array of MarkRecords--in Coverage orde
...
@@ -387,7 +387,7 @@ struct MarkArray : ArrayOf<MarkRecord> /* Array of MarkRecords--in Coverage orde
const
AnchorMatrix
&
anchors
,
unsigned
int
class_count
,
const
AnchorMatrix
&
anchors
,
unsigned
int
class_count
,
unsigned
int
glyph_pos
)
const
unsigned
int
glyph_pos
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
const
MarkRecord
&
record
=
ArrayOf
<
MarkRecord
>::
operator
[](
mark_index
);
const
MarkRecord
&
record
=
ArrayOf
<
MarkRecord
>::
operator
[](
mark_index
);
unsigned
int
mark_class
=
record
.
klass
;
unsigned
int
mark_class
=
record
.
klass
;
...
@@ -409,7 +409,7 @@ struct MarkArray : ArrayOf<MarkRecord> /* Array of MarkRecords--in Coverage orde
...
@@ -409,7 +409,7 @@ struct MarkArray : ArrayOf<MarkRecord> /* Array of MarkRecords--in Coverage orde
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
ArrayOf
<
MarkRecord
>::
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
ArrayOf
<
MarkRecord
>::
sanitize
(
c
,
this
));
}
}
};
};
...
@@ -426,7 +426,7 @@ struct SinglePosFormat1
...
@@ -426,7 +426,7 @@ struct SinglePosFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
().
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
().
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
...
@@ -438,7 +438,7 @@ struct SinglePosFormat1
...
@@ -438,7 +438,7 @@ struct SinglePosFormat1
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
coverage
.
sanitize
(
c
,
this
)
&&
valueFormat
.
sanitize_value
(
c
,
this
,
values
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
coverage
.
sanitize
(
c
,
this
)
&&
valueFormat
.
sanitize_value
(
c
,
this
,
values
));
}
}
...
@@ -465,7 +465,7 @@ struct SinglePosFormat2
...
@@ -465,7 +465,7 @@ struct SinglePosFormat2
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
().
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
().
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
...
@@ -480,7 +480,7 @@ struct SinglePosFormat2
...
@@ -480,7 +480,7 @@ struct SinglePosFormat2
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
coverage
.
sanitize
(
c
,
this
)
&&
valueFormat
.
sanitize_values
(
c
,
this
,
values
,
valueCount
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
coverage
.
sanitize
(
c
,
this
)
&&
valueFormat
.
sanitize_values
(
c
,
this
,
values
,
valueCount
));
}
}
...
@@ -511,7 +511,7 @@ struct SinglePos
...
@@ -511,7 +511,7 @@ struct SinglePos
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
...
@@ -551,7 +551,7 @@ struct PairSet
...
@@ -551,7 +551,7 @@ struct PairSet
const
ValueFormat
*
valueFormats
,
const
ValueFormat
*
valueFormats
,
unsigned
int
pos
)
const
unsigned
int
pos
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
unsigned
int
len1
=
valueFormats
[
0
].
get_len
();
unsigned
int
len1
=
valueFormats
[
0
].
get_len
();
unsigned
int
len2
=
valueFormats
[
1
].
get_len
();
unsigned
int
len2
=
valueFormats
[
1
].
get_len
();
unsigned
int
record_size
=
USHORT
::
static_size
*
(
1
+
len1
+
len2
);
unsigned
int
record_size
=
USHORT
::
static_size
*
(
1
+
len1
+
len2
);
...
@@ -585,7 +585,7 @@ struct PairSet
...
@@ -585,7 +585,7 @@ struct PairSet
};
};
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
const
sanitize_closure_t
*
closure
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
const
sanitize_closure_t
*
closure
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
(
c
->
check_struct
(
this
)
if
(
!
(
c
->
check_struct
(
this
)
&&
c
->
check_array
(
array
,
USHORT
::
static_size
*
closure
->
stride
,
len
)))
return
TRACE_RETURN
(
false
);
&&
c
->
check_array
(
array
,
USHORT
::
static_size
*
closure
->
stride
,
len
)))
return
TRACE_RETURN
(
false
);
...
@@ -612,7 +612,7 @@ struct PairPosFormat1
...
@@ -612,7 +612,7 @@ struct PairPosFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
hb_apply_context_t
::
mark_skipping_forward_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
idx
,
1
);
hb_apply_context_t
::
mark_skipping_forward_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
idx
,
1
);
if
(
skippy_iter
.
has_no_chance
())
return
TRACE_RETURN
(
false
);
if
(
skippy_iter
.
has_no_chance
())
return
TRACE_RETURN
(
false
);
...
@@ -625,7 +625,7 @@ struct PairPosFormat1
...
@@ -625,7 +625,7 @@ struct PairPosFormat1
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
unsigned
int
len1
=
valueFormat1
.
get_len
();
unsigned
int
len1
=
valueFormat1
.
get_len
();
unsigned
int
len2
=
valueFormat2
.
get_len
();
unsigned
int
len2
=
valueFormat2
.
get_len
();
...
@@ -666,7 +666,7 @@ struct PairPosFormat2
...
@@ -666,7 +666,7 @@ struct PairPosFormat2
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
hb_apply_context_t
::
mark_skipping_forward_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
idx
,
1
);
hb_apply_context_t
::
mark_skipping_forward_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
idx
,
1
);
if
(
skippy_iter
.
has_no_chance
())
return
TRACE_RETURN
(
false
);
if
(
skippy_iter
.
has_no_chance
())
return
TRACE_RETURN
(
false
);
...
@@ -697,7 +697,7 @@ struct PairPosFormat2
...
@@ -697,7 +697,7 @@ struct PairPosFormat2
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
(
c
->
check_struct
(
this
)
if
(
!
(
c
->
check_struct
(
this
)
&&
coverage
.
sanitize
(
c
,
this
)
&&
coverage
.
sanitize
(
c
,
this
)
&&
classDef1
.
sanitize
(
c
,
this
)
&&
classDef1
.
sanitize
(
c
,
this
)
...
@@ -756,7 +756,7 @@ struct PairPos
...
@@ -756,7 +756,7 @@ struct PairPos
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
...
@@ -779,7 +779,7 @@ struct EntryExitRecord
...
@@ -779,7 +779,7 @@ struct EntryExitRecord
friend
struct
CursivePosFormat1
;
friend
struct
CursivePosFormat1
;
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
void
*
base
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
void
*
base
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
entryAnchor
.
sanitize
(
c
,
base
)
&&
exitAnchor
.
sanitize
(
c
,
base
));
return
TRACE_RETURN
(
entryAnchor
.
sanitize
(
c
,
base
)
&&
exitAnchor
.
sanitize
(
c
,
base
));
}
}
...
@@ -805,7 +805,7 @@ struct CursivePosFormat1
...
@@ -805,7 +805,7 @@ struct CursivePosFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
/* We don't handle mark glyphs here. */
/* We don't handle mark glyphs here. */
if
(
c
->
property
&
HB_OT_LAYOUT_GLYPH_PROPS_MARK
)
return
TRACE_RETURN
(
false
);
if
(
c
->
property
&
HB_OT_LAYOUT_GLYPH_PROPS_MARK
)
return
TRACE_RETURN
(
false
);
...
@@ -886,7 +886,7 @@ struct CursivePosFormat1
...
@@ -886,7 +886,7 @@ struct CursivePosFormat1
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
entryExitRecord
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
entryExitRecord
.
sanitize
(
c
,
this
));
}
}
...
@@ -914,7 +914,7 @@ struct CursivePos
...
@@ -914,7 +914,7 @@ struct CursivePos
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
...
@@ -944,7 +944,7 @@ struct MarkBasePosFormat1
...
@@ -944,7 +944,7 @@ struct MarkBasePosFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
unsigned
int
mark_index
=
(
this
+
markCoverage
)
(
c
->
buffer
->
cur
().
codepoint
);
unsigned
int
mark_index
=
(
this
+
markCoverage
)
(
c
->
buffer
->
cur
().
codepoint
);
if
(
likely
(
mark_index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
if
(
likely
(
mark_index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
...
@@ -968,7 +968,7 @@ struct MarkBasePosFormat1
...
@@ -968,7 +968,7 @@ struct MarkBasePosFormat1
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
markCoverage
.
sanitize
(
c
,
this
)
&&
baseCoverage
.
sanitize
(
c
,
this
)
&&
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
markCoverage
.
sanitize
(
c
,
this
)
&&
baseCoverage
.
sanitize
(
c
,
this
)
&&
markArray
.
sanitize
(
c
,
this
)
&&
baseArray
.
sanitize
(
c
,
this
,
(
unsigned
int
)
classCount
));
markArray
.
sanitize
(
c
,
this
)
&&
baseArray
.
sanitize
(
c
,
this
,
(
unsigned
int
)
classCount
));
}
}
...
@@ -1004,7 +1004,7 @@ struct MarkBasePos
...
@@ -1004,7 +1004,7 @@ struct MarkBasePos
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
...
@@ -1039,7 +1039,7 @@ struct MarkLigPosFormat1
...
@@ -1039,7 +1039,7 @@ struct MarkLigPosFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
unsigned
int
mark_index
=
(
this
+
markCoverage
)
(
c
->
buffer
->
cur
().
codepoint
);
unsigned
int
mark_index
=
(
this
+
markCoverage
)
(
c
->
buffer
->
cur
().
codepoint
);
if
(
likely
(
mark_index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
if
(
likely
(
mark_index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
...
@@ -1079,7 +1079,7 @@ struct MarkLigPosFormat1
...
@@ -1079,7 +1079,7 @@ struct MarkLigPosFormat1
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
markCoverage
.
sanitize
(
c
,
this
)
&&
ligatureCoverage
.
sanitize
(
c
,
this
)
&&
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
markCoverage
.
sanitize
(
c
,
this
)
&&
ligatureCoverage
.
sanitize
(
c
,
this
)
&&
markArray
.
sanitize
(
c
,
this
)
&&
ligatureArray
.
sanitize
(
c
,
this
,
(
unsigned
int
)
classCount
));
markArray
.
sanitize
(
c
,
this
)
&&
ligatureArray
.
sanitize
(
c
,
this
,
(
unsigned
int
)
classCount
));
}
}
...
@@ -1116,7 +1116,7 @@ struct MarkLigPos
...
@@ -1116,7 +1116,7 @@ struct MarkLigPos
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
...
@@ -1146,7 +1146,7 @@ struct MarkMarkPosFormat1
...
@@ -1146,7 +1146,7 @@ struct MarkMarkPosFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
unsigned
int
mark1_index
=
(
this
+
mark1Coverage
)
(
c
->
buffer
->
cur
().
codepoint
);
unsigned
int
mark1_index
=
(
this
+
mark1Coverage
)
(
c
->
buffer
->
cur
().
codepoint
);
if
(
likely
(
mark1_index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
if
(
likely
(
mark1_index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
...
@@ -1187,7 +1187,7 @@ struct MarkMarkPosFormat1
...
@@ -1187,7 +1187,7 @@ struct MarkMarkPosFormat1
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
mark1Coverage
.
sanitize
(
c
,
this
)
&&
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
mark1Coverage
.
sanitize
(
c
,
this
)
&&
mark2Coverage
.
sanitize
(
c
,
this
)
&&
mark1Array
.
sanitize
(
c
,
this
)
mark2Coverage
.
sanitize
(
c
,
this
)
&&
mark1Array
.
sanitize
(
c
,
this
)
&&
mark2Array
.
sanitize
(
c
,
this
,
(
unsigned
int
)
classCount
));
&&
mark2Array
.
sanitize
(
c
,
this
,
(
unsigned
int
)
classCount
));
...
@@ -1226,7 +1226,7 @@ struct MarkMarkPos
...
@@ -1226,7 +1226,7 @@ struct MarkMarkPos
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
...
@@ -1317,7 +1317,7 @@ struct PosLookupSubTable
...
@@ -1317,7 +1317,7 @@ struct PosLookupSubTable
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
unsigned
int
lookup_type
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
unsigned
int
lookup_type
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
header
.
sub_format
.
sanitize
(
c
))
if
(
!
u
.
header
.
sub_format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
(
false
);
switch
(
lookup_type
)
{
switch
(
lookup_type
)
{
...
@@ -1423,7 +1423,7 @@ struct PosLookup : Lookup
...
@@ -1423,7 +1423,7 @@ struct PosLookup : Lookup
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
Lookup
::
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
Lookup
::
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
OffsetArrayOf
<
PosLookupSubTable
>
&
list
=
CastR
<
OffsetArrayOf
<
PosLookupSubTable
>
>
(
subTable
);
OffsetArrayOf
<
PosLookupSubTable
>
&
list
=
CastR
<
OffsetArrayOf
<
PosLookupSubTable
>
>
(
subTable
);
return
TRACE_RETURN
(
list
.
sanitize
(
c
,
this
,
get_type
()));
return
TRACE_RETURN
(
list
.
sanitize
(
c
,
this
,
get_type
()));
...
@@ -1451,7 +1451,7 @@ struct GPOS : GSUBGPOS
...
@@ -1451,7 +1451,7 @@ struct GPOS : GSUBGPOS
static
inline
void
position_finish
(
hb_font_t
*
font
,
hb_buffer_t
*
buffer
,
hb_bool_t
zero_width_attahced_marks
);
static
inline
void
position_finish
(
hb_font_t
*
font
,
hb_buffer_t
*
buffer
,
hb_bool_t
zero_width_attahced_marks
);
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
GSUBGPOS
::
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
GSUBGPOS
::
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
OffsetTo
<
PosLookupList
>
&
list
=
CastR
<
OffsetTo
<
PosLookupList
>
>
(
lookupList
);
OffsetTo
<
PosLookupList
>
&
list
=
CastR
<
OffsetTo
<
PosLookupList
>
>
(
lookupList
);
return
TRACE_RETURN
(
list
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
list
.
sanitize
(
c
,
this
));
...
@@ -1548,7 +1548,7 @@ inline typename context_t::return_t ExtensionPos::process (context_t *c) const
...
@@ -1548,7 +1548,7 @@ inline typename context_t::return_t ExtensionPos::process (context_t *c) const
inline
bool
ExtensionPos
::
sanitize
(
hb_sanitize_context_t
*
c
)
inline
bool
ExtensionPos
::
sanitize
(
hb_sanitize_context_t
*
c
)
{
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
Extension
::
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
Extension
::
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
unsigned
int
offset
=
get_offset
();
unsigned
int
offset
=
get_offset
();
if
(
unlikely
(
!
offset
))
return
TRACE_RETURN
(
true
);
if
(
unlikely
(
!
offset
))
return
TRACE_RETURN
(
true
);
...
...
src/hb-ot-layout-gsub-table.hh
浏览文件 @
be218c68
...
@@ -39,7 +39,7 @@ struct SingleSubstFormat1
...
@@ -39,7 +39,7 @@ struct SingleSubstFormat1
{
{
inline
void
closure
(
hb_closure_context_t
*
c
)
const
inline
void
closure
(
hb_closure_context_t
*
c
)
const
{
{
TRACE_CLOSURE
();
TRACE_CLOSURE
(
this
);
Coverage
::
Iter
iter
;
Coverage
::
Iter
iter
;
for
(
iter
.
init
(
this
+
coverage
);
iter
.
more
();
iter
.
next
())
{
for
(
iter
.
init
(
this
+
coverage
);
iter
.
more
();
iter
.
next
())
{
hb_codepoint_t
glyph_id
=
iter
.
get_glyph
();
hb_codepoint_t
glyph_id
=
iter
.
get_glyph
();
...
@@ -65,13 +65,13 @@ struct SingleSubstFormat1
...
@@ -65,13 +65,13 @@ struct SingleSubstFormat1
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
{
TRACE_WOULD_APPLY
();
TRACE_WOULD_APPLY
(
this
);
return
TRACE_RETURN
(
c
->
len
==
1
&&
(
this
+
coverage
)
(
c
->
glyphs
[
0
])
!=
NOT_COVERED
);
return
TRACE_RETURN
(
c
->
len
==
1
&&
(
this
+
coverage
)
(
c
->
glyphs
[
0
])
!=
NOT_COVERED
);
}
}
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
hb_codepoint_t
glyph_id
=
c
->
buffer
->
cur
().
codepoint
;
hb_codepoint_t
glyph_id
=
c
->
buffer
->
cur
().
codepoint
;
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
...
@@ -89,7 +89,7 @@ struct SingleSubstFormat1
...
@@ -89,7 +89,7 @@ struct SingleSubstFormat1
unsigned
int
num_glyphs
,
unsigned
int
num_glyphs
,
int
delta
)
int
delta
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
coverage
.
serialize
(
c
,
this
).
serialize
(
c
,
glyphs
,
num_glyphs
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
coverage
.
serialize
(
c
,
this
).
serialize
(
c
,
glyphs
,
num_glyphs
)))
return
TRACE_RETURN
(
false
);
deltaGlyphID
.
set
(
delta
);
/* TODO(serilaize) overflow? */
deltaGlyphID
.
set
(
delta
);
/* TODO(serilaize) overflow? */
...
@@ -97,7 +97,7 @@ struct SingleSubstFormat1
...
@@ -97,7 +97,7 @@ struct SingleSubstFormat1
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
deltaGlyphID
.
sanitize
(
c
));
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
deltaGlyphID
.
sanitize
(
c
));
}
}
...
@@ -116,7 +116,7 @@ struct SingleSubstFormat2
...
@@ -116,7 +116,7 @@ struct SingleSubstFormat2
{
{
inline
void
closure
(
hb_closure_context_t
*
c
)
const
inline
void
closure
(
hb_closure_context_t
*
c
)
const
{
{
TRACE_CLOSURE
();
TRACE_CLOSURE
(
this
);
Coverage
::
Iter
iter
;
Coverage
::
Iter
iter
;
for
(
iter
.
init
(
this
+
coverage
);
iter
.
more
();
iter
.
next
())
{
for
(
iter
.
init
(
this
+
coverage
);
iter
.
more
();
iter
.
next
())
{
if
(
c
->
glyphs
->
has
(
iter
.
get_glyph
()))
if
(
c
->
glyphs
->
has
(
iter
.
get_glyph
()))
...
@@ -140,13 +140,13 @@ struct SingleSubstFormat2
...
@@ -140,13 +140,13 @@ struct SingleSubstFormat2
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
{
TRACE_WOULD_APPLY
();
TRACE_WOULD_APPLY
(
this
);
return
TRACE_RETURN
(
c
->
len
==
1
&&
(
this
+
coverage
)
(
c
->
glyphs
[
0
])
!=
NOT_COVERED
);
return
TRACE_RETURN
(
c
->
len
==
1
&&
(
this
+
coverage
)
(
c
->
glyphs
[
0
])
!=
NOT_COVERED
);
}
}
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
hb_codepoint_t
glyph_id
=
c
->
buffer
->
cur
().
codepoint
;
hb_codepoint_t
glyph_id
=
c
->
buffer
->
cur
().
codepoint
;
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
...
@@ -164,7 +164,7 @@ struct SingleSubstFormat2
...
@@ -164,7 +164,7 @@ struct SingleSubstFormat2
Supplier
<
GlyphID
>
&
substitutes
,
Supplier
<
GlyphID
>
&
substitutes
,
unsigned
int
num_glyphs
)
unsigned
int
num_glyphs
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
substitute
.
serialize
(
c
,
substitutes
,
num_glyphs
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
substitute
.
serialize
(
c
,
substitutes
,
num_glyphs
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
coverage
.
serialize
(
c
,
this
).
serialize
(
c
,
glyphs
,
num_glyphs
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
coverage
.
serialize
(
c
,
this
).
serialize
(
c
,
glyphs
,
num_glyphs
)))
return
TRACE_RETURN
(
false
);
...
@@ -172,7 +172,7 @@ struct SingleSubstFormat2
...
@@ -172,7 +172,7 @@ struct SingleSubstFormat2
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
substitute
.
sanitize
(
c
));
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
substitute
.
sanitize
(
c
));
}
}
...
@@ -205,7 +205,7 @@ struct SingleSubst
...
@@ -205,7 +205,7 @@ struct SingleSubst
Supplier
<
GlyphID
>
&
substitutes
,
Supplier
<
GlyphID
>
&
substitutes
,
unsigned
int
num_glyphs
)
unsigned
int
num_glyphs
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
u
.
format
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
u
.
format
)))
return
TRACE_RETURN
(
false
);
unsigned
int
format
=
2
;
unsigned
int
format
=
2
;
int
delta
;
int
delta
;
...
@@ -228,7 +228,7 @@ struct SingleSubst
...
@@ -228,7 +228,7 @@ struct SingleSubst
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
...
@@ -250,7 +250,7 @@ struct Sequence
...
@@ -250,7 +250,7 @@ struct Sequence
{
{
inline
void
closure
(
hb_closure_context_t
*
c
)
const
inline
void
closure
(
hb_closure_context_t
*
c
)
const
{
{
TRACE_CLOSURE
();
TRACE_CLOSURE
(
this
);
unsigned
int
count
=
substitute
.
len
;
unsigned
int
count
=
substitute
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
c
->
glyphs
->
add
(
substitute
[
i
]);
c
->
glyphs
->
add
(
substitute
[
i
]);
...
@@ -265,7 +265,7 @@ struct Sequence
...
@@ -265,7 +265,7 @@ struct Sequence
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
if
(
unlikely
(
!
substitute
.
len
))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
substitute
.
len
))
return
TRACE_RETURN
(
false
);
unsigned
int
klass
=
c
->
property
&
HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE
?
HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH
:
0
;
unsigned
int
klass
=
c
->
property
&
HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE
?
HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH
:
0
;
...
@@ -283,14 +283,14 @@ struct Sequence
...
@@ -283,14 +283,14 @@ struct Sequence
Supplier
<
GlyphID
>
&
glyphs
,
Supplier
<
GlyphID
>
&
glyphs
,
unsigned
int
num_glyphs
)
unsigned
int
num_glyphs
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
substitute
.
serialize
(
c
,
glyphs
,
num_glyphs
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
substitute
.
serialize
(
c
,
glyphs
,
num_glyphs
)))
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
(
true
);
return
TRACE_RETURN
(
true
);
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
substitute
.
sanitize
(
c
));
return
TRACE_RETURN
(
substitute
.
sanitize
(
c
));
}
}
...
@@ -305,7 +305,7 @@ struct MultipleSubstFormat1
...
@@ -305,7 +305,7 @@ struct MultipleSubstFormat1
{
{
inline
void
closure
(
hb_closure_context_t
*
c
)
const
inline
void
closure
(
hb_closure_context_t
*
c
)
const
{
{
TRACE_CLOSURE
();
TRACE_CLOSURE
(
this
);
Coverage
::
Iter
iter
;
Coverage
::
Iter
iter
;
for
(
iter
.
init
(
this
+
coverage
);
iter
.
more
();
iter
.
next
())
{
for
(
iter
.
init
(
this
+
coverage
);
iter
.
more
();
iter
.
next
())
{
if
(
c
->
glyphs
->
has
(
iter
.
get_glyph
()))
if
(
c
->
glyphs
->
has
(
iter
.
get_glyph
()))
...
@@ -328,13 +328,13 @@ struct MultipleSubstFormat1
...
@@ -328,13 +328,13 @@ struct MultipleSubstFormat1
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
{
TRACE_WOULD_APPLY
();
TRACE_WOULD_APPLY
(
this
);
return
TRACE_RETURN
(
c
->
len
==
1
&&
(
this
+
coverage
)
(
c
->
glyphs
[
0
])
!=
NOT_COVERED
);
return
TRACE_RETURN
(
c
->
len
==
1
&&
(
this
+
coverage
)
(
c
->
glyphs
[
0
])
!=
NOT_COVERED
);
}
}
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
().
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
().
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
...
@@ -348,7 +348,7 @@ struct MultipleSubstFormat1
...
@@ -348,7 +348,7 @@ struct MultipleSubstFormat1
unsigned
int
num_glyphs
,
unsigned
int
num_glyphs
,
Supplier
<
GlyphID
>
&
substitute_glyphs_list
)
Supplier
<
GlyphID
>
&
substitute_glyphs_list
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
sequence
.
serialize
(
c
,
num_glyphs
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
sequence
.
serialize
(
c
,
num_glyphs
)))
return
TRACE_RETURN
(
false
);
for
(
unsigned
int
i
=
0
;
i
<
num_glyphs
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
num_glyphs
;
i
++
)
...
@@ -361,7 +361,7 @@ struct MultipleSubstFormat1
...
@@ -361,7 +361,7 @@ struct MultipleSubstFormat1
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
sequence
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
sequence
.
sanitize
(
c
,
this
));
}
}
...
@@ -394,7 +394,7 @@ struct MultipleSubst
...
@@ -394,7 +394,7 @@ struct MultipleSubst
unsigned
int
num_glyphs
,
unsigned
int
num_glyphs
,
Supplier
<
GlyphID
>
&
substitute_glyphs_list
)
Supplier
<
GlyphID
>
&
substitute_glyphs_list
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
u
.
format
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
u
.
format
)))
return
TRACE_RETURN
(
false
);
unsigned
int
format
=
1
;
unsigned
int
format
=
1
;
u
.
format
.
set
(
format
);
u
.
format
.
set
(
format
);
...
@@ -405,7 +405,7 @@ struct MultipleSubst
...
@@ -405,7 +405,7 @@ struct MultipleSubst
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
...
@@ -428,7 +428,7 @@ struct AlternateSubstFormat1
...
@@ -428,7 +428,7 @@ struct AlternateSubstFormat1
{
{
inline
void
closure
(
hb_closure_context_t
*
c
)
const
inline
void
closure
(
hb_closure_context_t
*
c
)
const
{
{
TRACE_CLOSURE
();
TRACE_CLOSURE
(
this
);
Coverage
::
Iter
iter
;
Coverage
::
Iter
iter
;
for
(
iter
.
init
(
this
+
coverage
);
iter
.
more
();
iter
.
next
())
{
for
(
iter
.
init
(
this
+
coverage
);
iter
.
more
();
iter
.
next
())
{
if
(
c
->
glyphs
->
has
(
iter
.
get_glyph
()))
{
if
(
c
->
glyphs
->
has
(
iter
.
get_glyph
()))
{
...
@@ -459,13 +459,13 @@ struct AlternateSubstFormat1
...
@@ -459,13 +459,13 @@ struct AlternateSubstFormat1
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
{
TRACE_WOULD_APPLY
();
TRACE_WOULD_APPLY
(
this
);
return
TRACE_RETURN
(
c
->
len
==
1
&&
(
this
+
coverage
)
(
c
->
glyphs
[
0
])
!=
NOT_COVERED
);
return
TRACE_RETURN
(
c
->
len
==
1
&&
(
this
+
coverage
)
(
c
->
glyphs
[
0
])
!=
NOT_COVERED
);
}
}
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
hb_codepoint_t
glyph_id
=
c
->
buffer
->
cur
().
codepoint
;
hb_codepoint_t
glyph_id
=
c
->
buffer
->
cur
().
codepoint
;
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
...
@@ -497,7 +497,7 @@ struct AlternateSubstFormat1
...
@@ -497,7 +497,7 @@ struct AlternateSubstFormat1
unsigned
int
num_glyphs
,
unsigned
int
num_glyphs
,
Supplier
<
GlyphID
>
&
alternate_glyphs_list
)
Supplier
<
GlyphID
>
&
alternate_glyphs_list
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
alternateSet
.
serialize
(
c
,
num_glyphs
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
alternateSet
.
serialize
(
c
,
num_glyphs
)))
return
TRACE_RETURN
(
false
);
for
(
unsigned
int
i
=
0
;
i
<
num_glyphs
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
num_glyphs
;
i
++
)
...
@@ -510,7 +510,7 @@ struct AlternateSubstFormat1
...
@@ -510,7 +510,7 @@ struct AlternateSubstFormat1
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
alternateSet
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
alternateSet
.
sanitize
(
c
,
this
));
}
}
...
@@ -543,7 +543,7 @@ struct AlternateSubst
...
@@ -543,7 +543,7 @@ struct AlternateSubst
unsigned
int
num_glyphs
,
unsigned
int
num_glyphs
,
Supplier
<
GlyphID
>
&
alternate_glyphs_list
)
Supplier
<
GlyphID
>
&
alternate_glyphs_list
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
u
.
format
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
u
.
format
)))
return
TRACE_RETURN
(
false
);
unsigned
int
format
=
1
;
unsigned
int
format
=
1
;
u
.
format
.
set
(
format
);
u
.
format
.
set
(
format
);
...
@@ -554,7 +554,7 @@ struct AlternateSubst
...
@@ -554,7 +554,7 @@ struct AlternateSubst
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
...
@@ -574,7 +574,7 @@ struct Ligature
...
@@ -574,7 +574,7 @@ struct Ligature
{
{
inline
void
closure
(
hb_closure_context_t
*
c
)
const
inline
void
closure
(
hb_closure_context_t
*
c
)
const
{
{
TRACE_CLOSURE
();
TRACE_CLOSURE
(
this
);
unsigned
int
count
=
component
.
len
;
unsigned
int
count
=
component
.
len
;
for
(
unsigned
int
i
=
1
;
i
<
count
;
i
++
)
for
(
unsigned
int
i
=
1
;
i
<
count
;
i
++
)
if
(
!
c
->
glyphs
->
has
(
component
[
i
]))
if
(
!
c
->
glyphs
->
has
(
component
[
i
]))
...
@@ -592,7 +592,7 @@ struct Ligature
...
@@ -592,7 +592,7 @@ struct Ligature
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
{
TRACE_WOULD_APPLY
();
TRACE_WOULD_APPLY
(
this
);
if
(
c
->
len
!=
component
.
len
)
if
(
c
->
len
!=
component
.
len
)
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
(
false
);
...
@@ -605,7 +605,7 @@ struct Ligature
...
@@ -605,7 +605,7 @@ struct Ligature
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
unsigned
int
count
=
component
.
len
;
unsigned
int
count
=
component
.
len
;
if
(
unlikely
(
count
<
1
))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
count
<
1
))
return
TRACE_RETURN
(
false
);
...
@@ -642,7 +642,7 @@ struct Ligature
...
@@ -642,7 +642,7 @@ struct Ligature
Supplier
<
GlyphID
>
&
components
,
/* Starting from second */
Supplier
<
GlyphID
>
&
components
,
/* Starting from second */
unsigned
int
num_components
/* Including first component */
)
unsigned
int
num_components
/* Including first component */
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
ligGlyph
=
ligature
;
ligGlyph
=
ligature
;
if
(
unlikely
(
!
component
.
serialize
(
c
,
components
,
num_components
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
component
.
serialize
(
c
,
components
,
num_components
)))
return
TRACE_RETURN
(
false
);
...
@@ -651,7 +651,7 @@ struct Ligature
...
@@ -651,7 +651,7 @@ struct Ligature
public:
public:
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
ligGlyph
.
sanitize
(
c
)
&&
component
.
sanitize
(
c
));
return
TRACE_RETURN
(
ligGlyph
.
sanitize
(
c
)
&&
component
.
sanitize
(
c
));
}
}
...
@@ -669,7 +669,7 @@ struct LigatureSet
...
@@ -669,7 +669,7 @@ struct LigatureSet
{
{
inline
void
closure
(
hb_closure_context_t
*
c
)
const
inline
void
closure
(
hb_closure_context_t
*
c
)
const
{
{
TRACE_CLOSURE
();
TRACE_CLOSURE
(
this
);
unsigned
int
num_ligs
=
ligature
.
len
;
unsigned
int
num_ligs
=
ligature
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
num_ligs
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
num_ligs
;
i
++
)
(
this
+
ligature
[
i
]).
closure
(
c
);
(
this
+
ligature
[
i
]).
closure
(
c
);
...
@@ -684,7 +684,7 @@ struct LigatureSet
...
@@ -684,7 +684,7 @@ struct LigatureSet
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
{
TRACE_WOULD_APPLY
();
TRACE_WOULD_APPLY
(
this
);
unsigned
int
num_ligs
=
ligature
.
len
;
unsigned
int
num_ligs
=
ligature
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
num_ligs
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
num_ligs
;
i
++
)
{
{
...
@@ -697,7 +697,7 @@ struct LigatureSet
...
@@ -697,7 +697,7 @@ struct LigatureSet
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
unsigned
int
num_ligs
=
ligature
.
len
;
unsigned
int
num_ligs
=
ligature
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
num_ligs
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
num_ligs
;
i
++
)
{
{
...
@@ -714,7 +714,7 @@ struct LigatureSet
...
@@ -714,7 +714,7 @@ struct LigatureSet
unsigned
int
num_ligatures
,
unsigned
int
num_ligatures
,
Supplier
<
GlyphID
>
&
component_list
/* Starting from second for each ligature */
)
Supplier
<
GlyphID
>
&
component_list
/* Starting from second for each ligature */
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
ligature
.
serialize
(
c
,
num_ligatures
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
ligature
.
serialize
(
c
,
num_ligatures
)))
return
TRACE_RETURN
(
false
);
for
(
unsigned
int
i
=
0
;
i
<
num_ligatures
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
num_ligatures
;
i
++
)
...
@@ -728,7 +728,7 @@ struct LigatureSet
...
@@ -728,7 +728,7 @@ struct LigatureSet
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
ligature
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
ligature
.
sanitize
(
c
,
this
));
}
}
...
@@ -744,7 +744,7 @@ struct LigatureSubstFormat1
...
@@ -744,7 +744,7 @@ struct LigatureSubstFormat1
{
{
inline
void
closure
(
hb_closure_context_t
*
c
)
const
inline
void
closure
(
hb_closure_context_t
*
c
)
const
{
{
TRACE_CLOSURE
();
TRACE_CLOSURE
(
this
);
Coverage
::
Iter
iter
;
Coverage
::
Iter
iter
;
for
(
iter
.
init
(
this
+
coverage
);
iter
.
more
();
iter
.
next
())
{
for
(
iter
.
init
(
this
+
coverage
);
iter
.
more
();
iter
.
next
())
{
if
(
c
->
glyphs
->
has
(
iter
.
get_glyph
()))
if
(
c
->
glyphs
->
has
(
iter
.
get_glyph
()))
...
@@ -768,7 +768,7 @@ struct LigatureSubstFormat1
...
@@ -768,7 +768,7 @@ struct LigatureSubstFormat1
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
{
TRACE_WOULD_APPLY
();
TRACE_WOULD_APPLY
(
this
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
glyphs
[
0
]);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
glyphs
[
0
]);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
...
@@ -778,7 +778,7 @@ struct LigatureSubstFormat1
...
@@ -778,7 +778,7 @@ struct LigatureSubstFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
hb_codepoint_t
glyph_id
=
c
->
buffer
->
cur
().
codepoint
;
hb_codepoint_t
glyph_id
=
c
->
buffer
->
cur
().
codepoint
;
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
...
@@ -796,7 +796,7 @@ struct LigatureSubstFormat1
...
@@ -796,7 +796,7 @@ struct LigatureSubstFormat1
Supplier
<
unsigned
int
>
&
component_count_list
,
Supplier
<
unsigned
int
>
&
component_count_list
,
Supplier
<
GlyphID
>
&
component_list
/* Starting from second for each ligature */
)
Supplier
<
GlyphID
>
&
component_list
/* Starting from second for each ligature */
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
ligatureSet
.
serialize
(
c
,
num_first_glyphs
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
ligatureSet
.
serialize
(
c
,
num_first_glyphs
)))
return
TRACE_RETURN
(
false
);
for
(
unsigned
int
i
=
0
;
i
<
num_first_glyphs
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
num_first_glyphs
;
i
++
)
...
@@ -811,7 +811,7 @@ struct LigatureSubstFormat1
...
@@ -811,7 +811,7 @@ struct LigatureSubstFormat1
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
ligatureSet
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
ligatureSet
.
sanitize
(
c
,
this
));
}
}
...
@@ -846,7 +846,7 @@ struct LigatureSubst
...
@@ -846,7 +846,7 @@ struct LigatureSubst
Supplier
<
unsigned
int
>
&
component_count_list
,
Supplier
<
unsigned
int
>
&
component_count_list
,
Supplier
<
GlyphID
>
&
component_list
/* Starting from second for each ligature */
)
Supplier
<
GlyphID
>
&
component_list
/* Starting from second for each ligature */
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
u
.
format
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
u
.
format
)))
return
TRACE_RETURN
(
false
);
unsigned
int
format
=
1
;
unsigned
int
format
=
1
;
u
.
format
.
set
(
format
);
u
.
format
.
set
(
format
);
...
@@ -858,7 +858,7 @@ struct LigatureSubst
...
@@ -858,7 +858,7 @@ struct LigatureSubst
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
...
@@ -915,7 +915,7 @@ struct ReverseChainSingleSubstFormat1
...
@@ -915,7 +915,7 @@ struct ReverseChainSingleSubstFormat1
{
{
inline
void
closure
(
hb_closure_context_t
*
c
)
const
inline
void
closure
(
hb_closure_context_t
*
c
)
const
{
{
TRACE_CLOSURE
();
TRACE_CLOSURE
(
this
);
const
OffsetArrayOf
<
Coverage
>
&
lookahead
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
backtrack
);
const
OffsetArrayOf
<
Coverage
>
&
lookahead
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
backtrack
);
unsigned
int
count
;
unsigned
int
count
;
...
@@ -967,13 +967,13 @@ struct ReverseChainSingleSubstFormat1
...
@@ -967,13 +967,13 @@ struct ReverseChainSingleSubstFormat1
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
{
TRACE_WOULD_APPLY
();
TRACE_WOULD_APPLY
(
this
);
return
TRACE_RETURN
(
c
->
len
==
1
&&
(
this
+
coverage
)
(
c
->
glyphs
[
0
])
!=
NOT_COVERED
);
return
TRACE_RETURN
(
c
->
len
==
1
&&
(
this
+
coverage
)
(
c
->
glyphs
[
0
])
!=
NOT_COVERED
);
}
}
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
if
(
unlikely
(
c
->
nesting_level_left
!=
MAX_NESTING_LEVEL
))
if
(
unlikely
(
c
->
nesting_level_left
!=
MAX_NESTING_LEVEL
))
return
TRACE_RETURN
(
false
);
/* No chaining to this type */
return
TRACE_RETURN
(
false
);
/* No chaining to this type */
...
@@ -1000,7 +1000,7 @@ struct ReverseChainSingleSubstFormat1
...
@@ -1000,7 +1000,7 @@ struct ReverseChainSingleSubstFormat1
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
(
coverage
.
sanitize
(
c
,
this
)
&&
backtrack
.
sanitize
(
c
,
this
)))
if
(
!
(
coverage
.
sanitize
(
c
,
this
)
&&
backtrack
.
sanitize
(
c
,
this
)))
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
(
false
);
OffsetArrayOf
<
Coverage
>
&
lookahead
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
backtrack
);
OffsetArrayOf
<
Coverage
>
&
lookahead
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
backtrack
);
...
@@ -1042,7 +1042,7 @@ struct ReverseChainSingleSubst
...
@@ -1042,7 +1042,7 @@ struct ReverseChainSingleSubst
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
...
@@ -1095,7 +1095,7 @@ struct SubstLookupSubTable
...
@@ -1095,7 +1095,7 @@ struct SubstLookupSubTable
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
unsigned
int
lookup_type
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
unsigned
int
lookup_type
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
header
.
sub_format
.
sanitize
(
c
))
if
(
!
u
.
header
.
sub_format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
(
false
);
switch
(
lookup_type
)
{
switch
(
lookup_type
)
{
...
@@ -1176,7 +1176,7 @@ struct SubstLookup : Lookup
...
@@ -1176,7 +1176,7 @@ struct SubstLookup : Lookup
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
,
const
hb_set_digest_t
*
digest
)
const
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
,
const
hb_set_digest_t
*
digest
)
const
{
{
TRACE_WOULD_APPLY
();
TRACE_WOULD_APPLY
(
this
);
if
(
unlikely
(
!
c
->
len
))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
c
->
len
))
return
TRACE_RETURN
(
false
);
if
(
!
digest
->
may_have
(
c
->
glyphs
[
0
]))
return
TRACE_RETURN
(
false
);
if
(
!
digest
->
may_have
(
c
->
glyphs
[
0
]))
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
(
process
(
c
));
return
TRACE_RETURN
(
process
(
c
));
...
@@ -1251,7 +1251,7 @@ struct SubstLookup : Lookup
...
@@ -1251,7 +1251,7 @@ struct SubstLookup : Lookup
Supplier
<
GlyphID
>
&
substitutes
,
Supplier
<
GlyphID
>
&
substitutes
,
unsigned
int
num_glyphs
)
unsigned
int
num_glyphs
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
Lookup
::
serialize
(
c
,
SubstLookupSubTable
::
Single
,
lookup_props
,
1
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
Lookup
::
serialize
(
c
,
SubstLookupSubTable
::
Single
,
lookup_props
,
1
)))
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
(
serialize_subtable
(
c
,
0
).
u
.
single
.
serialize
(
c
,
glyphs
,
substitutes
,
num_glyphs
));
return
TRACE_RETURN
(
serialize_subtable
(
c
,
0
).
u
.
single
.
serialize
(
c
,
glyphs
,
substitutes
,
num_glyphs
));
}
}
...
@@ -1263,7 +1263,7 @@ struct SubstLookup : Lookup
...
@@ -1263,7 +1263,7 @@ struct SubstLookup : Lookup
unsigned
int
num_glyphs
,
unsigned
int
num_glyphs
,
Supplier
<
GlyphID
>
&
substitute_glyphs_list
)
Supplier
<
GlyphID
>
&
substitute_glyphs_list
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
Lookup
::
serialize
(
c
,
SubstLookupSubTable
::
Multiple
,
lookup_props
,
1
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
Lookup
::
serialize
(
c
,
SubstLookupSubTable
::
Multiple
,
lookup_props
,
1
)))
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
(
serialize_subtable
(
c
,
0
).
u
.
multiple
.
serialize
(
c
,
glyphs
,
substitute_len_list
,
num_glyphs
,
return
TRACE_RETURN
(
serialize_subtable
(
c
,
0
).
u
.
multiple
.
serialize
(
c
,
glyphs
,
substitute_len_list
,
num_glyphs
,
substitute_glyphs_list
));
substitute_glyphs_list
));
...
@@ -1276,7 +1276,7 @@ struct SubstLookup : Lookup
...
@@ -1276,7 +1276,7 @@ struct SubstLookup : Lookup
unsigned
int
num_glyphs
,
unsigned
int
num_glyphs
,
Supplier
<
GlyphID
>
&
alternate_glyphs_list
)
Supplier
<
GlyphID
>
&
alternate_glyphs_list
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
Lookup
::
serialize
(
c
,
SubstLookupSubTable
::
Alternate
,
lookup_props
,
1
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
Lookup
::
serialize
(
c
,
SubstLookupSubTable
::
Alternate
,
lookup_props
,
1
)))
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
(
serialize_subtable
(
c
,
0
).
u
.
alternate
.
serialize
(
c
,
glyphs
,
alternate_len_list
,
num_glyphs
,
return
TRACE_RETURN
(
serialize_subtable
(
c
,
0
).
u
.
alternate
.
serialize
(
c
,
glyphs
,
alternate_len_list
,
num_glyphs
,
alternate_glyphs_list
));
alternate_glyphs_list
));
...
@@ -1291,7 +1291,7 @@ struct SubstLookup : Lookup
...
@@ -1291,7 +1291,7 @@ struct SubstLookup : Lookup
Supplier
<
unsigned
int
>
&
component_count_list
,
Supplier
<
unsigned
int
>
&
component_count_list
,
Supplier
<
GlyphID
>
&
component_list
/* Starting from second for each ligature */
)
Supplier
<
GlyphID
>
&
component_list
/* Starting from second for each ligature */
)
{
{
TRACE_SERIALIZE
();
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
Lookup
::
serialize
(
c
,
SubstLookupSubTable
::
Ligature
,
lookup_props
,
1
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
Lookup
::
serialize
(
c
,
SubstLookupSubTable
::
Ligature
,
lookup_props
,
1
)))
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
(
serialize_subtable
(
c
,
0
).
u
.
ligature
.
serialize
(
c
,
first_glyphs
,
ligature_per_first_glyph_count_list
,
num_first_glyphs
,
return
TRACE_RETURN
(
serialize_subtable
(
c
,
0
).
u
.
ligature
.
serialize
(
c
,
first_glyphs
,
ligature_per_first_glyph_count_list
,
num_first_glyphs
,
ligatures_list
,
component_count_list
,
component_list
));
ligatures_list
,
component_count_list
,
component_list
));
...
@@ -1299,7 +1299,7 @@ struct SubstLookup : Lookup
...
@@ -1299,7 +1299,7 @@ struct SubstLookup : Lookup
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
Lookup
::
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
Lookup
::
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
OffsetArrayOf
<
SubstLookupSubTable
>
&
list
=
CastR
<
OffsetArrayOf
<
SubstLookupSubTable
>
>
(
subTable
);
OffsetArrayOf
<
SubstLookupSubTable
>
&
list
=
CastR
<
OffsetArrayOf
<
SubstLookupSubTable
>
>
(
subTable
);
if
(
unlikely
(
!
list
.
sanitize
(
c
,
this
,
get_type
())))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
list
.
sanitize
(
c
,
this
,
get_type
())))
return
TRACE_RETURN
(
false
);
...
@@ -1362,7 +1362,7 @@ struct GSUB : GSUBGPOS
...
@@ -1362,7 +1362,7 @@ struct GSUB : GSUBGPOS
#endif
#endif
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
GSUBGPOS
::
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
GSUBGPOS
::
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
OffsetTo
<
SubstLookupList
>
&
list
=
CastR
<
OffsetTo
<
SubstLookupList
>
>
(
lookupList
);
OffsetTo
<
SubstLookupList
>
&
list
=
CastR
<
OffsetTo
<
SubstLookupList
>
>
(
lookupList
);
return
TRACE_RETURN
(
list
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
list
.
sanitize
(
c
,
this
));
...
@@ -1403,7 +1403,7 @@ inline typename context_t::return_t ExtensionSubst::process (context_t *c) const
...
@@ -1403,7 +1403,7 @@ inline typename context_t::return_t ExtensionSubst::process (context_t *c) const
inline
bool
ExtensionSubst
::
sanitize
(
hb_sanitize_context_t
*
c
)
inline
bool
ExtensionSubst
::
sanitize
(
hb_sanitize_context_t
*
c
)
{
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
Extension
::
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
if
(
unlikely
(
!
Extension
::
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
unsigned
int
offset
=
get_offset
();
unsigned
int
offset
=
get_offset
();
if
(
unlikely
(
!
offset
))
return
TRACE_RETURN
(
true
);
if
(
unlikely
(
!
offset
))
return
TRACE_RETURN
(
true
);
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
be218c68
...
@@ -42,7 +42,7 @@ namespace OT {
...
@@ -42,7 +42,7 @@ namespace OT {
#define HB_DEBUG_CLOSURE (HB_DEBUG+0)
#define HB_DEBUG_CLOSURE (HB_DEBUG+0)
#endif
#endif
#define TRACE_CLOSURE() \
#define TRACE_CLOSURE(
this
) \
hb_auto_trace_t<HB_DEBUG_CLOSURE, void_t> trace \
hb_auto_trace_t<HB_DEBUG_CLOSURE, void_t> trace \
(&c->debug_depth, "CLOSURE", this, HB_FUNC, \
(&c->debug_depth, "CLOSURE", this, HB_FUNC, \
"");
"");
...
@@ -89,7 +89,7 @@ struct hb_closure_context_t
...
@@ -89,7 +89,7 @@ struct hb_closure_context_t
#define HB_DEBUG_WOULD_APPLY (HB_DEBUG+0)
#define HB_DEBUG_WOULD_APPLY (HB_DEBUG+0)
#endif
#endif
#define TRACE_WOULD_APPLY() \
#define TRACE_WOULD_APPLY(
this
) \
hb_auto_trace_t<HB_DEBUG_WOULD_APPLY, bool> trace \
hb_auto_trace_t<HB_DEBUG_WOULD_APPLY, bool> trace \
(&c->debug_depth, "WOULD_APPLY", this, HB_FUNC, \
(&c->debug_depth, "WOULD_APPLY", this, HB_FUNC, \
"%d glyphs", c->len);
"%d glyphs", c->len);
...
@@ -126,7 +126,7 @@ struct hb_would_apply_context_t
...
@@ -126,7 +126,7 @@ struct hb_would_apply_context_t
#define HB_DEBUG_COLLECT_GLYPHS (HB_DEBUG+0)
#define HB_DEBUG_COLLECT_GLYPHS (HB_DEBUG+0)
#endif
#endif
#define TRACE_COLLECT_GLYPHS() \
#define TRACE_COLLECT_GLYPHS(
this
) \
hb_auto_trace_t<HB_DEBUG_COLLECT_GLYPHS, void_t> trace \
hb_auto_trace_t<HB_DEBUG_COLLECT_GLYPHS, void_t> trace \
(&c->debug_depth, "COLLECT_GLYPHS", this, HB_FUNC, \
(&c->debug_depth, "COLLECT_GLYPHS", this, HB_FUNC, \
"");
"");
...
@@ -187,7 +187,7 @@ struct hb_get_coverage_context_t
...
@@ -187,7 +187,7 @@ struct hb_get_coverage_context_t
#define HB_DEBUG_APPLY (HB_DEBUG+0)
#define HB_DEBUG_APPLY (HB_DEBUG+0)
#endif
#endif
#define TRACE_APPLY() \
#define TRACE_APPLY(
this
) \
hb_auto_trace_t<HB_DEBUG_APPLY, bool> trace \
hb_auto_trace_t<HB_DEBUG_APPLY, bool> trace \
(&c->debug_depth, "APPLY", this, HB_FUNC, \
(&c->debug_depth, "APPLY", this, HB_FUNC, \
"idx %d codepoint %u", c->buffer->idx, c->buffer->cur().codepoint);
"idx %d codepoint %u", c->buffer->idx, c->buffer->cur().codepoint);
...
@@ -734,7 +734,7 @@ static inline bool match_lookahead (hb_apply_context_t *c,
...
@@ -734,7 +734,7 @@ static inline bool match_lookahead (hb_apply_context_t *c,
struct
LookupRecord
struct
LookupRecord
{
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
}
}
...
@@ -877,7 +877,7 @@ struct Rule
...
@@ -877,7 +877,7 @@ struct Rule
{
{
inline
void
closure
(
hb_closure_context_t
*
c
,
ContextClosureLookupContext
&
lookup_context
)
const
inline
void
closure
(
hb_closure_context_t
*
c
,
ContextClosureLookupContext
&
lookup_context
)
const
{
{
TRACE_CLOSURE
();
TRACE_CLOSURE
(
this
);
const
LookupRecord
*
lookupRecord
=
&
StructAtOffset
<
LookupRecord
>
(
input
,
input
[
0
].
static_size
*
(
inputCount
?
inputCount
-
1
:
0
));
const
LookupRecord
*
lookupRecord
=
&
StructAtOffset
<
LookupRecord
>
(
input
,
input
[
0
].
static_size
*
(
inputCount
?
inputCount
-
1
:
0
));
context_closure_lookup
(
c
,
context_closure_lookup
(
c
,
inputCount
,
input
,
inputCount
,
input
,
...
@@ -887,21 +887,21 @@ struct Rule
...
@@ -887,21 +887,21 @@ struct Rule
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
,
ContextApplyLookupContext
&
lookup_context
)
const
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
,
ContextApplyLookupContext
&
lookup_context
)
const
{
{
TRACE_WOULD_APPLY
();
TRACE_WOULD_APPLY
(
this
);
const
LookupRecord
*
lookupRecord
=
&
StructAtOffset
<
LookupRecord
>
(
input
,
input
[
0
].
static_size
*
(
inputCount
?
inputCount
-
1
:
0
));
const
LookupRecord
*
lookupRecord
=
&
StructAtOffset
<
LookupRecord
>
(
input
,
input
[
0
].
static_size
*
(
inputCount
?
inputCount
-
1
:
0
));
return
TRACE_RETURN
(
context_would_apply_lookup
(
c
,
inputCount
,
input
,
lookupCount
,
lookupRecord
,
lookup_context
));
return
TRACE_RETURN
(
context_would_apply_lookup
(
c
,
inputCount
,
input
,
lookupCount
,
lookupRecord
,
lookup_context
));
}
}
inline
bool
apply
(
hb_apply_context_t
*
c
,
ContextApplyLookupContext
&
lookup_context
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
,
ContextApplyLookupContext
&
lookup_context
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
const
LookupRecord
*
lookupRecord
=
&
StructAtOffset
<
LookupRecord
>
(
input
,
input
[
0
].
static_size
*
(
inputCount
?
inputCount
-
1
:
0
));
const
LookupRecord
*
lookupRecord
=
&
StructAtOffset
<
LookupRecord
>
(
input
,
input
[
0
].
static_size
*
(
inputCount
?
inputCount
-
1
:
0
));
return
TRACE_RETURN
(
context_apply_lookup
(
c
,
inputCount
,
input
,
lookupCount
,
lookupRecord
,
lookup_context
));
return
TRACE_RETURN
(
context_apply_lookup
(
c
,
inputCount
,
input
,
lookupCount
,
lookupRecord
,
lookup_context
));
}
}
public:
public:
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
inputCount
.
sanitize
(
c
)
return
inputCount
.
sanitize
(
c
)
&&
lookupCount
.
sanitize
(
c
)
&&
lookupCount
.
sanitize
(
c
)
&&
c
->
check_range
(
input
,
&&
c
->
check_range
(
input
,
...
@@ -926,7 +926,7 @@ struct RuleSet
...
@@ -926,7 +926,7 @@ struct RuleSet
{
{
inline
void
closure
(
hb_closure_context_t
*
c
,
ContextClosureLookupContext
&
lookup_context
)
const
inline
void
closure
(
hb_closure_context_t
*
c
,
ContextClosureLookupContext
&
lookup_context
)
const
{
{
TRACE_CLOSURE
();
TRACE_CLOSURE
(
this
);
unsigned
int
num_rules
=
rule
.
len
;
unsigned
int
num_rules
=
rule
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
num_rules
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
num_rules
;
i
++
)
(
this
+
rule
[
i
]).
closure
(
c
,
lookup_context
);
(
this
+
rule
[
i
]).
closure
(
c
,
lookup_context
);
...
@@ -934,7 +934,7 @@ struct RuleSet
...
@@ -934,7 +934,7 @@ struct RuleSet
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
,
ContextApplyLookupContext
&
lookup_context
)
const
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
,
ContextApplyLookupContext
&
lookup_context
)
const
{
{
TRACE_WOULD_APPLY
();
TRACE_WOULD_APPLY
(
this
);
unsigned
int
num_rules
=
rule
.
len
;
unsigned
int
num_rules
=
rule
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
num_rules
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
num_rules
;
i
++
)
{
{
...
@@ -946,7 +946,7 @@ struct RuleSet
...
@@ -946,7 +946,7 @@ struct RuleSet
inline
bool
apply
(
hb_apply_context_t
*
c
,
ContextApplyLookupContext
&
lookup_context
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
,
ContextApplyLookupContext
&
lookup_context
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
unsigned
int
num_rules
=
rule
.
len
;
unsigned
int
num_rules
=
rule
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
num_rules
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
num_rules
;
i
++
)
{
{
...
@@ -957,7 +957,7 @@ struct RuleSet
...
@@ -957,7 +957,7 @@ struct RuleSet
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
rule
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
rule
.
sanitize
(
c
,
this
));
}
}
...
@@ -974,7 +974,7 @@ struct ContextFormat1
...
@@ -974,7 +974,7 @@ struct ContextFormat1
{
{
inline
void
closure
(
hb_closure_context_t
*
c
)
const
inline
void
closure
(
hb_closure_context_t
*
c
)
const
{
{
TRACE_CLOSURE
();
TRACE_CLOSURE
(
this
);
const
Coverage
&
cov
=
(
this
+
coverage
);
const
Coverage
&
cov
=
(
this
+
coverage
);
...
@@ -993,7 +993,7 @@ struct ContextFormat1
...
@@ -993,7 +993,7 @@ struct ContextFormat1
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
{
TRACE_WOULD_APPLY
();
TRACE_WOULD_APPLY
(
this
);
const
RuleSet
&
rule_set
=
this
+
ruleSet
[(
this
+
coverage
)
(
c
->
glyphs
[
0
])];
const
RuleSet
&
rule_set
=
this
+
ruleSet
[(
this
+
coverage
)
(
c
->
glyphs
[
0
])];
struct
ContextApplyLookupContext
lookup_context
=
{
struct
ContextApplyLookupContext
lookup_context
=
{
...
@@ -1010,7 +1010,7 @@ struct ContextFormat1
...
@@ -1010,7 +1010,7 @@ struct ContextFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
().
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
().
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
(
false
);
...
@@ -1024,7 +1024,7 @@ struct ContextFormat1
...
@@ -1024,7 +1024,7 @@ struct ContextFormat1
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
ruleSet
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
ruleSet
.
sanitize
(
c
,
this
));
}
}
...
@@ -1045,7 +1045,7 @@ struct ContextFormat2
...
@@ -1045,7 +1045,7 @@ struct ContextFormat2
{
{
inline
void
closure
(
hb_closure_context_t
*
c
)
const
inline
void
closure
(
hb_closure_context_t
*
c
)
const
{
{
TRACE_CLOSURE
();
TRACE_CLOSURE
(
this
);
if
(
!
(
this
+
coverage
).
intersects
(
c
->
glyphs
))
if
(
!
(
this
+
coverage
).
intersects
(
c
->
glyphs
))
return
;
return
;
...
@@ -1066,7 +1066,7 @@ struct ContextFormat2
...
@@ -1066,7 +1066,7 @@ struct ContextFormat2
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
{
TRACE_WOULD_APPLY
();
TRACE_WOULD_APPLY
(
this
);
const
ClassDef
&
class_def
=
this
+
classDef
;
const
ClassDef
&
class_def
=
this
+
classDef
;
unsigned
int
index
=
class_def
(
c
->
glyphs
[
0
]);
unsigned
int
index
=
class_def
(
c
->
glyphs
[
0
]);
...
@@ -1085,7 +1085,7 @@ struct ContextFormat2
...
@@ -1085,7 +1085,7 @@ struct ContextFormat2
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
().
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
().
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
...
@@ -1100,7 +1100,7 @@ struct ContextFormat2
...
@@ -1100,7 +1100,7 @@ struct ContextFormat2
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
classDef
.
sanitize
(
c
,
this
)
&&
ruleSet
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
classDef
.
sanitize
(
c
,
this
)
&&
ruleSet
.
sanitize
(
c
,
this
));
}
}
...
@@ -1124,7 +1124,7 @@ struct ContextFormat3
...
@@ -1124,7 +1124,7 @@ struct ContextFormat3
{
{
inline
void
closure
(
hb_closure_context_t
*
c
)
const
inline
void
closure
(
hb_closure_context_t
*
c
)
const
{
{
TRACE_CLOSURE
();
TRACE_CLOSURE
(
this
);
if
(
!
(
this
+
coverage
[
0
]).
intersects
(
c
->
glyphs
))
if
(
!
(
this
+
coverage
[
0
]).
intersects
(
c
->
glyphs
))
return
;
return
;
...
@@ -1141,7 +1141,7 @@ struct ContextFormat3
...
@@ -1141,7 +1141,7 @@ struct ContextFormat3
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
{
TRACE_WOULD_APPLY
();
TRACE_WOULD_APPLY
(
this
);
const
LookupRecord
*
lookupRecord
=
&
StructAtOffset
<
LookupRecord
>
(
coverage
,
coverage
[
0
].
static_size
*
glyphCount
);
const
LookupRecord
*
lookupRecord
=
&
StructAtOffset
<
LookupRecord
>
(
coverage
,
coverage
[
0
].
static_size
*
glyphCount
);
struct
ContextApplyLookupContext
lookup_context
=
{
struct
ContextApplyLookupContext
lookup_context
=
{
...
@@ -1158,7 +1158,7 @@ struct ContextFormat3
...
@@ -1158,7 +1158,7 @@ struct ContextFormat3
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
unsigned
int
index
=
(
this
+
coverage
[
0
])
(
c
->
buffer
->
cur
().
codepoint
);
unsigned
int
index
=
(
this
+
coverage
[
0
])
(
c
->
buffer
->
cur
().
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
...
@@ -1171,7 +1171,7 @@ struct ContextFormat3
...
@@ -1171,7 +1171,7 @@ struct ContextFormat3
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
c
->
check_struct
(
this
))
return
TRACE_RETURN
(
false
);
if
(
!
c
->
check_struct
(
this
))
return
TRACE_RETURN
(
false
);
unsigned
int
count
=
glyphCount
;
unsigned
int
count
=
glyphCount
;
if
(
!
c
->
check_array
(
coverage
,
coverage
[
0
].
static_size
,
count
))
return
TRACE_RETURN
(
false
);
if
(
!
c
->
check_array
(
coverage
,
coverage
[
0
].
static_size
,
count
))
return
TRACE_RETURN
(
false
);
...
@@ -1209,7 +1209,7 @@ struct Context
...
@@ -1209,7 +1209,7 @@ struct Context
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
...
@@ -1316,7 +1316,7 @@ struct ChainRule
...
@@ -1316,7 +1316,7 @@ struct ChainRule
{
{
inline
void
closure
(
hb_closure_context_t
*
c
,
ChainContextClosureLookupContext
&
lookup_context
)
const
inline
void
closure
(
hb_closure_context_t
*
c
,
ChainContextClosureLookupContext
&
lookup_context
)
const
{
{
TRACE_CLOSURE
();
TRACE_CLOSURE
(
this
);
const
HeadlessArrayOf
<
USHORT
>
&
input
=
StructAfter
<
HeadlessArrayOf
<
USHORT
>
>
(
backtrack
);
const
HeadlessArrayOf
<
USHORT
>
&
input
=
StructAfter
<
HeadlessArrayOf
<
USHORT
>
>
(
backtrack
);
const
ArrayOf
<
USHORT
>
&
lookahead
=
StructAfter
<
ArrayOf
<
USHORT
>
>
(
input
);
const
ArrayOf
<
USHORT
>
&
lookahead
=
StructAfter
<
ArrayOf
<
USHORT
>
>
(
input
);
const
ArrayOf
<
LookupRecord
>
&
lookup
=
StructAfter
<
ArrayOf
<
LookupRecord
>
>
(
lookahead
);
const
ArrayOf
<
LookupRecord
>
&
lookup
=
StructAfter
<
ArrayOf
<
LookupRecord
>
>
(
lookahead
);
...
@@ -1330,7 +1330,7 @@ struct ChainRule
...
@@ -1330,7 +1330,7 @@ struct ChainRule
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
,
ChainContextApplyLookupContext
&
lookup_context
)
const
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
,
ChainContextApplyLookupContext
&
lookup_context
)
const
{
{
TRACE_WOULD_APPLY
();
TRACE_WOULD_APPLY
(
this
);
const
HeadlessArrayOf
<
USHORT
>
&
input
=
StructAfter
<
HeadlessArrayOf
<
USHORT
>
>
(
backtrack
);
const
HeadlessArrayOf
<
USHORT
>
&
input
=
StructAfter
<
HeadlessArrayOf
<
USHORT
>
>
(
backtrack
);
const
ArrayOf
<
USHORT
>
&
lookahead
=
StructAfter
<
ArrayOf
<
USHORT
>
>
(
input
);
const
ArrayOf
<
USHORT
>
&
lookahead
=
StructAfter
<
ArrayOf
<
USHORT
>
>
(
input
);
const
ArrayOf
<
LookupRecord
>
&
lookup
=
StructAfter
<
ArrayOf
<
LookupRecord
>
>
(
lookahead
);
const
ArrayOf
<
LookupRecord
>
&
lookup
=
StructAfter
<
ArrayOf
<
LookupRecord
>
>
(
lookahead
);
...
@@ -1343,7 +1343,7 @@ struct ChainRule
...
@@ -1343,7 +1343,7 @@ struct ChainRule
inline
bool
apply
(
hb_apply_context_t
*
c
,
ChainContextApplyLookupContext
&
lookup_context
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
,
ChainContextApplyLookupContext
&
lookup_context
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
const
HeadlessArrayOf
<
USHORT
>
&
input
=
StructAfter
<
HeadlessArrayOf
<
USHORT
>
>
(
backtrack
);
const
HeadlessArrayOf
<
USHORT
>
&
input
=
StructAfter
<
HeadlessArrayOf
<
USHORT
>
>
(
backtrack
);
const
ArrayOf
<
USHORT
>
&
lookahead
=
StructAfter
<
ArrayOf
<
USHORT
>
>
(
input
);
const
ArrayOf
<
USHORT
>
&
lookahead
=
StructAfter
<
ArrayOf
<
USHORT
>
>
(
input
);
const
ArrayOf
<
LookupRecord
>
&
lookup
=
StructAfter
<
ArrayOf
<
LookupRecord
>
>
(
lookahead
);
const
ArrayOf
<
LookupRecord
>
&
lookup
=
StructAfter
<
ArrayOf
<
LookupRecord
>
>
(
lookahead
);
...
@@ -1355,7 +1355,7 @@ struct ChainRule
...
@@ -1355,7 +1355,7 @@ struct ChainRule
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
backtrack
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
backtrack
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
HeadlessArrayOf
<
USHORT
>
&
input
=
StructAfter
<
HeadlessArrayOf
<
USHORT
>
>
(
backtrack
);
HeadlessArrayOf
<
USHORT
>
&
input
=
StructAfter
<
HeadlessArrayOf
<
USHORT
>
>
(
backtrack
);
if
(
!
input
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
input
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
...
@@ -1387,7 +1387,7 @@ struct ChainRuleSet
...
@@ -1387,7 +1387,7 @@ struct ChainRuleSet
{
{
inline
void
closure
(
hb_closure_context_t
*
c
,
ChainContextClosureLookupContext
&
lookup_context
)
const
inline
void
closure
(
hb_closure_context_t
*
c
,
ChainContextClosureLookupContext
&
lookup_context
)
const
{
{
TRACE_CLOSURE
();
TRACE_CLOSURE
(
this
);
unsigned
int
num_rules
=
rule
.
len
;
unsigned
int
num_rules
=
rule
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
num_rules
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
num_rules
;
i
++
)
(
this
+
rule
[
i
]).
closure
(
c
,
lookup_context
);
(
this
+
rule
[
i
]).
closure
(
c
,
lookup_context
);
...
@@ -1395,7 +1395,7 @@ struct ChainRuleSet
...
@@ -1395,7 +1395,7 @@ struct ChainRuleSet
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
,
ChainContextApplyLookupContext
&
lookup_context
)
const
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
,
ChainContextApplyLookupContext
&
lookup_context
)
const
{
{
TRACE_WOULD_APPLY
();
TRACE_WOULD_APPLY
(
this
);
unsigned
int
num_rules
=
rule
.
len
;
unsigned
int
num_rules
=
rule
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
num_rules
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
num_rules
;
i
++
)
if
((
this
+
rule
[
i
]).
would_apply
(
c
,
lookup_context
))
if
((
this
+
rule
[
i
]).
would_apply
(
c
,
lookup_context
))
...
@@ -1406,7 +1406,7 @@ struct ChainRuleSet
...
@@ -1406,7 +1406,7 @@ struct ChainRuleSet
inline
bool
apply
(
hb_apply_context_t
*
c
,
ChainContextApplyLookupContext
&
lookup_context
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
,
ChainContextApplyLookupContext
&
lookup_context
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
unsigned
int
num_rules
=
rule
.
len
;
unsigned
int
num_rules
=
rule
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
num_rules
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
num_rules
;
i
++
)
if
((
this
+
rule
[
i
]).
apply
(
c
,
lookup_context
))
if
((
this
+
rule
[
i
]).
apply
(
c
,
lookup_context
))
...
@@ -1416,7 +1416,7 @@ struct ChainRuleSet
...
@@ -1416,7 +1416,7 @@ struct ChainRuleSet
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
rule
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
rule
.
sanitize
(
c
,
this
));
}
}
...
@@ -1432,7 +1432,7 @@ struct ChainContextFormat1
...
@@ -1432,7 +1432,7 @@ struct ChainContextFormat1
{
{
inline
void
closure
(
hb_closure_context_t
*
c
)
const
inline
void
closure
(
hb_closure_context_t
*
c
)
const
{
{
TRACE_CLOSURE
();
TRACE_CLOSURE
(
this
);
const
Coverage
&
cov
=
(
this
+
coverage
);
const
Coverage
&
cov
=
(
this
+
coverage
);
struct
ChainContextClosureLookupContext
lookup_context
=
{
struct
ChainContextClosureLookupContext
lookup_context
=
{
...
@@ -1450,7 +1450,7 @@ struct ChainContextFormat1
...
@@ -1450,7 +1450,7 @@ struct ChainContextFormat1
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
{
TRACE_WOULD_APPLY
();
TRACE_WOULD_APPLY
(
this
);
const
ChainRuleSet
&
rule_set
=
this
+
ruleSet
[(
this
+
coverage
)
(
c
->
glyphs
[
0
])];
const
ChainRuleSet
&
rule_set
=
this
+
ruleSet
[(
this
+
coverage
)
(
c
->
glyphs
[
0
])];
struct
ChainContextApplyLookupContext
lookup_context
=
{
struct
ChainContextApplyLookupContext
lookup_context
=
{
...
@@ -1467,7 +1467,7 @@ struct ChainContextFormat1
...
@@ -1467,7 +1467,7 @@ struct ChainContextFormat1
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
().
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
().
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
...
@@ -1480,7 +1480,7 @@ struct ChainContextFormat1
...
@@ -1480,7 +1480,7 @@ struct ChainContextFormat1
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
ruleSet
.
sanitize
(
c
,
this
));
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
ruleSet
.
sanitize
(
c
,
this
));
}
}
...
@@ -1500,7 +1500,7 @@ struct ChainContextFormat2
...
@@ -1500,7 +1500,7 @@ struct ChainContextFormat2
{
{
inline
void
closure
(
hb_closure_context_t
*
c
)
const
inline
void
closure
(
hb_closure_context_t
*
c
)
const
{
{
TRACE_CLOSURE
();
TRACE_CLOSURE
(
this
);
if
(
!
(
this
+
coverage
).
intersects
(
c
->
glyphs
))
if
(
!
(
this
+
coverage
).
intersects
(
c
->
glyphs
))
return
;
return
;
...
@@ -1525,7 +1525,7 @@ struct ChainContextFormat2
...
@@ -1525,7 +1525,7 @@ struct ChainContextFormat2
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
{
TRACE_WOULD_APPLY
();
TRACE_WOULD_APPLY
(
this
);
const
ClassDef
&
input_class_def
=
this
+
inputClassDef
;
const
ClassDef
&
input_class_def
=
this
+
inputClassDef
;
...
@@ -1545,7 +1545,7 @@ struct ChainContextFormat2
...
@@ -1545,7 +1545,7 @@ struct ChainContextFormat2
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
().
codepoint
);
unsigned
int
index
=
(
this
+
coverage
)
(
c
->
buffer
->
cur
().
codepoint
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
if
(
likely
(
index
==
NOT_COVERED
))
return
TRACE_RETURN
(
false
);
...
@@ -1565,7 +1565,7 @@ struct ChainContextFormat2
...
@@ -1565,7 +1565,7 @@ struct ChainContextFormat2
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
backtrackClassDef
.
sanitize
(
c
,
this
)
&&
return
TRACE_RETURN
(
coverage
.
sanitize
(
c
,
this
)
&&
backtrackClassDef
.
sanitize
(
c
,
this
)
&&
inputClassDef
.
sanitize
(
c
,
this
)
&&
lookaheadClassDef
.
sanitize
(
c
,
this
)
&&
inputClassDef
.
sanitize
(
c
,
this
)
&&
lookaheadClassDef
.
sanitize
(
c
,
this
)
&&
ruleSet
.
sanitize
(
c
,
this
));
ruleSet
.
sanitize
(
c
,
this
));
...
@@ -1599,7 +1599,7 @@ struct ChainContextFormat3
...
@@ -1599,7 +1599,7 @@ struct ChainContextFormat3
{
{
inline
void
closure
(
hb_closure_context_t
*
c
)
const
inline
void
closure
(
hb_closure_context_t
*
c
)
const
{
{
TRACE_CLOSURE
();
TRACE_CLOSURE
(
this
);
const
OffsetArrayOf
<
Coverage
>
&
input
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
backtrack
);
const
OffsetArrayOf
<
Coverage
>
&
input
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
backtrack
);
if
(
!
(
this
+
input
[
0
]).
intersects
(
c
->
glyphs
))
if
(
!
(
this
+
input
[
0
]).
intersects
(
c
->
glyphs
))
...
@@ -1621,7 +1621,7 @@ struct ChainContextFormat3
...
@@ -1621,7 +1621,7 @@ struct ChainContextFormat3
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
{
TRACE_WOULD_APPLY
();
TRACE_WOULD_APPLY
(
this
);
const
OffsetArrayOf
<
Coverage
>
&
input
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
backtrack
);
const
OffsetArrayOf
<
Coverage
>
&
input
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
backtrack
);
const
OffsetArrayOf
<
Coverage
>
&
lookahead
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
input
);
const
OffsetArrayOf
<
Coverage
>
&
lookahead
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
input
);
...
@@ -1645,7 +1645,7 @@ struct ChainContextFormat3
...
@@ -1645,7 +1645,7 @@ struct ChainContextFormat3
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
();
TRACE_APPLY
(
this
);
const
OffsetArrayOf
<
Coverage
>
&
input
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
backtrack
);
const
OffsetArrayOf
<
Coverage
>
&
input
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
backtrack
);
unsigned
int
index
=
(
this
+
input
[
0
])
(
c
->
buffer
->
cur
().
codepoint
);
unsigned
int
index
=
(
this
+
input
[
0
])
(
c
->
buffer
->
cur
().
codepoint
);
...
@@ -1665,7 +1665,7 @@ struct ChainContextFormat3
...
@@ -1665,7 +1665,7 @@ struct ChainContextFormat3
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
backtrack
.
sanitize
(
c
,
this
))
return
TRACE_RETURN
(
false
);
if
(
!
backtrack
.
sanitize
(
c
,
this
))
return
TRACE_RETURN
(
false
);
OffsetArrayOf
<
Coverage
>
&
input
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
backtrack
);
OffsetArrayOf
<
Coverage
>
&
input
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
backtrack
);
if
(
!
input
.
sanitize
(
c
,
this
))
return
TRACE_RETURN
(
false
);
if
(
!
input
.
sanitize
(
c
,
this
))
return
TRACE_RETURN
(
false
);
...
@@ -1710,7 +1710,7 @@ struct ChainContext
...
@@ -1710,7 +1710,7 @@ struct ChainContext
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
...
@@ -1736,7 +1736,7 @@ struct ExtensionFormat1
...
@@ -1736,7 +1736,7 @@ struct ExtensionFormat1
inline
unsigned
int
get_offset
(
void
)
const
{
return
extensionOffset
;
}
inline
unsigned
int
get_offset
(
void
)
const
{
return
extensionOffset
;
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
return
TRACE_RETURN
(
c
->
check_struct
(
this
));
}
}
...
@@ -1769,7 +1769,7 @@ struct Extension
...
@@ -1769,7 +1769,7 @@ struct Extension
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
if
(
!
u
.
format
.
sanitize
(
c
))
return
TRACE_RETURN
(
false
);
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
case
1
:
return
TRACE_RETURN
(
u
.
format1
.
sanitize
(
c
));
...
@@ -1826,7 +1826,7 @@ struct GSUBGPOS
...
@@ -1826,7 +1826,7 @@ struct GSUBGPOS
{
return
(
this
+
lookupList
)[
i
];
}
{
return
(
this
+
lookupList
)[
i
];
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
version
.
sanitize
(
c
)
&&
likely
(
version
.
major
==
1
)
&&
return
TRACE_RETURN
(
version
.
sanitize
(
c
)
&&
likely
(
version
.
major
==
1
)
&&
scriptList
.
sanitize
(
c
,
this
)
&&
scriptList
.
sanitize
(
c
,
this
)
&&
featureList
.
sanitize
(
c
,
this
)
&&
featureList
.
sanitize
(
c
,
this
)
&&
...
...
src/hb-ot-maxp-table.hh
浏览文件 @
be218c68
...
@@ -48,7 +48,7 @@ struct maxp
...
@@ -48,7 +48,7 @@ struct maxp
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
likely
(
version
.
major
==
1
||
(
version
.
major
==
0
&&
version
.
minor
==
0x5000
)));
likely
(
version
.
major
==
1
||
(
version
.
major
==
0
&&
version
.
minor
==
0x5000
)));
}
}
...
...
src/hb-ot-name-table.hh
浏览文件 @
be218c68
...
@@ -57,7 +57,7 @@ struct NameRecord
...
@@ -57,7 +57,7 @@ struct NameRecord
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
void
*
base
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
void
*
base
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
/* We can check from base all the way up to the end of string... */
/* 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_RETURN
(
c
->
check_struct
(
this
)
&&
c
->
check_range
((
char
*
)
base
,
(
unsigned
int
)
length
+
offset
));
}
}
...
@@ -99,7 +99,7 @@ struct name
...
@@ -99,7 +99,7 @@ struct name
}
}
inline
bool
sanitize_records
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize_records
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
char
*
string_pool
=
(
char
*
)
this
+
stringOffset
;
char
*
string_pool
=
(
char
*
)
this
+
stringOffset
;
unsigned
int
_count
=
count
;
unsigned
int
_count
=
count
;
for
(
unsigned
int
i
=
0
;
i
<
_count
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
_count
;
i
++
)
...
@@ -108,7 +108,7 @@ struct name
...
@@ -108,7 +108,7 @@ struct name
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
return
TRACE_RETURN
(
c
->
check_struct
(
this
)
&&
likely
(
format
==
0
||
format
==
1
)
&&
likely
(
format
==
0
||
format
==
1
)
&&
c
->
check_array
(
nameRecord
,
nameRecord
[
0
].
static_size
,
count
)
&&
c
->
check_array
(
nameRecord
,
nameRecord
[
0
].
static_size
,
count
)
&&
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录