Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
c2c33eef
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看板
提交
c2c33eef
编写于
2月 07, 2011
作者:
A
alanb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7017454: Residual warnings in sun/nio/** and java/io native code (win64)
Reviewed-by: chegar
上级
5f9cb587
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
32 addition
and
30 deletion
+32
-30
src/share/native/java/io/io_util.c
src/share/native/java/io/io_util.c
+6
-6
src/windows/native/java/io/WinNTFileSystem_md.c
src/windows/native/java/io/WinNTFileSystem_md.c
+10
-10
src/windows/native/java/io/canonicalize_md.c
src/windows/native/java/io/canonicalize_md.c
+2
-2
src/windows/native/java/io/io_util_md.c
src/windows/native/java/io/io_util_md.c
+3
-3
src/windows/native/sun/nio/ch/Iocp.c
src/windows/native/sun/nio/ch/Iocp.c
+3
-2
src/windows/native/sun/nio/fs/RegistryFileTypeDetector.c
src/windows/native/sun/nio/fs/RegistryFileTypeDetector.c
+1
-1
src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c
src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c
+7
-6
未找到文件。
src/share/native/java/io/io_util.c
浏览文件 @
c2c33eef
...
...
@@ -44,7 +44,7 @@ readSingle(JNIEnv *env, jobject this, jfieldID fid) {
JNU_ThrowIOException
(
env
,
"Stream Closed"
);
return
-
1
;
}
nread
=
IO_Read
(
fd
,
&
ret
,
1
);
nread
=
(
jint
)
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
=
IO_Read
(
fd
,
buf
,
len
);
nread
=
(
jint
)
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
=
IO_Append
(
fd
,
&
c
,
1
);
n
=
(
jint
)
IO_Append
(
fd
,
&
c
,
1
);
}
else
{
n
=
IO_Write
(
fd
,
&
c
,
1
);
n
=
(
jint
)
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
=
IO_Append
(
fd
,
buf
+
off
,
len
);
n
=
(
jint
)
IO_Append
(
fd
,
buf
+
off
,
len
);
}
else
{
n
=
IO_Write
(
fd
,
buf
+
off
,
len
);
n
=
(
jint
)
IO_Write
(
fd
,
buf
+
off
,
len
);
}
if
(
n
==
JVM_IO_ERR
)
{
JNU_ThrowIOExceptionWithLastError
(
env
,
"Write error"
);
...
...
src/windows/native/java/io/WinNTFileSystem_md.c
浏览文件 @
c2c33eef
...
...
@@ -220,19 +220,19 @@ Java_java_io_WinNTFileSystem_canonicalize0(JNIEnv *env, jobject this,
/*we estimate the max length of memory needed as
"currentDir. length + pathname.length"
*/
int
len
=
wcslen
(
path
);
int
len
=
(
int
)
wcslen
(
path
);
len
+=
currentDirLength
(
path
,
len
);
if
(
len
>
MAX_PATH_LENGTH
-
1
)
{
WCHAR
*
cp
=
(
WCHAR
*
)
malloc
(
len
*
sizeof
(
WCHAR
));
if
(
cp
!=
NULL
)
{
if
(
wcanonicalize
(
path
,
cp
,
len
)
>=
0
)
{
rv
=
(
*
env
)
->
NewString
(
env
,
cp
,
wcslen
(
cp
));
rv
=
(
*
env
)
->
NewString
(
env
,
cp
,
(
jsize
)
wcslen
(
cp
));
}
free
(
cp
);
}
}
else
if
(
wcanonicalize
(
path
,
canonicalPath
,
MAX_PATH_LENGTH
)
>=
0
)
{
rv
=
(
*
env
)
->
NewString
(
env
,
canonicalPath
,
wcslen
(
canonicalPath
));
rv
=
(
*
env
)
->
NewString
(
env
,
canonicalPath
,
(
jsize
)
wcslen
(
canonicalPath
));
}
}
END_UNICODE_STRING
(
env
,
path
);
if
(
rv
==
NULL
)
{
...
...
@@ -251,14 +251,14 @@ Java_java_io_WinNTFileSystem_canonicalizeWithPrefix0(JNIEnv *env, jobject this,
WCHAR
canonicalPath
[
MAX_PATH_LENGTH
];
WITH_UNICODE_STRING
(
env
,
canonicalPrefixString
,
canonicalPrefix
)
{
WITH_UNICODE_STRING
(
env
,
pathWithCanonicalPrefixString
,
pathWithCanonicalPrefix
)
{
int
len
=
wcslen
(
canonicalPrefix
)
+
MAX_PATH
;
int
len
=
(
int
)
wcslen
(
canonicalPrefix
)
+
MAX_PATH
;
if
(
len
>
MAX_PATH_LENGTH
)
{
WCHAR
*
cp
=
(
WCHAR
*
)
malloc
(
len
*
sizeof
(
WCHAR
));
if
(
cp
!=
NULL
)
{
if
(
wcanonicalizeWithPrefix
(
canonicalPrefix
,
pathWithCanonicalPrefix
,
cp
,
len
)
>=
0
)
{
rv
=
(
*
env
)
->
NewString
(
env
,
cp
,
wcslen
(
cp
));
rv
=
(
*
env
)
->
NewString
(
env
,
cp
,
(
jsize
)
wcslen
(
cp
));
}
free
(
cp
);
}
...
...
@@ -266,7 +266,7 @@ Java_java_io_WinNTFileSystem_canonicalizeWithPrefix0(JNIEnv *env, jobject this,
if
(
wcanonicalizeWithPrefix
(
canonicalPrefix
,
pathWithCanonicalPrefix
,
canonicalPath
,
MAX_PATH_LENGTH
)
>=
0
)
{
rv
=
(
*
env
)
->
NewString
(
env
,
canonicalPath
,
wcslen
(
canonicalPath
));
rv
=
(
*
env
)
->
NewString
(
env
,
canonicalPath
,
(
jsize
)
wcslen
(
canonicalPath
));
}
}
END_UNICODE_STRING
(
env
,
pathWithCanonicalPrefix
);
}
END_UNICODE_STRING
(
env
,
canonicalPrefix
);
...
...
@@ -358,7 +358,7 @@ Java_java_io_WinNTFileSystem_getBooleanAttributes(JNIEnv *env, jobject this,
}
else
{
/* pagefile.sys is a special case */
if
(
GetLastError
()
==
ERROR_SHARING_VIOLATION
)
{
rv
=
java_io_FileSystem_BA_EXISTS
;
if
((
pathlen
=
wcslen
(
pathbuf
))
>=
SPECIALFILE_NAMELEN
&&
if
((
pathlen
=
(
jint
)
wcslen
(
pathbuf
))
>=
SPECIALFILE_NAMELEN
&&
(
_wcsicmp
(
pathbuf
+
pathlen
-
SPECIALFILE_NAMELEN
,
L"pagefile.sys"
)
==
0
)
||
(
_wcsicmp
(
pathbuf
+
pathlen
-
SPECIALFILE_NAMELEN
,
...
...
@@ -625,7 +625,7 @@ Java_java_io_WinNTFileSystem_list(JNIEnv *env, jobject this, jobject file)
}
/* Remove trailing space chars from directory name */
len
=
wcslen
(
search_path
);
len
=
(
int
)
wcslen
(
search_path
);
while
(
search_path
[
len
-
1
]
==
' '
)
{
len
--
;
}
...
...
@@ -668,7 +668,7 @@ Java_java_io_WinNTFileSystem_list(JNIEnv *env, jobject this, jobject file)
||
!
wcscmp
(
find_data
.
cFileName
,
L".."
))
continue
;
name
=
(
*
env
)
->
NewString
(
env
,
find_data
.
cFileName
,
wcslen
(
find_data
.
cFileName
));
(
jsize
)
wcslen
(
find_data
.
cFileName
));
if
(
name
==
NULL
)
return
NULL
;
// error;
if
(
len
==
maxlen
)
{
...
...
@@ -819,7 +819,7 @@ Java_java_io_WinNTFileSystem_getDriveDirectory(JNIEnv *env, jobject this,
jchar
*
pf
=
p
;
if
(
p
==
NULL
)
return
NULL
;
if
(
iswalpha
(
*
p
)
&&
(
p
[
1
]
==
L':'
))
p
+=
2
;
ret
=
(
*
env
)
->
NewString
(
env
,
p
,
wcslen
(
p
));
ret
=
(
*
env
)
->
NewString
(
env
,
p
,
(
jsize
)
wcslen
(
p
));
free
(
pf
);
return
ret
;
}
...
...
src/windows/native/java/io/canonicalize_md.c
浏览文件 @
c2c33eef
...
...
@@ -479,7 +479,7 @@ wcanonicalize(WCHAR *orig_path, WCHAR *result, int size)
assert
(
*
src
==
L'\\'
);
/* Invariant */
*
p
=
L'\0'
;
/* Temporarily clear separator */
if
((
pathlen
=
wcslen
(
path
))
>
MAX_PATH
-
1
)
{
if
((
pathlen
=
(
int
)
wcslen
(
path
))
>
MAX_PATH
-
1
)
{
pathbuf
=
getPrefixed
(
path
,
pathlen
);
h
=
FindFirstFileW
(
pathbuf
,
&
fd
);
/* Look up prefix */
free
(
pathbuf
);
...
...
@@ -538,7 +538,7 @@ wcanonicalizeWithPrefix(WCHAR *canonicalPrefix, WCHAR *pathWithCanonicalPrefix,
dend
=
dst
+
size
;
/* Don't go to or past here */
if
((
pathlen
=
wcslen
(
pathWithCanonicalPrefix
))
>
MAX_PATH
-
1
)
{
if
((
pathlen
=
(
int
)
wcslen
(
pathWithCanonicalPrefix
))
>
MAX_PATH
-
1
)
{
pathbuf
=
getPrefixed
(
pathWithCanonicalPrefix
,
pathlen
);
h
=
FindFirstFileW
(
pathbuf
,
&
fd
);
/* Look up prefix */
free
(
pathbuf
);
...
...
src/windows/native/java/io/io_util_md.c
浏览文件 @
c2c33eef
...
...
@@ -104,7 +104,7 @@ currentDirLength(const WCHAR* ps, int pathlen) {
else
return
0
;
/* invalid drive name. */
dir
=
currentDir
(
di
);
if
(
dir
!=
NULL
){
dirlen
=
wcslen
(
dir
);
dirlen
=
(
int
)
wcslen
(
dir
);
free
(
dir
);
}
return
dirlen
;
...
...
@@ -115,7 +115,7 @@ currentDirLength(const WCHAR* ps, int pathlen) {
int
dirlen
=
-
1
;
dir
=
_wgetcwd
(
NULL
,
MAX_PATH
);
if
(
dir
!=
NULL
)
{
curDirLenCached
=
wcslen
(
dir
);
curDirLenCached
=
(
int
)
wcslen
(
dir
);
free
(
dir
);
}
}
...
...
@@ -165,7 +165,7 @@ pathToNTPath(JNIEnv *env, jstring path, jboolean throwFNFE) {
int
max_path
=
248
;
/* CreateDirectoryW() has the limit of 248 */
WITH_UNICODE_STRING
(
env
,
path
,
ps
)
{
pathlen
=
wcslen
(
ps
);
pathlen
=
(
int
)
wcslen
(
ps
);
if
(
pathlen
!=
0
)
{
if
(
pathlen
>
2
&&
(
ps
[
0
]
==
L'\\'
&&
ps
[
1
]
==
L'\\'
||
//UNC
...
...
src/windows/native/sun/nio/ch/Iocp.c
浏览文件 @
c2c33eef
...
...
@@ -72,9 +72,10 @@ JNIEXPORT jlong JNICALL
Java_sun_nio_ch_Iocp_createIoCompletionPort
(
JNIEnv
*
env
,
jclass
this
,
jlong
handle
,
jlong
existingPort
,
jint
completionKey
,
jint
concurrency
)
{
ULONG_PTR
ck
=
completionKey
;
HANDLE
port
=
CreateIoCompletionPort
((
HANDLE
)
jlong_to_ptr
(
handle
),
(
HANDLE
)
jlong_to_ptr
(
existingPort
),
(
DWORD
)
completionKey
,
ck
,
(
DWORD
)
concurrency
);
if
(
port
==
NULL
)
{
JNU_ThrowIOExceptionWithLastError
(
env
,
"CreateIoCompletionPort failed"
);
...
...
@@ -96,7 +97,7 @@ Java_sun_nio_ch_Iocp_getQueuedCompletionStatus(JNIEnv* env, jclass this,
jlong
completionPort
,
jobject
obj
)
{
DWORD
bytesTransferred
;
DWORD
completionKey
;
ULONG_PTR
completionKey
;
OVERLAPPED
*
lpOverlapped
;
BOOL
res
;
...
...
src/windows/native/sun/nio/fs/RegistryFileTypeDetector.c
浏览文件 @
c2c33eef
...
...
@@ -51,7 +51,7 @@ Java_sun_nio_fs_RegistryFileTypeDetector_queryStringValue(JNIEnv* env, jclass th
res
=
RegQueryValueExW
(
hKey
,
lpValueName
,
NULL
,
&
type
,
(
LPBYTE
)
&
data
,
&
size
);
if
(
res
==
ERROR_SUCCESS
)
{
if
(
type
==
REG_SZ
)
{
jsize
len
=
wcslen
((
WCHAR
*
)
data
);
jsize
len
=
(
jsize
)
wcslen
((
WCHAR
*
)
data
);
result
=
(
*
env
)
->
NewString
(
env
,
(
const
jchar
*
)
&
data
,
len
);
}
}
...
...
src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c
浏览文件 @
c2c33eef
...
...
@@ -368,7 +368,7 @@ Java_sun_nio_fs_WindowsNativeDispatcher_FindFirstFile0(JNIEnv* env, jclass this,
HANDLE
handle
=
FindFirstFileW
(
lpFileName
,
&
data
);
if
(
handle
!=
INVALID_HANDLE_VALUE
)
{
jstring
name
=
(
*
env
)
->
NewString
(
env
,
data
.
cFileName
,
wcslen
(
data
.
cFileName
));
jstring
name
=
(
*
env
)
->
NewString
(
env
,
data
.
cFileName
,
(
jsize
)
wcslen
(
data
.
cFileName
));
if
(
name
==
NULL
)
return
;
(
*
env
)
->
SetLongField
(
env
,
obj
,
findFirst_handle
,
ptr_to_jlong
(
handle
));
...
...
@@ -401,7 +401,7 @@ Java_sun_nio_fs_WindowsNativeDispatcher_FindNextFile(JNIEnv* env, jclass this,
WIN32_FIND_DATAW
*
data
=
(
WIN32_FIND_DATAW
*
)
jlong_to_ptr
(
dataAddress
);
if
(
FindNextFileW
(
h
,
data
)
!=
0
)
{
return
(
*
env
)
->
NewString
(
env
,
data
->
cFileName
,
wcslen
(
data
->
cFileName
));
return
(
*
env
)
->
NewString
(
env
,
data
->
cFileName
,
(
jsize
)
wcslen
(
data
->
cFileName
));
}
else
{
if
(
GetLastError
()
!=
ERROR_NO_MORE_FILES
)
throwWindowsException
(
env
,
GetLastError
());
...
...
@@ -424,7 +424,7 @@ Java_sun_nio_fs_WindowsNativeDispatcher_FindFirstStream0(JNIEnv* env, jclass thi
handle
=
(
*
FindFirstStream_func
)(
lpFileName
,
FindStreamInfoStandard
,
&
data
,
0
);
if
(
handle
!=
INVALID_HANDLE_VALUE
)
{
jstring
name
=
(
*
env
)
->
NewString
(
env
,
data
.
cStreamName
,
wcslen
(
data
.
cStreamName
));
jstring
name
=
(
*
env
)
->
NewString
(
env
,
data
.
cStreamName
,
(
jsize
)
wcslen
(
data
.
cStreamName
));
if
(
name
==
NULL
)
return
;
(
*
env
)
->
SetLongField
(
env
,
obj
,
findStream_handle
,
ptr_to_jlong
(
handle
));
...
...
@@ -452,7 +452,7 @@ Java_sun_nio_fs_WindowsNativeDispatcher_FindNextStream(JNIEnv* env, jclass this,
}
if
((
*
FindNextStream_func
)(
h
,
&
data
)
!=
0
)
{
return
(
*
env
)
->
NewString
(
env
,
data
.
cStreamName
,
wcslen
(
data
.
cStreamName
));
return
(
*
env
)
->
NewString
(
env
,
data
.
cStreamName
,
(
jsize
)
wcslen
(
data
.
cStreamName
));
}
else
{
if
(
GetLastError
()
!=
ERROR_HANDLE_EOF
)
throwWindowsException
(
env
,
GetLastError
());
...
...
@@ -1224,9 +1224,10 @@ JNIEXPORT jlong JNICALL
Java_sun_nio_fs_WindowsNativeDispatcher_CreateIoCompletionPort
(
JNIEnv
*
env
,
jclass
this
,
jlong
fileHandle
,
jlong
existingPort
,
jint
completionKey
)
{
ULONG_PTR
ck
=
completionKey
;
HANDLE
port
=
CreateIoCompletionPort
((
HANDLE
)
jlong_to_ptr
(
fileHandle
),
(
HANDLE
)
jlong_to_ptr
(
existingPort
),
(
DWORD
)
completionKey
,
ck
,
0
);
if
(
port
==
NULL
)
{
throwWindowsException
(
env
,
GetLastError
());
...
...
@@ -1239,7 +1240,7 @@ Java_sun_nio_fs_WindowsNativeDispatcher_GetQueuedCompletionStatus0(JNIEnv* env,
jlong
completionPort
,
jobject
obj
)
{
DWORD
bytesTransferred
;
DWORD
completionKey
;
ULONG_PTR
completionKey
;
OVERLAPPED
*
lpOverlapped
;
BOOL
res
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录