tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r377964 - in /tomcat/connectors/trunk/jni/native/src: file.c network.c
Date Wed, 15 Feb 2006 08:33:29 GMT
Author: pero
Date: Wed Feb 15 00:33:27 2006
New Revision: 377964

URL: http://svn.apache.org/viewcvs?rev=377964&view=rev
Log:
fix some type cast warnings at MACOS X 10.4.4 Xcode 2.2 (gcc 4.0.1)

Modified:
    tomcat/connectors/trunk/jni/native/src/file.c
    tomcat/connectors/trunk/jni/native/src/network.c

Modified: tomcat/connectors/trunk/jni/native/src/file.c
URL: http://svn.apache.org/viewcvs/tomcat/connectors/trunk/jni/native/src/file.c?rev=377964&r1=377963&r2=377964&view=diff
==============================================================================
--- tomcat/connectors/trunk/jni/native/src/file.c (original)
+++ tomcat/connectors/trunk/jni/native/src/file.c Wed Feb 15 00:33:27 2006
@@ -521,8 +521,7 @@
     jbyte *bytes = (*e)->GetByteArrayElements(e, buf, NULL);
 
     UNREFERENCED(o);
-    rv = apr_file_gets(bytes + offset, nbytes - offset, f);
-
+    rv = apr_file_gets((char*)(bytes + offset),nbytes - offset, f);
     (*e)->ReleaseByteArrayElements(e, buf, bytes,
                                    rv == APR_SUCCESS ? 0 : JNI_ABORT);
     return (jint)rv;

Modified: tomcat/connectors/trunk/jni/native/src/network.c
URL: http://svn.apache.org/viewcvs/tomcat/connectors/trunk/jni/native/src/network.c?rev=377964&r1=377963&r2=377964&view=diff
==============================================================================
--- tomcat/connectors/trunk/jni/native/src/network.c (original)
+++ tomcat/connectors/trunk/jni/native/src/network.c Wed Feb 15 00:33:27 2006
@@ -517,7 +517,7 @@
             bytes = (*e)->GetPrimitiveArrayCritical(e, buf, NULL);
         else
             bytes = (*e)->GetByteArrayElements(e, buf, NULL);
-        ss = (*s->net->send)(s->opaque, bytes + offset, &nbytes);
+        ss = (*s->net->send)(s->opaque, (char *)(bytes + offset), &nbytes);
         if (nb)
             (*e)->ReleasePrimitiveArrayCritical(e, buf, bytes, JNI_ABORT);
         else
@@ -689,7 +689,7 @@
          bytes = (*e)->GetPrimitiveArrayCritical(e, buf, NULL);
     else
          bytes = (*e)->GetByteArrayElements(e, buf, NULL);
-    ss = apr_socket_sendto(s->sock, w, flag, bytes + offset, &nbytes);
+    ss = apr_socket_sendto(s->sock, w, flag, (char *)(bytes + offset), &nbytes);
 
     if (nb)
         (*e)->ReleasePrimitiveArrayCritical(e, buf, bytes, 0);
@@ -718,11 +718,11 @@
         char sb[TCN_BUFFER_SZ];
 
         if ((ss = (*s->net->recv)(s->opaque, sb, &nbytes)) == APR_SUCCESS)
-            (*e)->SetByteArrayRegion(e, buf, offset, (jsize)nbytes, sb);
+            (*e)->SetByteArrayRegion(e, buf, offset, (jsize)nbytes, (jbyte*)sb);
     }
     else {
         jbyte *bytes = (*e)->GetByteArrayElements(e, buf, NULL);
-        ss = (*s->net->recv)(s->opaque, bytes + offset, &nbytes);
+        ss = (*s->net->recv)(s->opaque, (char*)(bytes + offset), &nbytes);
         (*e)->ReleaseByteArrayElements(e, buf, bytes,
                                        nbytes ? 0 : JNI_ABORT);
     }
@@ -776,11 +776,11 @@
     if (toread <= TCN_BUFFER_SZ) {
         char sb[TCN_BUFFER_SZ];
         ss = (*s->net->recv)(s->opaque, sb, &nbytes);
-        (*e)->SetByteArrayRegion(e, buf, offset, (jsize)nbytes, sb);
+        (*e)->SetByteArrayRegion(e, buf, offset, (jsize)nbytes, (jbyte*)sb);
     }
     else {
         jbyte *bytes = (*e)->GetByteArrayElements(e, buf, NULL);
-        ss = (*s->net->recv)(s->opaque, bytes + offset, &nbytes);
+        ss = (*s->net->recv)(s->opaque, (char*)(bytes + offset), &nbytes);
         (*e)->ReleaseByteArrayElements(e, buf, bytes,
                                        nbytes ? 0 : JNI_ABORT);
     }
@@ -1022,7 +1022,7 @@
     TCN_ASSERT(sock != 0);
     TCN_ASSERT(s->sock != NULL);
     TCN_ASSERT(buf != NULL);
-    ss = apr_socket_recvfrom(f, s->sock, (apr_int32_t)flags, bytes + offset, &nbytes);
+    ss = apr_socket_recvfrom(f, s->sock, (apr_int32_t)flags, (char*)(bytes + offset),
&nbytes);
 
     (*e)->ReleaseByteArrayElements(e, buf, bytes,
                                    nbytes ? 0 : JNI_ABORT);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message