--- old/src/share/native/java/io/io_util.c Thu Nov 24 17:57:37 2011 +++ new/src/share/native/java/io/io_util.c Thu Nov 24 17:57:37 2011 @@ -44,7 +44,7 @@ JNU_ThrowIOException(env, "Stream Closed"); return -1; } - nread = (jint)IO_Read(fd, &ret, 1); + nread = IO_Read(fd, &ret, 1); if (nread == 0) { /* EOF */ return -1; } else if (nread == JVM_IO_ERR) { /* error */ @@ -108,7 +108,7 @@ JNU_ThrowIOException(env, "Stream Closed"); nread = -1; } else { - nread = (jint)IO_Read(fd, buf, len); + nread = IO_Read(fd, buf, len); if (nread > 0) { (*env)->SetByteArrayRegion(env, bytes, off, nread, (jbyte *)buf); } else if (nread == JVM_IO_ERR) { @@ -137,9 +137,9 @@ return; } if (append == JNI_TRUE) { - n = (jint)IO_Append(fd, &c, 1); + n = IO_Append(fd, &c, 1); } else { - n = (jint)IO_Write(fd, &c, 1); + n = IO_Write(fd, &c, 1); } if (n == JVM_IO_ERR) { JNU_ThrowIOExceptionWithLastError(env, "Write error"); @@ -190,9 +190,9 @@ break; } if (append == JNI_TRUE) { - n = (jint)IO_Append(fd, buf+off, len); + n = IO_Append(fd, buf+off, len); } else { - n = (jint)IO_Write(fd, buf+off, len); + n = IO_Write(fd, buf+off, len); } if (n == JVM_IO_ERR) { JNU_ThrowIOExceptionWithLastError(env, "Write error"); --- old/src/windows/native/java/io/io_util_md.c Thu Nov 24 17:57:39 2011 +++ new/src/windows/native/java/io/io_util_md.c Thu Nov 24 17:57:39 2011 @@ -478,7 +478,7 @@ } JNIEXPORT -size_t +jint handleRead(jlong fd, void *buf, jint len) { DWORD read = 0; @@ -499,10 +499,10 @@ } return -1; } - return read; + return (jint)read; } -static size_t writeInternal(jlong fd, const void *buf, jint len, jboolean append) +static jint writeInternal(jlong fd, const void *buf, jint len, jboolean append) { BOOL result = 0; DWORD written = 0; @@ -527,16 +527,16 @@ if ((h == INVALID_HANDLE_VALUE) || (result == 0)) { return -1; } - return (size_t)written; + return (jint)written; } JNIEXPORT -size_t handleWrite(jlong fd, const void *buf, jint len) { +jint handleWrite(jlong fd, const void *buf, jint len) { return writeInternal(fd, buf, len, JNI_FALSE); } JNIEXPORT -size_t handleAppend(jlong fd, const void *buf, jint len) { +jint handleAppend(jlong fd, const void *buf, jint len) { return writeInternal(fd, buf, len, JNI_TRUE); } --- old/src/windows/native/java/io/io_util_md.h Thu Nov 24 17:57:41 2011 +++ new/src/windows/native/java/io/io_util_md.h Thu Nov 24 17:57:41 2011 @@ -39,9 +39,9 @@ int handleAvailable(jlong fd, jlong *pbytes); JNIEXPORT int handleSync(jlong fd); int handleSetLength(jlong fd, jlong length); -JNIEXPORT size_t handleRead(jlong fd, void *buf, jint len); -JNIEXPORT size_t handleWrite(jlong fd, const void *buf, jint len); -JNIEXPORT size_t handleAppend(jlong fd, const void *buf, jint len); +JNIEXPORT jint handleRead(jlong fd, void *buf, jint len); +JNIEXPORT jint handleWrite(jlong fd, const void *buf, jint len); +JNIEXPORT jint handleAppend(jlong fd, const void *buf, jint len); jint handleClose(JNIEnv *env, jobject this, jfieldID fid); jlong handleLseek(jlong fd, jlong offset, jint whence);