Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
a794ebf4
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看板
提交
a794ebf4
编写于
8月 06, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[HB] Use glib again
上级
9b76a290
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
37 addition
and
36 deletion
+37
-36
src/Makefile.am
src/Makefile.am
+3
-2
src/hb-blob.c
src/hb-blob.c
+2
-2
src/hb-object-private.h
src/hb-object-private.h
+6
-13
src/hb-private.h
src/hb-private.h
+26
-19
未找到文件。
src/Makefile.am
浏览文件 @
a794ebf4
...
@@ -36,12 +36,13 @@ HBHEADERS = \
...
@@ -36,12 +36,13 @@ HBHEADERS = \
$(NULL)
$(NULL)
libharfbuzz_la_SOURCES
=
$(HBSOURCES)
$(HBHEADERS)
libharfbuzz_la_SOURCES
=
$(HBSOURCES)
$(HBHEADERS)
libharfbuzz_la_LIBADD
=
libharfbuzz_la_CPPFLAGS
=
-DHAVE_GLIB
$(GLIB_CFLAGS)
libharfbuzz_la_LIBADD
=
$(GLIB_LIBS)
noinst_PROGRAMS
=
main
noinst_PROGRAMS
=
main
main_SOURCES
=
main.cc
main_SOURCES
=
main.cc
main_C
XXFLAGS
=
$(GLIB_CFLAGS)
main_C
PPFLAGS
=
-DHAVE_GLIB
$(GLIB_CFLAGS)
main_LDADD
=
libharfbuzz.la
$(GLIB_LIBS)
main_LDADD
=
libharfbuzz.la
$(GLIB_LIBS)
EXTRA_DIST
=
README COPYING
EXTRA_DIST
=
README COPYING
...
...
src/hb-blob.c
浏览文件 @
a794ebf4
...
@@ -171,7 +171,7 @@ const char *
...
@@ -171,7 +171,7 @@ const char *
hb_blob_lock
(
hb_blob_t
*
blob
)
hb_blob_lock
(
hb_blob_t
*
blob
)
{
{
if
(
!
HB_OBJECT_IS_INERT
(
blob
))
if
(
!
HB_OBJECT_IS_INERT
(
blob
))
(
void
)
_
hb_reference_count_inc
(
blob
->
lock
);
(
void
)
hb_reference_count_inc
(
blob
->
lock
);
#if HB_DEBUG
#if HB_DEBUG
fprintf
(
stderr
,
"%p %s (%d) -> %p
\n
"
,
blob
,
__FUNCTION__
,
fprintf
(
stderr
,
"%p %s (%d) -> %p
\n
"
,
blob
,
__FUNCTION__
,
...
@@ -185,7 +185,7 @@ void
...
@@ -185,7 +185,7 @@ void
hb_blob_unlock
(
hb_blob_t
*
blob
)
hb_blob_unlock
(
hb_blob_t
*
blob
)
{
{
if
(
!
HB_OBJECT_IS_INERT
(
blob
))
{
if
(
!
HB_OBJECT_IS_INERT
(
blob
))
{
int
old_lock
=
_
hb_reference_count_dec
(
blob
->
lock
);
int
old_lock
=
hb_reference_count_dec
(
blob
->
lock
);
assert
(
old_lock
>
0
);
assert
(
old_lock
>
0
);
}
}
...
...
src/hb-object-private.h
浏览文件 @
a794ebf4
...
@@ -30,26 +30,19 @@
...
@@ -30,26 +30,19 @@
#ifndef HB_REFCOUNT_PRIVATE_H
#ifndef HB_REFCOUNT_PRIVATE_H
#define HB_REFCOUNT_PRIVATE_H
#define HB_REFCOUNT_PRIVATE_H
typedef
int
hb_atomic_int_t
;
/* XXX add real atomic ops */
#define _hb_atomic_fetch_and_add(AI, V) ((AI) += (V), (AI)-(V))
#define _hb_atomic_int_get(AI) ((AI)+0)
#define _hb_atomic_int_set(AI, VALUE) HB_STMT_START { (AI) = (VALUE); } HB_STMT_END
/* Encapsulate operations on the object's reference count */
/* Encapsulate operations on the object's reference count */
typedef
struct
{
typedef
struct
{
hb_atomic_int_t
ref_count
;
hb_atomic_int_t
ref_count
;
}
hb_reference_count_t
;
}
hb_reference_count_t
;
#define
_hb_reference_count_inc(RC) _
hb_atomic_fetch_and_add ((RC).ref_count, 1)
#define
hb_reference_count_inc(RC)
hb_atomic_fetch_and_add ((RC).ref_count, 1)
#define
_hb_reference_count_dec(RC) _
hb_atomic_fetch_and_add ((RC).ref_count, -1)
#define
hb_reference_count_dec(RC)
hb_atomic_fetch_and_add ((RC).ref_count, -1)
#define HB_REFERENCE_COUNT_INIT(RC, VALUE) ((RC).ref_count = (VALUE))
#define HB_REFERENCE_COUNT_INIT(RC, VALUE) ((RC).ref_count = (VALUE))
#define HB_REFERENCE_COUNT_GET_VALUE(RC)
_
hb_atomic_int_get ((RC).ref_count)
#define HB_REFERENCE_COUNT_GET_VALUE(RC) hb_atomic_int_get ((RC).ref_count)
#define HB_REFERENCE_COUNT_SET_VALUE(RC, VALUE)
_
hb_atomic_int_set ((RC).ref_count, (VALUE))
#define HB_REFERENCE_COUNT_SET_VALUE(RC, VALUE) hb_atomic_int_set ((RC).ref_count, (VALUE))
#define HB_REFERENCE_COUNT_INVALID_VALUE ((hb_atomic_int_t) -1)
#define HB_REFERENCE_COUNT_INVALID_VALUE ((hb_atomic_int_t) -1)
#define HB_REFERENCE_COUNT_INVALID {HB_REFERENCE_COUNT_INVALID_VALUE}
#define HB_REFERENCE_COUNT_INVALID {HB_REFERENCE_COUNT_INVALID_VALUE}
...
@@ -85,7 +78,7 @@ typedef struct {
...
@@ -85,7 +78,7 @@ typedef struct {
int old_count; \
int old_count; \
if (HB_UNLIKELY (!(obj) || HB_OBJECT_IS_INERT (obj))) \
if (HB_UNLIKELY (!(obj) || HB_OBJECT_IS_INERT (obj))) \
return obj; \
return obj; \
old_count =
_
hb_reference_count_inc (obj->ref_count); \
old_count = hb_reference_count_inc (obj->ref_count); \
assert (old_count > 0); \
assert (old_count > 0); \
return obj; \
return obj; \
} HB_STMT_END
} HB_STMT_END
...
@@ -102,7 +95,7 @@ typedef struct {
...
@@ -102,7 +95,7 @@ typedef struct {
int old_count; \
int old_count; \
if (HB_UNLIKELY (!(obj) || HB_OBJECT_IS_INERT (obj))) \
if (HB_UNLIKELY (!(obj) || HB_OBJECT_IS_INERT (obj))) \
return; \
return; \
old_count =
_
hb_reference_count_dec (obj->ref_count); \
old_count = hb_reference_count_dec (obj->ref_count); \
assert (old_count > 0); \
assert (old_count > 0); \
if (old_count != 1) \
if (old_count != 1) \
return; \
return; \
...
...
src/hb-private.h
浏览文件 @
a794ebf4
...
@@ -46,6 +46,32 @@
...
@@ -46,6 +46,32 @@
#include "hb-common.h"
#include "hb-common.h"
#define hb_be_uint8
#define hb_be_int8
#define hb_be_uint16(v) ((uint16_t) hb_be_int16 ((uint16_t) v))
#define hb_be_uint32(v) ((uint32_t) hb_be_int32 ((uint32_t) v))
typedef
int
hb_atomic_int_t
;
/* We need external help for these */
#if HAVE_GLIB
#include <glib.h>
/* Macros to convert to/from BigEndian */
#define hb_be_int16(v) GINT16_FROM_BE (v)
#define hb_be_int32(v) GINT32_FROM_BE (v)
#define hb_atomic_fetch_and_add(AI, V) g_atomic_int_exchange_and_add (&(AI), V)
#define hb_atomic_int_get(AI) g_atomic_int_get (&(AI))
#define hb_atomic_int_set(AI, V) g_atomic_int_set (&(AI), V)
#else
#error "Could not find any system to define platform macros, see hb-private.h"
#endif
/* Basics */
/* Basics */
#undef MIN
#undef MIN
...
@@ -146,25 +172,6 @@ _hb_popcount32 (uint32_t mask)
...
@@ -146,25 +172,6 @@ _hb_popcount32 (uint32_t mask)
#endif
#endif
}
}
static
HB_GNUC_UNUSED
inline
uint16_t
_hb_be_uint16
(
uint16_t
v
)
{
return
(
v
>>
8
)
+
(
v
<<
8
);
}
static
HB_GNUC_UNUSED
inline
uint32_t
_hb_be_uint32
(
uint32_t
v
)
{
return
_hb_be_uint16
(
v
>>
16
)
+
(
_hb_be_uint16
(
v
)
<<
16
);
}
/* Macros to convert to/from BigEndian */
#define hb_be_uint8
#define hb_be_int8
#define hb_be_uint16(v) _hb_be_uint16 (v)
#define hb_be_int16(v) ((int16_t) hb_be_uint16 (v))
#define hb_be_uint32(v) _hb_be_uint32 (v)
#define hb_be_int32(v) ((int32_t) hb_be_uint32 (v))
#include "hb-object-private.h"
#include "hb-object-private.h"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录