8030010: cleanup native code warnings

Co-authored-by: Francis Andre <francis.andre.kampbell@orange.fr>
Reviewed-by: alanb, lancea
This commit is contained in:
Mandy Chung 2014-02-12 10:51:50 -08:00
parent fa26d0e934
commit 328fa609d0
8 changed files with 10 additions and 14 deletions

View File

@ -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,

View File

@ -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);

View File

@ -153,7 +153,6 @@ Agent_OnLoad(JavaVM *vm, char *tail, void * reserved) {
char * options;
jarAttribute* attributes;
char * premainClass;
char * agentClass;
char * bootClassPath;
/*

View File

@ -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;

View File

@ -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;

View File

@ -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, "\\");

View File

@ -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)

View File

@ -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);