Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Zlib
提交
e9f0b784
T
Third Party Zlib
项目概览
OpenHarmony
/
Third Party Zlib
1 年多 前同步成功
通知
16
Star
112
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Zlib
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e9f0b784
编写于
3月 24, 2013
作者:
M
Mark Adler
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add casts and consts to ease user conversion to C++.
You would still need to run zlib2ansi on all of the *.c files.
上级
0aac8cf7
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
17 addition
and
16 deletion
+17
-16
gzlib.c
gzlib.c
+7
-6
gzread.c
gzread.c
+5
-5
gzwrite.c
gzwrite.c
+2
-2
zconf.h
zconf.h
+1
-1
zconf.h.cmakein
zconf.h.cmakein
+1
-1
zconf.h.in
zconf.h.in
+1
-1
未找到文件。
gzlib.c
浏览文件 @
e9f0b784
...
...
@@ -108,7 +108,7 @@ local gzFile gz_open(path, fd, mode)
return
NULL
;
/* allocate gzFile structure to return */
state
=
malloc
(
sizeof
(
gz_state
));
state
=
(
gz_statep
)
malloc
(
sizeof
(
gz_state
));
if
(
state
==
NULL
)
return
NULL
;
state
->
size
=
0
;
/* no buffers allocated yet */
...
...
@@ -196,8 +196,8 @@ local gzFile gz_open(path, fd, mode)
}
else
#endif
len
=
strlen
(
path
);
state
->
path
=
malloc
(
len
+
1
);
len
=
strlen
(
(
const
char
*
)
path
);
state
->
path
=
(
char
*
)
malloc
(
len
+
1
);
if
(
state
->
path
==
NULL
)
{
free
(
state
);
return
NULL
;
...
...
@@ -242,7 +242,7 @@ local gzFile gz_open(path, fd, mode)
#ifdef _WIN32
fd
==
-
2
?
_wopen
(
path
,
oflag
,
0666
)
:
#endif
open
(
path
,
oflag
,
0666
));
open
(
(
const
char
*
)
path
,
oflag
,
0666
));
if
(
state
->
fd
==
-
1
)
{
free
(
state
->
path
);
free
(
state
);
...
...
@@ -288,7 +288,7 @@ gzFile ZEXPORT gzdopen(fd, mode)
char
*
path
;
/* identifier for error messages */
gzFile
gz
;
if
(
fd
==
-
1
||
(
path
=
malloc
(
7
+
3
*
sizeof
(
int
)))
==
NULL
)
if
(
fd
==
-
1
||
(
path
=
(
char
*
)
malloc
(
7
+
3
*
sizeof
(
int
)))
==
NULL
)
return
NULL
;
#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
snprintf
(
path
,
7
+
3
*
sizeof
(
int
),
"<fd:%d>"
,
fd
);
/* for debugging */
...
...
@@ -598,7 +598,8 @@ void ZLIB_INTERNAL gz_error(state, err, msg)
return
;
/* construct error message with path */
if
((
state
->
msg
=
malloc
(
strlen
(
state
->
path
)
+
strlen
(
msg
)
+
3
))
==
NULL
)
{
if
((
state
->
msg
=
(
char
*
)
malloc
(
strlen
(
state
->
path
)
+
strlen
(
msg
)
+
3
))
==
NULL
)
{
state
->
err
=
Z_MEM_ERROR
;
return
;
}
...
...
gzread.c
浏览文件 @
e9f0b784
...
...
@@ -91,8 +91,8 @@ local int gz_look(state)
/* allocate read buffers and inflate memory */
if
(
state
->
size
==
0
)
{
/* allocate buffers */
state
->
in
=
malloc
(
state
->
want
);
state
->
out
=
malloc
(
state
->
want
<<
1
);
state
->
in
=
(
unsigned
char
*
)
malloc
(
state
->
want
);
state
->
out
=
(
unsigned
char
*
)
malloc
(
state
->
want
<<
1
);
if
(
state
->
in
==
NULL
||
state
->
out
==
NULL
)
{
if
(
state
->
out
!=
NULL
)
free
(
state
->
out
);
...
...
@@ -353,14 +353,14 @@ int ZEXPORT gzread(file, buf, len)
/* large len -- read directly into user buffer */
else
if
(
state
->
how
==
COPY
)
{
/* read directly */
if
(
gz_load
(
state
,
buf
,
len
,
&
n
)
==
-
1
)
if
(
gz_load
(
state
,
(
unsigned
char
*
)
buf
,
len
,
&
n
)
==
-
1
)
return
-
1
;
}
/* large len -- decompress directly into user buffer */
else
{
/* state->how == GZIP */
strm
->
avail_out
=
len
;
strm
->
next_out
=
buf
;
strm
->
next_out
=
(
unsigned
char
*
)
buf
;
if
(
gz_decomp
(
state
)
==
-
1
)
return
-
1
;
n
=
state
->
x
.
have
;
...
...
@@ -523,7 +523,7 @@ char * ZEXPORT gzgets(file, buf, len)
/* look for end-of-line in current output buffer */
n
=
state
->
x
.
have
>
left
?
left
:
state
->
x
.
have
;
eol
=
memchr
(
state
->
x
.
next
,
'\n'
,
n
);
eol
=
(
unsigned
char
*
)
memchr
(
state
->
x
.
next
,
'\n'
,
n
);
if
(
eol
!=
NULL
)
n
=
(
unsigned
)(
eol
-
state
->
x
.
next
)
+
1
;
...
...
gzwrite.c
浏览文件 @
e9f0b784
...
...
@@ -19,7 +19,7 @@ local int gz_init(state)
z_streamp
strm
=
&
(
state
->
strm
);
/* allocate input buffer */
state
->
in
=
malloc
(
state
->
want
);
state
->
in
=
(
unsigned
char
*
)
malloc
(
state
->
want
);
if
(
state
->
in
==
NULL
)
{
gz_error
(
state
,
Z_MEM_ERROR
,
"out of memory"
);
return
-
1
;
...
...
@@ -28,7 +28,7 @@ local int gz_init(state)
/* only need output buffer and deflate state if compressing */
if
(
!
state
->
direct
)
{
/* allocate output buffer */
state
->
out
=
malloc
(
state
->
want
);
state
->
out
=
(
unsigned
char
*
)
malloc
(
state
->
want
);
if
(
state
->
out
==
NULL
)
{
free
(
state
->
in
);
gz_error
(
state
,
Z_MEM_ERROR
,
"out of memory"
);
...
...
zconf.h
浏览文件 @
e9f0b784
...
...
@@ -218,7 +218,7 @@
# endif
#endif
#if
defined(ZLIB_CONST
) && !defined(z_const)
#if
( defined(ZLIB_CONST) || defined(__cplusplus)
) && !defined(z_const)
# define z_const const
#else
# define z_const
...
...
zconf.h.cmakein
浏览文件 @
e9f0b784
...
...
@@ -220,7 +220,7 @@
# endif
#endif
#if
defined(ZLIB_CONST
) && !defined(z_const)
#if
( defined(ZLIB_CONST) || defined(__cplusplus)
) && !defined(z_const)
# define z_const const
#else
# define z_const
...
...
zconf.h.in
浏览文件 @
e9f0b784
...
...
@@ -218,7 +218,7 @@
# endif
#endif
#if
defined(ZLIB_CONST
) && !defined(z_const)
#if
( defined(ZLIB_CONST) || defined(__cplusplus)
) && !defined(z_const)
# define z_const const
#else
# define z_const
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录