Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
09766b1e
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看板
提交
09766b1e
编写于
5月 10, 2010
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make StructAtOffset take a pointer
Is safer.
上级
bea34c7c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
18 deletion
+18
-18
src/hb-open-type-private.hh
src/hb-open-type-private.hh
+13
-13
src/hb-ot-layout-gpos-private.hh
src/hb-ot-layout-gpos-private.hh
+3
-3
src/hb-ot-layout-gsub-private.hh
src/hb-ot-layout-gsub-private.hh
+2
-2
未找到文件。
src/hb-open-type-private.hh
浏览文件 @
09766b1e
...
...
@@ -65,23 +65,23 @@ template<typename Type, typename TObject>
inline
Type
*
CastP
(
TObject
*
X
)
{
return
reinterpret_cast
<
Type
*>
(
X
);
}
/* StructAtOffset<T>(
X
,Ofs) returns the struct T& that is placed at memory
* location
of X
plus Ofs bytes. */
template
<
typename
Type
,
typename
TObject
>
inline
const
Type
&
StructAtOffset
(
const
TObject
&
X
,
unsigned
int
offset
)
{
return
*
reinterpret_cast
<
const
Type
*>
(
CharP
(
&
X
)
+
offset
);
}
template
<
typename
Type
,
typename
TObject
>
inline
Type
&
StructAtOffset
(
TObject
&
X
,
unsigned
int
offset
)
{
return
*
reinterpret_cast
<
Type
*>
(
CharP
(
&
X
)
+
offset
);
}
/* StructAtOffset<T>(
P
,Ofs) returns the struct T& that is placed at memory
* location
pointed to by P
plus Ofs bytes. */
template
<
typename
Type
>
inline
const
Type
&
StructAtOffset
(
const
void
*
P
,
unsigned
int
offset
)
{
return
*
reinterpret_cast
<
const
Type
*>
(
CharP
(
P
)
+
offset
);
}
template
<
typename
Type
>
inline
Type
&
StructAtOffset
(
void
*
P
,
unsigned
int
offset
)
{
return
*
reinterpret_cast
<
Type
*>
(
CharP
(
P
)
+
offset
);
}
/* StructAfter<T>(X) returns the struct T& that is placed after X.
* Works with X of variable size also. X must implement get_size() */
template
<
typename
Type
,
typename
TObject
>
inline
const
Type
&
StructAfter
(
const
TObject
&
X
)
{
return
StructAtOffset
<
Type
>
(
X
,
X
.
get_size
());
}
{
return
StructAtOffset
<
Type
>
(
&
X
,
X
.
get_size
());
}
template
<
typename
Type
,
typename
TObject
>
inline
Type
&
StructAfter
(
TObject
&
X
)
{
return
StructAtOffset
<
Type
>
(
X
,
X
.
get_size
());
}
{
return
StructAtOffset
<
Type
>
(
&
X
,
X
.
get_size
());
}
...
...
@@ -472,7 +472,7 @@ struct GenericOffsetTo : OffsetType
{
unsigned
int
offset
=
*
this
;
if
(
unlikely
(
!
offset
))
return
Null
(
Type
);
return
StructAtOffset
<
Type
>
(
*
CharP
(
base
)
,
offset
);
return
StructAtOffset
<
Type
>
(
base
,
offset
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
context
,
void
*
base
)
{
...
...
@@ -480,7 +480,7 @@ struct GenericOffsetTo : OffsetType
if
(
!
context
->
check_struct
(
this
))
return
false
;
unsigned
int
offset
=
*
this
;
if
(
unlikely
(
!
offset
))
return
true
;
Type
&
obj
=
StructAtOffset
<
Type
>
(
*
CharP
(
base
)
,
offset
);
Type
&
obj
=
StructAtOffset
<
Type
>
(
base
,
offset
);
return
likely
(
obj
.
sanitize
(
context
))
||
neuter
(
context
);
}
template
<
typename
T
>
...
...
@@ -489,7 +489,7 @@ struct GenericOffsetTo : OffsetType
if
(
!
context
->
check_struct
(
this
))
return
false
;
unsigned
int
offset
=
*
this
;
if
(
unlikely
(
!
offset
))
return
true
;
Type
&
obj
=
StructAtOffset
<
Type
>
(
*
CharP
(
base
)
,
offset
);
Type
&
obj
=
StructAtOffset
<
Type
>
(
base
,
offset
);
return
likely
(
obj
.
sanitize
(
context
,
user_data
))
||
neuter
(
context
);
}
...
...
src/hb-ot-layout-gpos-private.hh
浏览文件 @
09766b1e
...
...
@@ -618,7 +618,7 @@ struct PairPosFormat1
context
->
buffer
->
in_pos
=
j
;
return
true
;
}
record
=
&
StructAtOffset
<
PairValueRecord
>
(
*
record
,
record_size
);
record
=
&
StructAtOffset
<
PairValueRecord
>
(
record
,
record_size
);
}
return
false
;
...
...
@@ -1409,7 +1409,7 @@ struct ExtensionPos : Extension
{
unsigned
int
offset
=
get_offset
();
if
(
unlikely
(
!
offset
))
return
Null
(
PosLookupSubTable
);
return
StructAtOffset
<
PosLookupSubTable
>
(
*
this
,
offset
);
return
StructAtOffset
<
PosLookupSubTable
>
(
this
,
offset
);
}
inline
bool
apply
(
hb_apply_context_t
*
context
)
const
;
...
...
@@ -1608,7 +1608,7 @@ inline bool ExtensionPos::sanitize (hb_sanitize_context_t *context)
if
(
unlikely
(
!
Extension
::
sanitize
(
context
)))
return
false
;
unsigned
int
offset
=
get_offset
();
if
(
unlikely
(
!
offset
))
return
true
;
return
StructAtOffset
<
PosLookupSubTable
>
(
*
this
,
offset
).
sanitize
(
context
);
return
StructAtOffset
<
PosLookupSubTable
>
(
this
,
offset
).
sanitize
(
context
);
}
static
inline
bool
position_lookup
(
hb_apply_context_t
*
context
,
unsigned
int
lookup_index
)
...
...
src/hb-ot-layout-gsub-private.hh
浏览文件 @
09766b1e
...
...
@@ -586,7 +586,7 @@ struct ExtensionSubst : Extension
{
unsigned
int
offset
=
get_offset
();
if
(
unlikely
(
!
offset
))
return
Null
(
SubstLookupSubTable
);
return
StructAtOffset
<
SubstLookupSubTable
>
(
*
this
,
offset
);
return
StructAtOffset
<
SubstLookupSubTable
>
(
this
,
offset
);
}
inline
bool
apply
(
hb_apply_context_t
*
context
)
const
;
...
...
@@ -916,7 +916,7 @@ inline bool ExtensionSubst::sanitize (hb_sanitize_context_t *context)
if
(
unlikely
(
!
Extension
::
sanitize
(
context
)))
return
false
;
unsigned
int
offset
=
get_offset
();
if
(
unlikely
(
!
offset
))
return
true
;
return
StructAtOffset
<
SubstLookupSubTable
>
(
*
this
,
offset
).
sanitize
(
context
);
return
StructAtOffset
<
SubstLookupSubTable
>
(
this
,
offset
).
sanitize
(
context
);
}
inline
bool
ExtensionSubst
::
is_reverse
(
void
)
const
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录