Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
bd61bc13
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看板
提交
bd61bc13
编写于
12月 11, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[OTLayout] Add UINT24 type
上级
9cf7f9d4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
11 deletion
+26
-11
src/hb-open-type-private.hh
src/hb-open-type-private.hh
+22
-11
src/hb-private.hh
src/hb-private.hh
+4
-0
未找到文件。
src/hb-open-type-private.hh
浏览文件 @
bd61bc13
...
...
@@ -534,32 +534,43 @@ struct BEInt<Type, 4>
inline
bool
operator
!=
(
const
BEInt
<
Type
,
4
>&
o
)
const
{
return
!
(
*
this
==
o
);
}
private:
uint8_t
v
[
4
];
};
template
<
typename
Type
>
struct
BEInt
<
Type
,
3
>
{
public:
inline
void
set
(
Type
i
)
{
hb_be_uint24_put
(
v
,
i
);
}
inline
operator
Type
(
void
)
const
{
return
hb_be_uint24_get
(
v
);
}
inline
bool
operator
==
(
const
BEInt
<
Type
,
3
>&
o
)
const
{
return
hb_be_uint24_eq
(
v
,
o
.
v
);
}
inline
bool
operator
!=
(
const
BEInt
<
Type
,
3
>&
o
)
const
{
return
!
(
*
this
==
o
);
}
private:
uint8_t
v
[
3
];
};
/* Integer types in big-endian order and no alignment requirement */
template
<
typename
Type
>
template
<
typename
Type
,
unsigned
int
Size
>
struct
IntType
{
inline
void
set
(
Type
i
)
{
v
.
set
(
i
);
}
inline
operator
Type
(
void
)
const
{
return
v
;
}
inline
bool
operator
==
(
const
IntType
<
Type
>
&
o
)
const
{
return
v
==
o
.
v
;
}
inline
bool
operator
!=
(
const
IntType
<
Type
>
&
o
)
const
{
return
v
!=
o
.
v
;
}
static
inline
int
cmp
(
const
IntType
<
Type
>
*
a
,
const
IntType
<
Typ
e
>
*
b
)
{
return
b
->
cmp
(
*
a
);
}
inline
int
cmp
(
IntType
<
Type
>
va
)
const
{
Type
a
=
va
;
Type
b
=
v
;
return
a
<
b
?
-
1
:
a
==
b
?
0
:
+
1
;
}
inline
bool
operator
==
(
const
IntType
<
Type
,
Size
>
&
o
)
const
{
return
v
==
o
.
v
;
}
inline
bool
operator
!=
(
const
IntType
<
Type
,
Size
>
&
o
)
const
{
return
v
!=
o
.
v
;
}
static
inline
int
cmp
(
const
IntType
<
Type
,
Size
>
*
a
,
const
IntType
<
Type
,
Siz
e
>
*
b
)
{
return
b
->
cmp
(
*
a
);
}
inline
int
cmp
(
IntType
<
Type
,
Size
>
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
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
(
this
);
return
TRACE_RETURN
(
likely
(
c
->
check_struct
(
this
)));
}
protected:
BEInt
<
Type
,
sizeof
(
Type
)
>
v
;
BEInt
<
Type
,
Size
>
v
;
public:
DEFINE_SIZE_STATIC
(
sizeof
(
Type
)
);
DEFINE_SIZE_STATIC
(
Size
);
};
typedef
IntType
<
uint16_t
>
USHORT
;
/* 16-bit unsigned integer. */
typedef
IntType
<
int16_t
>
SHORT
;
/* 16-bit signed integer. */
typedef
IntType
<
uint32_t
>
ULONG
;
/* 32-bit unsigned integer. */
typedef
IntType
<
int32_t
>
LONG
;
/* 32-bit signed integer. */
typedef
IntType
<
uint16_t
,
2
>
USHORT
;
/* 16-bit unsigned integer. */
typedef
IntType
<
int16_t
,
2
>
SHORT
;
/* 16-bit signed integer. */
typedef
IntType
<
uint32_t
,
4
>
ULONG
;
/* 32-bit unsigned integer. */
typedef
IntType
<
int32_t
,
4
>
LONG
;
/* 32-bit signed integer. */
typedef
IntType
<
uint32_t
,
3
>
UINT24
;
/* 24-bit unsigned integer. */
/* 16-bit signed integer (SHORT) that describes a quantity in FUnits. */
typedef
SHORT
FWORD
;
...
...
src/hb-private.hh
浏览文件 @
bd61bc13
...
...
@@ -509,6 +509,10 @@ static inline uint32_t hb_uint32_swap (const uint32_t v)
#define hb_be_uint32_get(v) (uint32_t) ((v[0] << 24) + (v[1] << 16) + (v[2] << 8) + v[3])
#define hb_be_uint32_eq(a,b) (a[0] == b[0] && a[1] == b[1] && a[2] == b[2] && a[3] == b[3])
#define hb_be_uint24_put(v,V) HB_STMT_START { v[0] = (V>>16); v[1] = (V>>8); v[2] (V); } HB_STMT_END
#define hb_be_uint24_get(v) (uint32_t) ((v[0] << 16) + (v[1] << 8) + v[2])
#define hb_be_uint24_eq(a,b) (a[0] == b[0] && a[1] == b[1] && a[2] == b[2])
/* ASCII tag/character handling */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录