Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
40cbefe8
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
40cbefe8
编写于
5月 10, 2010
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unnecessary casts
上级
09766b1e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
43 addition
and
43 deletion
+43
-43
src/hb-open-type-private.hh
src/hb-open-type-private.hh
+6
-6
src/hb-ot-layout-common-private.hh
src/hb-ot-layout-common-private.hh
+1
-1
src/hb-ot-layout-gpos-private.hh
src/hb-ot-layout-gpos-private.hh
+17
-17
src/hb-ot-layout-gsub-private.hh
src/hb-ot-layout-gsub-private.hh
+2
-2
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+17
-17
未找到文件。
src/hb-open-type-private.hh
浏览文件 @
40cbefe8
...
...
@@ -224,7 +224,7 @@ struct hb_sanitize_context_t
fprintf
(
stderr
,
"SANITIZE(%p) %-*d-> range [%p..%p] (%d bytes) in [%p..%p] -> %s
\n
"
,
\
base
,
this
->
debug_depth
,
this
->
debug_depth
,
base
,
CharP
(
base
)
+
len
,
len
,
base
,
CharP
(
base
)
+
len
,
len
,
this
->
start
,
this
->
end
,
ret
?
"pass"
:
"FAIL"
);
...
...
@@ -252,7 +252,7 @@ struct hb_sanitize_context_t
return
likely
(
this
->
check_range
(
obj
,
sizeof
(
*
obj
)));
}
inline
bool
can_edit
(
const
char
*
base
HB_UNUSED
,
unsigned
int
len
HB_UNUSED
)
inline
bool
can_edit
(
const
void
*
base
HB_UNUSED
,
unsigned
int
len
HB_UNUSED
)
{
this
->
edit_count
++
;
...
...
@@ -261,7 +261,7 @@ struct hb_sanitize_context_t
base
,
this
->
debug_depth
,
this
->
debug_depth
,
this
->
edit_count
,
base
,
base
+
len
,
len
,
base
,
CharP
(
base
)
+
len
,
len
,
this
->
start
,
this
->
end
,
this
->
writable
?
"granted"
:
"REJECTED"
);
...
...
@@ -496,7 +496,7 @@ struct GenericOffsetTo : OffsetType
private:
/* Set the offset to Null */
inline
bool
neuter
(
hb_sanitize_context_t
*
context
)
{
if
(
context
->
can_edit
(
CharP
(
this
)
,
this
->
static_size
))
{
if
(
context
->
can_edit
(
this
,
this
->
static_size
))
{
this
->
set
(
0
);
/* 0 is Null offset */
return
true
;
}
...
...
@@ -627,12 +627,12 @@ struct OffsetListOf : OffsetArrayOf<Type>
inline
bool
sanitize
(
hb_sanitize_context_t
*
context
)
{
TRACE_SANITIZE
();
return
OffsetArrayOf
<
Type
>::
sanitize
(
context
,
CharP
(
this
)
);
return
OffsetArrayOf
<
Type
>::
sanitize
(
context
,
this
);
}
template
<
typename
T
>
inline
bool
sanitize
(
hb_sanitize_context_t
*
context
,
T
user_data
)
{
TRACE_SANITIZE
();
return
OffsetArrayOf
<
Type
>::
sanitize
(
context
,
CharP
(
this
)
,
user_data
);
return
OffsetArrayOf
<
Type
>::
sanitize
(
context
,
this
,
user_data
);
}
};
...
...
src/hb-ot-layout-common-private.hh
浏览文件 @
40cbefe8
...
...
@@ -112,7 +112,7 @@ struct RecordListOf : RecordArrayOf<Type>
inline
bool
sanitize
(
hb_sanitize_context_t
*
context
)
{
TRACE_SANITIZE
();
return
RecordArrayOf
<
Type
>::
sanitize
(
context
,
CharP
(
this
)
);
return
RecordArrayOf
<
Type
>::
sanitize
(
context
,
this
);
}
};
...
...
src/hb-ot-layout-gpos-private.hh
浏览文件 @
40cbefe8
...
...
@@ -92,7 +92,7 @@ struct ValueFormat : USHORT
{
return
get_len
()
*
Value
::
static_size
;
}
void
apply_value
(
hb_ot_layout_context_t
*
layout
,
const
char
*
base
,
const
void
*
base
,
const
Value
*
values
,
hb_internal_glyph_position_t
*
glyph_pos
)
const
{
...
...
@@ -436,7 +436,7 @@ struct SinglePosFormat1
if
(
likely
(
index
==
NOT_COVERED
))
return
false
;
valueFormat
.
apply_value
(
context
->
layout
,
CharP
(
this
)
,
values
,
CURPOSITION
());
valueFormat
.
apply_value
(
context
->
layout
,
this
,
values
,
CURPOSITION
());
context
->
buffer
->
in_pos
++
;
return
true
;
...
...
@@ -446,7 +446,7 @@ struct SinglePosFormat1
TRACE_SANITIZE
();
return
context
->
check_struct
(
this
)
&&
coverage
.
sanitize
(
context
,
this
)
&&
valueFormat
.
sanitize_value
(
context
,
CharP
(
this
)
,
values
);
&&
valueFormat
.
sanitize_value
(
context
,
this
,
values
);
}
private:
...
...
@@ -478,7 +478,7 @@ struct SinglePosFormat2
if
(
likely
(
index
>=
valueCount
))
return
false
;
valueFormat
.
apply_value
(
context
->
layout
,
CharP
(
this
)
,
valueFormat
.
apply_value
(
context
->
layout
,
this
,
&
values
[
index
*
valueFormat
.
get_len
()],
CURPOSITION
());
...
...
@@ -490,7 +490,7 @@ struct SinglePosFormat2
TRACE_SANITIZE
();
return
context
->
check_struct
(
this
)
&&
coverage
.
sanitize
(
context
,
this
)
&&
valueFormat
.
sanitize_values
(
context
,
CharP
(
this
)
,
values
,
valueCount
);
&&
valueFormat
.
sanitize_values
(
context
,
this
,
values
,
valueCount
);
}
private:
...
...
@@ -611,8 +611,8 @@ struct PairPosFormat1
{
if
(
IN_GLYPH
(
j
)
==
record
->
secondGlyph
)
{
valueFormat1
.
apply_value
(
context
->
layout
,
CharP
(
this
)
,
&
record
->
values
[
0
],
CURPOSITION
());
valueFormat2
.
apply_value
(
context
->
layout
,
CharP
(
this
)
,
&
record
->
values
[
len1
],
POSITION
(
j
));
valueFormat1
.
apply_value
(
context
->
layout
,
this
,
&
record
->
values
[
0
],
CURPOSITION
());
valueFormat2
.
apply_value
(
context
->
layout
,
this
,
&
record
->
values
[
len1
],
POSITION
(
j
));
if
(
len2
)
j
++
;
context
->
buffer
->
in_pos
=
j
;
...
...
@@ -632,7 +632,7 @@ struct PairPosFormat1
if
(
!
(
context
->
check_struct
(
this
)
&&
coverage
.
sanitize
(
context
,
this
)
&&
likely
(
pairSet
.
sanitize
(
context
,
CharP
(
this
)
,
len1
+
len2
))))
return
false
;
&&
likely
(
pairSet
.
sanitize
(
context
,
this
,
len1
+
len2
))))
return
false
;
if
(
!
(
valueFormat1
.
has_device
()
||
valueFormat2
.
has_device
()))
return
true
;
...
...
@@ -644,8 +644,8 @@ struct PairPosFormat1
unsigned
int
count2
=
pair_set
.
len
;
PairValueRecord
*
record
=
pair_set
.
array
;
if
(
!
(
valueFormat1
.
sanitize_values_stride_unsafe
(
context
,
CharP
(
this
)
,
&
record
->
values
[
0
],
count2
,
stride
)
&&
valueFormat2
.
sanitize_values_stride_unsafe
(
context
,
CharP
(
this
)
,
&
record
->
values
[
len1
],
count2
,
stride
)))
if
(
!
(
valueFormat1
.
sanitize_values_stride_unsafe
(
context
,
this
,
&
record
->
values
[
0
],
count2
,
stride
)
&&
valueFormat2
.
sanitize_values_stride_unsafe
(
context
,
this
,
&
record
->
values
[
len1
],
count2
,
stride
)))
return
false
;
}
...
...
@@ -704,8 +704,8 @@ struct PairPosFormat2
return
false
;
const
Value
*
v
=
&
values
[
record_len
*
(
klass1
*
class2Count
+
klass2
)];
valueFormat1
.
apply_value
(
context
->
layout
,
CharP
(
this
)
,
v
,
CURPOSITION
());
valueFormat2
.
apply_value
(
context
->
layout
,
CharP
(
this
)
,
v
+
len1
,
POSITION
(
j
));
valueFormat1
.
apply_value
(
context
->
layout
,
this
,
v
,
CURPOSITION
());
valueFormat2
.
apply_value
(
context
->
layout
,
this
,
v
+
len1
,
POSITION
(
j
));
if
(
len2
)
j
++
;
...
...
@@ -727,8 +727,8 @@ struct PairPosFormat2
unsigned
int
record_size
=
valueFormat1
.
get_size
()
+
valueFormat2
.
get_size
();
unsigned
int
count
=
(
unsigned
int
)
class1Count
*
(
unsigned
int
)
class2Count
;
return
context
->
check_array
(
values
,
record_size
,
count
)
&&
valueFormat1
.
sanitize_values_stride_unsafe
(
context
,
CharP
(
this
)
,
&
values
[
0
],
count
,
stride
)
&&
valueFormat2
.
sanitize_values_stride_unsafe
(
context
,
CharP
(
this
)
,
&
values
[
len1
],
count
,
stride
);
valueFormat1
.
sanitize_values_stride_unsafe
(
context
,
this
,
&
values
[
0
],
count
,
stride
)
&&
valueFormat2
.
sanitize_values_stride_unsafe
(
context
,
this
,
&
values
[
len1
],
count
,
stride
);
}
private:
...
...
@@ -1091,7 +1091,7 @@ struct MarkBasePosFormat1
&&
markCoverage
.
sanitize
(
context
,
this
)
&&
baseCoverage
.
sanitize
(
context
,
this
)
&&
markArray
.
sanitize
(
context
,
this
)
&&
likely
(
baseArray
.
sanitize
(
context
,
CharP
(
this
)
,
(
unsigned
int
)
classCount
));
&&
likely
(
baseArray
.
sanitize
(
context
,
this
,
(
unsigned
int
)
classCount
));
}
private:
...
...
@@ -1214,7 +1214,7 @@ struct MarkLigPosFormat1
&&
markCoverage
.
sanitize
(
context
,
this
)
&&
ligatureCoverage
.
sanitize
(
context
,
this
)
&&
markArray
.
sanitize
(
context
,
this
)
&&
likely
(
ligatureArray
.
sanitize
(
context
,
CharP
(
this
)
,
(
unsigned
int
)
classCount
));
&&
likely
(
ligatureArray
.
sanitize
(
context
,
this
,
(
unsigned
int
)
classCount
));
}
private:
...
...
@@ -1318,7 +1318,7 @@ struct MarkMarkPosFormat1
&&
mark1Coverage
.
sanitize
(
context
,
this
)
&&
mark2Coverage
.
sanitize
(
context
,
this
)
&&
mark1Array
.
sanitize
(
context
,
this
)
&&
likely
(
mark2Array
.
sanitize
(
context
,
CharP
(
this
)
,
(
unsigned
int
)
classCount
));
&&
likely
(
mark2Array
.
sanitize
(
context
,
this
,
(
unsigned
int
)
classCount
));
}
private:
...
...
src/hb-ot-layout-gsub-private.hh
浏览文件 @
40cbefe8
...
...
@@ -617,10 +617,10 @@ struct ReverseChainSingleSubstFormat1
if
(
match_backtrack
(
context
,
backtrack
.
len
,
(
USHORT
*
)
backtrack
.
array
(),
match_coverage
,
CharP
(
this
)
)
&&
match_coverage
,
this
)
&&
match_lookahead
(
context
,
lookahead
.
len
,
(
USHORT
*
)
lookahead
.
array
(),
match_coverage
,
CharP
(
this
)
,
match_coverage
,
this
,
1
))
{
IN_CURGLYPH
()
=
substitute
[
index
];
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
40cbefe8
...
...
@@ -58,7 +58,7 @@ struct hb_apply_context_t
#define BUFFER context->buffer
typedef
bool
(
*
match_func_t
)
(
hb_codepoint_t
glyph_id
,
const
USHORT
&
value
,
const
char
*
data
);
typedef
bool
(
*
match_func_t
)
(
hb_codepoint_t
glyph_id
,
const
USHORT
&
value
,
const
void
*
data
);
typedef
bool
(
*
apply_lookup_func_t
)
(
hb_apply_context_t
*
context
,
unsigned
int
lookup_index
);
struct
ContextFuncs
...
...
@@ -68,18 +68,18 @@ struct ContextFuncs
};
static
inline
bool
match_glyph
(
hb_codepoint_t
glyph_id
,
const
USHORT
&
value
,
const
char
*
data
HB_UNUSED
)
static
inline
bool
match_glyph
(
hb_codepoint_t
glyph_id
,
const
USHORT
&
value
,
const
void
*
data
HB_UNUSED
)
{
return
glyph_id
==
value
;
}
static
inline
bool
match_class
(
hb_codepoint_t
glyph_id
,
const
USHORT
&
value
,
const
char
*
data
)
static
inline
bool
match_class
(
hb_codepoint_t
glyph_id
,
const
USHORT
&
value
,
const
void
*
data
)
{
const
ClassDef
&
class_def
=
*
reinterpret_cast
<
const
ClassDef
*>
(
data
);
return
class_def
.
get_class
(
glyph_id
)
==
value
;
}
static
inline
bool
match_coverage
(
hb_codepoint_t
glyph_id
,
const
USHORT
&
value
,
const
char
*
data
)
static
inline
bool
match_coverage
(
hb_codepoint_t
glyph_id
,
const
USHORT
&
value
,
const
void
*
data
)
{
const
OffsetTo
<
Coverage
>
&
coverage
=
(
const
OffsetTo
<
Coverage
>&
)
value
;
return
(
data
+
coverage
)
(
glyph_id
)
!=
NOT_COVERED
;
...
...
@@ -90,7 +90,7 @@ static inline bool match_input (hb_apply_context_t *context,
unsigned
int
count
,
/* Including the first glyph (not matched) */
const
USHORT
input
[],
/* Array of input values--start with second glyph */
match_func_t
match_func
,
const
char
*
match_data
,
const
void
*
match_data
,
unsigned
int
*
context_length_out
)
{
unsigned
int
i
,
j
;
...
...
@@ -120,7 +120,7 @@ static inline bool match_backtrack (hb_apply_context_t *context,
unsigned
int
count
,
const
USHORT
backtrack
[],
match_func_t
match_func
,
const
char
*
match_data
)
const
void
*
match_data
)
{
if
(
unlikely
(
context
->
buffer
->
out_pos
<
count
))
return
false
;
...
...
@@ -145,7 +145,7 @@ static inline bool match_lookahead (hb_apply_context_t *context,
unsigned
int
count
,
const
USHORT
lookahead
[],
match_func_t
match_func
,
const
char
*
match_data
,
const
void
*
match_data
,
unsigned
int
offset
)
{
unsigned
int
i
,
j
;
...
...
@@ -247,7 +247,7 @@ static inline bool apply_lookup (hb_apply_context_t *context,
struct
ContextLookupContext
{
ContextFuncs
funcs
;
const
char
*
match_data
;
const
void
*
match_data
;
};
static
inline
bool
context_lookup
(
hb_apply_context_t
*
context
,
...
...
@@ -391,8 +391,8 @@ struct ContextFormat2
* them across subrule lookups. Not sure it's worth it.
*/
struct
ContextLookupContext
lookup_context
=
{
{
match_class
,
apply_func
},
CharP
(
&
class_def
)
{
match_class
,
apply_func
},
&
class_def
};
return
rule_set
.
apply
(
context
,
lookup_context
);
}
...
...
@@ -435,7 +435,7 @@ struct ContextFormat3
const
LookupRecord
*
lookupRecord
=
&
StructAtOffset
<
LookupRecord
>
(
coverage
,
coverage
[
0
].
static_size
*
glyphCount
);
struct
ContextLookupContext
lookup_context
=
{
{
match_coverage
,
apply_func
},
CharP
(
this
)
this
};
return
context_lookup
(
context
,
glyphCount
,
(
const
USHORT
*
)
(
coverage
+
1
),
...
...
@@ -508,7 +508,7 @@ struct Context
struct
ChainContextLookupContext
{
ContextFuncs
funcs
;
const
char
*
match_data
[
3
];
const
void
*
match_data
[
3
];
};
static
inline
bool
chain_context_lookup
(
hb_apply_context_t
*
context
,
...
...
@@ -684,10 +684,10 @@ struct ChainContextFormat2
* them across subrule lookups. Not sure it's worth it.
*/
struct
ChainContextLookupContext
lookup_context
=
{
{
match_class
,
apply_func
},
{
CharP
(
&
backtrack_class_def
)
,
CharP
(
&
input_class_def
)
,
CharP
(
&
lookahead_class_def
)
}
{
match_class
,
apply_func
},
{
&
backtrack_class_def
,
&
input_class_def
,
&
lookahead_class_def
}
};
return
rule_set
.
apply
(
context
,
lookup_context
);
}
...
...
@@ -744,7 +744,7 @@ struct ChainContextFormat3
const
ArrayOf
<
LookupRecord
>
&
lookup
=
StructAfter
<
ArrayOf
<
LookupRecord
>
>
(
lookahead
);
struct
ChainContextLookupContext
lookup_context
=
{
{
match_coverage
,
apply_func
},
{
CharP
(
this
),
CharP
(
this
),
CharP
(
this
)
}
{
this
,
this
,
this
}
};
return
chain_context_lookup
(
context
,
backtrack
.
len
,
(
const
USHORT
*
)
backtrack
.
array
(),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录