8036675: Compiler warnings in serviceability code
authorsla
Wed, 05 Mar 2014 15:43:18 +0100
changeset 23056 af6eda86177e
parent 23055 63ec3bde101c
child 23057 c67ddf10398e
8036675: Compiler warnings in serviceability code Reviewed-by: alanb, mgronlun
jdk/src/share/demo/jvmti/hprof/hprof_init.c
jdk/src/share/native/sun/tracing/dtrace/JVM.c
--- a/jdk/src/share/demo/jvmti/hprof/hprof_init.c	Wed Mar 05 13:28:37 2014 +0000
+++ b/jdk/src/share/demo/jvmti/hprof/hprof_init.c	Wed Mar 05 15:43:18 2014 +0100
@@ -237,7 +237,7 @@
  * such a connection can't be made.
  */
 static int
-connect_to_socket(char *hostname, unsigned short port)
+connect_to_socket(char *hostname, int port)
 {
     int fd;
 
@@ -251,7 +251,7 @@
     }
 
     /* create a socket */
-    fd = md_connect(hostname, port);
+    fd = md_connect(hostname, (unsigned short)port);
     return fd;
 }
 
@@ -817,7 +817,7 @@
 
     if ( gdata->net_port > 0 ) {
         LOG2("Agent_OnLoad", "Connecting to socket");
-        gdata->fd = connect_to_socket(gdata->net_hostname, (unsigned short)gdata->net_port);
+        gdata->fd = connect_to_socket(gdata->net_hostname, gdata->net_port);
         if (gdata->fd <= 0) {
             char errmsg[120];
 
--- a/jdk/src/share/native/sun/tracing/dtrace/JVM.c	Wed Mar 05 13:28:37 2014 +0000
+++ b/jdk/src/share/native/sun/tracing/dtrace/JVM.c	Wed Mar 05 15:43:18 2014 +0100
@@ -287,9 +287,9 @@
 
     if (name != NULL) {
         int i;
-        int len = (*env)->GetStringUTFLength(env, name);
+        jsize len = (*env)->GetStringUTFLength(env, name);
         int unicode_len = (*env)->GetStringLength(env, name);
-        if (len >= sizeof(buf)) {
+        if (len >= (jsize)sizeof(buf)) {
             utfName = malloc(len + 1);
             if (utfName == NULL) {
                 goto free_body;