6989469: (launcher) compiler warnings in jli native code
authorksrini
Mon, 25 Oct 2010 10:34:26 -0700
changeset 7028 adadd244f506
parent 7027 d3404b1406d5
child 7029 1f8f7240a1e2
child 7033 8b0d199d8d11
6989469: (launcher) compiler warnings in jli native code Reviewed-by: darcy, ohair, sherman
jdk/src/share/bin/java.c
jdk/src/share/bin/parse_manifest.c
jdk/src/share/bin/wildcard.c
jdk/src/share/native/java/util/zip/zlib-1.2.3/zcrc32.c
jdk/src/solaris/bin/java_md.c
jdk/src/solaris/bin/jexec.c
jdk/src/windows/bin/java_md.c
--- a/jdk/src/share/bin/java.c	Fri Oct 22 20:27:44 2010 +0100
+++ b/jdk/src/share/bin/java.c	Mon Oct 25 10:34:26 2010 -0700
@@ -355,7 +355,6 @@
 
     JavaVM *vm = 0;
     JNIEnv *env = 0;
-    jstring mainClassName;
     jclass mainClass;
     jmethodID mainID;
     jobjectArray mainArgs;
--- a/jdk/src/share/bin/parse_manifest.c	Fri Oct 22 20:27:44 2010 +0100
+++ b/jdk/src/share/bin/parse_manifest.c	Mon Oct 25 10:34:26 2010 -0700
@@ -72,7 +72,7 @@
     if (entry->how == STORED) {
         *(char *)((size_t)in + entry->csize) = '\0';
         if (size_out) {
-            *size_out = entry->csize;
+            *size_out = (int)entry->csize;
         }
         return (in);
     } else if (entry->how == DEFLATED) {
@@ -103,7 +103,7 @@
             return (NULL);
         }
         if (size_out) {
-            *size_out = entry->isize;
+            *size_out = (int)entry->isize;
         }
         return (out);
     } else
@@ -317,7 +317,7 @@
          * manifest.  If so, build the entry record from the data found in
          * the header located and return success.
          */
-        if (CENNAM(p) == JLI_StrLen(file_name) &&
+        if ((size_t)CENNAM(p) == JLI_StrLen(file_name) &&
           memcmp((p + CENHDR), file_name, JLI_StrLen(file_name)) == 0) {
             if (lseek(fd, base_offset + CENOFF(p), SEEK_SET) < (off_t)0) {
                 free(buffer);
@@ -606,8 +606,5 @@
     }
     free(mp);
     close(fd);
-    if (rc == 0)
-        return (0);
-    else
-        return (-2);
+    return (rc == 0) ? 0 : -2;
 }
--- a/jdk/src/share/bin/wildcard.c	Fri Oct 22 20:27:44 2010 +0100
+++ b/jdk/src/share/bin/wildcard.c	Mon Oct 25 10:34:26 2010 -0700
@@ -290,12 +290,12 @@
     char *path;
     char *p;
     for (i = 0, size = 1; i < fl->size; i++)
-        size += JLI_StrLen(fl->files[i]) + 1;
+        size += (int)JLI_StrLen(fl->files[i]) + 1;
 
     path = JLI_MemAlloc(size);
 
     for (i = 0, p = path; i < fl->size; i++) {
-        int len = JLI_StrLen(fl->files[i]);
+        int len = (int)JLI_StrLen(fl->files[i]);
         if (i > 0) *p++ = sep;
         memcpy(p, fl->files[i], len);
         p += len;
@@ -309,7 +309,7 @@
 FileList_split(const char *path, char sep)
 {
     const char *p, *q;
-    int len = JLI_StrLen(path);
+    int len = (int)JLI_StrLen(path);
     int count;
     FileList fl;
     for (count = 1, p = path; p < path + len; p++)
@@ -330,7 +330,7 @@
 static int
 isJarFileName(const char *filename)
 {
-    int len = JLI_StrLen(filename);
+    int len = (int)JLI_StrLen(filename);
     return (len >= 4) &&
         (filename[len - 4] == '.') &&
         (equal(filename + len - 3, "jar") ||
@@ -342,8 +342,8 @@
 static char *
 wildcardConcat(const char *wildcard, const char *basename)
 {
-    int wildlen = JLI_StrLen(wildcard);
-    int baselen = JLI_StrLen(basename);
+    int wildlen = (int)JLI_StrLen(wildcard);
+    int baselen = (int)JLI_StrLen(basename);
     char *filename = (char *) JLI_MemAlloc(wildlen + baselen);
     /* Replace the trailing '*' with basename */
     memcpy(filename, wildcard, wildlen-1);
@@ -369,7 +369,7 @@
 static int
 isWildcard(const char *filename)
 {
-    int len = JLI_StrLen(filename);
+    int len = (int)JLI_StrLen(filename);
     return (len > 0) &&
         (filename[len - 1] == '*') &&
         (len == 1 || IS_FILE_SEPARATOR(filename[len - 2])) &&
--- a/jdk/src/share/native/java/util/zip/zlib-1.2.3/zcrc32.c	Fri Oct 22 20:27:44 2010 +0100
+++ b/jdk/src/share/native/java/util/zip/zlib-1.2.3/zcrc32.c	Mon Oct 25 10:34:26 2010 -0700
@@ -406,7 +406,7 @@
         return crc1;
 
     /* put operator for one zero bit in odd */
-    odd[0] = 0xedb88320L;           /* CRC-32 polynomial */
+    odd[0] = 0xedb88320UL;           /* CRC-32 polynomial */
     row = 1;
     for (n = 1; n < GF2_DIM; n++) {
         odd[n] = row;
--- a/jdk/src/solaris/bin/java_md.c	Fri Oct 22 20:27:44 2010 +0100
+++ b/jdk/src/solaris/bin/java_md.c	Mon Oct 25 10:34:26 2010 -0700
@@ -868,7 +868,7 @@
     while (dp != NULL) {
         cp = JLI_StrChr(dp, (int)':');
         if (cp != NULL)
-            *cp = (char)NULL;
+            *cp = '\0';
         if ((target = ProcessDir(info, dp)) != NULL)
             break;
         dp = cp;
--- a/jdk/src/solaris/bin/jexec.c	Fri Oct 22 20:27:44 2010 +0100
+++ b/jdk/src/solaris/bin/jexec.c	Mon Oct 25 10:34:26 2010 -0700
@@ -221,6 +221,7 @@
      * implies an error in the exec. */
     free(nargv);
     errorExit(errno, BAD_EXEC_MSG);
+    return 0; // keep the compiler happy
 }
 
 
--- a/jdk/src/windows/bin/java_md.c	Fri Oct 22 20:27:44 2010 +0100
+++ b/jdk/src/windows/bin/java_md.c	Mon Oct 25 10:34:26 2010 -0700
@@ -208,7 +208,7 @@
     struct stat s;
 
     /* Make sure the jrepath contains something */
-    if (jrepath[0] == NULL) {
+    if ((void*)jrepath[0] == NULL) {
         return;
     }
     /* 32 bit windows only please */
@@ -540,7 +540,7 @@
         /* get the length of the string we need */
         int len = mlen =  _vscprintf(fmt, vl) + 1;
         if (freeit) {
-           mlen += JLI_StrLen(errtext);
+           mlen += (int)JLI_StrLen(errtext);
         }
 
         message = (char *)JLI_MemAlloc(mlen);
@@ -997,7 +997,6 @@
 
         exit(exitCode);
     }
-
 }
 
 /*