Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
0dfcc13a
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看板
提交
0dfcc13a
编写于
4月 21, 2010
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename ConstCharP to CharP (overloaded now)
上级
62c0fd75
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
32 addition
and
32 deletion
+32
-32
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
+12
-12
src/hb-ot-layout-gpos-private.hh
src/hb-ot-layout-gpos-private.hh
+6
-6
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
+7
-7
未找到文件。
src/hb-open-file-private.hh
浏览文件 @
0dfcc13a
...
...
@@ -52,7 +52,7 @@ typedef struct TableDirectory
inline
bool
sanitize
(
SANITIZE_ARG_DEF
,
const
void
*
base
)
{
TRACE_SANITIZE
();
return
SANITIZE_SELF
()
&&
SANITIZE
(
tag
)
&&
SANITIZE_MEM
(
C
onstC
harP
(
base
)
+
(
unsigned
long
)
offset
,
length
);
SANITIZE_MEM
(
CharP
(
base
)
+
(
unsigned
long
)
offset
,
length
);
}
Tag
tag
;
/* 4-byte identifier. */
...
...
@@ -180,8 +180,8 @@ struct OpenTypeFontFile
{
switch
(
tag
)
{
default:
return
0
;
case
TrueTypeTag
:
case
CFFTag
:
return
OffsetTable
::
get_for_data
(
C
onstC
harP
(
this
)).
get_face_count
();
case
TTCTag
:
return
TTCHeader
::
get_for_data
(
C
onstC
harP
(
this
)).
get_face_count
();
case
TrueTypeTag
:
case
CFFTag
:
return
OffsetTable
::
get_for_data
(
CharP
(
this
)).
get_face_count
();
case
TTCTag
:
return
TTCHeader
::
get_for_data
(
CharP
(
this
)).
get_face_count
();
}
}
inline
const
OpenTypeFontFace
&
get_face
(
unsigned
int
i
)
const
...
...
@@ -191,8 +191,8 @@ struct OpenTypeFontFile
/* Note: for non-collection SFNT data we ignore index. This is because
* Apple dfont container is a container of SFNT's. So each SFNT is a
* non-TTC, but the index is more than zero. */
case
TrueTypeTag
:
case
CFFTag
:
return
OffsetTable
::
get_for_data
(
C
onstC
harP
(
this
));
case
TTCTag
:
return
TTCHeader
::
get_for_data
(
C
onstC
harP
(
this
)).
get_face
(
i
);
case
TrueTypeTag
:
case
CFFTag
:
return
OffsetTable
::
get_for_data
(
CharP
(
this
));
case
TTCTag
:
return
TTCHeader
::
get_for_data
(
CharP
(
this
)).
get_face
(
i
);
}
}
...
...
src/hb-open-type-private.hh
浏览文件 @
0dfcc13a
...
...
@@ -40,12 +40,12 @@
* Casts
*/
/* Cast to
const char *, to char *, or to char * dropping const-ness
*/
template
<
typename
Type
>
inline
const
char
*
C
onstCharP
(
const
Type
X
)
{
return
reinterpret_cast
<
const
char
*>
(
X
);
}
template
<
typename
Type
>
inline
char
*
CharP
(
Type
X
)
{
return
reinterpret_cast
<
char
*>
(
X
);
}
/* Cast to
"const char *" and "char *"
*/
template
<
typename
Type
>
inline
const
char
*
C
harP
(
const
Type
*
X
)
{
return
reinterpret_cast
<
const
char
*>
(
X
);
}
template
<
typename
Type
>
inline
char
*
CharP
(
Type
*
X
)
{
return
reinterpret_cast
<
char
*>
(
X
);
}
#define CONST_CAST(T,X,Ofs) (*(reinterpret_cast<const T *>(C
onstC
harP(&(X)) + Ofs)))
#define DECONST_CAST(T,X,Ofs) (*(reinterpret_cast<T *>((char *)C
onstC
harP(&(X)) + Ofs)))
#define CONST_CAST(T,X,Ofs) (*(reinterpret_cast<const T *>(CharP(&(X)) + Ofs)))
#define DECONST_CAST(T,X,Ofs) (*(reinterpret_cast<T *>((char *)CharP(&(X)) + Ofs)))
#define CAST(T,X,Ofs) (*(reinterpret_cast<T *>(CharP(&(X)) + Ofs)))
...
...
@@ -54,7 +54,7 @@ template <typename Type> inline char * CharP (Type X) { return reinterpret_cast<
template
<
typename
Type
,
typename
TObject
>
inline
const
Type
&
StructAfter
(
const
TObject
&
X
)
{
return
*
reinterpret_cast
<
const
Type
*>
(
C
onstC
harP
(
&
X
)
+
X
.
get_size
());
return
*
reinterpret_cast
<
const
Type
*>
(
CharP
(
&
X
)
+
X
.
get_size
());
}
template
<
typename
Type
,
typename
TObject
>
inline
Type
&
StructAfter
(
TObject
&
X
)
...
...
@@ -129,7 +129,7 @@ inline const Type& Null<Type> () { \
HB_STMT_START { \
if (sanitize_depth < HB_DEBUG_SANITIZE) \
fprintf (stderr, "SANITIZE(%p) %-*d-> %s\n", \
(C
onstCharP (this) == Const
CharP (&NullPool)) ? 0 : this, \
(C
harP (this) ==
CharP (&NullPool)) ? 0 : this, \
sanitize_depth, sanitize_depth, \
__PRETTY_FUNCTION__); \
} HB_STMT_END
...
...
@@ -258,9 +258,9 @@ _hb_sanitize_edit (SANITIZE_ARG_DEF,
#define SANITIZE_OBJ(X) SANITIZE_MEM(&(X), sizeof (X))
#define SANITIZE_GET_SIZE() SANITIZE_SELF() && SANITIZE_MEM (this, this->get_size ())
#define SANITIZE_MEM(B,L) HB_LIKELY (_hb_sanitize_check (SANITIZE_ARG, C
onstC
harP(B), (L)))
#define SANITIZE_MEM(B,L) HB_LIKELY (_hb_sanitize_check (SANITIZE_ARG, CharP(B), (L)))
#define SANITIZE_ARRAY(A,S,L) HB_LIKELY (_hb_sanitize_array (SANITIZE_ARG, C
onstC
harP(A), S, L))
#define SANITIZE_ARRAY(A,S,L) HB_LIKELY (_hb_sanitize_array (SANITIZE_ARG, CharP(A), S, L))
#define NEUTER(Var, Val) \
(SANITIZE_OBJ (Var) && \
...
...
@@ -285,7 +285,7 @@ struct Sanitizer
_hb_sanitize_init
(
&
context
,
blob
);
Type
*
t
=
&
CAST
(
Type
,
*
(
char
*
)
C
onstC
harP
(
context
.
start
),
0
);
Type
*
t
=
&
CAST
(
Type
,
*
(
char
*
)
CharP
(
context
.
start
),
0
);
sane
=
t
->
sanitize
(
SANITIZE_ARG_INIT
);
if
(
sane
)
{
...
...
@@ -403,7 +403,7 @@ ASSERT_SIZE (LONG, 4);
struct
Tag
:
ULONG
{
/* What the char* converters return is NOT nul-terminated. Print using "%.4s" */
inline
operator
const
char
*
(
void
)
const
{
return
C
onstC
harP
(
this
);
}
inline
operator
const
char
*
(
void
)
const
{
return
CharP
(
this
);
}
inline
operator
char
*
(
void
)
{
return
CharP
(
this
);
}
inline
bool
sanitize
(
SANITIZE_ARG_DEF
)
{
...
...
@@ -476,7 +476,7 @@ struct GenericOffsetTo : OffsetType
{
unsigned
int
offset
=
*
this
;
if
(
HB_UNLIKELY
(
!
offset
))
return
Null
(
Type
);
return
CONST_CAST
(
Type
,
*
C
onstC
harP
(
base
),
offset
);
return
CONST_CAST
(
Type
,
*
CharP
(
base
),
offset
);
}
inline
bool
sanitize
(
SANITIZE_ARG_DEF
,
void
*
base
)
{
...
...
src/hb-ot-layout-gpos-private.hh
浏览文件 @
0dfcc13a
...
...
@@ -413,7 +413,7 @@ struct SinglePosFormat1
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
valueFormat
.
apply_value
(
context
,
C
onstC
harP
(
this
),
values
,
CURPOSITION
());
valueFormat
.
apply_value
(
context
,
CharP
(
this
),
values
,
CURPOSITION
());
buffer
->
in_pos
++
;
return
true
;
...
...
@@ -453,7 +453,7 @@ struct SinglePosFormat2
if
(
HB_LIKELY
(
index
>=
valueCount
))
return
false
;
valueFormat
.
apply_value
(
context
,
C
onstC
harP
(
this
),
valueFormat
.
apply_value
(
context
,
CharP
(
this
),
&
values
[
index
*
valueFormat
.
get_len
()],
CURPOSITION
());
...
...
@@ -582,8 +582,8 @@ struct PairPosFormat1
{
if
(
IN_GLYPH
(
j
)
==
record
->
secondGlyph
)
{
valueFormat1
.
apply_value
(
context
,
C
onstC
harP
(
this
),
&
record
->
values
[
0
],
CURPOSITION
());
valueFormat2
.
apply_value
(
context
,
C
onstC
harP
(
this
),
&
record
->
values
[
len1
],
POSITION
(
j
));
valueFormat1
.
apply_value
(
context
,
CharP
(
this
),
&
record
->
values
[
0
],
CURPOSITION
());
valueFormat2
.
apply_value
(
context
,
CharP
(
this
),
&
record
->
values
[
len1
],
POSITION
(
j
));
if
(
len2
)
j
++
;
buffer
->
in_pos
=
j
;
...
...
@@ -673,8 +673,8 @@ struct PairPosFormat2
return
false
;
const
Value
*
v
=
&
values
[
record_len
*
(
klass1
*
class2Count
+
klass2
)];
valueFormat1
.
apply_value
(
context
,
C
onstC
harP
(
this
),
v
,
CURPOSITION
());
valueFormat2
.
apply_value
(
context
,
C
onstC
harP
(
this
),
v
+
len1
,
POSITION
(
j
));
valueFormat1
.
apply_value
(
context
,
CharP
(
this
),
v
,
CURPOSITION
());
valueFormat2
.
apply_value
(
context
,
CharP
(
this
),
v
+
len1
,
POSITION
(
j
));
if
(
len2
)
j
++
;
...
...
src/hb-ot-layout-gsub-private.hh
浏览文件 @
0dfcc13a
...
...
@@ -591,10 +591,10 @@ struct ReverseChainSingleSubstFormat1
if
(
match_backtrack
(
APPLY_ARG
,
backtrack
.
len
,
(
USHORT
*
)
backtrack
.
array
(),
match_coverage
,
C
onstC
harP
(
this
))
&&
match_coverage
,
CharP
(
this
))
&&
match_lookahead
(
APPLY_ARG
,
lookahead
.
len
,
(
USHORT
*
)
lookahead
.
array
(),
match_coverage
,
C
onstC
harP
(
this
),
match_coverage
,
CharP
(
this
),
1
))
{
IN_CURGLYPH
()
=
substitute
[
index
];
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
0dfcc13a
...
...
@@ -44,7 +44,7 @@
HB_STMT_START { \
if (apply_depth < HB_DEBUG_APPLY) \
fprintf (stderr, "APPLY(%p) %-*d-> %s\n", \
(C
onstCharP (this) == Const
CharP (&NullPool)) ? 0 : this, \
(C
harP (this) ==
CharP (&NullPool)) ? 0 : this, \
apply_depth, apply_depth, \
__PRETTY_FUNCTION__); \
} HB_STMT_END
...
...
@@ -411,7 +411,7 @@ struct ContextFormat2
*/
struct
ContextLookupContext
lookup_context
=
{
{
match_class
,
apply_func
},
C
onstC
harP
(
&
class_def
)
CharP
(
&
class_def
)
};
return
rule_set
.
apply
(
APPLY_ARG
,
lookup_context
);
}
...
...
@@ -451,7 +451,7 @@ struct ContextFormat3
const
LookupRecord
*
lookupRecord
=
&
CONST_CAST
(
LookupRecord
,
coverage
,
coverage
[
0
].
get_size
()
*
glyphCount
);
struct
ContextLookupContext
lookup_context
=
{
{
match_coverage
,
apply_func
},
C
onstC
harP
(
this
)
CharP
(
this
)
};
return
context_lookup
(
APPLY_ARG
,
glyphCount
,
(
const
USHORT
*
)
(
coverage
+
1
),
...
...
@@ -696,9 +696,9 @@ struct ChainContextFormat2
*/
struct
ChainContextLookupContext
lookup_context
=
{
{
match_class
,
apply_func
},
{
C
onstC
harP
(
&
backtrack_class_def
),
C
onstC
harP
(
&
input_class_def
),
C
onstC
harP
(
&
lookahead_class_def
)}
{
CharP
(
&
backtrack_class_def
),
CharP
(
&
input_class_def
),
CharP
(
&
lookahead_class_def
)}
};
return
rule_set
.
apply
(
APPLY_ARG
,
lookup_context
);
}
...
...
@@ -752,7 +752,7 @@ struct ChainContextFormat3
const
ArrayOf
<
LookupRecord
>
&
lookup
=
StructAfter
<
ArrayOf
<
LookupRecord
>
>
(
lookahead
);
struct
ChainContextLookupContext
lookup_context
=
{
{
match_coverage
,
apply_func
},
{
C
onstCharP
(
this
),
ConstCharP
(
this
),
Const
CharP
(
this
)}
{
C
harP
(
this
),
CharP
(
this
),
CharP
(
this
)}
};
return
chain_context_lookup
(
APPLY_ARG
,
backtrack
.
len
,
(
const
USHORT
*
)
backtrack
.
array
(),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录