Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
191c4edc
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看板
提交
191c4edc
编写于
5月 09, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Reinstante DEFINE_NULL_DATA
Seems like I messed up; buffer overrun got reported.
上级
93bdf9b2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
10 deletion
+18
-10
src/hb-open-type-private.hh
src/hb-open-type-private.hh
+2
-0
src/hb-ot-layout-common-private.hh
src/hb-ot-layout-common-private.hh
+3
-10
src/hb-private.hh
src/hb-private.hh
+13
-0
未找到文件。
src/hb-open-type-private.hh
浏览文件 @
191c4edc
...
...
@@ -685,6 +685,7 @@ struct Tag : HBUINT32
public:
DEFINE_SIZE_STATIC
(
4
);
};
DEFINE_NULL_DATA
(
OT
,
Tag
,
" "
);
/* Glyph index number, same as uint16 (length = 16 bits) */
typedef
HBUINT16
GlyphID
;
...
...
@@ -696,6 +697,7 @@ typedef HBUINT16 NameID;
struct
Index
:
HBUINT16
{
static
const
unsigned
int
NOT_FOUND_INDEX
=
0xFFFFu
;
};
DEFINE_NULL_DATA
(
OT
,
Index
,
"
\xff\xff
"
);
/* Offset, Null offset = 0 */
template
<
typename
Type
>
...
...
src/hb-ot-layout-common-private.hh
浏览文件 @
191c4edc
...
...
@@ -165,6 +165,7 @@ struct RangeRecord
public:
DEFINE_SIZE_STATIC
(
6
);
};
DEFINE_NULL_DATA
(
OT
,
RangeRecord
,
"
\000\001
"
);
struct
IndexArray
:
ArrayOf
<
Index
>
...
...
@@ -224,6 +225,7 @@ struct LangSys
public:
DEFINE_SIZE_ARRAY
(
6
,
featureIndex
);
};
DEFINE_NULL_DATA
(
OT
,
LangSys
,
"
\0\0\xFF\xFF
"
);
struct
Script
...
...
@@ -245,16 +247,7 @@ struct Script
{
return
langSys
.
find_index
(
tag
,
index
);
}
inline
bool
has_default_lang_sys
(
void
)
const
{
return
defaultLangSys
!=
0
;
}
inline
const
LangSys
&
get_default_lang_sys
(
void
)
const
{
if
(
!
defaultLangSys
)
{
/* This is the ONLY place where our null data is not all zeros.
* So, return special data instead of using the null pool. */
return
*
reinterpret_cast
<
const
LangSys
*>
(
"
\0\0\xFF\xFF
"
);
}
return
this
+
defaultLangSys
;
}
inline
const
LangSys
&
get_default_lang_sys
(
void
)
const
{
return
this
+
defaultLangSys
;
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
const
Record
<
Script
>::
sanitize_closure_t
*
=
nullptr
)
const
...
...
src/hb-private.hh
浏览文件 @
191c4edc
...
...
@@ -1117,5 +1117,18 @@ static inline const Type& Null (void) {
}
#define Null(Type) Null<Type>()
/* Specializaiton for arbitrary-content arbitrary-sized Null objects. */
#define DEFINE_NULL_DATA(Namespace, Type, data) \
}
/* Close namespace. */
\
static const char _Null##Type[sizeof (Namespace::Type) + 1] = data;
/* +1 is for nul-termination in data */
\
template <> \
/*static*/
inline const Namespace::Type& Null<Namespace::Type> (void) { \
return *reinterpret_cast<const Namespace::Type *> (_Null##Type); \
} \
namespace Namespace { \
/* The following line really exists such that we end in a place needing semicolon */
\
static_assert (Namespace::Type::min_size + 1 <= sizeof (_Null##Type), "Null pool too small. Enlarge.")
#endif
/* HB_PRIVATE_HH */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录