Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
3e7e23be
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看板
提交
3e7e23be
编写于
11月 30, 2011
作者:
A
alanb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7030624: size_t usages in src/windows/native/java/io/io_util_md.c need to be re-visited
Reviewed-by: lancea, chegar
上级
039d858a
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
15 addition
and
15 deletion
+15
-15
src/share/native/java/io/io_util.c
src/share/native/java/io/io_util.c
+6
-6
src/windows/native/java/io/io_util_md.c
src/windows/native/java/io/io_util_md.c
+6
-6
src/windows/native/java/io/io_util_md.h
src/windows/native/java/io/io_util_md.h
+3
-3
未找到文件。
src/share/native/java/io/io_util.c
浏览文件 @
3e7e23be
...
...
@@ -44,7 +44,7 @@ readSingle(JNIEnv *env, jobject this, jfieldID fid) {
JNU_ThrowIOException
(
env
,
"Stream Closed"
);
return
-
1
;
}
nread
=
(
jint
)
IO_Read
(
fd
,
&
ret
,
1
);
nread
=
IO_Read
(
fd
,
&
ret
,
1
);
if
(
nread
==
0
)
{
/* EOF */
return
-
1
;
}
else
if
(
nread
==
JVM_IO_ERR
)
{
/* error */
...
...
@@ -108,7 +108,7 @@ readBytes(JNIEnv *env, jobject this, jbyteArray bytes,
JNU_ThrowIOException
(
env
,
"Stream Closed"
);
nread
=
-
1
;
}
else
{
nread
=
(
jint
)
IO_Read
(
fd
,
buf
,
len
);
nread
=
IO_Read
(
fd
,
buf
,
len
);
if
(
nread
>
0
)
{
(
*
env
)
->
SetByteArrayRegion
(
env
,
bytes
,
off
,
nread
,
(
jbyte
*
)
buf
);
}
else
if
(
nread
==
JVM_IO_ERR
)
{
...
...
@@ -137,9 +137,9 @@ writeSingle(JNIEnv *env, jobject this, jint byte, jboolean append, jfieldID fid)
return
;
}
if
(
append
==
JNI_TRUE
)
{
n
=
(
jint
)
IO_Append
(
fd
,
&
c
,
1
);
n
=
IO_Append
(
fd
,
&
c
,
1
);
}
else
{
n
=
(
jint
)
IO_Write
(
fd
,
&
c
,
1
);
n
=
IO_Write
(
fd
,
&
c
,
1
);
}
if
(
n
==
JVM_IO_ERR
)
{
JNU_ThrowIOExceptionWithLastError
(
env
,
"Write error"
);
...
...
@@ -190,9 +190,9 @@ writeBytes(JNIEnv *env, jobject this, jbyteArray bytes,
break
;
}
if
(
append
==
JNI_TRUE
)
{
n
=
(
jint
)
IO_Append
(
fd
,
buf
+
off
,
len
);
n
=
IO_Append
(
fd
,
buf
+
off
,
len
);
}
else
{
n
=
(
jint
)
IO_Write
(
fd
,
buf
+
off
,
len
);
n
=
IO_Write
(
fd
,
buf
+
off
,
len
);
}
if
(
n
==
JVM_IO_ERR
)
{
JNU_ThrowIOExceptionWithLastError
(
env
,
"Write error"
);
...
...
src/windows/native/java/io/io_util_md.c
浏览文件 @
3e7e23be
...
...
@@ -478,7 +478,7 @@ handleSetLength(jlong fd, jlong length) {
}
JNIEXPORT
size_
t
jin
t
handleRead
(
jlong
fd
,
void
*
buf
,
jint
len
)
{
DWORD
read
=
0
;
...
...
@@ -499,10 +499,10 @@ handleRead(jlong fd, void *buf, jint len)
}
return
-
1
;
}
return
read
;
return
(
jint
)
read
;
}
static
size_
t
writeInternal
(
jlong
fd
,
const
void
*
buf
,
jint
len
,
jboolean
append
)
static
jin
t
writeInternal
(
jlong
fd
,
const
void
*
buf
,
jint
len
,
jboolean
append
)
{
BOOL
result
=
0
;
DWORD
written
=
0
;
...
...
@@ -527,16 +527,16 @@ static size_t writeInternal(jlong fd, const void *buf, jint len, jboolean append
if
((
h
==
INVALID_HANDLE_VALUE
)
||
(
result
==
0
))
{
return
-
1
;
}
return
(
size_
t
)
written
;
return
(
jin
t
)
written
;
}
JNIEXPORT
size_
t
handleWrite
(
jlong
fd
,
const
void
*
buf
,
jint
len
)
{
jin
t
handleWrite
(
jlong
fd
,
const
void
*
buf
,
jint
len
)
{
return
writeInternal
(
fd
,
buf
,
len
,
JNI_FALSE
);
}
JNIEXPORT
size_
t
handleAppend
(
jlong
fd
,
const
void
*
buf
,
jint
len
)
{
jin
t
handleAppend
(
jlong
fd
,
const
void
*
buf
,
jint
len
)
{
return
writeInternal
(
fd
,
buf
,
len
,
JNI_TRUE
);
}
...
...
src/windows/native/java/io/io_util_md.h
浏览文件 @
3e7e23be
...
...
@@ -39,9 +39,9 @@ void fileOpen(JNIEnv *env, jobject this, jstring path, jfieldID fid, int flags);
int
handleAvailable
(
jlong
fd
,
jlong
*
pbytes
);
JNIEXPORT
int
handleSync
(
jlong
fd
);
int
handleSetLength
(
jlong
fd
,
jlong
length
);
JNIEXPORT
size_
t
handleRead
(
jlong
fd
,
void
*
buf
,
jint
len
);
JNIEXPORT
size_
t
handleWrite
(
jlong
fd
,
const
void
*
buf
,
jint
len
);
JNIEXPORT
size_
t
handleAppend
(
jlong
fd
,
const
void
*
buf
,
jint
len
);
JNIEXPORT
jin
t
handleRead
(
jlong
fd
,
void
*
buf
,
jint
len
);
JNIEXPORT
jin
t
handleWrite
(
jlong
fd
,
const
void
*
buf
,
jint
len
);
JNIEXPORT
jin
t
handleAppend
(
jlong
fd
,
const
void
*
buf
,
jint
len
);
jint
handleClose
(
JNIEnv
*
env
,
jobject
this
,
jfieldID
fid
);
jlong
handleLseek
(
jlong
fd
,
jlong
offset
,
jint
whence
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录