changeset 23056:af6eda86177e

8036675: Compiler warnings in serviceability code Reviewed-by: alanb, mgronlun
author sla
date Wed, 05 Mar 2014 15:43:18 +0100
parents 63ec3bde101c
children c67ddf10398e
files jdk/src/share/demo/jvmti/hprof/hprof_init.c jdk/src/share/native/sun/tracing/dtrace/JVM.c
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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;