summaryrefslogtreecommitdiff
path: root/native/jni/java-net
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2004-10-26 20:26:03 +0000
committerMark Wielaard <mark@klomp.org>2004-10-26 20:26:03 +0000
commit75c2a99d73ec6542aa3eceb7e3bbcb20b680aa81 (patch)
treeefa97a2786a29b56508530fd215b336e055a8c59 /native/jni/java-net
parent680f2e95a4e3755985b93f318541c91842f5a9b8 (diff)
downloadclasspath-75c2a99d73ec6542aa3eceb7e3bbcb20b680aa81.tar.gz
* configure.ac (CLASSPATH_MODULE): Add -no-undefined.
(Werror): New configure flag. (gtk-peer): Remove comma from help string. (AM_CFLAGS): Replace by... (WARNING_CFLAGS, STRICT_WARNING_CFLAGS, ERROR_CFLAGS): New gcc flags. (AM_CPPFLAGS): Replace by... (CLASSPATH_INCLUDES): New -I gcc flags. * native/fdlibm/Makefile.am: Use new AM_LDFLAGS, AM_CPPFLAGS and AM_CFLAGS when not library specific flags are used. * native/jni/gtk-peer/Makefile.am: Likewise. * native/jni/java-io/Makefile.am: Likewise. * native/jni/java-lang/Makefile.am: Likewise. * native/jni/java-net/Makefile.am: Likewise. * native/jni/java-nio/Makefile.am: Likewise. * native/jni/java-util/Makefile.am: Likewise. * native/jni/java-io/java_io_ObjectInputStream.c: Mark function arguments unused where necessary. * native/jni/java-io/java_io_VMFile.c: Likewise. * native/jni/java-io/java_io_VMObjectStreamClass.c: Likewise. (getFieldReference): Make sure we allocate the_type ourselves if we free it later. Removed unused argument object. * native/jni/java-io/javaio.c (javaio_read): Removed unused argument obj. (javaio_write): Likewise. * native/jni/java-io/javaio.h: Mark function arguments unused where necessary. * native/jni/java-lang/java_lang_Double.c: Likewise. (Java_java_lang_Double_parseDouble): Declare buf as const char*. * native/jni/java-lang/java_lang_Math.c: Mark function arguments unused where necessary. * native/jni/java-lang/java_lang_VMDouble.c: Likewise. * native/jni/java-lang/java_lang_VMFloat.c: Likewise. * native/jni/java-lang/java_lang_VMSystem.c: Likewise. * native/jni/java-lang/java_lang_reflect_Array.c: Likewise. * native/jni/java-net/gnu_java_net_PlainDatagramSocketImpl.c (Java_gnu_java_net_PlainDatagramSocketImpl_receive0): Mark only maxlen and offset as unsigned. * native/jni/java-net/java_net_InetAddress.c: Mark function arguments unused where necessary. (Java_java_net_InetAddress_getHostByName): New local int variable max_addresses. * native/jni/java-net/java_net_NetworkInterface.c: Mark function arguments unused where necessary. * native/jni/java-net/javanet.c (_javanet_set_int_field): Removed unused argument class. (_javanet_accept): Check result variable after it has been assigned. * native/jni/java-nio/gnu_java_nio_NIOServerSocket.c: Mark function arguments unused where necessary. * native/jni/java-nio/gnu_java_nio_VMPipe.c: Likewise. * native/jni/java-nio/gnu_java_nio_VMSelector.c: Likewise. * native/jni/java-nio/gnu_java_nio_VMSelector.c: Likewise. * native/jni/java-nio/gnu_java_nio_channels_FileChannelImpl.c: Likewise. * native/jni/java-nio/java_nio_DirectByteBufferImpl.c: Likewise. * native/jni/java-nio/java_nio_MappedByteBufferImpl.c: Likewise. * native/jni/java-nio/java_nio_channels_Channels.c: Likewise. * native/jni/java-util/java_util_VMTimeZone.c (jint_to_charbuf): Mark as static function. (Java_java_util_VMTimeZone_getSystemTimeZoneId): Mark clazz argument as unused. Cast _timezone to long before use. * native/target/generic/target_generic_network.h: Remove asserts.
Diffstat (limited to 'native/jni/java-net')
-rw-r--r--native/jni/java-net/Makefile.am5
-rw-r--r--native/jni/java-net/gnu_java_net_PlainDatagramSocketImpl.c3
-rw-r--r--native/jni/java-net/java_net_InetAddress.c26
-rw-r--r--native/jni/java-net/java_net_NetworkInterface.c4
-rw-r--r--native/jni/java-net/javanet.c6
5 files changed, 31 insertions, 13 deletions
diff --git a/native/jni/java-net/Makefile.am b/native/jni/java-net/Makefile.am
index a05164b0a..ed9f1e273 100644
--- a/native/jni/java-net/Makefile.am
+++ b/native/jni/java-net/Makefile.am
@@ -7,5 +7,8 @@ libjavanet_la_SOURCES = javanet.c \
gnu_java_net_PlainDatagramSocketImpl.c \
gnu_java_net_PlainSocketImpl.c
-libjavanet_la_LDFLAGS = @CLASSPATH_MODULE@
libjavanet_la_LIBADD = $(top_builddir)/native/jni/classpath/jcl.lo
+
+AM_LDFLAGS = @CLASSPATH_MODULE@
+AM_CPPFLAGS = @CLASSPATH_INCLUDES@
+AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@
diff --git a/native/jni/java-net/gnu_java_net_PlainDatagramSocketImpl.c b/native/jni/java-net/gnu_java_net_PlainDatagramSocketImpl.c
index 5c1c2f9b2..56e3a257b 100644
--- a/native/jni/java-net/gnu_java_net_PlainDatagramSocketImpl.c
+++ b/native/jni/java-net/gnu_java_net_PlainDatagramSocketImpl.c
@@ -161,7 +161,8 @@ Java_gnu_java_net_PlainDatagramSocketImpl_receive0(JNIEnv *env, jobject this,
jobject packet)
{
#ifndef WITHOUT_NETWORK
- unsigned int addr, port, maxlen, offset, bytes_read;
+ int addr, port, bytes_read;
+ unsigned int maxlen, offset;
jclass cls, addr_cls;
jfieldID fid;
jmethodID mid;
diff --git a/native/jni/java-net/java_net_InetAddress.c b/native/jni/java-net/java_net_InetAddress.c
index 8fa722fd0..9d44752e9 100644
--- a/native/jni/java-net/java_net_InetAddress.c
+++ b/native/jni/java-net/java_net_InetAddress.c
@@ -61,7 +61,9 @@ exception statement from your version. */
* Function to return the local hostname
*/
JNIEXPORT jstring JNICALL
-Java_java_net_InetAddress_getLocalHostname(JNIEnv *env, jclass class)
+Java_java_net_InetAddress_getLocalHostname(JNIEnv *env,
+ jclass class
+ __attribute__ ((__unused__)))
{
char hostname[256];
int result;
@@ -91,7 +93,9 @@ Java_java_net_InetAddress_getLocalHostname(JNIEnv *env, jclass class)
* Returns the value of the special IP address INADDR_ANY
*/
JNIEXPORT jarray JNICALL
-Java_java_net_InetAddress_lookupInaddrAny(JNIEnv *env, jclass class)
+Java_java_net_InetAddress_lookupInaddrAny(JNIEnv *env,
+ jclass class
+ __attribute__ ((__unused__)))
{
jarray IParray;
jbyte *octets;
@@ -135,7 +139,10 @@ Java_java_net_InetAddress_lookupInaddrAny(JNIEnv *env, jclass class)
* in as a byte array
*/
JNIEXPORT jstring JNICALL
-Java_java_net_InetAddress_getHostByAddr(JNIEnv *env, jclass class, jarray arr)
+Java_java_net_InetAddress_getHostByAddr(JNIEnv *env,
+ jclass class
+ __attribute__ ((__unused__)),
+ jarray arr)
{
#ifndef WITHOUT_NETWORK
jbyte *octets;
@@ -193,7 +200,10 @@ Java_java_net_InetAddress_getHostByAddr(JNIEnv *env, jclass class, jarray arr)
/*************************************************************************/
JNIEXPORT jobjectArray JNICALL
-Java_java_net_InetAddress_getHostByName(JNIEnv *env, jclass class, jstring host)
+Java_java_net_InetAddress_getHostByName(JNIEnv *env,
+ jclass class
+ __attribute__ ((__unused__)),
+ jstring host)
{
#ifndef WITHOUT_NETWORK
const char *hostname;
@@ -206,6 +216,7 @@ Java_java_net_InetAddress_getHostByName(JNIEnv *env, jclass class, jstring host)
int i;
jbyte *octets;
jarray ret_octets;
+ int max_addresses;
assert(env!=NULL);
assert((*env)!=NULL);
@@ -218,13 +229,12 @@ Java_java_net_InetAddress_getHostByName(JNIEnv *env, jclass class, jstring host)
return (jobjectArray)NULL;
}
- /* Look up the host */
+ max_addresses = sizeof(addresses) / sizeof(addresses[0]);
TARGET_NATIVE_NETWORK_GET_HOSTNAME_BY_NAME(hostname,
addresses,
- sizeof(addresses)/sizeof(addresses[0]),
+ max_addresses,
addresses_count,
- result
- );
+ result);
if (result != TARGET_NATIVE_OK)
{
JCL_ThrowException(env, UNKNOWN_HOST_EXCEPTION, (char*)hostname);
diff --git a/native/jni/java-net/java_net_NetworkInterface.c b/native/jni/java-net/java_net_NetworkInterface.c
index 6c51f872f..8a8bfebb6 100644
--- a/native/jni/java-net/java_net_NetworkInterface.c
+++ b/native/jni/java-net/java_net_NetworkInterface.c
@@ -54,7 +54,9 @@ exception statement from your version. */
* Returns all local network interfaces as vector
*/
JNIEXPORT jobject JNICALL
-Java_java_net_NetworkInterface_getRealNetworkInterfaces (JNIEnv* env, jclass class)
+Java_java_net_NetworkInterface_getRealNetworkInterfaces (JNIEnv* env,
+ jclass class
+ __attribute__ ((__unused__)))
{
JCL_ThrowException (env, IO_EXCEPTION, "java.net.NetworkInterface.getRealNetworkInterfaces(): not implemented");
return 0;
diff --git a/native/jni/java-net/javanet.c b/native/jni/java-net/javanet.c
index 7caf8801f..ce51fd54a 100644
--- a/native/jni/java-net/javanet.c
+++ b/native/jni/java-net/javanet.c
@@ -71,7 +71,8 @@ exception statement from your version. */
* Sets an integer field in the specified object.
*/
static void
-_javanet_set_int_field(JNIEnv *env, jobject obj, char *class, char *field,
+_javanet_set_int_field(JNIEnv *env, jobject obj,
+ const char *class, const char *field,
int val)
{
jclass cls;
@@ -789,7 +790,7 @@ _javanet_accept(JNIEnv *env, jobject this, jobject impl)
}
/* Accept the connection */
- while (result != TARGET_NATIVE_OK)
+ do
{
TARGET_NATIVE_NETWORK_SOCKET_ACCEPT(fd,newfd,result);
if (result != TARGET_NATIVE_OK
@@ -801,6 +802,7 @@ _javanet_accept(JNIEnv *env, jobject this, jobject impl)
return;
}
}
+ while (result != TARGET_NATIVE_OK);
/* Populate instance variables */
_javanet_set_int_field(env, impl, "gnu/java/net/PlainSocketImpl", "native_fd",