Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
47e71d96
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看板
提交
47e71d96
编写于
4月 27, 2011
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[object] Remove unnecessary use of macros
上级
8be1420f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
31 addition
and
42 deletion
+31
-42
TODO
TODO
+0
-2
src/hb-blob.cc
src/hb-blob.cc
+9
-9
src/hb-buffer.cc
src/hb-buffer.cc
+3
-3
src/hb-font.cc
src/hb-font.cc
+15
-15
src/hb-object-private.hh
src/hb-object-private.hh
+0
-9
src/hb-unicode.cc
src/hb-unicode.cc
+4
-4
未找到文件。
TODO
浏览文件 @
47e71d96
...
...
@@ -9,8 +9,6 @@ General fixes:
- Remove fixed-size feature/lookup arrays in hb-ot-map
- Use templates instead of macros for objects?
API issues to fix before 1.0:
============================
...
...
src/hb-blob.cc
浏览文件 @
47e71d96
...
...
@@ -87,7 +87,7 @@ hb_blob_create (const char *data,
{
hb_blob_t
*
blob
;
if
(
!
length
||
!
HB_OBJECT_DO_CREATE
(
hb_blob_t
,
blob
))
{
if
(
!
length
||
!
(
blob
=
hb_object_create
<
hb_blob_t
>
()
))
{
if
(
destroy
)
destroy
(
user_data
);
return
&
_hb_blob_nil
;
...
...
@@ -122,7 +122,7 @@ hb_blob_create_sub_blob (hb_blob_t *parent,
hb_blob_t
*
blob
;
const
char
*
pdata
;
if
(
!
length
||
offset
>=
parent
->
length
||
!
HB_OBJECT_DO_CREATE
(
hb_blob_t
,
blob
))
if
(
!
length
||
offset
>=
parent
->
length
||
!
(
blob
=
hb_object_create
<
hb_blob_t
>
()
))
return
&
_hb_blob_nil
;
pdata
=
hb_blob_lock
(
parent
);
...
...
@@ -149,13 +149,13 @@ hb_blob_create_empty (void)
hb_blob_t
*
hb_blob_reference
(
hb_blob_t
*
blob
)
{
HB_OBJECT_DO_REFERENCE
(
blob
);
return
hb_object_reference
(
blob
);
}
void
hb_blob_destroy
(
hb_blob_t
*
blob
)
{
HB_OBJECT_DO_DESTROY
(
blob
)
;
if
(
!
hb_object_destroy
(
blob
))
return
;
_hb_blob_destroy_user_data
(
blob
);
...
...
@@ -171,7 +171,7 @@ hb_blob_get_length (hb_blob_t *blob)
const
char
*
hb_blob_lock
(
hb_blob_t
*
blob
)
{
if
(
HB_OBJECT_IS_INERT
(
blob
))
if
(
hb_object_is_inert
(
blob
))
return
NULL
;
hb_mutex_lock
(
blob
->
lock
);
...
...
@@ -190,7 +190,7 @@ hb_blob_lock (hb_blob_t *blob)
void
hb_blob_unlock
(
hb_blob_t
*
blob
)
{
if
(
HB_OBJECT_IS_INERT
(
blob
))
if
(
hb_object_is_inert
(
blob
))
return
;
hb_mutex_lock
(
blob
->
lock
);
...
...
@@ -210,7 +210,7 @@ hb_blob_is_writable (hb_blob_t *blob)
{
hb_memory_mode_t
mode
;
if
(
HB_OBJECT_IS_INERT
(
blob
))
if
(
hb_object_is_inert
(
blob
))
return
FALSE
;
hb_mutex_lock
(
blob
->
lock
);
...
...
@@ -292,7 +292,7 @@ hb_blob_try_writable_inplace (hb_blob_t *blob)
{
hb_memory_mode_t
mode
;
if
(
HB_OBJECT_IS_INERT
(
blob
))
if
(
hb_object_is_inert
(
blob
))
return
FALSE
;
hb_mutex_lock
(
blob
->
lock
);
...
...
@@ -312,7 +312,7 @@ hb_blob_try_writable (hb_blob_t *blob)
{
hb_memory_mode_t
mode
;
if
(
HB_OBJECT_IS_INERT
(
blob
))
if
(
hb_object_is_inert
(
blob
))
return
FALSE
;
hb_mutex_lock
(
blob
->
lock
);
...
...
src/hb-buffer.cc
浏览文件 @
47e71d96
...
...
@@ -137,7 +137,7 @@ hb_buffer_create (unsigned int pre_alloc_size)
{
hb_buffer_t
*
buffer
;
if
(
!
HB_OBJECT_DO_CREATE
(
hb_buffer_t
,
buffer
))
if
(
!
(
buffer
=
hb_object_create
<
hb_buffer_t
>
()
))
return
&
_hb_buffer_nil
;
if
(
pre_alloc_size
)
...
...
@@ -151,13 +151,13 @@ hb_buffer_create (unsigned int pre_alloc_size)
hb_buffer_t
*
hb_buffer_reference
(
hb_buffer_t
*
buffer
)
{
HB_OBJECT_DO_REFERENCE
(
buffer
);
return
hb_object_reference
(
buffer
);
}
void
hb_buffer_destroy
(
hb_buffer_t
*
buffer
)
{
HB_OBJECT_DO_DESTROY
(
buffer
)
;
if
(
!
hb_object_destroy
(
buffer
))
return
;
hb_unicode_funcs_destroy
(
buffer
->
unicode
);
...
...
src/hb-font.cc
浏览文件 @
47e71d96
...
...
@@ -102,7 +102,7 @@ hb_font_funcs_create (void)
{
hb_font_funcs_t
*
ffuncs
;
if
(
!
HB_OBJECT_DO_CREATE
(
hb_font_funcs_t
,
ffuncs
))
if
(
!
(
ffuncs
=
hb_object_create
<
hb_font_funcs_t
>
()
))
return
&
_hb_font_funcs_nil
;
ffuncs
->
v
=
_hb_font_funcs_nil
.
v
;
...
...
@@ -113,13 +113,13 @@ hb_font_funcs_create (void)
hb_font_funcs_t
*
hb_font_funcs_reference
(
hb_font_funcs_t
*
ffuncs
)
{
HB_OBJECT_DO_REFERENCE
(
ffuncs
);
return
hb_object_reference
(
ffuncs
);
}
void
hb_font_funcs_destroy
(
hb_font_funcs_t
*
ffuncs
)
{
HB_OBJECT_DO_DESTROY
(
ffuncs
)
;
if
(
!
hb_object_destroy
(
ffuncs
))
return
;
free
(
ffuncs
);
}
...
...
@@ -129,7 +129,7 @@ hb_font_funcs_copy (hb_font_funcs_t *other_ffuncs)
{
hb_font_funcs_t
*
ffuncs
;
if
(
!
HB_OBJECT_DO_CREATE
(
hb_font_funcs_t
,
ffuncs
))
if
(
!
(
ffuncs
=
hb_object_create
<
hb_font_funcs_t
>
()
))
return
&
_hb_font_funcs_nil
;
ffuncs
->
v
=
other_ffuncs
->
v
;
...
...
@@ -140,7 +140,7 @@ hb_font_funcs_copy (hb_font_funcs_t *other_ffuncs)
void
hb_font_funcs_make_immutable
(
hb_font_funcs_t
*
ffuncs
)
{
if
(
HB_OBJECT_IS_INERT
(
ffuncs
))
if
(
hb_object_is_inert
(
ffuncs
))
return
;
ffuncs
->
immutable
=
TRUE
;
...
...
@@ -308,7 +308,7 @@ hb_face_create_for_tables (hb_get_table_func_t get_table,
{
hb_face_t
*
face
;
if
(
!
HB_OBJECT_DO_CREATE
(
hb_face_t
,
face
))
{
if
(
!
(
face
=
hb_object_create
<
hb_face_t
>
()
))
{
if
(
destroy
)
destroy
(
user_data
);
return
&
_hb_face_nil
;
...
...
@@ -389,13 +389,13 @@ hb_face_create_for_data (hb_blob_t *blob,
hb_face_t
*
hb_face_reference
(
hb_face_t
*
face
)
{
HB_OBJECT_DO_REFERENCE
(
face
);
return
hb_object_reference
(
face
);
}
void
hb_face_destroy
(
hb_face_t
*
face
)
{
HB_OBJECT_DO_DESTROY
(
face
)
;
if
(
!
hb_object_destroy
(
face
))
return
;
_hb_ot_layout_free
(
face
->
ot_layout
);
...
...
@@ -454,7 +454,7 @@ hb_font_create (void)
{
hb_font_t
*
font
;
if
(
!
HB_OBJECT_DO_CREATE
(
hb_font_t
,
font
))
if
(
!
(
font
=
hb_object_create
<
hb_font_t
>
()
))
return
&
_hb_font_nil
;
font
->
klass
=
&
_hb_font_funcs_nil
;
...
...
@@ -465,13 +465,13 @@ hb_font_create (void)
hb_font_t
*
hb_font_reference
(
hb_font_t
*
font
)
{
HB_OBJECT_DO_REFERENCE
(
font
);
return
hb_object_reference
(
font
);
}
void
hb_font_destroy
(
hb_font_t
*
font
)
{
HB_OBJECT_DO_DESTROY
(
font
)
;
if
(
!
hb_object_destroy
(
font
))
return
;
hb_font_funcs_destroy
(
font
->
klass
);
if
(
font
->
destroy
)
...
...
@@ -486,7 +486,7 @@ hb_font_set_funcs (hb_font_t *font,
void
*
user_data
,
hb_destroy_func_t
destroy
)
{
if
(
HB_OBJECT_IS_INERT
(
font
))
if
(
hb_object_is_inert
(
font
))
return
;
if
(
font
->
destroy
)
...
...
@@ -514,7 +514,7 @@ hb_font_unset_funcs (hb_font_t *font,
*
user_data
=
font
->
user_data
;
*
destroy
=
font
->
destroy
;
if
(
HB_OBJECT_IS_INERT
(
font
))
if
(
hb_object_is_inert
(
font
))
return
;
font
->
klass
=
NULL
;
...
...
@@ -527,7 +527,7 @@ hb_font_set_scale (hb_font_t *font,
int
x_scale
,
int
y_scale
)
{
if
(
HB_OBJECT_IS_INERT
(
font
))
if
(
hb_object_is_inert
(
font
))
return
;
font
->
x_scale
=
x_scale
;
...
...
@@ -548,7 +548,7 @@ hb_font_set_ppem (hb_font_t *font,
unsigned
int
x_ppem
,
unsigned
int
y_ppem
)
{
if
(
HB_OBJECT_IS_INERT
(
font
))
if
(
hb_object_is_inert
(
font
))
return
;
font
->
x_ppem
=
x_ppem
;
...
...
src/hb-object-private.hh
浏览文件 @
47e71d96
...
...
@@ -123,18 +123,9 @@ static inline bool hb_object_destroy (Type *obj)
}
HB_BEGIN_DECLS
/* Object allocation and lifecycle manamgement macros */
#define HB_OBJECT_DO_CREATE(Type, obj) likely (obj = hb_object_create<Type> ())
#define HB_OBJECT_IS_INERT(obj) hb_object_is_inert (obj)
#define HB_OBJECT_DO_REFERENCE(obj) return hb_object_reference (obj)
#define HB_OBJECT_DO_DESTROY(obj) if (!hb_object_destroy (obj)) return
HB_END_DECLS
#endif
/* HB_OBJECT_PRIVATE_HH */
src/hb-unicode.cc
浏览文件 @
47e71d96
...
...
@@ -107,7 +107,7 @@ hb_unicode_funcs_create (hb_unicode_funcs_t *parent)
{
hb_unicode_funcs_t
*
ufuncs
;
if
(
!
HB_OBJECT_DO_CREATE
(
hb_unicode_funcs_t
,
ufuncs
))
if
(
!
(
ufuncs
=
hb_object_create
<
hb_unicode_funcs_t
>
()
))
return
&
_hb_unicode_funcs_nil
;
if
(
parent
!=
NULL
)
...
...
@@ -133,13 +133,13 @@ hb_unicode_funcs_create (hb_unicode_funcs_t *parent)
hb_unicode_funcs_t
*
hb_unicode_funcs_reference
(
hb_unicode_funcs_t
*
ufuncs
)
{
HB_OBJECT_DO_REFERENCE
(
ufuncs
);
return
hb_object_reference
(
ufuncs
);
}
void
hb_unicode_funcs_destroy
(
hb_unicode_funcs_t
*
ufuncs
)
{
HB_OBJECT_DO_DESTROY
(
ufuncs
)
;
if
(
!
hb_object_destroy
(
ufuncs
))
return
;
#define DESTROY(name) if (ufuncs->destroy.name) ufuncs->destroy.name (ufuncs->user_data.name)
DESTROY
(
combining_class
);
...
...
@@ -158,7 +158,7 @@ hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs)
void
hb_unicode_funcs_make_immutable
(
hb_unicode_funcs_t
*
ufuncs
)
{
if
(
HB_OBJECT_IS_INERT
(
ufuncs
))
if
(
hb_object_is_inert
(
ufuncs
))
return
;
ufuncs
->
immutable
=
TRUE
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录