diff --git a/transport-native-epoll/src/main/c/io_netty_channel_epoll_Native.c b/transport-native-epoll/src/main/c/io_netty_channel_epoll_Native.c index c953425aef..b15450d346 100644 --- a/transport-native-epoll/src/main/c/io_netty_channel_epoll_Native.c +++ b/transport-native-epoll/src/main/c/io_netty_channel_epoll_Native.c @@ -15,6 +15,7 @@ */ #define _GNU_SOURCE #include +#include #include #include #include @@ -270,7 +271,7 @@ JNIEXPORT jint JNICALL Java_io_netty_channel_epoll_Native_epollCreate(JNIEnv* en } JNIEXPORT jint JNICALL Java_io_netty_channel_epoll_Native_epollWait0(JNIEnv* env, jclass clazz, jint efd, jlong address, jint len, jint timeout) { - struct epoll_event *ev = (struct epoll_event*) address; + struct epoll_event *ev = (struct epoll_event*) (intptr_t) address; int ready; int err; @@ -337,7 +338,7 @@ JNIEXPORT jint JNICALL Java_io_netty_channel_epoll_Native_sendmmsg0(JNIEnv* env, msg[i].msg_hdr.msg_name = &addr; msg[i].msg_hdr.msg_namelen = sizeof(addr); - msg[i].msg_hdr.msg_iov = (struct iovec*) (*env)->GetLongField(env, packet, packetMemoryAddressFieldId); + msg[i].msg_hdr.msg_iov = (struct iovec*) (intptr_t) (*env)->GetLongField(env, packet, packetMemoryAddressFieldId); msg[i].msg_hdr.msg_iovlen = (*env)->GetIntField(env, packet, packetCountFieldId);; } diff --git a/transport-native-epoll/src/main/c/io_netty_channel_unix_FileDescriptor.c b/transport-native-epoll/src/main/c/io_netty_channel_unix_FileDescriptor.c index 103b293900..f8859f7b00 100644 --- a/transport-native-epoll/src/main/c/io_netty_channel_unix_FileDescriptor.c +++ b/transport-native-epoll/src/main/c/io_netty_channel_unix_FileDescriptor.c @@ -15,6 +15,7 @@ */ #include #include +#include #include #include #include @@ -158,12 +159,12 @@ JNIEXPORT jint JNICALL Java_io_netty_channel_unix_FileDescriptor_write(JNIEnv* e } JNIEXPORT jint JNICALL Java_io_netty_channel_unix_FileDescriptor_writeAddress(JNIEnv* env, jclass clazz, jint fd, jlong address, jint pos, jint limit) { - return _write(env, clazz, fd, (void*) address, pos, limit); + return _write(env, clazz, fd, (void*) (intptr_t) address, pos, limit); } JNIEXPORT jlong JNICALL Java_io_netty_channel_unix_FileDescriptor_writevAddresses(JNIEnv* env, jclass clazz, jint fd, jlong memoryAddress, jint length) { - struct iovec* iov = (struct iovec*) memoryAddress; + struct iovec* iov = (struct iovec*) (intptr_t) memoryAddress; return _writev(env, clazz, fd, iov, length); } @@ -211,7 +212,7 @@ JNIEXPORT jint JNICALL Java_io_netty_channel_unix_FileDescriptor_read(JNIEnv* en } JNIEXPORT jint JNICALL Java_io_netty_channel_unix_FileDescriptor_readAddress(JNIEnv* env, jclass clazz, jint fd, jlong address, jint pos, jint limit) { - return _read(env, clazz, fd, (void*) address, pos, limit); + return _read(env, clazz, fd, (void*) (intptr_t) address, pos, limit); } JNIEXPORT jlong JNICALL Java_io_netty_channel_unix_FileDescriptor_newPipe(JNIEnv* env, jclass clazz) { diff --git a/transport-native-epoll/src/main/c/io_netty_channel_unix_Socket.c b/transport-native-epoll/src/main/c/io_netty_channel_unix_Socket.c index 2800a69075..25bf6d5915 100644 --- a/transport-native-epoll/src/main/c/io_netty_channel_unix_Socket.c +++ b/transport-native-epoll/src/main/c/io_netty_channel_unix_Socket.c @@ -16,8 +16,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -538,7 +538,7 @@ JNIEXPORT jint JNICALL Java_io_netty_channel_unix_Socket_sendTo(JNIEnv* env, jcl } JNIEXPORT jint JNICALL Java_io_netty_channel_unix_Socket_sendToAddress(JNIEnv* env, jclass clazz, jint fd, jlong memoryAddress, jint pos, jint limit ,jbyteArray address, jint scopeId, jint port) { - return _sendTo(env, fd, (void*) memoryAddress, pos, limit, address, scopeId, port); + return _sendTo(env, fd, (void *) (intptr_t) memoryAddress, pos, limit, address, scopeId, port); } JNIEXPORT jint JNICALL Java_io_netty_channel_unix_Socket_sendToAddresses(JNIEnv* env, jclass clazz, jint fd, jlong memoryAddress, jint length, jbyteArray address, jint scopeId, jint port) { @@ -551,7 +551,7 @@ JNIEXPORT jint JNICALL Java_io_netty_channel_unix_Socket_sendToAddresses(JNIEnv* struct msghdr m; m.msg_name = (void*) &addr; m.msg_namelen = (socklen_t) sizeof(struct sockaddr_storage); - m.msg_iov = (struct iovec*) memoryAddress; + m.msg_iov = (struct iovec*) (intptr_t) memoryAddress; m.msg_iovlen = length; ssize_t res; @@ -573,7 +573,7 @@ JNIEXPORT jobject JNICALL Java_io_netty_channel_unix_Socket_recvFrom(JNIEnv* env } JNIEXPORT jobject JNICALL Java_io_netty_channel_unix_Socket_recvFromAddress(JNIEnv* env, jclass clazz, jint fd, jlong address, jint pos, jint limit) { - return _recvFrom(env, fd, (void*) address, pos, limit); + return _recvFrom(env, fd, (void *) (intptr_t) address, pos, limit); } JNIEXPORT jint JNICALL Java_io_netty_channel_unix_Socket_bindDomainSocket(JNIEnv* env, jclass clazz, jint fd, jbyteArray socketPath) {