X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Fnative%2Fvm%2Fcldc1.1%2Fcom_sun_cldc_io_j2me_socket_Protocol.cpp;h=856745cfba274719d69ecd1be6b05cc4ab1b7ea7;hb=d75c5c294648344a83d3a1df07695e1123a84f79;hp=16bebd345efc6aa23b3d1d82550b4c612853c676;hpb=7d9438705087944b53d2291820d1c8f729dad833;p=cacao.git diff --git a/src/native/vm/cldc1.1/com_sun_cldc_io_j2me_socket_Protocol.cpp b/src/native/vm/cldc1.1/com_sun_cldc_io_j2me_socket_Protocol.cpp index 16bebd345..856745cfb 100644 --- a/src/native/vm/cldc1.1/com_sun_cldc_io_j2me_socket_Protocol.cpp +++ b/src/native/vm/cldc1.1/com_sun_cldc_io_j2me_socket_Protocol.cpp @@ -37,7 +37,6 @@ #include "mm/memory.hpp" #include "native/jni.hpp" -#include "native/llni.h" #include "native/native.hpp" #if defined(ENABLE_JNI_HEADERS) @@ -63,7 +62,8 @@ JNIEXPORT jint JNICALL Java_com_sun_cldc_io_j2me_socket_Protocol_open0(JNIEnv *e // The hostname byte-array is a NULL terminated C-string. // XXX Not GC safe. - char* name = (char*) &(LLNI_array_data((java_handle_bytearray_t*) hostname)); + ByteArray ba(hostname); + char* name = (char*) ba.get_raw_data_ptr(); /* get the host */ @@ -106,7 +106,8 @@ JNIEXPORT jint JNICALL Java_com_sun_cldc_io_j2me_socket_Protocol_readBuf(JNIEnv { // Get pointer to the buffer. // XXX Not GC safe. - void* buf = &(LLNI_array_direct((java_handle_bytearray_t*) b, off)); + ByteArray ba(b); + void* buf = (void*) (((int8_t*) ba.get_raw_data_ptr()) + off); // Receive from the socket. ssize_t result = recv(handle, buf, len, 0); @@ -157,7 +158,8 @@ JNIEXPORT jint JNICALL Java_com_sun_cldc_io_j2me_socket_Protocol_writeBuf(JNIEnv { // Get pointer to the buffer. // XXX Not GC safe. - void* buf = &(LLNI_array_direct((java_handle_bytearray_t*) b, off)); + ByteArray ba(b); + void* buf = (void*) (((int8_t*) ba.get_raw_data_ptr()) + off); // Send the given byte to the socket. ssize_t result = send(handle, buf, len, 0);