Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
ab09223a
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ab09223a
编写于
11月 19, 2010
作者:
S
sherman
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6989471: compiler warnings building java/zip native code
Summary: remvoed the warning Reviewed-by: ohair, alanb
上级
9b0bcd1b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
10 deletion
+19
-10
src/share/native/java/util/zip/zip_util.c
src/share/native/java/util/zip/zip_util.c
+17
-8
src/share/native/java/util/zip/zlib-1.2.3/compress.c
src/share/native/java/util/zip/zlib-1.2.3/compress.c
+1
-1
src/share/native/java/util/zip/zlib-1.2.3/uncompr.c
src/share/native/java/util/zip/zlib-1.2.3/uncompr.c
+1
-1
未找到文件。
src/share/native/java/util/zip/zip_util.c
浏览文件 @
ab09223a
...
@@ -314,7 +314,7 @@ findEND(jzfile *zip, void *endbuf)
...
@@ -314,7 +314,7 @@ findEND(jzfile *zip, void *endbuf)
if
(
pos
<
0
)
{
if
(
pos
<
0
)
{
/* Pretend there are some NUL bytes before start of file */
/* Pretend there are some NUL bytes before start of file */
off
=
-
pos
;
off
=
-
pos
;
memset
(
buf
,
'\0'
,
off
);
memset
(
buf
,
'\0'
,
(
size_t
)
off
);
}
}
if
(
readFullyAt
(
zfd
,
buf
+
off
,
sizeof
(
buf
)
-
off
,
if
(
readFullyAt
(
zfd
,
buf
+
off
,
sizeof
(
buf
)
-
off
,
...
@@ -426,7 +426,7 @@ static int
...
@@ -426,7 +426,7 @@ static int
isMetaName
(
const
char
*
name
,
int
length
)
isMetaName
(
const
char
*
name
,
int
length
)
{
{
const
char
*
s
;
const
char
*
s
;
if
(
length
<
sizeof
(
"META-INF/"
)
-
1
)
if
(
length
<
(
int
)
sizeof
(
"META-INF/"
)
-
1
)
return
0
;
return
0
;
for
(
s
=
"META-INF/"
;
*
s
!=
'\0'
;
s
++
)
{
for
(
s
=
"META-INF/"
;
*
s
!=
'\0'
;
s
++
)
{
char
c
=
*
name
++
;
char
c
=
*
name
++
;
...
@@ -912,7 +912,7 @@ readCENHeader(jzfile *zip, jlong cenpos, jint bufsize)
...
@@ -912,7 +912,7 @@ readCENHeader(jzfile *zip, jlong cenpos, jint bufsize)
ZFILE
zfd
=
zip
->
zfd
;
ZFILE
zfd
=
zip
->
zfd
;
char
*
cen
;
char
*
cen
;
if
(
bufsize
>
zip
->
len
-
cenpos
)
if
(
bufsize
>
zip
->
len
-
cenpos
)
bufsize
=
zip
->
len
-
cenpos
;
bufsize
=
(
jint
)(
zip
->
len
-
cenpos
)
;
if
((
cen
=
malloc
(
bufsize
))
==
NULL
)
goto
Catch
;
if
((
cen
=
malloc
(
bufsize
))
==
NULL
)
goto
Catch
;
if
(
readFullyAt
(
zfd
,
cen
,
bufsize
,
cenpos
)
==
-
1
)
goto
Catch
;
if
(
readFullyAt
(
zfd
,
cen
,
bufsize
,
cenpos
)
==
-
1
)
goto
Catch
;
censize
=
CENSIZE
(
cen
);
censize
=
CENSIZE
(
cen
);
...
@@ -1256,6 +1256,9 @@ ZIP_GetEntryDataOffset(jzfile *zip, jzentry *entry)
...
@@ -1256,6 +1256,9 @@ ZIP_GetEntryDataOffset(jzfile *zip, jzentry *entry)
* file had been previously locked with ZIP_Lock(). Returns the
* file had been previously locked with ZIP_Lock(). Returns the
* number of bytes read, or -1 if an error occurred. If zip->msg != 0
* number of bytes read, or -1 if an error occurred. If zip->msg != 0
* then a zip error occurred and zip->msg contains the error text.
* then a zip error occurred and zip->msg contains the error text.
*
* The current implementation does not support reading an entry that
* has the size bigger than 2**32 bytes in ONE invocation.
*/
*/
jint
jint
ZIP_Read
(
jzfile
*
zip
,
jzentry
*
entry
,
jlong
pos
,
void
*
buf
,
jint
len
)
ZIP_Read
(
jzfile
*
zip
,
jzentry
*
entry
,
jlong
pos
,
void
*
buf
,
jint
len
)
...
@@ -1276,7 +1279,7 @@ ZIP_Read(jzfile *zip, jzentry *entry, jlong pos, void *buf, jint len)
...
@@ -1276,7 +1279,7 @@ ZIP_Read(jzfile *zip, jzentry *entry, jlong pos, void *buf, jint len)
if
(
len
<=
0
)
if
(
len
<=
0
)
return
0
;
return
0
;
if
(
len
>
entry_size
-
pos
)
if
(
len
>
entry_size
-
pos
)
len
=
entry_size
-
pos
;
len
=
(
jint
)(
entry_size
-
pos
)
;
/* Get file offset to start reading data */
/* Get file offset to start reading data */
start
=
ZIP_GetEntryDataOffset
(
zip
,
entry
);
start
=
ZIP_GetEntryDataOffset
(
zip
,
entry
);
...
@@ -1306,6 +1309,9 @@ ZIP_Read(jzfile *zip, jzentry *entry, jlong pos, void *buf, jint len)
...
@@ -1306,6 +1309,9 @@ ZIP_Read(jzfile *zip, jzentry *entry, jlong pos, void *buf, jint len)
* from ZIP/JAR files specified in the class path. It is defined here
* from ZIP/JAR files specified in the class path. It is defined here
* so that it can be dynamically loaded by the runtime if the zip library
* so that it can be dynamically loaded by the runtime if the zip library
* is found.
* is found.
*
* The current implementation does not support reading an entry that
* has the size bigger than 2**32 bytes in ONE invocation.
*/
*/
jboolean
jboolean
InflateFully
(
jzfile
*
zip
,
jzentry
*
entry
,
void
*
buf
,
char
**
msg
)
InflateFully
(
jzfile
*
zip
,
jzentry
*
entry
,
void
*
buf
,
char
**
msg
)
...
@@ -1314,7 +1320,6 @@ InflateFully(jzfile *zip, jzentry *entry, void *buf, char **msg)
...
@@ -1314,7 +1320,6 @@ InflateFully(jzfile *zip, jzentry *entry, void *buf, char **msg)
char
tmp
[
BUF_SIZE
];
char
tmp
[
BUF_SIZE
];
jlong
pos
=
0
;
jlong
pos
=
0
;
jlong
count
=
entry
->
csize
;
jlong
count
=
entry
->
csize
;
jboolean
status
;
*
msg
=
0
;
/* Reset error message */
*
msg
=
0
;
/* Reset error message */
...
@@ -1330,10 +1335,10 @@ InflateFully(jzfile *zip, jzentry *entry, void *buf, char **msg)
...
@@ -1330,10 +1335,10 @@ InflateFully(jzfile *zip, jzentry *entry, void *buf, char **msg)
}
}
strm
.
next_out
=
buf
;
strm
.
next_out
=
buf
;
strm
.
avail_out
=
entry
->
size
;
strm
.
avail_out
=
(
uInt
)
entry
->
size
;
while
(
count
>
0
)
{
while
(
count
>
0
)
{
jint
n
=
count
>
(
jlong
)
sizeof
(
tmp
)
?
(
jint
)
sizeof
(
tmp
)
:
count
;
jint
n
=
count
>
(
jlong
)
sizeof
(
tmp
)
?
(
jint
)
sizeof
(
tmp
)
:
(
jint
)
count
;
ZIP_Lock
(
zip
);
ZIP_Lock
(
zip
);
n
=
ZIP_Read
(
zip
,
entry
,
pos
,
tmp
,
n
);
n
=
ZIP_Read
(
zip
,
entry
,
pos
,
tmp
,
n
);
ZIP_Unlock
(
zip
);
ZIP_Unlock
(
zip
);
...
@@ -1368,12 +1373,16 @@ InflateFully(jzfile *zip, jzentry *entry, void *buf, char **msg)
...
@@ -1368,12 +1373,16 @@ InflateFully(jzfile *zip, jzentry *entry, void *buf, char **msg)
return
JNI_TRUE
;
return
JNI_TRUE
;
}
}
/*
* The current implementation does not support reading an entry that
* has the size bigger than 2**32 bytes in ONE invocation.
*/
jzentry
*
JNICALL
jzentry
*
JNICALL
ZIP_FindEntry
(
jzfile
*
zip
,
char
*
name
,
jint
*
sizeP
,
jint
*
nameLenP
)
ZIP_FindEntry
(
jzfile
*
zip
,
char
*
name
,
jint
*
sizeP
,
jint
*
nameLenP
)
{
{
jzentry
*
entry
=
ZIP_GetEntry
(
zip
,
name
,
0
);
jzentry
*
entry
=
ZIP_GetEntry
(
zip
,
name
,
0
);
if
(
entry
)
{
if
(
entry
)
{
*
sizeP
=
entry
->
size
;
*
sizeP
=
(
jint
)
entry
->
size
;
*
nameLenP
=
strlen
(
entry
->
name
);
*
nameLenP
=
strlen
(
entry
->
name
);
}
}
return
entry
;
return
entry
;
...
...
src/share/native/java/util/zip/zlib-1.2.3/compress.c
浏览文件 @
ab09223a
...
@@ -75,7 +75,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
...
@@ -75,7 +75,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
deflateEnd
(
&
stream
);
deflateEnd
(
&
stream
);
return
err
==
Z_OK
?
Z_BUF_ERROR
:
err
;
return
err
==
Z_OK
?
Z_BUF_ERROR
:
err
;
}
}
*
destLen
=
stream
.
total_out
;
*
destLen
=
(
uLong
)
stream
.
total_out
;
err
=
deflateEnd
(
&
stream
);
err
=
deflateEnd
(
&
stream
);
return
err
;
return
err
;
...
...
src/share/native/java/util/zip/zlib-1.2.3/uncompr.c
浏览文件 @
ab09223a
...
@@ -78,7 +78,7 @@ int ZEXPORT uncompress (dest, destLen, source, sourceLen)
...
@@ -78,7 +78,7 @@ int ZEXPORT uncompress (dest, destLen, source, sourceLen)
return
Z_DATA_ERROR
;
return
Z_DATA_ERROR
;
return
err
;
return
err
;
}
}
*
destLen
=
stream
.
total_out
;
*
destLen
=
(
uLong
)
stream
.
total_out
;
err
=
inflateEnd
(
&
stream
);
err
=
inflateEnd
(
&
stream
);
return
err
;
return
err
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录