Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
4497af00
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4497af00
编写于
5月 25, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[HB] Would have helped if I actually knew C++ before using it...
上级
cc6c644f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
14 deletion
+14
-14
src/hb-ot-layout-gsubgpos-private.h
src/hb-ot-layout-gsubgpos-private.h
+2
-2
src/hb-ot-layout-open-private.h
src/hb-ot-layout-open-private.h
+12
-12
未找到文件。
src/hb-ot-layout-gsubgpos-private.h
浏览文件 @
4497af00
...
...
@@ -64,7 +64,7 @@ static inline bool match_glyph (hb_codepoint_t glyph_id, const USHORT &value, ch
static
inline
bool
match_class
(
hb_codepoint_t
glyph_id
,
const
USHORT
&
value
,
char
*
data
)
{
const
ClassDef
&
class_def
=
(
const
ClassDef
&
)
*
data
;
const
ClassDef
&
class_def
=
*
(
const
ClassDef
*
)
data
;
return
class_def
.
get_class
(
glyph_id
)
==
value
;
}
...
...
@@ -697,7 +697,7 @@ struct ExtensionFormat1
{
unsigned
int
offset
=
get_offset
();
if
(
HB_UNLIKELY
(
!
offset
))
return
Null
(
LookupSubTable
);
return
(
LookupSubTable
&
)
*
(((
char
*
)
this
)
+
offset
);
return
*
(
LookupSubTable
*
)
(((
char
*
)
this
)
+
offset
);
}
private:
...
...
src/hb-ot-layout-open-private.h
浏览文件 @
4497af00
...
...
@@ -72,7 +72,7 @@
{ \
if (HB_UNLIKELY (i >= num)) return Null(Type); \
if (HB_UNLIKELY (!array[i])) return Null(Type); \
return
(const Type&)*
((const char*)this + array[i]); \
return
*(const Type)
((const char*)this + array[i]); \
}
...
...
@@ -145,7 +145,7 @@ template <typename Type>
struct
Null
{
ASSERT_STATIC
(
sizeof
(
Type
)
<=
sizeof
(
NullPool
));
static
inline
const
Type
&
get
()
{
return
(
const
Type
&
)
*
NullPool
;
}
static
inline
const
Type
&
get
()
{
return
*
(
const
Type
*
)
NullPool
;
}
};
/* Specializaiton for arbitrary-content arbitrary-sized Null objects. */
...
...
@@ -154,7 +154,7 @@ static const char _Null##Type[size] = data; \
template <> \
struct Null <Type> \
{ \
static inline const Type &get () { return
(const Type&) *
_Null##Type; } \
static inline const Type &get () { return
*(const Type*)
_Null##Type; } \
}
/* Accessor macro. */
...
...
@@ -172,14 +172,14 @@ struct Null <Type> \
static inline const Type& get_for_data (const char *data) \
{ \
if (HB_UNLIKELY (data == NULL)) return Null(Type); \
return
(const Type&)*
data; \
return
*(const Type*)
data; \
}
/* Like get_for_data(), but checks major version first. */
#define STATIC_DEFINE_GET_FOR_DATA_CHECK_MAJOR_VERSION(Type, Major) \
static inline const Type& get_for_data (const char *data) \
{ \
if (HB_UNLIKELY (data == NULL)) return Null(Type); \
const Type& t =
(const Type&)*
data; \
const Type& t =
*(const Type*)
data; \
if (HB_UNLIKELY (!t.version.major || t.version.major > Major)) return Null(Type); \
return t; \
}
...
...
@@ -228,10 +228,10 @@ DEFINE_INT_TYPE (LONG, , 32); /* 32-bit signed integer. */
* system, feature, or baseline */
struct
Tag
:
ULONG
{
inline
Tag
(
const
Tag
&
o
)
{
(
ULONG
&
)
*
this
=
(
ULONG
&
)
o
;
}
inline
Tag
(
uint32_t
i
)
{
(
ULONG
&
)
*
this
=
i
;
}
inline
Tag
(
const
char
*
c
)
{
(
ULONG
&
)
*
this
=
(
ULONG
&
)
*
c
;
}
inline
bool
operator
==
(
const
char
*
c
)
const
{
return
(
ULONG
&
)
*
this
==
(
ULONG
&
)
*
c
;
}
inline
Tag
(
const
Tag
&
o
)
{
*
(
ULONG
*
)
this
=
(
ULONG
&
)
o
;
}
inline
Tag
(
uint32_t
i
)
{
*
(
ULONG
*
)
this
=
i
;
}
inline
Tag
(
const
char
*
c
)
{
*
(
ULONG
*
)
this
=
*
(
ULONG
*
)
c
;
}
inline
bool
operator
==
(
const
char
*
c
)
const
{
return
*
(
ULONG
*
)
this
==
*
(
ULONG
*
)
c
;
}
/* What the char* converters return is NOT nul-terminated. Print using "%.4s" */
inline
operator
const
char
*
(
void
)
const
{
return
(
const
char
*
)
this
;
}
inline
operator
char
*
(
void
)
{
return
(
char
*
)
this
;
}
...
...
@@ -259,7 +259,7 @@ struct OffsetTo : Offset
{
unsigned
int
offset
=
*
this
;
if
(
HB_UNLIKELY
(
!
offset
))
return
Null
(
Type
);
return
(
const
Type
&
)
*
((
const
char
*
)
base
+
offset
);
return
*
(
const
Type
*
)
((
const
char
*
)
base
+
offset
);
}
};
template
<
typename
Base
,
typename
Type
>
...
...
@@ -272,7 +272,7 @@ struct LongOffsetTo : LongOffset
{
unsigned
int
offset
=
*
this
;
if
(
HB_UNLIKELY
(
!
offset
))
return
Null
(
Type
);
return
(
const
Type
&
)
*
((
const
char
*
)
base
+
offset
);
return
*
(
const
Type
*
)
((
const
char
*
)
base
+
offset
);
}
};
template
<
typename
Base
,
typename
Type
>
...
...
@@ -479,7 +479,7 @@ struct OpenTypeFontFile
if
(
HB_UNLIKELY
(
i
>=
get_face_count
()))
return
Null
(
OpenTypeFontFace
);
switch
(
tag
)
{
default:
/* Never happens because of the if above */
case
TrueTypeTag
:
case
CFFTag
:
return
(
const
OffsetTable
&
)
*
this
;
case
TrueTypeTag
:
case
CFFTag
:
return
*
(
const
OffsetTable
*
)
this
;
case
TTCTag
:
return
this
+
TTCHeader
::
get_for_data
((
const
char
*
)
this
).
table
[
i
];
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录