mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-04 20:18:49 +00:00
8030010: cleanup native code warnings
Co-authored-by: Francis Andre <francis.andre.kampbell@orange.fr> Reviewed-by: alanb, lancea
This commit is contained in:
parent
fa26d0e934
commit
328fa609d0
@ -345,10 +345,10 @@ JLI_Launch(int argc, char ** argv, /* main argc, argc */
|
||||
} \
|
||||
} while (JNI_FALSE)
|
||||
|
||||
#define CHECK_EXCEPTION_RETURN(CER_return_value) \
|
||||
#define CHECK_EXCEPTION_RETURN() \
|
||||
do { \
|
||||
if ((*env)->ExceptionOccurred(env)) { \
|
||||
return CER_return_value; \
|
||||
return; \
|
||||
} \
|
||||
} while (JNI_FALSE)
|
||||
|
||||
@ -1258,7 +1258,6 @@ static jclass
|
||||
GetApplicationClass(JNIEnv *env)
|
||||
{
|
||||
jmethodID mid;
|
||||
jobject result;
|
||||
jclass cls = GetLauncherHelperClass(env);
|
||||
NULL_CHECK0(cls);
|
||||
NULL_CHECK0(mid = (*env)->GetStaticMethodID(env, cls,
|
||||
|
||||
@ -233,7 +233,7 @@ compute_cen(int fd, Byte *bp)
|
||||
jlong base_offset;
|
||||
jlong offset;
|
||||
char buffer[MINREAD];
|
||||
p = buffer;
|
||||
p = (Byte*) buffer;
|
||||
/*
|
||||
* Read the END Header, which is the starting point for ZIP files.
|
||||
* (Clearly designed to make writing a zip file easier than reading
|
||||
@ -276,7 +276,7 @@ compute_cen(int fd, Byte *bp)
|
||||
if (JLI_Lseek(fd, offset, SEEK_SET) < (jlong)0) {
|
||||
return (-1);
|
||||
}
|
||||
p = buffer;
|
||||
p = (Byte*) buffer;
|
||||
base_offset = base_offset - ZIP64_ENDSIZ(p) - ZIP64_ENDOFF(p) - ZIP64_ENDHDR;
|
||||
} else {
|
||||
base_offset = base_offset - ENDSIZ(p) - ENDOFF(p);
|
||||
|
||||
@ -153,7 +153,6 @@ Agent_OnLoad(JavaVM *vm, char *tail, void * reserved) {
|
||||
char * options;
|
||||
jarAttribute* attributes;
|
||||
char * premainClass;
|
||||
char * agentClass;
|
||||
char * bootClassPath;
|
||||
|
||||
/*
|
||||
|
||||
@ -325,7 +325,7 @@ static void *findJniFunction(JNIEnv *env, void *handle,
|
||||
void *entryName = NULL;
|
||||
char *jniFunctionName;
|
||||
int i;
|
||||
int len;
|
||||
size_t len;
|
||||
|
||||
// Check for JNI_On(Un)Load<_libname> function
|
||||
if (isLoad) {
|
||||
@ -501,9 +501,9 @@ Java_java_lang_ClassLoader_00024NativeLibrary_findBuiltinLib
|
||||
{
|
||||
const char *cname;
|
||||
char *libName;
|
||||
int prefixLen = (int) strlen(JNI_LIB_PREFIX);
|
||||
int suffixLen = (int) strlen(JNI_LIB_SUFFIX);
|
||||
int len;
|
||||
size_t prefixLen = strlen(JNI_LIB_PREFIX);
|
||||
size_t suffixLen = strlen(JNI_LIB_SUFFIX);
|
||||
size_t len;
|
||||
jstring lib;
|
||||
void *ret;
|
||||
const char *onLoadSymbols[] = JNI_ONLOAD_SYMBOLS;
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
* `this' so you can write 'throw e.fillInStackTrace();'
|
||||
*/
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_java_lang_Throwable_fillInStackTrace(JNIEnv *env, jobject throwable, int dummy)
|
||||
Java_java_lang_Throwable_fillInStackTrace(JNIEnv *env, jobject throwable, jint dummy)
|
||||
{
|
||||
JVM_FillInStackTrace(env, throwable);
|
||||
return throwable;
|
||||
|
||||
@ -42,7 +42,6 @@ void* JDK_FindJvmEntry(const char* name) {
|
||||
JNIEXPORT HMODULE JDK_LoadSystemLibrary(const char* name) {
|
||||
HMODULE handle = NULL;
|
||||
char path[MAX_PATH];
|
||||
int ret;
|
||||
|
||||
if (GetSystemDirectory(path, sizeof(path)) != 0) {
|
||||
strcat(path, "\\");
|
||||
|
||||
@ -360,7 +360,6 @@ Java_java_io_WinNTFileSystem_getBooleanAttributes(JNIEnv *env, jobject this,
|
||||
jobject file)
|
||||
{
|
||||
jint rv = 0;
|
||||
jint pathlen;
|
||||
|
||||
WCHAR *pathbuf = fileToNTPath(env, file, ids.path);
|
||||
if (pathbuf == NULL)
|
||||
|
||||
@ -79,7 +79,7 @@ win32Error(JNIEnv *env, const WCHAR *functionName)
|
||||
/*Good suggestion about 2-bytes-per-symbol in localized error reports*/
|
||||
char utf8_javaMessage[MESSAGE_LENGTH*2];
|
||||
const int errnum = (int)GetLastError();
|
||||
int n = os_error_message(errnum, utf16_OSErrorMsg, ARRAY_SIZE(utf16_OSErrorMsg));
|
||||
size_t n = os_error_message(errnum, utf16_OSErrorMsg, ARRAY_SIZE(utf16_OSErrorMsg));
|
||||
n = (n > 0)
|
||||
? swprintf(utf16_javaMessage, MESSAGE_LENGTH, L"%s error=%d, %s", functionName, errnum, utf16_OSErrorMsg)
|
||||
: swprintf(utf16_javaMessage, MESSAGE_LENGTH, L"%s failed, error=%d", functionName, errnum);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user