Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
a5ab682b
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看板
提交
a5ab682b
编写于
11月 03, 2010
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More "unreached code" warning fixes
Ugly :(.
上级
4e22c7e9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
24 deletion
+24
-24
src/hb-blob.c
src/hb-blob.c
+24
-24
未找到文件。
src/hb-blob.c
浏览文件 @
a5ab682b
...
...
@@ -182,9 +182,9 @@ hb_blob_lock (hb_blob_t *blob)
hb_mutex_lock
(
blob
->
lock
);
if
(
HB_DEBUG_BLOB
)
(
void
)
(
HB_DEBUG_BLOB
&&
fprintf
(
stderr
,
"%p %s (%d) -> %p
\n
"
,
blob
,
__FUNCTION__
,
blob
->
lock_count
,
blob
->
data
);
blob
->
lock_count
,
blob
->
data
)
)
;
blob
->
lock_count
++
;
...
...
@@ -201,9 +201,9 @@ hb_blob_unlock (hb_blob_t *blob)
hb_mutex_lock
(
blob
->
lock
);
if
(
HB_DEBUG_BLOB
)
(
void
)
(
HB_DEBUG_BLOB
&&
fprintf
(
stderr
,
"%p %s (%d) -> %p
\n
"
,
blob
,
__FUNCTION__
,
blob
->
lock_count
,
blob
->
data
);
blob
->
lock_count
,
blob
->
data
)
)
;
assert
(
blob
->
lock_count
>
0
);
blob
->
lock_count
--
;
...
...
@@ -245,30 +245,30 @@ _try_make_writable_inplace_unix_locked (hb_blob_t *blob)
#endif
if
((
uintptr_t
)
-
1L
==
pagesize
)
{
if
(
HB_DEBUG_BLOB
)
fprintf
(
stderr
,
"%p %s: failed to get pagesize: %s
\n
"
,
blob
,
__FUNCTION__
,
strerror
(
errno
));
(
void
)
(
HB_DEBUG_BLOB
&&
fprintf
(
stderr
,
"%p %s: failed to get pagesize: %s
\n
"
,
blob
,
__FUNCTION__
,
strerror
(
errno
))
)
;
return
FALSE
;
}
if
(
HB_DEBUG_BLOB
)
fprintf
(
stderr
,
"%p %s: pagesize is %lu
\n
"
,
blob
,
__FUNCTION__
,
(
unsigned
long
)
pagesize
);
(
void
)
(
HB_DEBUG_BLOB
&&
fprintf
(
stderr
,
"%p %s: pagesize is %lu
\n
"
,
blob
,
__FUNCTION__
,
(
unsigned
long
)
pagesize
)
)
;
mask
=
~
(
pagesize
-
1
);
addr
=
(
const
char
*
)
(((
uintptr_t
)
blob
->
data
)
&
mask
);
length
=
(
const
char
*
)
(((
uintptr_t
)
blob
->
data
+
blob
->
length
+
pagesize
-
1
)
&
mask
)
-
addr
;
if
(
HB_DEBUG_BLOB
)
(
void
)
(
HB_DEBUG_BLOB
&&
fprintf
(
stderr
,
"%p %s: calling mprotect on [%p..%p] (%lu bytes)
\n
"
,
blob
,
__FUNCTION__
,
addr
,
addr
+
length
,
(
unsigned
long
)
length
);
addr
,
addr
+
length
,
(
unsigned
long
)
length
)
)
;
if
(
-
1
==
mprotect
((
void
*
)
addr
,
length
,
PROT_READ
|
PROT_WRITE
))
{
if
(
HB_DEBUG_BLOB
)
fprintf
(
stderr
,
"%p %s: %s
\n
"
,
blob
,
__FUNCTION__
,
strerror
(
errno
));
(
void
)
(
HB_DEBUG_BLOB
&&
fprintf
(
stderr
,
"%p %s: %s
\n
"
,
blob
,
__FUNCTION__
,
strerror
(
errno
))
)
;
return
FALSE
;
}
if
(
HB_DEBUG_BLOB
)
(
void
)
(
HB_DEBUG_BLOB
&&
fprintf
(
stderr
,
"%p %s: successfully made [%p..%p] (%lu bytes) writable
\n
"
,
blob
,
__FUNCTION__
,
addr
,
addr
+
length
,
(
unsigned
long
)
length
);
addr
,
addr
+
length
,
(
unsigned
long
)
length
)
)
;
return
TRUE
;
#else
return
FALSE
;
...
...
@@ -278,16 +278,16 @@ _try_make_writable_inplace_unix_locked (hb_blob_t *blob)
static
void
try_writable_inplace_locked
(
hb_blob_t
*
blob
)
{
if
(
HB_DEBUG_BLOB
)
fprintf
(
stderr
,
"%p %s: making writable
\n
"
,
blob
,
__FUNCTION__
);
(
void
)
(
HB_DEBUG_BLOB
&&
fprintf
(
stderr
,
"%p %s: making writable
\n
"
,
blob
,
__FUNCTION__
)
)
;
if
(
_try_make_writable_inplace_unix_locked
(
blob
))
{
if
(
HB_DEBUG_BLOB
)
fprintf
(
stderr
,
"%p %s: making writable -> succeeded
\n
"
,
blob
,
__FUNCTION__
);
(
void
)
(
HB_DEBUG_BLOB
&&
fprintf
(
stderr
,
"%p %s: making writable -> succeeded
\n
"
,
blob
,
__FUNCTION__
)
)
;
blob
->
mode
=
HB_MEMORY_MODE_WRITABLE
;
}
else
{
if
(
HB_DEBUG_BLOB
)
fprintf
(
stderr
,
"%p %s: making writable -> FAILED
\n
"
,
blob
,
__FUNCTION__
);
(
void
)
(
HB_DEBUG_BLOB
&&
fprintf
(
stderr
,
"%p %s: making writable -> FAILED
\n
"
,
blob
,
__FUNCTION__
)
)
;
/* Failed to make writable inplace, mark that */
blob
->
mode
=
HB_MEMORY_MODE_READONLY
;
}
...
...
@@ -330,17 +330,17 @@ hb_blob_try_writable (hb_blob_t *blob)
{
char
*
new_data
;
if
(
HB_DEBUG_BLOB
)
(
void
)
(
HB_DEBUG_BLOB
&&
fprintf
(
stderr
,
"%p %s (%d) -> %p
\n
"
,
blob
,
__FUNCTION__
,
blob
->
lock_count
,
blob
->
data
);
blob
->
lock_count
,
blob
->
data
)
)
;
if
(
blob
->
lock_count
)
goto
done
;
new_data
=
malloc
(
blob
->
length
);
if
(
new_data
)
{
if
(
HB_DEBUG_BLOB
)
fprintf
(
stderr
,
"%p %s: dupped successfully -> %p
\n
"
,
blob
,
__FUNCTION__
,
blob
->
data
);
(
void
)
(
HB_DEBUG_BLOB
&&
fprintf
(
stderr
,
"%p %s: dupped successfully -> %p
\n
"
,
blob
,
__FUNCTION__
,
blob
->
data
)
)
;
memcpy
(
new_data
,
blob
->
data
,
blob
->
length
);
_hb_blob_destroy_user_data
(
blob
);
blob
->
mode
=
HB_MEMORY_MODE_WRITABLE
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录