Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
cace9cb4
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看板
提交
cace9cb4
编写于
10月 07, 2010
作者:
A
alanb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6989466: Miscellaneous compiler warnings in java/lang, java/util, java/io, sun/misc native code
Reviewed-by: andrew, mchung, ohair
上级
6777111d
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
57 addition
and
55 deletion
+57
-55
src/share/native/common/jdk_util.c
src/share/native/common/jdk_util.c
+1
-1
src/share/native/common/jni_util.c
src/share/native/common/jni_util.c
+3
-3
src/share/native/java/lang/Class.c
src/share/native/java/lang/Class.c
+3
-3
src/share/native/java/lang/ClassLoader.c
src/share/native/java/lang/ClassLoader.c
+3
-3
src/share/native/java/lang/System.c
src/share/native/java/lang/System.c
+1
-1
src/share/native/java/lang/fdlibm/include/fdlibm.h
src/share/native/java/lang/fdlibm/include/fdlibm.h
+2
-0
src/share/native/java/lang/reflect/Proxy.c
src/share/native/java/lang/reflect/Proxy.c
+3
-3
src/share/native/java/nio/Bits.c
src/share/native/java/nio/Bits.c
+12
-12
src/share/native/sun/management/Flag.c
src/share/native/sun/management/Flag.c
+1
-2
src/share/native/sun/misc/VM.c
src/share/native/sun/misc/VM.c
+2
-3
src/share/native/sun/misc/VMSupport.c
src/share/native/sun/misc/VMSupport.c
+0
-2
src/solaris/native/java/io/UnixFileSystem_md.c
src/solaris/native/java/io/UnixFileSystem_md.c
+3
-2
src/solaris/native/java/io/canonicalize_md.c
src/solaris/native/java/io/canonicalize_md.c
+1
-1
src/solaris/native/java/lang/java_props_md.c
src/solaris/native/java/lang/java_props_md.c
+4
-2
src/solaris/native/sun/net/sdp/SdpSupport.c
src/solaris/native/sun/net/sdp/SdpSupport.c
+1
-1
src/solaris/native/sun/nio/ch/Net.c
src/solaris/native/sun/nio/ch/Net.c
+5
-4
src/solaris/native/sun/nio/ch/SctpNet.c
src/solaris/native/sun/nio/ch/SctpNet.c
+1
-1
src/solaris/native/sun/nio/ch/UnixAsynchronousSocketChannelImpl.c
...ris/native/sun/nio/ch/UnixAsynchronousSocketChannelImpl.c
+2
-2
src/windows/native/common/jni_util_md.c
src/windows/native/common/jni_util_md.c
+1
-1
src/windows/native/java/lang/java_props_md.c
src/windows/native/java/lang/java_props_md.c
+2
-2
src/windows/native/java/util/TimeZone_md.c
src/windows/native/java/util/TimeZone_md.c
+5
-4
src/windows/native/sun/nio/ch/ServerSocketChannelImpl.c
src/windows/native/sun/nio/ch/ServerSocketChannelImpl.c
+0
-1
src/windows/native/sun/nio/ch/WindowsSelectorImpl.c
src/windows/native/sun/nio/ch/WindowsSelectorImpl.c
+1
-1
未找到文件。
src/share/native/common/jdk_util.c
浏览文件 @
cace9cb4
...
@@ -76,7 +76,7 @@ JDK_GetVersionInfo0(jdk_version_info* info, size_t info_size) {
...
@@ -76,7 +76,7 @@ JDK_GetVersionInfo0(jdk_version_info* info, size_t info_size) {
}
}
memset
(
info
,
0
,
sizeof
(
info_size
)
);
memset
(
info
,
0
,
info_size
);
info
->
jdk_version
=
((
jdk_major_version
&
0xFF
)
<<
24
)
|
info
->
jdk_version
=
((
jdk_major_version
&
0xFF
)
<<
24
)
|
((
jdk_minor_version
&
0xFF
)
<<
16
)
|
((
jdk_minor_version
&
0xFF
)
<<
16
)
|
((
jdk_micro_version
&
0xFF
)
<<
8
)
|
((
jdk_micro_version
&
0xFF
)
<<
8
)
|
...
...
src/share/native/common/jni_util.c
浏览文件 @
cace9cb4
...
@@ -433,7 +433,7 @@ getString8859_1Chars(JNIEnv *env, jstring jstr)
...
@@ -433,7 +433,7 @@ getString8859_1Chars(JNIEnv *env, jstring jstr)
for
(
i
=
0
;
i
<
len
;
i
++
)
{
for
(
i
=
0
;
i
<
len
;
i
++
)
{
jchar
unicode
=
str
[
i
];
jchar
unicode
=
str
[
i
];
if
(
unicode
<=
0x00ff
)
if
(
unicode
<=
0x00ff
)
result
[
i
]
=
unicode
;
result
[
i
]
=
(
char
)
unicode
;
else
else
result
[
i
]
=
'?'
;
result
[
i
]
=
'?'
;
}
}
...
@@ -498,7 +498,7 @@ getString646_USChars(JNIEnv *env, jstring jstr)
...
@@ -498,7 +498,7 @@ getString646_USChars(JNIEnv *env, jstring jstr)
for
(
i
=
0
;
i
<
len
;
i
++
)
{
for
(
i
=
0
;
i
<
len
;
i
++
)
{
jchar
unicode
=
str
[
i
];
jchar
unicode
=
str
[
i
];
if
(
unicode
<=
0x007f
)
if
(
unicode
<=
0x007f
)
result
[
i
]
=
unicode
;
result
[
i
]
=
(
char
)
unicode
;
else
else
result
[
i
]
=
'?'
;
result
[
i
]
=
'?'
;
}
}
...
@@ -569,7 +569,7 @@ getStringCp1252Chars(JNIEnv *env, jstring jstr)
...
@@ -569,7 +569,7 @@ getStringCp1252Chars(JNIEnv *env, jstring jstr)
for
(
i
=
0
;
i
<
len
;
i
++
)
{
for
(
i
=
0
;
i
<
len
;
i
++
)
{
jchar
c
=
str
[
i
];
jchar
c
=
str
[
i
];
if
(
c
<
256
)
if
(
c
<
256
)
result
[
i
]
=
c
;
result
[
i
]
=
(
char
)
c
;
else
switch
(
c
)
{
else
switch
(
c
)
{
case
0x20AC
:
result
[
i
]
=
(
char
)
0x80
;
break
;
case
0x20AC
:
result
[
i
]
=
(
char
)
0x80
;
break
;
case
0x201A
:
result
[
i
]
=
(
char
)
0x82
;
break
;
case
0x201A
:
result
[
i
]
=
(
char
)
0x82
;
break
;
...
...
src/share/native/java/lang/Class.c
浏览文件 @
cace9cb4
...
@@ -102,8 +102,8 @@ Java_java_lang_Class_forName0(JNIEnv *env, jclass this, jstring classname,
...
@@ -102,8 +102,8 @@ Java_java_lang_Class_forName0(JNIEnv *env, jclass this, jstring classname,
char
*
clname
;
char
*
clname
;
jclass
cls
=
0
;
jclass
cls
=
0
;
char
buf
[
128
];
char
buf
[
128
];
int
len
;
jsize
len
;
int
unicode_len
;
jsize
unicode_len
;
if
(
classname
==
NULL
)
{
if
(
classname
==
NULL
)
{
JNU_ThrowNullPointerException
(
env
,
0
);
JNU_ThrowNullPointerException
(
env
,
0
);
...
@@ -112,7 +112,7 @@ Java_java_lang_Class_forName0(JNIEnv *env, jclass this, jstring classname,
...
@@ -112,7 +112,7 @@ Java_java_lang_Class_forName0(JNIEnv *env, jclass this, jstring classname,
len
=
(
*
env
)
->
GetStringUTFLength
(
env
,
classname
);
len
=
(
*
env
)
->
GetStringUTFLength
(
env
,
classname
);
unicode_len
=
(
*
env
)
->
GetStringLength
(
env
,
classname
);
unicode_len
=
(
*
env
)
->
GetStringLength
(
env
,
classname
);
if
(
len
>=
sizeof
(
buf
))
{
if
(
len
>=
(
jsize
)
sizeof
(
buf
))
{
clname
=
malloc
(
len
+
1
);
clname
=
malloc
(
len
+
1
);
if
(
clname
==
NULL
)
{
if
(
clname
==
NULL
)
{
JNU_ThrowOutOfMemoryError
(
env
,
NULL
);
JNU_ThrowOutOfMemoryError
(
env
,
NULL
);
...
...
src/share/native/java/lang/ClassLoader.c
浏览文件 @
cace9cb4
...
@@ -331,7 +331,7 @@ Java_java_lang_ClassLoader_00024NativeLibrary_load
...
@@ -331,7 +331,7 @@ Java_java_lang_ClassLoader_00024NativeLibrary_load
if
(
handle
)
{
if
(
handle
)
{
const
char
*
onLoadSymbols
[]
=
JNI_ONLOAD_SYMBOLS
;
const
char
*
onLoadSymbols
[]
=
JNI_ONLOAD_SYMBOLS
;
JNI_OnLoad_t
JNI_OnLoad
;
JNI_OnLoad_t
JNI_OnLoad
;
int
i
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
sizeof
(
onLoadSymbols
)
/
sizeof
(
char
*
);
i
++
)
{
for
(
i
=
0
;
i
<
sizeof
(
onLoadSymbols
)
/
sizeof
(
char
*
);
i
++
)
{
JNI_OnLoad
=
(
JNI_OnLoad_t
)
JNI_OnLoad
=
(
JNI_OnLoad_t
)
JVM_FindLibraryEntry
(
handle
,
onLoadSymbols
[
i
]);
JVM_FindLibraryEntry
(
handle
,
onLoadSymbols
[
i
]);
...
@@ -369,7 +369,7 @@ Java_java_lang_ClassLoader_00024NativeLibrary_load
...
@@ -369,7 +369,7 @@ Java_java_lang_ClassLoader_00024NativeLibrary_load
cause
=
(
*
env
)
->
ExceptionOccurred
(
env
);
cause
=
(
*
env
)
->
ExceptionOccurred
(
env
);
if
(
cause
)
{
if
(
cause
)
{
(
*
env
)
->
ExceptionClear
(
env
);
(
*
env
)
->
ExceptionClear
(
env
);
(
*
env
)
->
SetLongField
(
env
,
this
,
handleID
,
(
jlong
)
NULL
);
(
*
env
)
->
SetLongField
(
env
,
this
,
handleID
,
(
jlong
)
0
);
(
*
env
)
->
Throw
(
env
,
cause
);
(
*
env
)
->
Throw
(
env
,
cause
);
}
}
goto
done
;
goto
done
;
...
@@ -392,7 +392,7 @@ Java_java_lang_ClassLoader_00024NativeLibrary_unload
...
@@ -392,7 +392,7 @@ Java_java_lang_ClassLoader_00024NativeLibrary_unload
const
char
*
onUnloadSymbols
[]
=
JNI_ONUNLOAD_SYMBOLS
;
const
char
*
onUnloadSymbols
[]
=
JNI_ONUNLOAD_SYMBOLS
;
void
*
handle
;
void
*
handle
;
JNI_OnUnload_t
JNI_OnUnload
;
JNI_OnUnload_t
JNI_OnUnload
;
int
i
;
unsigned
int
i
;
if
(
!
initIDs
(
env
))
if
(
!
initIDs
(
env
))
return
;
return
;
...
...
src/share/native/java/lang/System.c
浏览文件 @
cace9cb4
...
@@ -109,7 +109,7 @@ Java_java_lang_System_identityHashCode(JNIEnv *env, jobject this, jobject x)
...
@@ -109,7 +109,7 @@ Java_java_lang_System_identityHashCode(JNIEnv *env, jobject this, jobject x)
#error "ERROR: No override of JAVA_SPECIFICATION_VENDOR is allowed"
#error "ERROR: No override of JAVA_SPECIFICATION_VENDOR is allowed"
#else
#else
#define JAVA_SPECIFICATION_VENDOR "Oracle Corporation"
#define JAVA_SPECIFICATION_VENDOR "Oracle Corporation"
#endif
#endif
static
int
fmtdefault
;
// boolean value
static
int
fmtdefault
;
// boolean value
jobject
fillI18nProps
(
JNIEnv
*
env
,
jobject
props
,
char
*
baseKey
,
jobject
fillI18nProps
(
JNIEnv
*
env
,
jobject
props
,
char
*
baseKey
,
...
...
src/share/native/java/lang/fdlibm/include/fdlibm.h
浏览文件 @
cace9cb4
...
@@ -46,11 +46,13 @@
...
@@ -46,11 +46,13 @@
#define __LOp(x) *(1+(int*)x)
#define __LOp(x) *(1+(int*)x)
#endif
#endif
#ifndef __P
#ifdef __STDC__
#ifdef __STDC__
#define __P(p) p
#define __P(p) p
#else
#else
#define __P(p) ()
#define __P(p) ()
#endif
#endif
#endif
/*
/*
* ANSI/POSIX
* ANSI/POSIX
...
...
src/share/native/java/lang/reflect/Proxy.c
浏览文件 @
cace9cb4
...
@@ -82,9 +82,9 @@ Java_java_lang_reflect_Proxy_defineClass0(JNIEnv *env,
...
@@ -82,9 +82,9 @@ Java_java_lang_reflect_Proxy_defineClass0(JNIEnv *env,
goto
free_body
;
goto
free_body
;
if
(
name
!=
NULL
)
{
if
(
name
!=
NULL
)
{
int
len
=
(
*
env
)
->
GetStringUTFLength
(
env
,
name
);
jsize
len
=
(
*
env
)
->
GetStringUTFLength
(
env
,
name
);
int
unicode_len
=
(
*
env
)
->
GetStringLength
(
env
,
name
);
jsize
unicode_len
=
(
*
env
)
->
GetStringLength
(
env
,
name
);
if
(
len
>=
sizeof
(
buf
))
{
if
(
len
>=
(
jsize
)
sizeof
(
buf
))
{
utfName
=
malloc
(
len
+
1
);
utfName
=
malloc
(
len
+
1
);
if
(
utfName
==
NULL
)
{
if
(
utfName
==
NULL
)
{
JNU_ThrowOutOfMemoryError
(
env
,
NULL
);
JNU_ThrowOutOfMemoryError
(
env
,
NULL
);
...
...
src/share/native/java/nio/Bits.c
浏览文件 @
cace9cb4
...
@@ -72,7 +72,7 @@ Java_java_nio_Bits_copyFromShortArray(JNIEnv *env, jobject this, jobject src,
...
@@ -72,7 +72,7 @@ Java_java_nio_Bits_copyFromShortArray(JNIEnv *env, jobject this, jobject src,
jlong
srcPos
,
jlong
dstAddr
,
jlong
length
)
jlong
srcPos
,
jlong
dstAddr
,
jlong
length
)
{
{
jbyte
*
bytes
;
jbyte
*
bytes
;
size_t
i
,
size
;
size_t
size
;
jshort
*
srcShort
,
*
dstShort
,
*
endShort
;
jshort
*
srcShort
,
*
dstShort
,
*
endShort
;
jshort
tmpShort
;
jshort
tmpShort
;
...
@@ -83,7 +83,7 @@ Java_java_nio_Bits_copyFromShortArray(JNIEnv *env, jobject this, jobject src,
...
@@ -83,7 +83,7 @@ Java_java_nio_Bits_copyFromShortArray(JNIEnv *env, jobject this, jobject src,
if
(
length
>
MBYTE
)
if
(
length
>
MBYTE
)
size
=
MBYTE
;
size
=
MBYTE
;
else
else
size
=
length
;
size
=
(
size_t
)
length
;
GETCRITICAL
(
bytes
,
env
,
src
);
GETCRITICAL
(
bytes
,
env
,
src
);
...
@@ -107,7 +107,7 @@ Java_java_nio_Bits_copyToShortArray(JNIEnv *env, jobject this, jlong srcAddr,
...
@@ -107,7 +107,7 @@ Java_java_nio_Bits_copyToShortArray(JNIEnv *env, jobject this, jlong srcAddr,
jobject
dst
,
jlong
dstPos
,
jlong
length
)
jobject
dst
,
jlong
dstPos
,
jlong
length
)
{
{
jbyte
*
bytes
;
jbyte
*
bytes
;
size_t
i
,
size
;
size_t
size
;
jshort
*
srcShort
,
*
dstShort
,
*
endShort
;
jshort
*
srcShort
,
*
dstShort
,
*
endShort
;
jshort
tmpShort
;
jshort
tmpShort
;
...
@@ -118,7 +118,7 @@ Java_java_nio_Bits_copyToShortArray(JNIEnv *env, jobject this, jlong srcAddr,
...
@@ -118,7 +118,7 @@ Java_java_nio_Bits_copyToShortArray(JNIEnv *env, jobject this, jlong srcAddr,
if
(
length
>
MBYTE
)
if
(
length
>
MBYTE
)
size
=
MBYTE
;
size
=
MBYTE
;
else
else
size
=
length
;
size
=
(
size_t
)
length
;
GETCRITICAL
(
bytes
,
env
,
dst
);
GETCRITICAL
(
bytes
,
env
,
dst
);
...
@@ -142,7 +142,7 @@ Java_java_nio_Bits_copyFromIntArray(JNIEnv *env, jobject this, jobject src,
...
@@ -142,7 +142,7 @@ Java_java_nio_Bits_copyFromIntArray(JNIEnv *env, jobject this, jobject src,
jlong
srcPos
,
jlong
dstAddr
,
jlong
length
)
jlong
srcPos
,
jlong
dstAddr
,
jlong
length
)
{
{
jbyte
*
bytes
;
jbyte
*
bytes
;
size_t
i
,
size
;
size_t
size
;
jint
*
srcInt
,
*
dstInt
,
*
endInt
;
jint
*
srcInt
,
*
dstInt
,
*
endInt
;
jint
tmpInt
;
jint
tmpInt
;
...
@@ -153,7 +153,7 @@ Java_java_nio_Bits_copyFromIntArray(JNIEnv *env, jobject this, jobject src,
...
@@ -153,7 +153,7 @@ Java_java_nio_Bits_copyFromIntArray(JNIEnv *env, jobject this, jobject src,
if
(
length
>
MBYTE
)
if
(
length
>
MBYTE
)
size
=
MBYTE
;
size
=
MBYTE
;
else
else
size
=
length
;
size
=
(
size_t
)
length
;
GETCRITICAL
(
bytes
,
env
,
src
);
GETCRITICAL
(
bytes
,
env
,
src
);
...
@@ -177,7 +177,7 @@ Java_java_nio_Bits_copyToIntArray(JNIEnv *env, jobject this, jlong srcAddr,
...
@@ -177,7 +177,7 @@ Java_java_nio_Bits_copyToIntArray(JNIEnv *env, jobject this, jlong srcAddr,
jobject
dst
,
jlong
dstPos
,
jlong
length
)
jobject
dst
,
jlong
dstPos
,
jlong
length
)
{
{
jbyte
*
bytes
;
jbyte
*
bytes
;
size_t
i
,
size
;
size_t
size
;
jint
*
srcInt
,
*
dstInt
,
*
endInt
;
jint
*
srcInt
,
*
dstInt
,
*
endInt
;
jint
tmpInt
;
jint
tmpInt
;
...
@@ -188,7 +188,7 @@ Java_java_nio_Bits_copyToIntArray(JNIEnv *env, jobject this, jlong srcAddr,
...
@@ -188,7 +188,7 @@ Java_java_nio_Bits_copyToIntArray(JNIEnv *env, jobject this, jlong srcAddr,
if
(
length
>
MBYTE
)
if
(
length
>
MBYTE
)
size
=
MBYTE
;
size
=
MBYTE
;
else
else
size
=
length
;
size
=
(
size_t
)
length
;
GETCRITICAL
(
bytes
,
env
,
dst
);
GETCRITICAL
(
bytes
,
env
,
dst
);
...
@@ -212,7 +212,7 @@ Java_java_nio_Bits_copyFromLongArray(JNIEnv *env, jobject this, jobject src,
...
@@ -212,7 +212,7 @@ Java_java_nio_Bits_copyFromLongArray(JNIEnv *env, jobject this, jobject src,
jlong
srcPos
,
jlong
dstAddr
,
jlong
length
)
jlong
srcPos
,
jlong
dstAddr
,
jlong
length
)
{
{
jbyte
*
bytes
;
jbyte
*
bytes
;
size_t
i
,
size
;
size_t
size
;
jlong
*
srcLong
,
*
dstLong
,
*
endLong
;
jlong
*
srcLong
,
*
dstLong
,
*
endLong
;
jlong
tmpLong
;
jlong
tmpLong
;
...
@@ -223,7 +223,7 @@ Java_java_nio_Bits_copyFromLongArray(JNIEnv *env, jobject this, jobject src,
...
@@ -223,7 +223,7 @@ Java_java_nio_Bits_copyFromLongArray(JNIEnv *env, jobject this, jobject src,
if
(
length
>
MBYTE
)
if
(
length
>
MBYTE
)
size
=
MBYTE
;
size
=
MBYTE
;
else
else
size
=
length
;
size
=
(
size_t
)
length
;
GETCRITICAL
(
bytes
,
env
,
src
);
GETCRITICAL
(
bytes
,
env
,
src
);
...
@@ -247,7 +247,7 @@ Java_java_nio_Bits_copyToLongArray(JNIEnv *env, jobject this, jlong srcAddr,
...
@@ -247,7 +247,7 @@ Java_java_nio_Bits_copyToLongArray(JNIEnv *env, jobject this, jlong srcAddr,
jobject
dst
,
jlong
dstPos
,
jlong
length
)
jobject
dst
,
jlong
dstPos
,
jlong
length
)
{
{
jbyte
*
bytes
;
jbyte
*
bytes
;
size_t
i
,
size
;
size_t
size
;
jlong
*
srcLong
,
*
dstLong
,
*
endLong
;
jlong
*
srcLong
,
*
dstLong
,
*
endLong
;
jlong
tmpLong
;
jlong
tmpLong
;
...
@@ -258,7 +258,7 @@ Java_java_nio_Bits_copyToLongArray(JNIEnv *env, jobject this, jlong srcAddr,
...
@@ -258,7 +258,7 @@ Java_java_nio_Bits_copyToLongArray(JNIEnv *env, jobject this, jlong srcAddr,
if
(
length
>
MBYTE
)
if
(
length
>
MBYTE
)
size
=
MBYTE
;
size
=
MBYTE
;
else
else
size
=
length
;
size
=
(
size_t
)
length
;
GETCRITICAL
(
bytes
,
env
,
dst
);
GETCRITICAL
(
bytes
,
env
,
dst
);
...
...
src/share/native/sun/management/Flag.c
浏览文件 @
cace9cb4
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <jni.h>
#include <jni.h>
#include "management.h"
#include "management.h"
#include "sun_management_Flag.h"
#include "sun_management_Flag.h"
...
@@ -80,8 +81,6 @@ JNIEXPORT jint JNICALL
...
@@ -80,8 +81,6 @@ JNIEXPORT jint JNICALL
Java_sun_management_Flag_getFlags
Java_sun_management_Flag_getFlags
(
JNIEnv
*
env
,
jclass
cls
,
jobjectArray
names
,
jobjectArray
flags
,
jint
count
)
(
JNIEnv
*
env
,
jclass
cls
,
jobjectArray
names
,
jobjectArray
flags
,
jint
count
)
{
{
char
errmsg
[
128
];
jint
num_flags
,
i
,
index
;
jint
num_flags
,
i
,
index
;
jmmVMGlobal
*
globals
;
jmmVMGlobal
*
globals
;
size_t
gsize
;
size_t
gsize
;
...
...
src/share/native/sun/misc/VM.c
浏览文件 @
cace9cb4
...
@@ -23,6 +23,8 @@
...
@@ -23,6 +23,8 @@
* questions.
* questions.
*/
*/
#include <string.h>
#include "jni.h"
#include "jni.h"
#include "jni_util.h"
#include "jni_util.h"
#include "jlong.h"
#include "jlong.h"
...
@@ -113,7 +115,6 @@ typedef void (JNICALL *GetJvmVersionInfo_fp)(JNIEnv*, jvm_version_info*, size_t)
...
@@ -113,7 +115,6 @@ typedef void (JNICALL *GetJvmVersionInfo_fp)(JNIEnv*, jvm_version_info*, size_t)
JNIEXPORT
void
JNICALL
JNIEXPORT
void
JNICALL
Java_sun_misc_VM_initialize
(
JNIEnv
*
env
,
jclass
cls
)
{
Java_sun_misc_VM_initialize
(
JNIEnv
*
env
,
jclass
cls
)
{
char
errmsg
[
128
];
GetJvmVersionInfo_fp
func_p
;
GetJvmVersionInfo_fp
func_p
;
if
(
!
JDK_InitJvmHandle
())
{
if
(
!
JDK_InitJvmHandle
())
{
...
@@ -123,8 +124,6 @@ Java_sun_misc_VM_initialize(JNIEnv *env, jclass cls) {
...
@@ -123,8 +124,6 @@ Java_sun_misc_VM_initialize(JNIEnv *env, jclass cls) {
func_p
=
(
GetJvmVersionInfo_fp
)
JDK_FindJvmEntry
(
"JVM_GetVersionInfo"
);
func_p
=
(
GetJvmVersionInfo_fp
)
JDK_FindJvmEntry
(
"JVM_GetVersionInfo"
);
if
(
func_p
!=
NULL
)
{
if
(
func_p
!=
NULL
)
{
char
errmsg
[
100
];
jfieldID
fid
;
jvm_version_info
info
;
jvm_version_info
info
;
memset
(
&
info
,
0
,
sizeof
(
info
));
memset
(
&
info
,
0
,
sizeof
(
info
));
...
...
src/share/native/sun/misc/VMSupport.c
浏览文件 @
cace9cb4
...
@@ -38,8 +38,6 @@ static INIT_AGENT_PROPERTIES_FN InitAgentProperties_fp = NULL;
...
@@ -38,8 +38,6 @@ static INIT_AGENT_PROPERTIES_FN InitAgentProperties_fp = NULL;
JNIEXPORT
jobject
JNICALL
JNIEXPORT
jobject
JNICALL
Java_sun_misc_VMSupport_initAgentProperties
(
JNIEnv
*
env
,
jclass
cls
,
jobject
props
)
Java_sun_misc_VMSupport_initAgentProperties
(
JNIEnv
*
env
,
jclass
cls
,
jobject
props
)
{
{
char
errmsg
[
128
];
if
(
InitAgentProperties_fp
==
NULL
)
{
if
(
InitAgentProperties_fp
==
NULL
)
{
if
(
!
JDK_InitJvmHandle
())
{
if
(
!
JDK_InitJvmHandle
())
{
JNU_ThrowInternalError
(
env
,
JNU_ThrowInternalError
(
env
,
...
...
src/solaris/native/java/io/UnixFileSystem_md.c
浏览文件 @
cace9cb4
...
@@ -119,7 +119,7 @@ Java_java_io_UnixFileSystem_checkAccess(JNIEnv *env, jobject this,
...
@@ -119,7 +119,7 @@ Java_java_io_UnixFileSystem_checkAccess(JNIEnv *env, jobject this,
jobject
file
,
jint
a
)
jobject
file
,
jint
a
)
{
{
jboolean
rv
=
JNI_FALSE
;
jboolean
rv
=
JNI_FALSE
;
int
mode
;
int
mode
=
0
;
switch
(
a
)
{
switch
(
a
)
{
case
java_io_FileSystem_ACCESS_READ
:
case
java_io_FileSystem_ACCESS_READ
:
mode
=
R_OK
;
mode
=
R_OK
;
...
@@ -151,7 +151,8 @@ Java_java_io_UnixFileSystem_setPermission(JNIEnv *env, jobject this,
...
@@ -151,7 +151,8 @@ Java_java_io_UnixFileSystem_setPermission(JNIEnv *env, jobject this,
jboolean
rv
=
JNI_FALSE
;
jboolean
rv
=
JNI_FALSE
;
WITH_FIELD_PLATFORM_STRING
(
env
,
file
,
ids
.
path
,
path
)
{
WITH_FIELD_PLATFORM_STRING
(
env
,
file
,
ids
.
path
,
path
)
{
int
amode
,
mode
;
int
amode
=
0
;
int
mode
;
switch
(
access
)
{
switch
(
access
)
{
case
java_io_FileSystem_ACCESS_READ
:
case
java_io_FileSystem_ACCESS_READ
:
if
(
owneronly
)
if
(
owneronly
)
...
...
src/solaris/native/java/io/canonicalize_md.c
浏览文件 @
cace9cb4
...
@@ -246,7 +246,7 @@ canonicalize(char *original, char *resolved, int len)
...
@@ -246,7 +246,7 @@ canonicalize(char *original, char *resolved, int len)
if
(
r
!=
NULL
)
{
if
(
r
!=
NULL
)
{
/* Append unresolved subpath to resolved subpath */
/* Append unresolved subpath to resolved subpath */
int
rn
=
strlen
(
r
);
int
rn
=
strlen
(
r
);
if
(
rn
+
strlen
(
p
)
>=
len
)
{
if
(
rn
+
(
int
)
strlen
(
p
)
>=
len
)
{
/* Buffer overflow */
/* Buffer overflow */
errno
=
ENAMETOOLONG
;
errno
=
ENAMETOOLONG
;
return
-
1
;
return
-
1
;
...
...
src/solaris/native/java/lang/java_props_md.c
浏览文件 @
cace9cb4
...
@@ -46,7 +46,9 @@
...
@@ -46,7 +46,9 @@
#include "java_props.h"
#include "java_props.h"
#ifdef __linux__
#ifdef __linux__
#define CODESET _NL_CTYPE_CODESET_NAME
#ifndef CODESET
#define CODESET _NL_CTYPE_CODESET_NAME
#endif
#else
#else
#ifdef ALT_CODESET_KEY
#ifdef ALT_CODESET_KEY
#define CODESET ALT_CODESET_KEY
#define CODESET ALT_CODESET_KEY
...
@@ -289,7 +291,7 @@ static int ParseLocale(int cat, char ** std_language, char ** std_country, char
...
@@ -289,7 +291,7 @@ static int ParseLocale(int cat, char ** std_language, char ** std_country, char
java_props_t
*
java_props_t
*
GetJavaProperties
(
JNIEnv
*
env
)
GetJavaProperties
(
JNIEnv
*
env
)
{
{
static
java_props_t
sprops
=
{
0
}
;
static
java_props_t
sprops
;
char
*
v
;
/* tmp var */
char
*
v
;
/* tmp var */
if
(
sprops
.
user_dir
)
{
if
(
sprops
.
user_dir
)
{
...
...
src/solaris/native/sun/net/sdp/SdpSupport.c
浏览文件 @
cace9cb4
...
@@ -68,7 +68,7 @@ static int create(JNIEnv* env)
...
@@ -68,7 +68,7 @@ static int create(JNIEnv* env)
*/
*/
if
(
ipv6_available
())
{
if
(
ipv6_available
())
{
JNU_ThrowIOException
(
env
,
"IPv6 not supported"
);
JNU_ThrowIOException
(
env
,
"IPv6 not supported"
);
return
;
return
-
1
;
}
}
s
=
socket
(
AF_INET_SDP
,
SOCK_STREAM
,
0
);
s
=
socket
(
AF_INET_SDP
,
SOCK_STREAM
,
0
);
#else
#else
...
...
src/solaris/native/sun/nio/ch/Net.c
浏览文件 @
cace9cb4
...
@@ -298,7 +298,8 @@ Java_sun_nio_ch_Net_getIntOption0(JNIEnv *env, jclass clazz, jobject fdo,
...
@@ -298,7 +298,8 @@ Java_sun_nio_ch_Net_getIntOption0(JNIEnv *env, jclass clazz, jobject fdo,
struct
linger
linger
;
struct
linger
linger
;
u_char
carg
;
u_char
carg
;
void
*
arg
;
void
*
arg
;
int
arglen
,
n
;
socklen_t
arglen
;
int
n
;
/* Option value is an int except for a few specific cases */
/* Option value is an int except for a few specific cases */
...
@@ -317,7 +318,7 @@ Java_sun_nio_ch_Net_getIntOption0(JNIEnv *env, jclass clazz, jobject fdo,
...
@@ -317,7 +318,7 @@ Java_sun_nio_ch_Net_getIntOption0(JNIEnv *env, jclass clazz, jobject fdo,
}
}
if
(
mayNeedConversion
)
{
if
(
mayNeedConversion
)
{
n
=
NET_GetSockOpt
(
fdval
(
env
,
fdo
),
level
,
opt
,
arg
,
&
arglen
);
n
=
NET_GetSockOpt
(
fdval
(
env
,
fdo
),
level
,
opt
,
arg
,
(
int
*
)
&
arglen
);
}
else
{
}
else
{
n
=
getsockopt
(
fdval
(
env
,
fdo
),
level
,
opt
,
arg
,
&
arglen
);
n
=
getsockopt
(
fdval
(
env
,
fdo
),
level
,
opt
,
arg
,
&
arglen
);
}
}
...
@@ -527,7 +528,7 @@ JNIEXPORT jint JNICALL
...
@@ -527,7 +528,7 @@ JNIEXPORT jint JNICALL
Java_sun_nio_ch_Net_getInterface4
(
JNIEnv
*
env
,
jobject
this
,
jobject
fdo
)
Java_sun_nio_ch_Net_getInterface4
(
JNIEnv
*
env
,
jobject
this
,
jobject
fdo
)
{
{
struct
in_addr
in
;
struct
in_addr
in
;
in
t
arglen
=
sizeof
(
struct
in_addr
);
socklen_
t
arglen
=
sizeof
(
struct
in_addr
);
int
n
;
int
n
;
n
=
getsockopt
(
fdval
(
env
,
fdo
),
IPPROTO_IP
,
IP_MULTICAST_IF
,
(
void
*
)
&
in
,
&
arglen
);
n
=
getsockopt
(
fdval
(
env
,
fdo
),
IPPROTO_IP
,
IP_MULTICAST_IF
,
(
void
*
)
&
in
,
&
arglen
);
...
@@ -556,7 +557,7 @@ JNIEXPORT jint JNICALL
...
@@ -556,7 +557,7 @@ JNIEXPORT jint JNICALL
Java_sun_nio_ch_Net_getInterface6
(
JNIEnv
*
env
,
jobject
this
,
jobject
fdo
)
Java_sun_nio_ch_Net_getInterface6
(
JNIEnv
*
env
,
jobject
this
,
jobject
fdo
)
{
{
int
index
;
int
index
;
in
t
arglen
=
sizeof
(
index
);
socklen_
t
arglen
=
sizeof
(
index
);
int
n
;
int
n
;
n
=
getsockopt
(
fdval
(
env
,
fdo
),
IPPROTO_IPV6
,
IPV6_MULTICAST_IF
,
(
void
*
)
&
index
,
&
arglen
);
n
=
getsockopt
(
fdval
(
env
,
fdo
),
IPPROTO_IPV6
,
IPV6_MULTICAST_IF
,
(
void
*
)
&
index
,
&
arglen
);
...
...
src/solaris/native/sun/nio/ch/SctpNet.c
浏览文件 @
cace9cb4
...
@@ -537,7 +537,7 @@ JNIEXPORT int JNICALL Java_sun_nio_ch_SctpNet_getIntOption0
...
@@ -537,7 +537,7 @@ JNIEXPORT int JNICALL Java_sun_nio_ch_SctpNet_getIntOption0
int
result
;
int
result
;
struct
linger
linger
;
struct
linger
linger
;
void
*
arg
;
void
*
arg
;
unsigned
int
arglen
;
int
arglen
;
if
(
mapSocketOption
(
opt
,
&
klevel
,
&
kopt
)
<
0
)
{
if
(
mapSocketOption
(
opt
,
&
klevel
,
&
kopt
)
<
0
)
{
JNU_ThrowByNameWithLastError
(
env
,
JNU_JAVANETPKG
"SocketException"
,
JNU_ThrowByNameWithLastError
(
env
,
JNU_JAVANETPKG
"SocketException"
,
...
...
src/solaris/native/sun/nio/ch/UnixAsynchronousSocketChannelImpl.c
浏览文件 @
cace9cb4
...
@@ -40,10 +40,10 @@ Java_sun_nio_ch_UnixAsynchronousSocketChannelImpl_checkConnect(JNIEnv *env,
...
@@ -40,10 +40,10 @@ Java_sun_nio_ch_UnixAsynchronousSocketChannelImpl_checkConnect(JNIEnv *env,
jobject
this
,
int
fd
)
jobject
this
,
int
fd
)
{
{
int
error
=
0
;
int
error
=
0
;
int
n
=
sizeof
(
error
);
socklen_t
argle
n
=
sizeof
(
error
);
int
result
;
int
result
;
result
=
getsockopt
(
fd
,
SOL_SOCKET
,
SO_ERROR
,
&
error
,
&
n
);
result
=
getsockopt
(
fd
,
SOL_SOCKET
,
SO_ERROR
,
&
error
,
&
argle
n
);
if
(
result
<
0
)
{
if
(
result
<
0
)
{
JNU_ThrowIOExceptionWithLastError
(
env
,
"getsockopt"
);
JNU_ThrowIOExceptionWithLastError
(
env
,
"getsockopt"
);
}
else
{
}
else
{
...
...
src/windows/native/common/jni_util_md.c
浏览文件 @
cace9cb4
...
@@ -79,7 +79,7 @@ BOOL useNativeConverter(JNIEnv *env) {
...
@@ -79,7 +79,7 @@ BOOL useNativeConverter(JNIEnv *env) {
}
}
jstring
nativeNewStringPlatform
(
JNIEnv
*
env
,
const
char
*
str
)
{
jstring
nativeNewStringPlatform
(
JNIEnv
*
env
,
const
char
*
str
)
{
static
String_char_constructor
=
NULL
;
static
jmethodID
String_char_constructor
;
if
(
useNativeConverter
(
env
))
{
if
(
useNativeConverter
(
env
))
{
// use native Unicode conversion so Kernel isn't required during
// use native Unicode conversion so Kernel isn't required during
// System.initProperties
// System.initProperties
...
...
src/windows/native/java/lang/java_props_md.c
浏览文件 @
cace9cb4
...
@@ -489,7 +489,7 @@ GetJavaProperties(JNIEnv* env)
...
@@ -489,7 +489,7 @@ GetJavaProperties(JNIEnv* env)
break
;
break
;
}
}
sprintf
(
buf
,
"%d.%d"
,
ver
.
dwMajorVersion
,
ver
.
dwMinorVersion
);
sprintf
(
buf
,
"%d.%d"
,
ver
.
dwMajorVersion
,
ver
.
dwMinorVersion
);
sprops
.
os_version
=
strdup
(
buf
);
sprops
.
os_version
=
_
strdup
(
buf
);
#if _M_IA64
#if _M_IA64
sprops
.
os_arch
=
"ia64"
;
sprops
.
os_arch
=
"ia64"
;
#elif _M_AMD64
#elif _M_AMD64
...
@@ -500,7 +500,7 @@ GetJavaProperties(JNIEnv* env)
...
@@ -500,7 +500,7 @@ GetJavaProperties(JNIEnv* env)
sprops
.
os_arch
=
"unknown"
;
sprops
.
os_arch
=
"unknown"
;
#endif
#endif
sprops
.
patch_level
=
strdup
(
ver
.
szCSDVersion
);
sprops
.
patch_level
=
_
strdup
(
ver
.
szCSDVersion
);
sprops
.
desktop
=
"windows"
;
sprops
.
desktop
=
"windows"
;
}
}
...
...
src/windows/native/java/util/TimeZone_md.c
浏览文件 @
cace9cb4
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include <windows.h>
#include <windows.h>
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include "jvm.h"
#include "TimeZone_md.h"
#include "TimeZone_md.h"
#define VALUE_UNKNOWN 0
#define VALUE_UNKNOWN 0
...
@@ -463,7 +464,7 @@ static char *matchJavaTZ(const char *java_home_dir, int value_type, char *tzName
...
@@ -463,7 +464,7 @@ static char *matchJavaTZ(const char *java_home_dir, int value_type, char *tzName
/*
/*
* Found the time zone in the mapping table.
* Found the time zone in the mapping table.
*/
*/
javaTZName
=
strdup
(
items
[
TZ_JAVA_NAME
]);
javaTZName
=
_
strdup
(
items
[
TZ_JAVA_NAME
]);
break
;
break
;
}
}
/*
/*
...
@@ -473,7 +474,7 @@ static char *matchJavaTZ(const char *java_home_dir, int value_type, char *tzName
...
@@ -473,7 +474,7 @@ static char *matchJavaTZ(const char *java_home_dir, int value_type, char *tzName
strncpy
(
bestMatch
,
items
[
TZ_JAVA_NAME
],
MAX_ZONE_CHAR
);
strncpy
(
bestMatch
,
items
[
TZ_JAVA_NAME
],
MAX_ZONE_CHAR
);
}
else
if
(
country
!=
NULL
&&
strcmp
(
items
[
TZ_REGION
],
country
)
==
0
)
{
}
else
if
(
country
!=
NULL
&&
strcmp
(
items
[
TZ_REGION
],
country
)
==
0
)
{
if
(
value_type
==
VALUE_MAPID
)
{
if
(
value_type
==
VALUE_MAPID
)
{
javaTZName
=
strdup
(
items
[
TZ_JAVA_NAME
]);
javaTZName
=
_
strdup
(
items
[
TZ_JAVA_NAME
]);
break
;
break
;
}
}
strncpy
(
bestMatch
,
items
[
TZ_JAVA_NAME
],
MAX_ZONE_CHAR
);
strncpy
(
bestMatch
,
items
[
TZ_JAVA_NAME
],
MAX_ZONE_CHAR
);
...
@@ -490,7 +491,7 @@ static char *matchJavaTZ(const char *java_home_dir, int value_type, char *tzName
...
@@ -490,7 +491,7 @@ static char *matchJavaTZ(const char *java_home_dir, int value_type, char *tzName
fclose
(
fp
);
fclose
(
fp
);
if
(
javaTZName
==
NULL
&&
bestMatch
[
0
]
!=
'\0'
)
{
if
(
javaTZName
==
NULL
&&
bestMatch
[
0
]
!=
'\0'
)
{
javaTZName
=
strdup
(
bestMatch
);
javaTZName
=
_
strdup
(
bestMatch
);
}
}
return
javaTZName
;
return
javaTZName
;
...
@@ -515,7 +516,7 @@ char *findJavaTZ_md(const char *java_home_dir, const char *country)
...
@@ -515,7 +516,7 @@ char *findJavaTZ_md(const char *java_home_dir, const char *country)
if
(
result
!=
VALUE_UNKNOWN
)
{
if
(
result
!=
VALUE_UNKNOWN
)
{
if
(
result
==
VALUE_GMTOFFSET
)
{
if
(
result
==
VALUE_GMTOFFSET
)
{
std_timezone
=
strdup
(
winZoneName
);
std_timezone
=
_
strdup
(
winZoneName
);
}
else
{
}
else
{
std_timezone
=
matchJavaTZ
(
java_home_dir
,
result
,
std_timezone
=
matchJavaTZ
(
java_home_dir
,
result
,
winZoneName
,
winMapID
,
country
);
winZoneName
,
winMapID
,
country
);
...
...
src/windows/native/sun/nio/ch/ServerSocketChannelImpl.c
浏览文件 @
cace9cb4
...
@@ -84,7 +84,6 @@ Java_sun_nio_ch_ServerSocketChannelImpl_accept0(JNIEnv *env, jobject this,
...
@@ -84,7 +84,6 @@ Java_sun_nio_ch_ServerSocketChannelImpl_accept0(JNIEnv *env, jobject this,
jobject
remote_ia
;
jobject
remote_ia
;
int
remote_port
;
int
remote_port
;
jobject
isa
;
jobject
isa
;
jobject
ia
;
int
addrlen
=
sizeof
(
sa
);
int
addrlen
=
sizeof
(
sa
);
memset
((
char
*
)
&
sa
,
0
,
sizeof
(
sa
));
memset
((
char
*
)
&
sa
,
0
,
sizeof
(
sa
));
...
...
src/windows/native/sun/nio/ch/WindowsSelectorImpl.c
浏览文件 @
cace9cb4
...
@@ -223,7 +223,7 @@ Java_sun_nio_ch_WindowsSelectorImpl_discardUrgentData(JNIEnv* env, jobject this,
...
@@ -223,7 +223,7 @@ Java_sun_nio_ch_WindowsSelectorImpl_discardUrgentData(JNIEnv* env, jobject this,
jboolean
discarded
=
JNI_FALSE
;
jboolean
discarded
=
JNI_FALSE
;
int
n
;
int
n
;
do
{
do
{
n
=
recv
(
s
,
&
data
,
sizeof
(
data
),
MSG_OOB
);
n
=
recv
(
s
,
(
char
*
)
&
data
,
sizeof
(
data
),
MSG_OOB
);
if
(
n
>
0
)
{
if
(
n
>
0
)
{
discarded
=
JNI_TRUE
;
discarded
=
JNI_TRUE
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录