diff options
author | Mark Wielaard <mark@gcc.gnu.org> | 2006-01-17 18:09:40 +0000 |
---|---|---|
committer | Mark Wielaard <mark@gcc.gnu.org> | 2006-01-17 18:09:40 +0000 |
commit | 2127637945ea6b763966398130e0770fa993c860 (patch) | |
tree | c976ca91e3ef0bda3b34b37c0195145638d8d08e /libjava/classpath/native | |
parent | bcb36c3e02e3bd2843aad1b9888513dfb5d6e337 (diff) | |
download | gcc-2127637945ea6b763966398130e0770fa993c860.zip gcc-2127637945ea6b763966398130e0770fa993c860.tar.gz gcc-2127637945ea6b763966398130e0770fa993c860.tar.bz2 |
Imported GNU Classpath 0.20
Imported GNU Classpath 0.20
* Makefile.am (AM_CPPFLAGS): Add classpath/include.
* java/nio/charset/spi/CharsetProvider.java: New override file.
* java/security/Security.java: Likewise.
* sources.am: Regenerated.
* Makefile.in: Likewise.
From-SVN: r109831
Diffstat (limited to 'libjava/classpath/native')
53 files changed, 769 insertions, 1617 deletions
diff --git a/libjava/classpath/native/Makefile.in b/libjava/classpath/native/Makefile.in index bfa05c8..507a966 100644 --- a/libjava/classpath/native/Makefile.in +++ b/libjava/classpath/native/Makefile.in @@ -41,10 +41,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ - $(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -148,6 +149,7 @@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ JIKESENCODING = @JIKESENCODING@ +JIKESWARNINGS = @JIKESWARNINGS@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ diff --git a/libjava/classpath/native/fdlibm/Makefile.am b/libjava/classpath/native/fdlibm/Makefile.am index e3e3eec..545b0f8 100644 --- a/libjava/classpath/native/fdlibm/Makefile.am +++ b/libjava/classpath/native/fdlibm/Makefile.am @@ -15,7 +15,6 @@ libfdlibm_la_SOURCES = \ e_sqrt.c \ fdlibm.h \ ieeefp.h \ - java-assert.h \ k_cos.c \ k_rem_pio2.c \ k_sin.c \ @@ -44,7 +43,8 @@ libfdlibm_la_SOURCES = \ w_log.c \ w_pow.c \ w_remainder.c \ - w_sqrt.c + w_sqrt.c \ + namespace.h AM_LDFLAGS = @CLASSPATH_MODULE@ diff --git a/libjava/classpath/native/fdlibm/Makefile.in b/libjava/classpath/native/fdlibm/Makefile.in index 5d53fa6..b58bb63 100644 --- a/libjava/classpath/native/fdlibm/Makefile.in +++ b/libjava/classpath/native/fdlibm/Makefile.in @@ -44,10 +44,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ - $(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -167,6 +168,7 @@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ JIKESENCODING = @JIKESENCODING@ +JIKESWARNINGS = @JIKESWARNINGS@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ @@ -287,7 +289,6 @@ libfdlibm_la_SOURCES = \ e_sqrt.c \ fdlibm.h \ ieeefp.h \ - java-assert.h \ k_cos.c \ k_rem_pio2.c \ k_sin.c \ @@ -316,7 +317,8 @@ libfdlibm_la_SOURCES = \ w_log.c \ w_pow.c \ w_remainder.c \ - w_sqrt.c + w_sqrt.c \ + namespace.h AM_LDFLAGS = @CLASSPATH_MODULE@ all: all-am diff --git a/libjava/classpath/native/fdlibm/fdlibm.h b/libjava/classpath/native/fdlibm/fdlibm.h index 156a03c..13ee449 100644 --- a/libjava/classpath/native/fdlibm/fdlibm.h +++ b/libjava/classpath/native/fdlibm/fdlibm.h @@ -24,6 +24,8 @@ /* GCJ LOCAL: Include files. */ #include "ieeefp.h" +/* CLASSPATH LOCAL: */ +#include "namespace.h" #include "mprec.h" @@ -93,7 +95,11 @@ extern double erf __P((double)); extern double erfc __P((double)); extern double gamma __P((double)); extern double hypot __P((double, double)); -extern int isnan __P((double)); + +#if !defined(isnan) && !defined(HAVE_ISNAN) +#define isnan(x) ((x) != (x)) +#endif + extern int finite __P((double)); extern double j0 __P((double)); extern double j1 __P((double)); diff --git a/libjava/classpath/native/fdlibm/ieeefp.h b/libjava/classpath/native/fdlibm/ieeefp.h index 405baab..1dda99b 100644 --- a/libjava/classpath/native/fdlibm/ieeefp.h +++ b/libjava/classpath/native/fdlibm/ieeefp.h @@ -123,9 +123,8 @@ #define __IEEE_LITTLE_ENDIAN #endif -#if defined (__PPC__) || defined (__ppc__) || defined (__ppc64__) -#if (defined(_BIG_ENDIAN) && _BIG_ENDIAN) || (defined(_AIX) && _AIX) \ - || defined (__APPLE__) +#if defined (__PPC__) || defined (__ppc__) || defined (__powerpc__) || defined (__ppc64__) +#if (defined(_BIG_ENDIAN) && _BIG_ENDIAN) || (defined(_AIX) && _AIX) || defined (__BIG_ENDIAN__)|| defined (__APPLE__) #define __IEEE_BIG_ENDIAN #else #if (defined(_LITTLE_ENDIAN) && _LITTLE_ENDIAN) || (defined(__sun__) && __sun__) || (defined(__WIN32__) && __WIN32__) diff --git a/libjava/classpath/native/fdlibm/java-assert.h b/libjava/classpath/native/fdlibm/java-assert.h deleted file mode 100644 index ad512ad..0000000 --- a/libjava/classpath/native/fdlibm/java-assert.h +++ /dev/null @@ -1,40 +0,0 @@ -/* java-assert.h - Header file holding assertion definitions. -*- c++ -*- */ - -/* Copyright (C) 1998, 1999 Free Software Foundation - - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ - -#ifndef __JAVA_ASSERT_H__ -#define __JAVA_ASSERT_H__ - -#include <config.h> - -/* This is a libgcj implementation header. */ - -void _Jv_Abort (const char *, const char *, int, const char *) - __attribute__ ((__noreturn__)); - -#ifdef DEBUG -#define _Jv_AssertDoCall(Message) _Jv_Abort (__FUNCTION__, __FILE__, __LINE__, Message) - -#define JvAssertMessage(Expr, Message) \ - do { if (! (Expr)) _Jv_AssertDoCall (Message); } while (0) -#define JvAssert(Expr) \ - do { if (! (Expr)) _Jv_AssertDoCall (# Expr); } while (0) - -#define JvFail(Message) _Jv_AssertDoCall (Message) - -#else /* DEBUG */ - -#define _Jv_AssertDoCall(Message) -#define JvAssertMessage(Expr, Message) -#define JvAssert(Expr) -#define JvFail(Message) _Jv_Abort (0, 0, 0, Message) - -#endif /* not DEBUG */ - -#endif /* __JAVA_ASSERT_H__ */ diff --git a/libjava/classpath/native/fdlibm/mprec.c b/libjava/classpath/native/fdlibm/mprec.c index 00679ed..0badf60 100644 --- a/libjava/classpath/native/fdlibm/mprec.c +++ b/libjava/classpath/native/fdlibm/mprec.c @@ -80,9 +80,9 @@ * down depends on the machine and the number being converted. */ +#include <assert.h> #include <stdlib.h> #include <string.h> -#include <java-assert.h> #include "mprec.h" /* reent.c knows this value */ @@ -97,12 +97,14 @@ _DEFUN (Balloc, (ptr, k), struct _Jv_reent *ptr _AND int k) int i = 0; int j = 1; - JvAssert ((1 << k) < MAX_BIGNUM_WDS); + /* FIXME - assert disabled because of PR classpath/23863 + * assert ((1 << k) < MAX_BIGNUM_WDS); + */ while ((ptr->_allocation_map & j) && i < MAX_BIGNUMS) i++, j <<= 1; - JvAssert (i < MAX_BIGNUMS); + assert (i < MAX_BIGNUMS); if (i >= MAX_BIGNUMS) return NULL; @@ -124,7 +126,7 @@ _DEFUN (Bfree, (ptr, v), struct _Jv_reent *ptr _AND _Jv_Bigint * v) i = v - ptr->_freelist; - JvAssert (i >= 0 && i < MAX_BIGNUMS); + assert (i >= 0 && i < MAX_BIGNUMS); if (i >= 0 && i < MAX_BIGNUMS) ptr->_allocation_map &= ~ (1 << i); diff --git a/libjava/classpath/native/fdlibm/mprec.h b/libjava/classpath/native/fdlibm/mprec.h index f250619..cd8f928 100644 --- a/libjava/classpath/native/fdlibm/mprec.h +++ b/libjava/classpath/native/fdlibm/mprec.h @@ -30,13 +30,10 @@ #define __CLASSPATH_MPREC_H__ #include <config.h> +#include "config-int.h" #include "ieeefp.h" - -#if defined HAVE_STDINT_H -#include <stdint.h> -#elif defined HAVE_INTTYPES_H -#include <inttypes.h> -#endif +/* CLASSPATH LOCAL */ +#include "namespace.h" #if defined HAVE_SYS_TYPES_H #include <sys/types.h> @@ -50,24 +47,6 @@ extern "C" { #endif -/* ISO C99 int type declarations */ - -#if !defined HAVE_INT32_DEFINED && defined HAVE_BSD_INT32_DEFINED -typedef u_int32_t uint32_t; -#endif - -#if !defined HAVE_BSD_INT32_DEFINED && !defined HAVE_INT32_DEFINED -/* FIXME this could have problems with systems that don't define SI to be 4 */ -typedef int int32_t __attribute__((mode(SI))); - -/* This is a blatant hack: on Solaris 2.5, pthread.h defines uint32_t - in pthread.h, which we sometimes include. We protect our - definition the same way Solaris 2.5 does, to avoid redefining it. */ -# ifndef _UINT32_T -typedef unsigned int uint32_t __attribute__((mode(SI))); -# endif -#endif - /* These typedefs are true for the targets running Java. */ #ifdef __IEEE_LITTLE_ENDIAN @@ -84,6 +63,7 @@ typedef unsigned int uint32_t __attribute__((mode(SI))); #ifdef DEBUG #include "stdio.h" +#include <stdlib.h> #define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);} #endif diff --git a/libjava/classpath/native/fdlibm/namespace.h b/libjava/classpath/native/fdlibm/namespace.h new file mode 100644 index 0000000..02da970 --- /dev/null +++ b/libjava/classpath/native/fdlibm/namespace.h @@ -0,0 +1,3 @@ +/* GCJ LOCAL We don't use the renaming here, so this file is empty for us. + * Warning ! This is a generated file. Use build_mathnamespace to regenerate it + */ diff --git a/libjava/classpath/native/jawt/Makefile.in b/libjava/classpath/native/jawt/Makefile.in index 1fa178b..2c8ffe8 100644 --- a/libjava/classpath/native/jawt/Makefile.in +++ b/libjava/classpath/native/jawt/Makefile.in @@ -44,10 +44,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ - $(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -161,6 +162,7 @@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ JIKESENCODING = @JIKESENCODING@ +JIKESWARNINGS = @JIKESWARNINGS@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ diff --git a/libjava/classpath/native/jni/Makefile.in b/libjava/classpath/native/jni/Makefile.in index 79d9fa7..d7ccced 100644 --- a/libjava/classpath/native/jni/Makefile.in +++ b/libjava/classpath/native/jni/Makefile.in @@ -41,10 +41,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ - $(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -148,6 +149,7 @@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ JIKESENCODING = @JIKESENCODING@ +JIKESWARNINGS = @JIKESWARNINGS@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ diff --git a/libjava/classpath/native/jni/classpath/Makefile.in b/libjava/classpath/native/jni/classpath/Makefile.in index 9531df7..5e15f78 100644 --- a/libjava/classpath/native/jni/classpath/Makefile.in +++ b/libjava/classpath/native/jni/classpath/Makefile.in @@ -44,10 +44,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ - $(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -160,6 +161,7 @@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ JIKESENCODING = @JIKESENCODING@ +JIKESWARNINGS = @JIKESWARNINGS@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ diff --git a/libjava/classpath/native/jni/classpath/jcl.c b/libjava/classpath/native/jni/classpath/jcl.c index aacbe89..dd6ca06 100644 --- a/libjava/classpath/native/jni/classpath/jcl.c +++ b/libjava/classpath/native/jni/classpath/jcl.c @@ -43,7 +43,9 @@ exception statement from your version. */ #include <jcl.h> #ifndef __GNUC__ -#define __attribute__(x) /* nothing */ + #ifndef __attribute__ + #define __attribute__(x) /* nothing */ + #endif #endif JNIEXPORT void JNICALL diff --git a/libjava/classpath/native/jni/gtk-peer/Makefile.in b/libjava/classpath/native/jni/gtk-peer/Makefile.in index 77ce68f..0296ce8 100644 --- a/libjava/classpath/native/jni/gtk-peer/Makefile.in +++ b/libjava/classpath/native/jni/gtk-peer/Makefile.in @@ -44,10 +44,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ - $(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -238,6 +239,7 @@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ JIKESENCODING = @JIKESENCODING@ +JIKESWARNINGS = @JIKESWARNINGS@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c index cd7eee6..30f2d5e 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c @@ -291,6 +291,10 @@ Java_gnu_java_awt_peer_gtk_GdkFontPeer_getTextMetrics const char *cstr = NULL; jdouble *native_metrics = NULL; PangoRectangle log; + PangoRectangle log2; + int line_count = 0; + int i = 0; + int width = 0; gdk_threads_enter(); @@ -299,9 +303,17 @@ Java_gnu_java_awt_peer_gtk_GdkFontPeer_getTextMetrics cstr = (*env)->GetStringUTFChars (env, str, NULL); g_assert(cstr != NULL); - + pango_layout_set_text (pfont->layout, cstr, -1); pango_layout_get_extents (pfont->layout, NULL, &log); + + line_count = pango_layout_get_line_count (pfont->layout); + for (i = 0; i < line_count; i++) + { + pango_layout_line_get_extents (pango_layout_get_line (pfont->layout, i), + NULL, &log2); + width += log2.width; + } (*env)->ReleaseStringUTFChars (env, str, cstr); pango_layout_set_text (pfont->layout, "", -1); @@ -315,12 +327,12 @@ Java_gnu_java_awt_peer_gtk_GdkFontPeer_getTextMetrics native_metrics[TEXT_METRICS_Y_BEARING] = PANGO_PIXELS( ((double)log.y) ); - native_metrics[TEXT_METRICS_WIDTH] - = PANGO_PIXELS( ((double)log.width) ); - native_metrics[TEXT_METRICS_HEIGHT] = PANGO_PIXELS( ((double)log.height) ); + native_metrics[TEXT_METRICS_WIDTH] + = PANGO_PIXELS( ((double)width) ); + native_metrics[TEXT_METRICS_X_ADVANCE] = PANGO_PIXELS( ((double) (log.x + log.width)) ); diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c index 4aca1cf5..f6e0e6b 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c @@ -99,7 +99,7 @@ static GdkPoint *translate_points (JNIEnv *env, jintArray xpoints, static void realize_cb (GtkWidget *widget, jobject jgraphics); JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GdkGraphics_copyState +Java_gnu_java_awt_peer_gtk_GdkGraphics_nativeCopyState (JNIEnv *env, jobject obj, jobject old) { struct graphics *g = NULL; @@ -236,7 +236,7 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics_connectSignals } JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GdkGraphics_dispose +Java_gnu_java_awt_peer_gtk_GdkGraphics_nativeDispose (JNIEnv *env, jobject obj) { struct graphics *g = NULL; @@ -291,6 +291,11 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics_drawString struct peerfont *pfont = NULL; struct graphics *g = NULL; const char *cstr = NULL; + const char *sTmp = NULL; + char *tmp = NULL; + char *p = NULL; + int count = 0; + int charSize = 0; int baseline_y = 0; PangoLayoutIter *iter = NULL; @@ -303,9 +308,29 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics_drawString g_assert (pfont != NULL); cstr = (*env)->GetStringUTFChars (env, str, NULL); + g_assert (cstr != NULL); + + charSize = sizeof(char); + p = malloc((strlen(cstr) + 1) * charSize); + g_assert (p != NULL); + + tmp = p; + sTmp = cstr; + for (; *sTmp != '\0'; sTmp++) + if (((unsigned char) *sTmp) >= ' ') + { + *p = *sTmp; + count++; + p++; + } + *p = '\0'; + + p = realloc(tmp, (count + 1) * charSize); + g_assert (p != NULL); + pango_layout_set_text (pfont->layout, p, -1); + free(p); pango_layout_set_font_description (pfont->layout, pfont->desc); - pango_layout_set_text (pfont->layout, cstr, -1); iter = pango_layout_get_iter (pfont->layout); baseline_y = pango_layout_iter_get_baseline (iter); @@ -317,7 +342,7 @@ Java_gnu_java_awt_peer_gtk_GdkGraphics_drawString pango_layout_iter_free (iter); pango_layout_set_text (pfont->layout, "", -1); - + gdk_flush (); (*env)->ReleaseStringUTFChars (env, str, cstr); diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c index 0467c3c..7662800 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.c @@ -71,6 +71,7 @@ Java_gnu_java_awt_peer_gtk_GdkGraphicsEnvironment_nativeGetFontFamilies const char *name_tmp = pango_font_family_get_name (families[idx]); jstring name = (*env)->NewStringUTF (env, name_tmp); (*env)->SetObjectArrayElement (env, family_name, idx, name); + (*env)->DeleteLocalRef(env, name); } g_free (families); diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c index 74103b5..4d6169b 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c @@ -270,6 +270,8 @@ query_formats (JNIEnv *env, jclass clazz) (*env)->DeleteLocalRef(env, string); ++ch; } + + (*env)->DeleteLocalRef(env, jformat); } g_slist_free(formats); @@ -376,6 +378,7 @@ save_to_stream(const gchar *buf, (*(ssr->env))->ReleaseByteArrayElements ((ssr->env), jbuf, cbuf, 0); (*(ssr->env))->CallVoidMethod ((ssr->env), *(ssr->stream), dataOutputWriteID, jbuf); + (*(ssr->env))->DeleteLocalRef((ssr->env), jbuf); gdk_threads_enter (); diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c index c5bf5a3..e9a0f69 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c @@ -121,6 +121,7 @@ Java_gnu_java_awt_peer_gtk_GtkChoicePeer_append gtk_combo_box_append_text (GTK_COMBO_BOX (ptr), label); (*env)->ReleaseStringUTFChars (env, item, label); + (*env)->DeleteLocalRef(env, item); } gdk_threads_leave (); diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c index 779be57..3b62dc3 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c @@ -53,11 +53,7 @@ jstring cp_gtk_imageTarget; jstring cp_gtk_filesTarget; /* Simple id to keep track of the selection we are currently managing. */ -#if SIZEOF_VOID_P == 8 -static long current_selection = 0; -#else -static int current_selection = 0; -#endif +static gint current_selection = 0; /* Whether we "own" the clipboard. And may clear it. */ static int owner = 0; @@ -265,11 +261,7 @@ static void clipboard_clear_func (GtkClipboard *clipboard __attribute__((unused)), gpointer user_data) { -#if SIZEOF_VOID_P == 8 - if (owner && (long) user_data == current_selection) -#else - if (owner && (int) user_data == current_selection) -#endif + if (owner && GPOINTER_TO_INT(user_data) == current_selection) { JNIEnv *env = cp_gtk_gdk_env(); owner = 0; @@ -359,7 +351,7 @@ Java_gnu_java_awt_peer_gtk_GtkClipboard_advertiseContent if (gtk_clipboard_set_with_data (cp_gtk_clipboard, targets, n, clipboard_get_func, clipboard_clear_func, - (gpointer) current_selection)) + GINT_TO_POINTER(current_selection))) { owner = 1; if (gtk_clipboard_instance == NULL) diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c index fc89ab7..6da42ce 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c @@ -239,6 +239,7 @@ Java_gnu_java_awt_peer_gtk_GtkListPeer_append COLUMN_STRING, text, -1); (*env)->ReleaseStringUTFChars (env, item, text); + (*env)->DeleteLocalRef(env, item); } gdk_threads_leave (); diff --git a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkSelection.c b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkSelection.c index f744e90..3244d23 100644 --- a/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkSelection.c +++ b/libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkSelection.c @@ -130,6 +130,7 @@ clipboard_targets_received (GtkClipboard *clipboard break; (*env)->SetObjectArrayElement (env, strings, i++, string); + (*env)->DeleteLocalRef (env, string); } } } @@ -201,6 +202,10 @@ clipboard_text_received (GtkClipboard *clipboard textAvailableID, string); (*env)->DeleteGlobalRef (env, selection_obj); + + if (string != NULL) + (*env)->DeleteLocalRef (env, string); + } JNIEXPORT void JNICALL @@ -324,6 +329,7 @@ clipboard_uris_received (GtkClipboard *clipboard if (string == NULL) break; (*env)->SetObjectArrayElement (env, strings, i, string); + (*env)->DeleteLocalRef (env, string); } } g_strfreev (uris); diff --git a/libjava/classpath/native/jni/java-io/Makefile.am b/libjava/classpath/native/jni/java-io/Makefile.am index efa7d56..35afaae 100644 --- a/libjava/classpath/native/jni/java-io/Makefile.am +++ b/libjava/classpath/native/jni/java-io/Makefile.am @@ -1,8 +1,6 @@ nativelib_LTLIBRARIES = libjavaio.la -libjavaio_la_SOURCES = javaio.h \ - javaio.c \ - java_io_VMFile.c \ +libjavaio_la_SOURCES = java_io_VMFile.c \ java_io_VMObjectInputStream.c \ java_io_VMObjectStreamClass.c diff --git a/libjava/classpath/native/jni/java-io/Makefile.in b/libjava/classpath/native/jni/java-io/Makefile.in index baa6217..cb418503 100644 --- a/libjava/classpath/native/jni/java-io/Makefile.in +++ b/libjava/classpath/native/jni/java-io/Makefile.in @@ -44,10 +44,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ - $(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -64,7 +65,7 @@ nativelibLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(nativelib_LTLIBRARIES) libjavaio_la_DEPENDENCIES = \ $(top_builddir)/native/jni/classpath/jcl.lo -am_libjavaio_la_OBJECTS = javaio.lo java_io_VMFile.lo \ +am_libjavaio_la_OBJECTS = java_io_VMFile.lo \ java_io_VMObjectInputStream.lo java_io_VMObjectStreamClass.lo libjavaio_la_OBJECTS = $(am_libjavaio_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include @@ -170,6 +171,7 @@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ JIKESENCODING = @JIKESENCODING@ +JIKESWARNINGS = @JIKESWARNINGS@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ @@ -275,9 +277,7 @@ target_os = @target_os@ target_vendor = @target_vendor@ vm_classes = @vm_classes@ nativelib_LTLIBRARIES = libjavaio.la -libjavaio_la_SOURCES = javaio.h \ - javaio.c \ - java_io_VMFile.c \ +libjavaio_la_SOURCES = java_io_VMFile.c \ java_io_VMObjectInputStream.c \ java_io_VMObjectStreamClass.c @@ -357,7 +357,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java_io_VMFile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java_io_VMObjectInputStream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java_io_VMObjectStreamClass.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/javaio.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ diff --git a/libjava/classpath/native/jni/java-io/java_io_VMFile.c b/libjava/classpath/native/jni/java-io/java_io_VMFile.c index b32c294..354df04 100644 --- a/libjava/classpath/native/jni/java-io/java_io_VMFile.c +++ b/libjava/classpath/native/jni/java-io/java_io_VMFile.c @@ -50,8 +50,6 @@ exception statement from your version. */ #endif #include "target_native_math_int.h" -#include "javaio.h" - #include "java_io_VMFile.h" /*************************************************************************/ diff --git a/libjava/classpath/native/jni/java-io/javaio.c b/libjava/classpath/native/jni/java-io/javaio.c deleted file mode 100644 index 6dc3de8..0000000 --- a/libjava/classpath/native/jni/java-io/javaio.c +++ /dev/null @@ -1,363 +0,0 @@ -/* javaio.c - Common java.io native functions - Copyright (C) 1998, 2002, 2004 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -/* do not move; needed here because of some macro definitions */ -#include <config.h> - -#include <stdio.h> -#include <stdlib.h> - -#include <jni.h> -#include <jcl.h> - -#include "target_native.h" -#ifndef WITHOUT_FILESYSTEM -#include "target_native_file.h" -#endif -#include "target_native_math_int.h" - -#include "javaio.h" - -/* - * Function to open a file - */ - -jint -_javaio_open_read (JNIEnv * env, jstring name) -{ -#ifndef WITHOUT_FILESYSTEM - const char *filename; - int fd; - int result; - - filename = JCL_jstring_to_cstring (env, name); - if (filename == NULL) - return (-1); - - TARGET_NATIVE_FILE_OPEN_READ (filename, fd, result); - (*env)->ReleaseStringUTFChars (env, name, filename); - if (result != TARGET_NATIVE_OK) - { - if (TARGET_NATIVE_LAST_ERROR () == TARGET_NATIVE_ERROR_NO_SUCH_FILE) - JCL_ThrowException (env, - "java/io/FileNotFoundException", - TARGET_NATIVE_LAST_ERROR_STRING ()); - else - JCL_ThrowException (env, - "java/io/IOException", - TARGET_NATIVE_LAST_ERROR_STRING ()); - } - - JCL_free_cstring (env, name, filename); - return (fd); -#else /* not WITHOUT_FILESYSTEM */ - return (-1); -#endif /* not WITHOUT_FILESYSTEM */ -} - -/* - * Function to open a file for reading/writing - */ - -jint -_javaio_open_readwrite (JNIEnv * env, jstring name) -{ -#ifndef WITHOUT_FILESYSTEM - const char *filename; - int fd; - int result; - - filename = JCL_jstring_to_cstring (env, name); - if (filename == NULL) - return (-1); - - TARGET_NATIVE_FILE_OPEN_READWRITE (filename, fd, result); - (*env)->ReleaseStringUTFChars (env, name, filename); - if (result != TARGET_NATIVE_OK) - { - if (TARGET_NATIVE_LAST_ERROR () == TARGET_NATIVE_ERROR_NO_SUCH_FILE) - JCL_ThrowException (env, - "java/io/FileNotFoundException", - TARGET_NATIVE_LAST_ERROR_STRING ()); - else - JCL_ThrowException (env, - "java/io/IOException", - TARGET_NATIVE_LAST_ERROR_STRING ()); - } - - JCL_free_cstring (env, name, filename); - return (fd); -#else /* not WITHOUT_FILESYSTEM */ - return (-1); -#endif /* not WITHOUT_FILESYSTEM */ -} - -/*************************************************************************/ - -/* - * Function to close a file - */ - -void -_javaio_close (JNIEnv * env, jint fd) -{ -#ifndef WITHOUT_FILESYSTEM - int result; - - if (fd != -1) - { - TARGET_NATIVE_FILE_CLOSE (fd, result); - if (result != TARGET_NATIVE_OK) - JCL_ThrowException (env, - "java/io/IOException", - TARGET_NATIVE_LAST_ERROR_STRING ()); - } -#else /* not WITHOUT_FILESYSTEM */ -#endif /* not WITHOUT_FILESYSTEM */ -} - -/*************************************************************************/ - -/* - * Skips bytes in a file - */ - -jlong -_javaio_skip_bytes (JNIEnv * env, jint fd, jlong num_bytes) -{ -#ifndef WITHOUT_FILESYSTEM - jlong current_offset, new_offset; - int result; - - TARGET_NATIVE_FILE_SEEK_CURRENT (fd, TARGET_NATIVE_MATH_INT_INT64_CONST_0, - current_offset, result); - if (result != TARGET_NATIVE_OK) - JCL_ThrowException (env, - "java/io/IOException", - TARGET_NATIVE_LAST_ERROR_STRING ()); - - TARGET_NATIVE_FILE_SEEK_CURRENT (fd, num_bytes, new_offset, result); - if (result != TARGET_NATIVE_OK) - JCL_ThrowException (env, - "java/io/IOException", - TARGET_NATIVE_LAST_ERROR_STRING ()); - - return (TARGET_NATIVE_MATH_INT_INT64_SUB (new_offset, current_offset)); -#else /* not WITHOUT_FILESYSTEM */ - return (TARGET_NATIVE_MATH_INT_INT64_CONST_0); -#endif /* not WITHOUT_FILESYSTEM */ -} - -/*************************************************************************/ - -/* - * Gets the size of the file - */ - -jlong -_javaio_get_file_length (JNIEnv * env, jint fd) -{ -#ifndef WITHOUT_FILESYSTEM - jlong length; - int result; - - TARGET_NATIVE_FILE_SIZE (fd, length, result); - if (result != TARGET_NATIVE_OK) - { - JCL_ThrowException (env, - "java/io/IOException", - TARGET_NATIVE_LAST_ERROR_STRING ()); - return (TARGET_NATIVE_MATH_INT_INT64_CONST_MINUS_1); - } - - return (length); -#else /* not WITHOUT_FILESYSTEM */ - return (TARGET_NATIVE_MATH_INT_INT64_CONST_0); -#endif /* not WITHOUT_FILESYSTEM */ -} - -/*************************************************************************/ - -/* - * Reads data from a file - */ - -jint -_javaio_read (JNIEnv * env, jint fd, jarray buf, jint offset, jint len) -{ -#ifndef WITHOUT_FILESYSTEM - jbyte *bufptr; - int bytesRead; - int result; - - assert (offset >= 0); - assert (len >= 0); - - if (len == 0) - return 0; /* Nothing todo, and GetByteArrayElements() seems undefined. */ - - bufptr = (*env)->GetByteArrayElements (env, buf, JNI_FALSE); - if (bufptr == NULL) - { - JCL_ThrowException (env, "java/io/IOException", - "Internal Error: get byte array fail"); - return (-1); - } - - TARGET_NATIVE_FILE_READ (fd, (bufptr + offset), len, bytesRead, result); - (*env)->ReleaseByteArrayElements (env, buf, bufptr, 0); - if (result != TARGET_NATIVE_OK) - JCL_ThrowException (env, - "java/io/IOException", - TARGET_NATIVE_LAST_ERROR_STRING ()); - - if (bytesRead == 0) - return (-1); - - return (bytesRead); -#else /* not WITHOUT_FILESYSTEM */ - jbyte *bufptr; - int bytesRead; - - assert (offset >= 0); - assert (len >= 0); - - if ((fd == 0) || (fd == 1) || (fd == 2)) - { - if (len == 0) - return 0; /* Nothing todo, and GetByteArrayElements() seems undefined. */ - - bufptr = (*env)->GetByteArrayElements (env, buf, JNI_FALSE); - if (bufptr == NULL) - { - JCL_ThrowException (env, "java/io/IOException", - "Internal Error: get byte array"); - return (-1); - } - - TARGET_NATIVE_FILE_READ (fd, (bufptr + offset), len, bytesRead, result); - (*env)->ReleaseByteArrayElements (env, buf, bufptr, 0); - if (result != TARGET_NATIVE_OK) - JCL_ThrowException (env, - "java/io/IOException", - TARGET_NATIVE_LAST_ERROR_STRING ()); - - if (bytesRead == 0) - return (-1); - - return (bytesRead); - } - else - { - return (-1); - } -#endif /* not WITHOUT_FILESYSTEM */ -} - -/*************************************************************************/ - -/* - * Writes data to a file - */ - -jint -_javaio_write (JNIEnv * env, jint fd, jarray buf, jint offset, jint len) -{ -#ifndef WITHOUT_FILESYSTEM - jbyte *bufptr; - int bytes_written; - int result; - - if (len == 0) - return 0; /* Nothing todo, and GetByteArrayElements() seems undefined. */ - - bufptr = (*env)->GetByteArrayElements (env, buf, 0); - if (bufptr == NULL) - { - JCL_ThrowException (env, "java/io/IOException", - "Internal Error: get byte array"); - return (-1); - } - - TARGET_NATIVE_FILE_WRITE (fd, (bufptr + offset), len, bytes_written, - result); - (*env)->ReleaseByteArrayElements (env, buf, bufptr, 0); - if (result != TARGET_NATIVE_OK) - JCL_ThrowException (env, - "java/io/IOException", - TARGET_NATIVE_LAST_ERROR_STRING ()); - - if (bytes_written == 0) - return (-1); - - return (bytes_written); -#else /* not WITHOUT_FILESYSTEM */ - jbyte *bufptr; - int bytesWritten; - - if ((fd == 0) || (fd == 1) || (fd == 2)) - { - if (len == 0) - return 0; /* Nothing todo, and GetByteArrayElements() seems undefined. */ - - bufptr = (*env)->GetByteArrayElements (env, buf, 0); - if (bufptr == NULL) - { - JCL_ThrowException (env, "java/io/IOException", "Internal Error"); - return (-1); - } - - TARGET_NATIVE_FILE_WRITE (fd, (bufptr + offset), len, bytes_written, - result); - (*env)->ReleaseByteArrayElements (env, buf, bufptr, 0); - - if (bytes_written == -1) - JCL_ThrowException (env, - "java/io/IOException", - TARGET_NATIVE_LAST_ERROR_STRING ()); - - if (bytes_written == 0) - return (-1); - - return (bytes_written); - } - else - { - return (-1); - } -#endif /* not WITHOUT_FILESYSTEM */ -} diff --git a/libjava/classpath/native/jni/java-io/javaio.h b/libjava/classpath/native/jni/java-io/javaio.h deleted file mode 100644 index 2e4a8d1..0000000 --- a/libjava/classpath/native/jni/java-io/javaio.h +++ /dev/null @@ -1,58 +0,0 @@ -/* javaio.h - Declaration for common java.io native functions - Copyright (C) 1998, 2004 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#ifndef JAVAIO_H_INCLUDED -#define JAVAIO_H_INCLUDED - -#include <stddef.h> - -/* - * Function Prototypes - */ - -extern jlong _javaio_get_file_length(JNIEnv *, jint); -extern jlong _javaio_skip_bytes(JNIEnv *, jint, jlong); -extern jint _javaio_open(JNIEnv *, jstring, int); -extern jint _javaio_open_read(JNIEnv *, jstring); -extern jint _javaio_open_readwrite(JNIEnv *, jstring); -extern void _javaio_close(JNIEnv *, jint fd); -extern jint _javaio_read(JNIEnv *, jint, jarray, jint, jint); -extern jint _javaio_write(JNIEnv *, jint, jarray, jint, jint); - -#endif /* JAVAIO_H_INCLUDED */ - diff --git a/libjava/classpath/native/jni/java-lang/Makefile.in b/libjava/classpath/native/jni/java-lang/Makefile.in index 4af8303..aacb56f 100644 --- a/libjava/classpath/native/jni/java-lang/Makefile.in +++ b/libjava/classpath/native/jni/java-lang/Makefile.in @@ -44,10 +44,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ - $(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -175,6 +176,7 @@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ JIKESENCODING = @JIKESENCODING@ +JIKESWARNINGS = @JIKESWARNINGS@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ diff --git a/libjava/classpath/native/jni/java-net/Makefile.am b/libjava/classpath/native/jni/java-net/Makefile.am index bf7a92b..4bca951 100644 --- a/libjava/classpath/native/jni/java-net/Makefile.am +++ b/libjava/classpath/native/jni/java-net/Makefile.am @@ -4,8 +4,8 @@ libjavanet_la_SOURCES = javanet.c \ javanet.h \ java_net_VMInetAddress.c \ java_net_VMNetworkInterface.c \ - gnu_java_net_PlainDatagramSocketImpl.c \ - gnu_java_net_PlainSocketImpl.c + gnu_java_net_VMPlainDatagramSocketImpl.c \ + gnu_java_net_VMPlainSocketImpl.c libjavanet_la_LIBADD = $(top_builddir)/native/jni/classpath/jcl.lo diff --git a/libjava/classpath/native/jni/java-net/Makefile.in b/libjava/classpath/native/jni/java-net/Makefile.in index d1d678e..bf64c9d 100644 --- a/libjava/classpath/native/jni/java-net/Makefile.in +++ b/libjava/classpath/native/jni/java-net/Makefile.in @@ -44,10 +44,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ - $(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -66,8 +67,8 @@ libjavanet_la_DEPENDENCIES = \ $(top_builddir)/native/jni/classpath/jcl.lo am_libjavanet_la_OBJECTS = javanet.lo java_net_VMInetAddress.lo \ java_net_VMNetworkInterface.lo \ - gnu_java_net_PlainDatagramSocketImpl.lo \ - gnu_java_net_PlainSocketImpl.lo + gnu_java_net_VMPlainDatagramSocketImpl.lo \ + gnu_java_net_VMPlainSocketImpl.lo libjavanet_la_OBJECTS = $(am_libjavanet_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -172,6 +173,7 @@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ JIKESENCODING = @JIKESENCODING@ +JIKESWARNINGS = @JIKESWARNINGS@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ @@ -281,8 +283,8 @@ libjavanet_la_SOURCES = javanet.c \ javanet.h \ java_net_VMInetAddress.c \ java_net_VMNetworkInterface.c \ - gnu_java_net_PlainDatagramSocketImpl.c \ - gnu_java_net_PlainSocketImpl.c + gnu_java_net_VMPlainDatagramSocketImpl.c \ + gnu_java_net_VMPlainSocketImpl.c libjavanet_la_LIBADD = $(top_builddir)/native/jni/classpath/jcl.lo AM_LDFLAGS = @CLASSPATH_MODULE@ @@ -357,8 +359,8 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_net_PlainDatagramSocketImpl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_net_PlainSocketImpl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_net_VMPlainDatagramSocketImpl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_net_VMPlainSocketImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java_net_VMInetAddress.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java_net_VMNetworkInterface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/javanet.Plo@am__quote@ diff --git a/libjava/classpath/native/jni/java-net/gnu_java_net_PlainDatagramSocketImpl.c b/libjava/classpath/native/jni/java-net/gnu_java_net_PlainDatagramSocketImpl.c deleted file mode 100644 index 5bc284f..0000000 --- a/libjava/classpath/native/jni/java-net/gnu_java_net_PlainDatagramSocketImpl.c +++ /dev/null @@ -1,452 +0,0 @@ -/* PlainDatagramSocketImpl.c - Native methods for PlainDatagramSocketImpl class - Copyright (C) 1998 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -/* do not move; needed here because of some macro definitions */ -#include <config.h> - -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <assert.h> - -#include <jni.h> -#include <jcl.h> - -#include "javanet.h" - -#include "target_native.h" -#ifndef WITHOUT_NETWORK -#include "target_native_network.h" -#endif /* WITHOUT_NETWORK */ - -#include "gnu_java_net_PlainDatagramSocketImpl.h" - -/* - * Note that most of the functions in this module simply redirect to another - * internal function. Why? Because many of these functions are shared - * with PlainSocketImpl. - */ - -/*************************************************************************/ - -/* - * Creates a new datagram socket - */ -JNIEXPORT void JNICALL -Java_gnu_java_net_PlainDatagramSocketImpl_create (JNIEnv * env, jobject obj) -{ - assert (env != NULL); - assert ((*env) != NULL); - -#ifndef WITHOUT_NETWORK - _javanet_create (env, obj, 0); -#else /* not WITHOUT_NETWORK */ -#endif /* not WITHOUT_NETWORK */ -} - -/*************************************************************************/ - -/* - * Close the socket. - */ -JNIEXPORT void JNICALL -Java_gnu_java_net_PlainDatagramSocketImpl_close (JNIEnv * env, jobject obj) -{ - assert (env != NULL); - assert ((*env) != NULL); - -#ifndef WITHOUT_NETWORK - _javanet_close (env, obj, 0); -#else /* not WITHOUT_NETWORK */ -#endif /* not WITHOUT_NETWORK */ -} - -/*************************************************************************/ - -/* - * This method binds the specified address to the specified local port. - * Note that we have to set the local address and local port public instance - * variables. - */ -JNIEXPORT void JNICALL -Java_gnu_java_net_PlainDatagramSocketImpl_bind (JNIEnv * env, jobject obj, - jint port, jobject addr) -{ - assert (env != NULL); - assert ((*env) != NULL); - -#ifndef WITHOUT_NETWORK - _javanet_bind (env, obj, addr, port, 0); -#else /* not WITHOUT_NETWORK */ -#endif /* not WITHOUT_NETWORK */ -} - -/*************************************************************************/ - -/* - * This method sets the specified option for a socket - */ -JNIEXPORT void JNICALL -Java_gnu_java_net_PlainDatagramSocketImpl_setOption (JNIEnv * env, - jobject obj, - jint option_id, - jobject val) -{ - assert (env != NULL); - assert ((*env) != NULL); - -#ifndef WITHOUT_NETWORK - _javanet_set_option (env, obj, option_id, val); -#else /* not WITHOUT_NETWORK */ -#endif /* not WITHOUT_NETWORK */ -} - -/*************************************************************************/ - -/* - * This method sets the specified option for a socket - */ -JNIEXPORT jobject JNICALL -Java_gnu_java_net_PlainDatagramSocketImpl_getOption (JNIEnv * env, - jobject obj, - jint option_id) -{ - assert (env != NULL); - assert ((*env) != NULL); - -#ifndef WITHOUT_NETWORK - return (_javanet_get_option (env, obj, option_id)); -#else /* not WITHOUT_NETWORK */ - return NULL; -#endif /* not WITHOUT_NETWORK */ -} - -/*************************************************************************/ - -/* - * Reads a buffer from a remote host - */ -JNIEXPORT void JNICALL -Java_gnu_java_net_PlainDatagramSocketImpl_receive0 (JNIEnv * env, jobject obj, - jobject packet) -{ -#ifndef WITHOUT_NETWORK - int addr, port, bytes_read; - unsigned int maxlen, offset; - jclass cls, addr_cls; - jfieldID fid; - jmethodID mid; - jarray arr; - unsigned char octets[4]; - char ip_str[16]; - jobject ip_str_obj, addr_obj; - - assert (env != NULL); - assert ((*env) != NULL); - - addr = 0; - port = 0; - maxlen = 0; - offset = 0; - bytes_read = 0; - - if (packet == NULL) - { - JCL_ThrowException (env, "java/lang/NullPointerException", - "Null datagram packet"); - return; - } - - /* Get the buffer from the packet */ - cls = (*env)->GetObjectClass (env, packet); - if (cls == NULL) - { - JCL_ThrowException (env, IO_EXCEPTION, "Internal error"); - return; - } - - mid = (*env)->GetMethodID (env, cls, "getData", "()[B"); - if (mid == NULL) - { - JCL_ThrowException (env, IO_EXCEPTION, "Internal error: getData"); - return; - } - - arr = (*env)->CallObjectMethod (env, packet, mid); - if ((*env)->ExceptionOccurred (env)) - return; - if (arr == NULL) - { - JCL_ThrowException (env, IO_EXCEPTION, "Internal error: call getData"); - return; - } - - /* Now get the offset from the packet */ - mid = (*env)->GetMethodID (env, cls, "getOffset", "()I"); - if (mid == NULL) - { - JCL_ThrowException (env, IO_EXCEPTION, "Internal error: getOffset"); - return; - } - - offset = (*env)->CallIntMethod (env, packet, mid); - if ((*env)->ExceptionOccurred (env)) - return; - - DBG ("PlainDatagramSocketImpl.receive(): Got the offset\n"); - - /* Now get the maximal available length from the packet */ - fid = (*env)->GetFieldID (env, cls, "maxlen", "I"); - if (fid == NULL) - { - JCL_ThrowException (env, IO_EXCEPTION, "Internal error: maxlen"); - return; - } - - maxlen = (*env)->GetIntField (env, packet, fid); - if ((*env)->ExceptionOccurred (env)) - return; - - /* Receive the packet */ - /* should we try some sort of validation on the length? */ - bytes_read = - _javanet_recvfrom (env, obj, arr, offset, maxlen, &addr, &port); - if ((*env)->ExceptionOccurred (env)) - return; - if (bytes_read == -1) - { - JCL_ThrowException (env, IO_EXCEPTION, "Internal error: receive"); - return; - } - - DBG ("PlainDatagramSocketImpl.receive(): Received packet\n"); - - /* Store the address */ - TARGET_NATIVE_NETWORK_INT_TO_IPADDRESS_BYTES (addr, - octets[0], - octets[1], - octets[2], octets[3]); - sprintf (ip_str, "%d.%d.%d.%d", octets[0], octets[1], octets[2], octets[3]); - ip_str_obj = (*env)->NewStringUTF (env, ip_str); - if (ip_str_obj == NULL) - { - JCL_ThrowException (env, IO_EXCEPTION, "Internal error: new string"); - return; - } - - addr_cls = (*env)->FindClass (env, "java/net/InetAddress"); - if (addr_cls == NULL) - { - JCL_ThrowException (env, IO_EXCEPTION, - "Internal error: InetAddress class"); - return; - } - DBG ("PlainDatagramSocketImpl.receive(): Found InetAddress class\n"); - - mid = (*env)->GetStaticMethodID (env, addr_cls, "getByName", - "(Ljava/lang/String;)Ljava/net/InetAddress;"); - if (mid == NULL) - { - JCL_ThrowException (env, IO_EXCEPTION, "Internal Error"); - return; - } - DBG - ("PlainDatagramSocketImpl.receive(): Found InetAddress.getByName method\n"); - - addr_obj = (*env)->CallStaticObjectMethod (env, addr_cls, mid, ip_str_obj); - if ((*env)->ExceptionOccurred (env)) - return; - - mid = (*env)->GetMethodID (env, cls, "setAddress", - "(Ljava/net/InetAddress;)V"); - if (mid == NULL) - { - JCL_ThrowException (env, IO_EXCEPTION, "Internal error: setAddress"); - return; - } - - (*env)->CallVoidMethod (env, packet, mid, addr_obj); - if ((*env)->ExceptionOccurred (env)) - return; - - DBG ("PlainDatagramSocketImpl.receive(): Stored the address\n"); - - /* Store the port */ - mid = (*env)->GetMethodID (env, cls, "setPort", "(I)V"); - if (mid == NULL) - { - JCL_ThrowException (env, IO_EXCEPTION, "Internal error: setPort"); - return; - } - - (*env)->CallVoidMethod (env, packet, mid, port); - if ((*env)->ExceptionOccurred (env)) - return; - - DBG ("PlainDatagramSocketImpl.receive(): Stored the port\n"); - - /* Store back the length */ - fid = (*env)->GetFieldID (env, cls, "length", "I"); - if (fid == NULL) - { - JCL_ThrowException (env, IO_EXCEPTION, "Internal error: length"); - return; - } - - (*env)->SetIntField (env, packet, fid, bytes_read); - if ((*env)->ExceptionOccurred (env)) - return; - - DBG ("PlainDatagramSocketImpl.receive(): Stored the length\n"); -#else /* not WITHOUT_NETWORK */ -#endif /* not WITHOUT_NETWORK */ -} - -/*************************************************************************/ - -/* - * Writes a buffer to the remote host - */ -JNIEXPORT void JNICALL -Java_gnu_java_net_PlainDatagramSocketImpl_sendto (JNIEnv * env, jobject obj, - jobject addr, jint port, - jarray buf, jint offset, - jint len) -{ -#ifndef WITHOUT_NETWORK - jint netAddress; - - assert (env != NULL); - assert ((*env) != NULL); - - netAddress = _javanet_get_netaddr (env, addr); - if ((*env)->ExceptionOccurred (env)) - return; - - DBG ("PlainDatagramSocketImpl.sendto(): have addr\n"); - - _javanet_sendto (env, obj, buf, offset, len, netAddress, port); - if ((*env)->ExceptionOccurred (env)) - return; - - DBG ("PlainDatagramSocketImpl.sendto(): finished\n"); -#else /* not WITHOUT_NETWORK */ -#endif /* not WITHOUT_NETWORK */ -} - -/*************************************************************************/ - -/* - * Joins a multicast group - */ -JNIEXPORT void JNICALL -Java_gnu_java_net_PlainDatagramSocketImpl_join (JNIEnv * env, jobject obj, - jobject addr) -{ -#ifndef WITHOUT_NETWORK - jint netAddress; - int fd; - int result; - - assert (env != NULL); - assert ((*env) != NULL); - - netAddress = _javanet_get_netaddr (env, addr); - if ((*env)->ExceptionOccurred (env)) - return; - - fd = _javanet_get_int_field (env, obj, "native_fd"); - if ((*env)->ExceptionOccurred (env)) - return; - - DBG ("PlainDatagramSocketImpl.join(): have native fd\n"); - - TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_ADD_MEMBERSHIP (fd, netAddress, - result); - - if (result != TARGET_NATIVE_OK) - { - JCL_ThrowException (env, IO_EXCEPTION, - TARGET_NATIVE_LAST_ERROR_STRING ()); - return; - } - - DBG ("PlainDatagramSocketImpl.join(): finished\n"); -#else /* not WITHOUT_NETWORK */ -#endif /* not WITHOUT_NETWORK */ -} - -/*************************************************************************/ - -/* - * Leaves a multicast group - */ -JNIEXPORT void JNICALL -Java_gnu_java_net_PlainDatagramSocketImpl_leave (JNIEnv * env, jobject obj, - jobject addr) -{ -#ifndef WITHOUT_NETWORK - jint netAddress; - int fd; - int result; - - assert (env != NULL); - assert ((*env) != NULL); - - netAddress = _javanet_get_netaddr (env, addr); - if ((*env)->ExceptionOccurred (env)) - return; - - fd = _javanet_get_int_field (env, obj, "native_fd"); - if ((*env)->ExceptionOccurred (env)) - return; - - DBG ("PlainDatagramSocketImpl.leave(): have native fd\n"); - - TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_DROP_MEMBERSHIP (fd, netAddress, - result); - if (result != TARGET_NATIVE_OK) - { - JCL_ThrowException (env, IO_EXCEPTION, - TARGET_NATIVE_LAST_ERROR_STRING ()); - return; - } - - DBG ("PlainDatagramSocketImpl.leave(): finished\n"); -#else /* not WITHOUT_NETWORK */ -#endif /* not WITHOUT_NETWORK */ -} diff --git a/libjava/classpath/native/jni/java-net/gnu_java_net_VMPlainDatagramSocketImpl.c b/libjava/classpath/native/jni/java-net/gnu_java_net_VMPlainDatagramSocketImpl.c new file mode 100644 index 0000000..1b3cb97 --- /dev/null +++ b/libjava/classpath/native/jni/java-net/gnu_java_net_VMPlainDatagramSocketImpl.c @@ -0,0 +1,399 @@ +/* VMPlainDatagramSocketImpl.c - Native methods for PlainDatagramSocketImpl + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +/* do not move; needed here because of some macro definitions */ +#include <config.h> + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> + +#include <jni.h> +#include <jcl.h> + +#include "javanet.h" + +#include "target_native.h" +#ifndef WITHOUT_NETWORK + #include "target_native_network.h" +#endif /* WITHOUT_NETWORK */ + + +#include "gnu_java_net_VMPlainDatagramSocketImpl.h" + +/* + * Note that most of the functions in this module simply redirect to another + * internal function. Why? Because many of these functions are shared + * with PlainSocketImpl. + */ + +/*************************************************************************/ + +/* + * Creates a new datagram socket + */ +JNIEXPORT void JNICALL +Java_gnu_java_net_VMPlainDatagramSocketImpl_create(JNIEnv *env, + jclass klass __attribute__ ((__unused__)) + , jobject obj) +{ + +#ifndef WITHOUT_NETWORK + _javanet_create(env, obj, 0); +#else /* not WITHOUT_NETWORK */ +#endif /* not WITHOUT_NETWORK */ +} + +/*************************************************************************/ + +/* + * Close the socket. + */ +JNIEXPORT void JNICALL +Java_gnu_java_net_VMPlainDatagramSocketImpl_close(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj) +{ + +#ifndef WITHOUT_NETWORK + _javanet_close(env, obj, 0); +#else /* not WITHOUT_NETWORK */ +#endif /* not WITHOUT_NETWORK */ +} + +/*************************************************************************/ + +/* + * Connects to the specified destination. + */ +JNIEXPORT void JNICALL +Java_gnu_java_net_VMPlainDatagramSocketImpl_connect(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj, + jobject addr, jint port) +{ +#ifndef WITHOUT_NETWORK + + _javanet_connect(env, obj, addr, port, 0); +#else /* not WITHOUT_NETWORK */ +#endif /* not WITHOUT_NETWORK */ +} + +/*************************************************************************/ + +/* + * This method binds the specified address to the specified local port. + * Note that we have to set the local address and local port public instance + * variables. + */ +JNIEXPORT void JNICALL +Java_gnu_java_net_VMPlainDatagramSocketImpl_bind(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj, + jint port, jobject addr) +{ + +#ifndef WITHOUT_NETWORK + _javanet_bind(env, obj, addr, port, 0); +#else /* not WITHOUT_NETWORK */ +#endif /* not WITHOUT_NETWORK */ +} + +/*************************************************************************/ + +/* + * This method sets the specified option for a socket + */ +JNIEXPORT void JNICALL +Java_gnu_java_net_VMPlainDatagramSocketImpl_setOption(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj, + jint option_id, + jobject val) +{ + +#ifndef WITHOUT_NETWORK + _javanet_set_option(env, obj, option_id, val); +#else /* not WITHOUT_NETWORK */ +#endif /* not WITHOUT_NETWORK */ +} + +/*************************************************************************/ + +/* + * This method sets the specified option for a socket + */ +JNIEXPORT jobject JNICALL +Java_gnu_java_net_VMPlainDatagramSocketImpl_getOption(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj, + jint option_id) +{ + +#ifndef WITHOUT_NETWORK + return(_javanet_get_option(env, obj, option_id)); +#else /* not WITHOUT_NETWORK */ + return NULL; +#endif /* not WITHOUT_NETWORK */ +} + +/*************************************************************************/ + +/* + * Reads a buffer from a remote host + */ +JNIEXPORT void JNICALL +Java_gnu_java_net_VMPlainDatagramSocketImpl_nativeReceive(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj, + jbyteArray arr, + jint offset, + jint length, + jbyteArray receivedFromAddress, + jintArray receivedFromPort, + jintArray receivedLength) +{ +#ifndef WITHOUT_NETWORK + int addr, *port, *bytes_read; + char *addressBytes; + + addr = 0; + + port = (int*)(*env)->GetIntArrayElements(env, receivedFromPort, NULL); + if (port == NULL) + { + JCL_ThrowException(env, IO_EXCEPTION, "Internal error: could not access receivedFromPort array"); + return; + } + + bytes_read = (int*)(*env)->GetIntArrayElements(env, receivedLength, NULL); + if (bytes_read == NULL) + { + (*env)->ReleaseIntArrayElements(env, receivedFromPort, (jint*)port, 0); + JCL_ThrowException(env, IO_EXCEPTION, "Internal error: could not access receivedLength array"); + return; + } + + /* Receive the packet */ + /* should we try some sort of validation on the length? */ + (*bytes_read) = _javanet_recvfrom(env, obj, arr, offset, length, &addr, port); + + /* Special case the strange situation where the receiver didn't want any + bytes. */ + if (length == 0 && (*bytes_read) == -1) + *bytes_read = 0; + + if ((*bytes_read) == -1) + { + (*env)->ReleaseIntArrayElements(env, receivedFromPort, (jint*)port, 0); + (*env)->ReleaseIntArrayElements(env, receivedLength, (jint*)bytes_read, 0); + JCL_ThrowException(env, IO_EXCEPTION, "Internal error: receive"); + return; + } + + (*env)->ReleaseIntArrayElements(env, receivedFromPort, (jint*)port, 0); + (*env)->ReleaseIntArrayElements(env, receivedLength, (jint*)bytes_read, 0); + + if ((*env)->ExceptionOccurred(env)) + { + return; + } + + DBG("PlainDatagramSocketImpl.receive(): Received packet\n"); + + + /* Store the address */ + addressBytes = (char*)(*env)->GetPrimitiveArrayCritical(env, receivedFromAddress, NULL); + TARGET_NATIVE_NETWORK_INT_TO_IPADDRESS_BYTES(addr, + addressBytes[0], + addressBytes[1], + addressBytes[2], + addressBytes[3] + ); + (*env)->ReleasePrimitiveArrayCritical(env, receivedFromAddress, addressBytes, 0); + +#else /* not WITHOUT_NETWORK */ +#endif /* not WITHOUT_NETWORK */ +} + +/*************************************************************************/ + +/* + * Writes a buffer to the remote host + */ +JNIEXPORT void JNICALL +Java_gnu_java_net_VMPlainDatagramSocketImpl_nativeSendTo(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj, + jobject addr, + jint port, + jarray buf, + jint offset, + jint len) +{ +#ifndef WITHOUT_NETWORK + jint netAddress; + + /* check if address given, tr 7.3.2005 */ + if (addr != NULL) + { + netAddress = _javanet_get_netaddr(env, addr); + if ((*env)->ExceptionOccurred(env)) + { + return; + } + } + else + { + netAddress = 0; + } + + DBG("PlainDatagramSocketImpl.sendto(): have addr\n"); + + _javanet_sendto(env, obj, buf, offset, len, netAddress, port); + if ((*env)->ExceptionOccurred(env)) + { + return; + } + + DBG("PlainDatagramSocketImpl.sendto(): finished\n"); +#else /* not WITHOUT_NETWORK */ +#endif /* not WITHOUT_NETWORK */ +} + +/*************************************************************************/ + +/* + * Joins a multicast group + */ +JNIEXPORT void JNICALL +Java_gnu_java_net_VMPlainDatagramSocketImpl_join(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj, + jobject addr) +{ +#ifndef WITHOUT_NETWORK + jint netAddress; + int fd; + int result; + + /* check if address given, tr 7.3.2005 */ + if (addr != NULL) + { + netAddress = _javanet_get_netaddr(env, addr); + if ((*env)->ExceptionOccurred(env)) + { + JCL_ThrowException(env, IO_EXCEPTION, "Internal error"); + return; + } + } + else + { + netAddress = 0; + } + + fd = _javanet_get_int_field(env, obj, "native_fd"); + if ((*env)->ExceptionOccurred(env)) + { + JCL_ThrowException(env, IO_EXCEPTION, "Internal error"); + return; + } + + DBG("PlainDatagramSocketImpl.join(): have native fd\n"); + + TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_ADD_MEMBERSHIP(fd,netAddress,result); + + if (result != TARGET_NATIVE_OK) + { + JCL_ThrowException(env, IO_EXCEPTION, TARGET_NATIVE_LAST_ERROR_STRING()); + return; + } + + DBG("PlainDatagramSocketImpl.join(): finished\n"); +#else /* not WITHOUT_NETWORK */ +#endif /* not WITHOUT_NETWORK */ +} + +/*************************************************************************/ + +/* + * Leaves a multicast group + */ +JNIEXPORT void JNICALL +Java_gnu_java_net_VMPlainDatagramSocketImpl_leave(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj, + jobject addr) +{ +#ifndef WITHOUT_NETWORK + jint netAddress; + int fd; + int result; + + /* check if address given, tr 7.3.2005 */ + if (addr != NULL) + { + netAddress = _javanet_get_netaddr(env, addr); + if ((*env)->ExceptionOccurred(env)) + { + JCL_ThrowException(env, IO_EXCEPTION, "Internal error"); + return; + } + } + else + { + netAddress = 0; + } + + fd = _javanet_get_int_field(env, obj, "native_fd"); + if ((*env)->ExceptionOccurred(env)) + { JCL_ThrowException(env, IO_EXCEPTION, "Internal error"); return; } + + DBG("PlainDatagramSocketImpl.leave(): have native fd\n"); + + TARGET_NATIVE_NETWORK_SOCKET_SET_OPTION_DROP_MEMBERSHIP(fd,netAddress,result); + if (result!=TARGET_NATIVE_OK) + { + JCL_ThrowException(env, IO_EXCEPTION, TARGET_NATIVE_LAST_ERROR_STRING()); + return; + } + + DBG("PlainDatagramSocketImpl.leave(): finished\n"); +#else /* not WITHOUT_NETWORK */ +#endif /* not WITHOUT_NETWORK */ +} + diff --git a/libjava/classpath/native/jni/java-net/gnu_java_net_PlainSocketImpl.c b/libjava/classpath/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c index f5f22ab7..cf10ee4 100644 --- a/libjava/classpath/native/jni/java-net/gnu_java_net_PlainSocketImpl.c +++ b/libjava/classpath/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c @@ -1,5 +1,5 @@ -/* PlainSocketImpl.c - Native methods for PlainSocketImpl class - Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc. +/* VMPlainSocketImpl.c - Native methods for PlainSocketImpl class + Copyright (C) 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,8 +41,7 @@ exception statement from your version. */ #include <stdlib.h> #include <stdio.h> #include <string.h> -#include <assert.h> - + #include <jni.h> #include <jcl.h> @@ -50,11 +49,10 @@ exception statement from your version. */ #include "target_native.h" #ifndef WITHOUT_NETWORK -#include "target_native_file.h" /* Get FIONREAD on Solaris. */ -#include "target_native_network.h" + #include "target_native_network.h" #endif /* WITHOUT_NETWORK */ -#include "gnu_java_net_PlainSocketImpl.h" +#include "gnu_java_net_VMPlainSocketImpl.h" /* * Note that the functions in this module simply redirect to another @@ -69,14 +67,12 @@ exception statement from your version. */ * Creates a new stream or datagram socket */ JNIEXPORT void JNICALL -Java_gnu_java_net_PlainSocketImpl_create (JNIEnv * env, jobject this, - jboolean stream) +Java_gnu_java_net_VMPlainSocketImpl_create(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj) { #ifndef WITHOUT_NETWORK - assert (env != NULL); - assert ((*env) != NULL); - - _javanet_create (env, this, stream); + _javanet_create(env, obj, JNI_TRUE); #else /* not WITHOUT_NETWORK */ #endif /* not WITHOUT_NETWORK */ } @@ -88,13 +84,12 @@ Java_gnu_java_net_PlainSocketImpl_create (JNIEnv * env, jobject this, * action as well. */ JNIEXPORT void JNICALL -Java_gnu_java_net_PlainSocketImpl_close (JNIEnv * env, jobject this) +Java_gnu_java_net_VMPlainSocketImpl_close(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj) { #ifndef WITHOUT_NETWORK - assert (env != NULL); - assert ((*env) != NULL); - - _javanet_close (env, this, 1); + _javanet_close(env, obj, 1); #else /* not WITHOUT_NETWORK */ #endif /* not WITHOUT_NETWORK */ } @@ -105,14 +100,13 @@ Java_gnu_java_net_PlainSocketImpl_close (JNIEnv * env, jobject this) * Connects to the specified destination. */ JNIEXPORT void JNICALL -Java_gnu_java_net_PlainSocketImpl_connect (JNIEnv * env, jobject this, - jobject addr, jint port) +Java_gnu_java_net_VMPlainSocketImpl_connect(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj, + jobject addr, jint port) { #ifndef WITHOUT_NETWORK - assert (env != NULL); - assert ((*env) != NULL); - - _javanet_connect (env, this, addr, port); + _javanet_connect(env, obj, addr, port, 1); #else /* not WITHOUT_NETWORK */ #endif /* not WITHOUT_NETWORK */ } @@ -125,14 +119,13 @@ Java_gnu_java_net_PlainSocketImpl_connect (JNIEnv * env, jobject this, * variables. */ JNIEXPORT void JNICALL -Java_gnu_java_net_PlainSocketImpl_bind (JNIEnv * env, jobject this, - jobject addr, jint port) +Java_gnu_java_net_VMPlainSocketImpl_bind(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj, jobject addr, + jint port) { #ifndef WITHOUT_NETWORK - assert (env != NULL); - assert ((*env) != NULL); - - _javanet_bind (env, this, addr, port, 1); + _javanet_bind(env, obj, addr, port, 1); #else /* not WITHOUT_NETWORK */ #endif /* not WITHOUT_NETWORK */ } @@ -144,14 +137,12 @@ Java_gnu_java_net_PlainSocketImpl_bind (JNIEnv * env, jobject this, * connections allowed. */ JNIEXPORT void JNICALL -Java_gnu_java_net_PlainSocketImpl_listen (JNIEnv * env, jobject this, - jint queuelen) +Java_gnu_java_net_VMPlainSocketImpl_listen(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj, jint queuelen) { #ifndef WITHOUT_NETWORK - assert (env != NULL); - assert ((*env) != NULL); - - _javanet_listen (env, this, queuelen); + _javanet_listen(env, obj, queuelen); #else /* not WITHOUT_NETWORK */ #endif /* not WITHOUT_NETWORK */ } @@ -163,14 +154,12 @@ Java_gnu_java_net_PlainSocketImpl_listen (JNIEnv * env, jobject this, * object. Note that we assume this is a PlainSocketImpl just like us. */ JNIEXPORT void JNICALL -Java_gnu_java_net_PlainSocketImpl_accept (JNIEnv * env, jobject this, - jobject impl) +Java_gnu_java_net_VMPlainSocketImpl_accept(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj, jobject impl) { #ifndef WITHOUT_NETWORK - assert (env != NULL); - assert ((*env) != NULL); - - _javanet_accept (env, this, impl); + _javanet_accept(env, obj, impl); #else /* not WITHOUT_NETWORK */ #endif /* not WITHOUT_NETWORK */ } @@ -178,39 +167,37 @@ Java_gnu_java_net_PlainSocketImpl_accept (JNIEnv * env, jobject this, /*************************************************************************/ JNIEXPORT jint JNICALL -Java_gnu_java_net_PlainSocketImpl_available (JNIEnv * env, jobject this) +Java_gnu_java_net_VMPlainSocketImpl_available(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj) { #ifndef WITHOUT_NETWORK - jclass cls; + jclass cls; jfieldID fid; - int fd; - int bytesAvailable; - int result; - - assert (env != NULL); - assert ((*env) != NULL); - - cls = (*env)->GetObjectClass (env, this); + int fd; + int bytesAvailable; + int result; + + cls = (*env)->GetObjectClass(env, obj); if (cls == 0) { - JCL_ThrowException (env, IO_EXCEPTION, "internal error"); + JCL_ThrowException(env, IO_EXCEPTION, "internal error"); return 0; } - - fid = (*env)->GetFieldID (env, cls, "native_fd", "I"); + + fid = (*env)->GetFieldID(env, cls, "native_fd", "I"); if (fid == 0) { - JCL_ThrowException (env, IO_EXCEPTION, "internal error"); + JCL_ThrowException(env, IO_EXCEPTION, "internal error"); return 0; } - fd = (*env)->GetIntField (env, this, fid); - - TARGET_NATIVE_NETWORK_SOCKET_RECEIVE_AVAILABLE (fd, bytesAvailable, result); + fd = (*env)->GetIntField(env, obj, fid); + + TARGET_NATIVE_NETWORK_SOCKET_RECEIVE_AVAILABLE(fd,bytesAvailable,result); if (result != TARGET_NATIVE_OK) { - JCL_ThrowException (env, IO_EXCEPTION, - TARGET_NATIVE_LAST_ERROR_STRING ()); + JCL_ThrowException(env, IO_EXCEPTION, TARGET_NATIVE_LAST_ERROR_STRING()); return 0; } @@ -226,14 +213,13 @@ Java_gnu_java_net_PlainSocketImpl_available (JNIEnv * env, jobject this) * This method sets the specified option for a socket */ JNIEXPORT void JNICALL -Java_gnu_java_net_PlainSocketImpl_setOption (JNIEnv * env, jobject this, - jint option_id, jobject val) +Java_gnu_java_net_VMPlainSocketImpl_setOption(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj, + jint option_id, jobject val) { #ifndef WITHOUT_NETWORK - assert (env != NULL); - assert ((*env) != NULL); - - _javanet_set_option (env, this, option_id, val); + _javanet_set_option(env, obj, option_id, val); #else /* not WITHOUT_NETWORK */ #endif /* not WITHOUT_NETWORK */ } @@ -241,17 +227,16 @@ Java_gnu_java_net_PlainSocketImpl_setOption (JNIEnv * env, jobject this, /*************************************************************************/ /* - * This method sets the specified option for a socket + * This method gets the specified option for a socket */ JNIEXPORT jobject JNICALL -Java_gnu_java_net_PlainSocketImpl_getOption (JNIEnv * env, jobject this, - jint option_id) +Java_gnu_java_net_VMPlainSocketImpl_getOption(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj, + jint option_id) { #ifndef WITHOUT_NETWORK - assert (env != NULL); - assert ((*env) != NULL); - - return (_javanet_get_option (env, this, option_id)); + return(_javanet_get_option(env, obj, option_id)); #else /* not WITHOUT_NETWORK */ return NULL; #endif /* not WITHOUT_NETWORK */ @@ -263,14 +248,13 @@ Java_gnu_java_net_PlainSocketImpl_getOption (JNIEnv * env, jobject this, * Reads a buffer from a remote host */ JNIEXPORT jint JNICALL -Java_gnu_java_net_PlainSocketImpl_read (JNIEnv * env, jobject this, - jarray buf, jint offset, jint len) +Java_gnu_java_net_VMPlainSocketImpl_read(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj, jarray buf, + jint offset, jint len) { #ifndef WITHOUT_NETWORK - assert (env != NULL); - assert ((*env) != NULL); - - return (_javanet_recvfrom (env, this, buf, offset, len, 0, 0)); + return(_javanet_recvfrom(env, obj, buf, offset, len, 0, 0)); #else /* not WITHOUT_NETWORK */ return 0; #endif /* not WITHOUT_NETWORK */ @@ -282,37 +266,34 @@ Java_gnu_java_net_PlainSocketImpl_read (JNIEnv * env, jobject this, * Writes a buffer to the remote host */ JNIEXPORT void JNICALL -Java_gnu_java_net_PlainSocketImpl_write (JNIEnv * env, jobject this, - jarray buf, jint offset, jint len) +Java_gnu_java_net_VMPlainSocketImpl_write(JNIEnv *env, + jclass klass __attribute__ ((__unused__)), + jobject obj, jarray buf, + jint offset, jint len) { #ifndef WITHOUT_NETWORK - assert (env != NULL); - assert ((*env) != NULL); - - _javanet_sendto (env, this, buf, offset, len, 0, 0); + _javanet_sendto(env, obj, buf, offset, len, 0, 0); #else /* not WITHOUT_NETWORK */ #endif /* not WITHOUT_NETWORK */ } JNIEXPORT void JNICALL -Java_gnu_java_net_PlainSocketImpl_shutdownInput (JNIEnv * env, jobject this) +Java_gnu_java_net_VMPlainSocketImpl_shutdownInput (JNIEnv * env, + jclass klass __attribute__ ((__unused__)), + jobject this) { #ifndef WITHOUT_NETWORK - assert (env != NULL); - assert ((*env) != NULL); - _javanet_shutdownInput (env, this); #else /* not WITHOUT_NETWORK */ #endif /* not WITHOUT_NETWORK */ } JNIEXPORT void JNICALL -Java_gnu_java_net_PlainSocketImpl_shutdownOutput (JNIEnv * env, jobject this) +Java_gnu_java_net_VMPlainSocketImpl_shutdownOutput (JNIEnv * env, + jclass klass __attribute__ ((__unused__)), + jobject this) { #ifndef WITHOUT_NETWORK - assert (env != NULL); - assert ((*env) != NULL); - _javanet_shutdownOutput (env, this); #else /* not WITHOUT_NETWORK */ #endif /* not WITHOUT_NETWORK */ diff --git a/libjava/classpath/native/jni/java-net/java_net_VMInetAddress.c b/libjava/classpath/native/jni/java-net/java_net_VMInetAddress.c index 0ba00d1..86ac06e 100644 --- a/libjava/classpath/native/jni/java-net/java_net_VMInetAddress.c +++ b/libjava/classpath/native/jni/java-net/java_net_VMInetAddress.c @@ -1,5 +1,5 @@ /* VMInetAddress.c - Native methods for InetAddress class - Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc. + Copyright (C) 1998, 2002, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,7 +41,6 @@ exception statement from your version. */ #include <stdlib.h> #include <stdio.h> #include <string.h> -#include <assert.h> #include <jni.h> #include <jcl.h> @@ -69,9 +68,6 @@ Java_java_net_VMInetAddress_getLocalHostname (JNIEnv * env, int result; jstring retval; - assert (env != NULL); - assert ((*env) != NULL); - #ifndef WITHOUT_NETWORK TARGET_NATIVE_NETWORK_GET_HOSTNAME (hostname, sizeof (hostname), result); if (result != TARGET_NATIVE_OK) @@ -100,9 +96,6 @@ Java_java_net_VMInetAddress_lookupInaddrAny (JNIEnv * env, jarray IParray; jbyte *octets; - assert (env != NULL); - assert ((*env) != NULL); - /* Allocate an array for the IP address */ IParray = (*env)->NewByteArray (env, 4); if (IParray == NULL) @@ -150,9 +143,6 @@ Java_java_net_VMInetAddress_getHostByAddr (JNIEnv * env, int result; jstring retval; - assert (env != NULL); - assert ((*env) != NULL); - /* Grab the byte[] array with the IP out of the input data */ len = (*env)->GetArrayLength (env, arr); if (len != 4) @@ -215,9 +205,6 @@ Java_java_net_VMInetAddress_getHostByName (JNIEnv * env, jarray ret_octets; int max_addresses; - assert (env != NULL); - assert ((*env) != NULL); - /* Grab the hostname string */ hostname = (*env)->GetStringUTFChars (env, host, 0); if (!hostname) diff --git a/libjava/classpath/native/jni/java-net/java_net_VMNetworkInterface.c b/libjava/classpath/native/jni/java-net/java_net_VMNetworkInterface.c index 71f5e89..f05e9fc 100644 --- a/libjava/classpath/native/jni/java-net/java_net_VMNetworkInterface.c +++ b/libjava/classpath/native/jni/java-net/java_net_VMNetworkInterface.c @@ -1,5 +1,5 @@ /* VMNetworkInterface.c - Native methods for NetworkInterface class - Copyright (C) 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,7 +41,6 @@ exception statement from your version. */ #include <stdlib.h> #include <stdio.h> #include <string.h> -#include <assert.h> #include <jni.h> #include <jcl.h> diff --git a/libjava/classpath/native/jni/java-net/javanet.c b/libjava/classpath/native/jni/java-net/javanet.c index 31afbc8..0f296a6 100644 --- a/libjava/classpath/native/jni/java-net/javanet.c +++ b/libjava/classpath/native/jni/java-net/javanet.c @@ -1,5 +1,5 @@ /* javanet.c - Common internal functions for the java.net package - Copyright (C) 1998, 2002, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1998, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,7 +41,6 @@ exception statement from your version. */ #include <stdlib.h> #include <stdio.h> #include <string.h> -#include <assert.h> #include <jni.h> #include <jcl.h> @@ -77,9 +76,6 @@ _javanet_set_int_field (JNIEnv * env, jobject obj, jclass cls; jfieldID fid; - assert (env != NULL); - assert ((*env) != NULL); - cls = (*env)->FindClass (env, class); if (cls == NULL) return; @@ -106,9 +102,6 @@ _javanet_get_int_field (JNIEnv * env, jobject obj, const char *field) jfieldID fid; int fd; - assert (env != NULL); - assert ((*env) != NULL); - DBG ("_javanet_get_int_field(): Entered _javanet_get_int_field\n"); cls = (*env)->GetObjectClass (env, obj); @@ -133,20 +126,20 @@ _javanet_get_int_field (JNIEnv * env, jobject obj, const char *field) * need to include it. */ static void -_javanet_create_localfd (JNIEnv * env, jobject this) +_javanet_create_localfd (JNIEnv * env, jobject this, jboolean stream) { jclass this_cls, fd_cls; jfieldID fid; jmethodID mid; jobject fd_obj; - assert (env != NULL); - assert ((*env) != NULL); - DBG ("_javanet_create_localfd(): Entered _javanet_create_localfd\n"); /* Look up the fd field */ - this_cls = (*env)->FindClass (env, "java/net/SocketImpl"); + if (stream) + this_cls = (*env)->FindClass(env, "java/net/SocketImpl"); + else + this_cls = (*env)->FindClass(env, "java/net/DatagramSocketImpl"); if (this_cls == NULL) return; @@ -194,9 +187,6 @@ _javanet_create_boolean (JNIEnv * env, jboolean val) jmethodID mid; jobject obj; - assert (env != NULL); - assert ((*env) != NULL); - cls = (*env)->FindClass (env, "java/lang/Boolean"); if (cls == NULL) return NULL; @@ -224,9 +214,6 @@ _javanet_create_integer (JNIEnv * env, jint val) jmethodID mid; jobject obj; - assert (env != NULL); - assert ((*env) != NULL); - cls = (*env)->FindClass (env, "java/lang/Integer"); if (cls == NULL) return NULL; @@ -258,9 +245,6 @@ _javanet_create_inetaddress (JNIEnv * env, int netaddr) jstring ip_str; jobject ia; - assert (env != NULL); - assert ((*env) != NULL); - /* Build a string IP address */ TARGET_NATIVE_NETWORK_INT_TO_IPADDRESS_BYTES (netaddr, octets[0], @@ -315,9 +299,6 @@ _javanet_set_remhost_addr (JNIEnv * env, jobject this, jobject ia) jclass this_cls; jfieldID fid; - assert (env != NULL); - assert ((*env) != NULL); - /* Set the variable in the object */ this_cls = (*env)->FindClass (env, "java/net/SocketImpl"); if (this_cls == NULL) @@ -343,9 +324,6 @@ _javanet_set_remhost (JNIEnv * env, jobject this, int netaddr) { jobject ia; - assert (env != NULL); - assert ((*env) != NULL); - DBG ("_javanet_set_remhost(): Entered _javanet_set_remhost\n"); /* Get an InetAddress object */ @@ -372,9 +350,6 @@ _javanet_get_netaddr (JNIEnv * env, jobject addr) jbyte *octets; int netaddr, len; - assert (env != NULL); - assert ((*env) != NULL); - DBG ("_javanet_get_netaddr(): Entered _javanet_get_netaddr\n"); if (addr == NULL) @@ -441,9 +416,6 @@ _javanet_create (JNIEnv * env, jobject this, jboolean stream) int fd; int result; - assert (env != NULL); - assert ((*env) != NULL); - if (stream) { /* create a stream socket */ @@ -514,9 +486,6 @@ _javanet_close (JNIEnv * env, jobject this, int stream) int result; int error = 0; - assert (env != NULL); - assert ((*env) != NULL); - fd = _javanet_get_int_field (env, this, "native_fd"); if (fd == -1) return; @@ -552,7 +521,8 @@ _javanet_close (JNIEnv * env, jobject this, int stream) * Connects to the specified destination. */ void -_javanet_connect (JNIEnv * env, jobject this, jobject addr, jint port) +_javanet_connect (JNIEnv * env, jobject this, jobject addr, jint port, + jboolean stream) { #ifndef WITHOUT_NETWORK int netaddr, fd; @@ -560,9 +530,6 @@ _javanet_connect (JNIEnv * env, jobject this, jobject addr, jint port) int local_address, local_port; int remote_address, remote_port; - assert (env != NULL); - assert ((*env) != NULL); - DBG ("_javanet_connect(): Entered _javanet_connect\n"); /* Pre-process input variables */ @@ -613,7 +580,7 @@ _javanet_connect (JNIEnv * env, jobject this, jobject addr, jint port) return; } - _javanet_create_localfd (env, this); + _javanet_create_localfd (env, this, stream); if ((*env)->ExceptionOccurred (env)) { /* We don't care whether this succeeds. close() will cleanup later. */ @@ -622,8 +589,13 @@ _javanet_connect (JNIEnv * env, jobject this, jobject addr, jint port) } DBG ("_javanet_connect(): Created fd\n"); - _javanet_set_int_field (env, this, "java/net/SocketImpl", "localport", - local_port); + if (stream) + _javanet_set_int_field (env, this, "java/net/SocketImpl", "localport", + local_port); + else + _javanet_set_int_field (env, this, "java/net/DatagramSocketImpl", + "localPort", local_port); + if ((*env)->ExceptionOccurred (env)) { /* We don't care whether this succeeds. close() will cleanup later. */ @@ -643,31 +615,36 @@ _javanet_connect (JNIEnv * env, jobject this, jobject addr, jint port) return; } - if (remote_address == netaddr) - { - _javanet_set_remhost_addr (env, this, addr); - } - else - { - _javanet_set_remhost (env, this, remote_address); - } - if ((*env)->ExceptionOccurred (env)) + if (stream) { - /* We don't care whether this succeeds. close() will cleanup later. */ - TARGET_NATIVE_NETWORK_SOCKET_CLOSE (fd, result); - return; - } - DBG ("_javanet_connect(): Set the remote host\n"); + if (remote_address == netaddr) + { + _javanet_set_remhost_addr (env, this, addr); + } + else + { + _javanet_set_remhost (env, this, remote_address); + } + if ((*env)->ExceptionOccurred (env)) + { + /* We don't care whether this succeeds. close() will cleanup later. + */ + TARGET_NATIVE_NETWORK_SOCKET_CLOSE (fd, result); + return; + } + DBG ("_javanet_connect(): Set the remote host\n"); - _javanet_set_int_field (env, this, "java/net/SocketImpl", "port", - remote_port); - if ((*env)->ExceptionOccurred (env)) - { - /* We don't care whether this succeeds. close() will cleanup later. */ - TARGET_NATIVE_NETWORK_SOCKET_CLOSE (fd, result); - return; + _javanet_set_int_field (env, this, "java/net/SocketImpl", "port", + remote_port); + if ((*env)->ExceptionOccurred (env)) + { + /* We don't care whether this succeeds. close() will cleanup later. + */ + TARGET_NATIVE_NETWORK_SOCKET_CLOSE (fd, result); + return; + } + DBG ("_javanet_connect(): Set the remote port\n"); } - DBG ("_javanet_connect(): Set the remote port\n"); #else /* not WITHOUT_NETWORK */ #endif /* not WITHOUT_NETWORK */ } @@ -693,9 +670,6 @@ _javanet_bind (JNIEnv * env, jobject this, jobject addr, jint port, int result; int local_address, local_port; - assert (env != NULL); - assert ((*env) != NULL); - DBG ("_javanet_bind(): Entering native bind()\n"); /* Get the address to connect to */ @@ -797,9 +771,6 @@ _javanet_listen (JNIEnv * env, jobject this, jint queuelen) int fd; int result; - assert (env != NULL); - assert ((*env) != NULL); - /* Get the real file descriptor */ fd = _javanet_get_int_field (env, this, "native_fd"); if (fd == -1) @@ -836,9 +807,6 @@ _javanet_accept (JNIEnv * env, jobject this, jobject impl) int local_address, local_port; int remote_address, remote_port; - assert (env != NULL); - assert ((*env) != NULL); - /* Get the real file descriptor */ fd = _javanet_get_int_field (env, this, "native_fd"); if (fd == -1) @@ -897,7 +865,7 @@ _javanet_accept (JNIEnv * env, jobject this, jobject impl) return; } - _javanet_create_localfd (env, impl); + _javanet_create_localfd (env, impl, 1); if ((*env)->ExceptionOccurred (env)) { /* We don't care whether this succeeds. close() will cleanup later. */ @@ -971,9 +939,6 @@ _javanet_recvfrom (JNIEnv * env, jobject this, jarray buf, int offset, int from_address, from_port; int received_bytes; - assert (env != NULL); - assert ((*env) != NULL); - DBG ("_javanet_recvfrom(): Entered _javanet_recvfrom\n"); /* Get the real file descriptor */ @@ -1040,6 +1005,11 @@ _javanet_recvfrom (JNIEnv * env, jobject this, jarray buf, int offset, (*port) = from_port; } + /* zero bytes received means recv() noticed the other side orderly + closing the connection. */ + if (received_bytes == 0) + received_bytes = -1; + return (received_bytes); #else /* not WITHOUT_NETWORK */ #endif /* not WITHOUT_NETWORK */ @@ -1065,9 +1035,6 @@ _javanet_sendto (JNIEnv * env, jobject this, jarray buf, int offset, int len, jbyte *p; int bytes_sent; - assert (env != NULL); - assert ((*env) != NULL); - /* Get the real file descriptor */ fd = _javanet_get_int_field (env, this, "native_fd"); if (fd == -1) @@ -1138,9 +1105,6 @@ _javanet_set_option (JNIEnv * env, jobject this, jint option_id, jobject val) int address; int result; - assert (env != NULL); - assert ((*env) != NULL); - /* Get the real file descriptor */ fd = _javanet_get_int_field (env, this, "native_fd"); if (fd == -1) @@ -1355,9 +1319,6 @@ _javanet_get_option (JNIEnv * env, jobject this, jint option_id) int address; int result; - assert (env != NULL); - assert ((*env) != NULL); - /* Get the real file descriptor */ fd = _javanet_get_int_field (env, this, "native_fd"); if (fd == -1) @@ -1531,9 +1492,6 @@ _javanet_shutdownInput (JNIEnv * env, jobject this) { int fd; - assert (env != NULL); - assert ((*env) != NULL); - /* Get the real file descriptor. */ fd = _javanet_get_int_field (env, this, "native_fd"); if (fd == -1) @@ -1546,7 +1504,8 @@ _javanet_shutdownInput (JNIEnv * env, jobject this) /* Shutdown input stream of socket. */ if (shutdown (fd, SHUT_RD) == -1) { - JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno)); + JCL_ThrowException (env, SOCKET_EXCEPTION, + TARGET_NATIVE_LAST_ERROR_STRING()); return; } } @@ -1556,9 +1515,6 @@ _javanet_shutdownOutput (JNIEnv * env, jobject this) { int fd; - assert (env != NULL); - assert ((*env) != NULL); - /* Get the real file descriptor. */ fd = _javanet_get_int_field (env, this, "native_fd"); if (fd == -1) @@ -1571,7 +1527,8 @@ _javanet_shutdownOutput (JNIEnv * env, jobject this) /* Shutdown output stream of socket. */ if (shutdown (fd, SHUT_WR) == -1) { - JCL_ThrowException (env, SOCKET_EXCEPTION, strerror (errno)); + JCL_ThrowException (env, SOCKET_EXCEPTION, + TARGET_NATIVE_LAST_ERROR_STRING()); return; } } diff --git a/libjava/classpath/native/jni/java-net/javanet.h b/libjava/classpath/native/jni/java-net/javanet.h index 7c77ea7..c173b10 100644 --- a/libjava/classpath/native/jni/java-net/javanet.h +++ b/libjava/classpath/native/jni/java-net/javanet.h @@ -92,7 +92,7 @@ extern int _javanet_get_int_field(JNIEnv *, jobject, const char *); extern int _javanet_get_netaddr(JNIEnv *, jobject); extern void _javanet_create(JNIEnv *, jobject, jboolean); extern void _javanet_close(JNIEnv *, jobject, int); -extern void _javanet_connect(JNIEnv *, jobject, jobject, jint); +extern void _javanet_connect(JNIEnv *, jobject, jobject, jint, jboolean); extern void _javanet_bind(JNIEnv *, jobject, jobject, jint, int); extern void _javanet_listen(JNIEnv *, jobject, jint); extern void _javanet_accept(JNIEnv *, jobject, jobject); diff --git a/libjava/classpath/native/jni/java-nio/Makefile.in b/libjava/classpath/native/jni/java-nio/Makefile.in index a082889..ede3c62 100644 --- a/libjava/classpath/native/jni/java-nio/Makefile.in +++ b/libjava/classpath/native/jni/java-nio/Makefile.in @@ -44,10 +44,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ - $(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -177,6 +178,7 @@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ JIKESENCODING = @JIKESENCODING@ +JIKESWARNINGS = @JIKESWARNINGS@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ diff --git a/libjava/classpath/native/jni/java-nio/gnu_java_nio_channels_FileChannelImpl.c b/libjava/classpath/native/jni/java-nio/gnu_java_nio_channels_FileChannelImpl.c index a989499..5aed63f 100644 --- a/libjava/classpath/native/jni/java-nio/gnu_java_nio_channels_FileChannelImpl.c +++ b/libjava/classpath/native/jni/java-nio/gnu_java_nio_channels_FileChannelImpl.c @@ -1,5 +1,5 @@ /* gnu_java_nio_channels_FileChannelImpl.c - - Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -538,11 +538,27 @@ Java_gnu_java_nio_channels_FileChannelImpl_mapImpl (JNIEnv *env, jobject obj, return NULL; } + fd = get_native_fd (env, obj); + prot = PROT_READ; - if (mode == '+') - prot |= PROT_WRITE; + if (mode == '+' || mode == 'c') + { + /* When writing we need to make sure the file is big enough, + otherwise the result of mmap is undefined. */ + jlong filesize; + filesize = Java_gnu_java_nio_channels_FileChannelImpl_size(env, obj); + if (filesize == -1) + return NULL; + if (position + size > filesize) + if (ftruncate(fd, position + size) == -1) + { + JCL_ThrowException (env, IO_EXCEPTION, strerror (errno)); + return NULL; + } + prot |= PROT_WRITE; + } + flags = (mode == 'c' ? MAP_PRIVATE : MAP_SHARED); - fd = get_native_fd (env, obj); p = mmap (NULL, (size_t) ALIGN_UP (size, pagesize), prot, flags, fd, ALIGN_DOWN (position, pagesize)); if (p == MAP_FAILED) diff --git a/libjava/classpath/native/jni/java-nio/java_nio.c b/libjava/classpath/native/jni/java-nio/java_nio.c deleted file mode 100644 index a25f38a..0000000 --- a/libjava/classpath/native/jni/java-nio/java_nio.c +++ /dev/null @@ -1,328 +0,0 @@ -/* java_nio.c - Native methods for gnu.java.nio.FileChannelImpl class - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -/* do not move; needed here because of some macro definitions */ -#include <config.h> - -#ifdef HAVE_MMAP -#include <sys/mman.h> -#endif - -#include <jni.h> -#include <jcl.h> - -#include "target_native.h" -#ifndef WITHOUT_NETWORK -#include "target_native_network.h" -#endif /* WITHOUT_NETWORK */ - -#include "java_nio_channels_FileChannelImpl.h" - -#include "javaio.h" - -#define NIO_DEBUG(X) /* no debug */ -//#define NIO_DEBUG(X) X - -/*************************************** - * - * File Channel implementation - * - *************/ - - -static char * -compare (int i, int lim, char *buffer) -{ - sprintf (buffer, "(%d >= %d)", i, lim); - return buffer; -} - -static inline int -convert_Int (int X) -{ - unsigned char *a = (unsigned char *) &X; - int res = - (((int) a[0]) << 24) + - (((int) a[1]) << 16) + (((int) a[2]) << 8) + (((int) a[3]) << 0); - return res; -} - -static inline jlong -convert_Long (jlong X) -{ - unsigned char *a = (unsigned char *) &X; - int res1 = - (((int) a[0]) << 24) + - (((int) a[1]) << 16) + (((int) a[2]) << 8) + (((int) a[3]) << 0); - int res2; - a += 4; - res2 = - (((int) a[0]) << 24) + - (((int) a[1]) << 16) + (((int) a[2]) << 8) + (((int) a[3]) << 0); - return ((jlong) res1) | ((jlong) res2) << 32LL; -} - -static inline short -convert_Short (short X) -{ - unsigned char *a = (unsigned char *) &X; - int res = (((int) a[2]) << 8) + (((int) a[3]) << 0); - return res; -} -static inline short -convert_Char (short X) -{ - unsigned char *a = (unsigned char *) &X; - int res = (((int) a[2]) << 8) + (((int) a[3]) << 0); - return res; -} - -static inline unsigned char -convert_Byte (unsigned char X) -{ - return X; -} - -static inline float -convert_Float (float X) -{ - return X; -} - -static inline double -convert_Double (double X) -{ - return X; -} - - -// Note: do to many get()'s on a buffer and you should throw a BufferUnderflowException -// Alas, I only found this out during testing.... - -#define READ_WRITE_MMAPED_FILE(TYPE,ELT) \ - \ -ELT Java_gnu_java_nio_MappedByteFileBuffer_nio_1read_1 ## TYPE ## _1file_1channel(JNIEnv *env, \ - jclass c, jobject b, \ - int index, int limit, jlong jaddress) \ -{ \ - char *address = *(void **) &jaddress; char buffer[128]; \ - if (index >= limit) JCL_ThrowException(env, "java/nio/BufferUnderflowException", compare(index,limit, buffer)); \ - NIO_DEBUG( fprintf(stderr, "READ:index = %d [0]=%c [1]=%c\n", index, address[0],address[1]); ) \ - address += index; \ - return convert_ ## TYPE (*(ELT *) address); \ -} \ - \ -void Java_gnu_java_nio_MappedByteFileBuffer_nio_1write_1 ## TYPE ## _1file_1channel(JNIEnv *env, \ - jclass c, jobject b, \ - int index, int limit, ELT value, jlong jaddress) \ -{ \ - \ - char *address = *(void **) &jaddress; char buffer[128]; \ - if (index >= limit) JCL_ThrowException(env, "java/nio/BufferUnderflowException", compare(index,limit, buffer)); \ -NIO_DEBUG( fprintf(stderr, "WRITE:index = %d [0]=%c [1]=%c\n", index, address[0],address[1]); ) \ - address += index; \ - *(ELT *) address = value; \ -} \ - \ -ELT Java_gnu_java_nio_MappedByteFileBuffer_nio_1get_1 ## TYPE(JNIEnv *env, jclass c, jobject b, \ - int index, int limit, jlong jaddress) \ -{ \ - fprintf(stderr, "unimplemented\n"); return 0; \ -} \ - \ -void Java_gnu_java_nio_MappedByteFileBuffer_nio_1put_1 ## TYPE(JNIEnv *env, jclass c, jobject b, \ - int index, int limit, \ - ELT value, jlong jaddress) \ -{ \ - fprintf(stderr, "unimplemented\n"); \ -} - -READ_WRITE_MMAPED_FILE (Byte, u_int8_t); -READ_WRITE_MMAPED_FILE (Char, u_int16_t); -READ_WRITE_MMAPED_FILE (Short, u_int16_t); -READ_WRITE_MMAPED_FILE (Int, u_int32_t); -READ_WRITE_MMAPED_FILE (Long, u_int64_t); -READ_WRITE_MMAPED_FILE (Float, float); -READ_WRITE_MMAPED_FILE (Double, double); - -u_int64_t -nio_mmap_file (jint fd, jlong pos, jint size, jint jflags) -{ -#ifdef HAVE_MMAP - u_int64_t ret = 0; - void *address; - - int flags = (jflags != 2) ? MAP_SHARED : MAP_PRIVATE; - int prot = PROT_READ; - - if (jflags == 1) - prot |= PROT_WRITE; - - // fprintf(stderr, "mapping file: %d\n", fd); - - address = mmap (0, size, prot, flags, fd, pos); - - if (address == (void *) -1) - { - perror ("mapping file failed"); - return 0; - } - - // fprintf(stderr, "address = %p, fd = %d, pos=%lld, size=%d\n", address, fd, pos, size); - - *(void **) &ret = address; - - return ret; -#else /* not HAVE_MMAP */ - return (TARGET_NATIVE_MATH_INT_INT64_CONST_0); -#endif /* not HAVE_MMAP */ -} - - -void -nio_msync (int fd, jlong jaddress, int size) -{ -#ifdef HAVE_MMAP - int res; - char *address = *(void **) &jaddress; - - // fprintf(stderr, "synchronizing with file (%p -> %d bytes (%s))\n", address, size, address); - - res = msync (address, size, MS_SYNC | MS_INVALIDATE); - - if (res == -1) - { - perror ("synchronize with file failed"); - } -#else /* not HAVE_MMAP */ -#endif /* not HAVE_MMAP */ -} - -void -nio_unmmap_file (int fd, jlong jaddress, int size) -{ -#ifdef HAVE_MMAP - int res = 0; - char *address = *(void **) &jaddress; - - // nio_msync(fd, jaddress, size); - - // fprintf(stderr, "unmapping (%p -> %d bytes)\n", address, size); - - res = munmap (address, size); - if (res == -1) - { - perror ("un-mapping file failed"); - } -#else /* not HAVE_MMAP */ -#endif /* not HAVE_MMAP */ -} - - -/*************************************** - * - * Socket Channel implementation - * - *************/ - -/*************************************************************************/ - -/* - * Returns a 32 bit Internet address for the passed in InetAddress object - * Ronald: This is a verbatim copy from javanet.c. - * It's a copy to avoid a link error in orp. - */ - -static int -socket_channel_get_net_addr (JNIEnv * env, jobject addr) -{ -#ifndef WITHOUT_NETWORK - jclass cls = 0; - jmethodID mid; - jarray arr = 0; - jbyte *octets; - int netaddr, len; - - DBG - ("socket_channel_get_net_addr(): Entered socket_channel_get_net_addr\n"); - - /* Call the getAddress method on the object to retrieve the IP address */ - cls = (*env)->GetObjectClass (env, addr); - if (cls == NULL) - return (0); - - mid = (*env)->GetMethodID (env, cls, "getAddress", "()[B"); - if (mid == NULL) - return (0); - - DBG ("socket_channel_get_net_addr(): Got getAddress method\n"); - - arr = (*env)->CallObjectMethod (env, addr, mid); - if (arr == NULL) - return (0); - - DBG ("socket_channel_get_net_addr(): Got the address\n"); - - /* Turn the IP address into a 32 bit Internet address in network byte order */ - len = (*env)->GetArrayLength (env, arr); - if (len != 4) - { - JCL_ThrowException (env, "java/io/IOException", - "Internal Error: invalid byte array length"); - return (0); - } - DBG ("socket_channel_get_net_addr(): Length ok\n"); - - octets = (*env)->GetByteArrayElements (env, arr, 0); - if (octets == NULL) - return (0); - - DBG ("socket_channel_get_net_addr(): Grabbed bytes\n"); - - TARGET_NATIVE_NETWORK_IPADDRESS_BYTES_TO_INT (octets[0], - octets[1], - octets[2], - octets[3], netaddr); - - (*env)->ReleaseByteArrayElements (env, arr, octets, 0); - DBG ("socket_channel_get_net_addr(): Done getting addr\n"); - - return netaddr; -#else /* not WITHOUT_NETWORK */ - return (0); -#endif /* not WITHOUT_NETWORK */ -} diff --git a/libjava/classpath/native/jni/java-nio/java_nio_VMDirectByteBuffer.c b/libjava/classpath/native/jni/java-nio/java_nio_VMDirectByteBuffer.c index 06e2990..f725cf2 100644 --- a/libjava/classpath/native/jni/java-nio/java_nio_VMDirectByteBuffer.c +++ b/libjava/classpath/native/jni/java-nio/java_nio_VMDirectByteBuffer.c @@ -93,8 +93,8 @@ Java_java_nio_VMDirectByteBuffer_get__Lgnu_classpath_Pointer_2I_3BII jobject address, jint index, jbyteArray dst, jint dst_offset, jint dst_len) { jbyte *src = (jbyte *) JCL_GetRawData (env, address) + index; - jbyte *_dst = (*env)->GetByteArrayElements (env, dst, NULL) + dst_offset; - memcpy (_dst, src, dst_len); + jbyte *_dst = (*env)->GetByteArrayElements (env, dst, NULL); + memcpy (_dst + dst_offset, src, dst_len); (*env)->ReleaseByteArrayElements (env, dst, _dst, 0); } @@ -103,10 +103,10 @@ Java_java_nio_VMDirectByteBuffer_put__Lgnu_classpath_Pointer_2I_3BII (JNIEnv *env, jclass clazz __attribute__ ((__unused__)), jobject address, jint index, jbyteArray src, jint src_offset, jint src_len) { - jbyte *_src = (*env)->GetByteArrayElements (env, src, NULL) + src_offset; - jbyte *dst = (jbyte *)JCL_GetRawData (env, address) + index; + jbyte *_src = (*env)->GetByteArrayElements (env, src, NULL); + jbyte *dst = (jbyte *)JCL_GetRawData (env, address); + memcpy (dst + index, _src + src_offset, src_len); (*env)->ReleaseByteArrayElements (env, src, _src, 0); - memcpy (dst, _src, src_len); } JNIEXPORT void JNICALL diff --git a/libjava/classpath/native/jni/java-util/Makefile.in b/libjava/classpath/native/jni/java-util/Makefile.in index bc5b3f6..ac8bc13 100644 --- a/libjava/classpath/native/jni/java-util/Makefile.in +++ b/libjava/classpath/native/jni/java-util/Makefile.in @@ -44,10 +44,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ - $(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -168,6 +169,7 @@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ JIKESENCODING = @JIKESENCODING@ +JIKESWARNINGS = @JIKESWARNINGS@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ diff --git a/libjava/classpath/native/jni/midi-alsa/Makefile.in b/libjava/classpath/native/jni/midi-alsa/Makefile.in index 5309d72..2634dad 100644 --- a/libjava/classpath/native/jni/midi-alsa/Makefile.in +++ b/libjava/classpath/native/jni/midi-alsa/Makefile.in @@ -44,10 +44,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ - $(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -171,6 +172,7 @@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ JIKESENCODING = @JIKESENCODING@ +JIKESWARNINGS = @JIKESWARNINGS@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ diff --git a/libjava/classpath/native/jni/midi-dssi/Makefile.in b/libjava/classpath/native/jni/midi-dssi/Makefile.in index c3b4b7e..a048071 100644 --- a/libjava/classpath/native/jni/midi-dssi/Makefile.in +++ b/libjava/classpath/native/jni/midi-dssi/Makefile.in @@ -44,10 +44,11 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ - $(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -171,6 +172,7 @@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ JIKESENCODING = @JIKESENCODING@ +JIKESWARNINGS = @JIKESWARNINGS@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ diff --git a/libjava/classpath/native/jni/qt-peer/Makefile.in b/libjava/classpath/native/jni/qt-peer/Makefile.in index ab3b230..e582bb6 100644 --- a/libjava/classpath/native/jni/qt-peer/Makefile.in +++ b/libjava/classpath/native/jni/qt-peer/Makefile.in @@ -47,10 +47,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ - $(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -186,6 +187,7 @@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ JIKESENCODING = @JIKESENCODING@ +JIKESWARNINGS = @JIKESWARNINGS@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ diff --git a/libjava/classpath/native/jni/qt-peer/mainqtthread.cpp b/libjava/classpath/native/jni/qt-peer/mainqtthread.cpp index 7922dbc..19566c6 100644 --- a/libjava/classpath/native/jni/qt-peer/mainqtthread.cpp +++ b/libjava/classpath/native/jni/qt-peer/mainqtthread.cpp @@ -45,9 +45,6 @@ exception statement from your version. */ MainThreadInterface *mainThread; QApplication *qApplication; -#if defined(Q_WS_X11) -extern void qt_x11_set_global_double_buffer( bool ); -#endif /** * Starts up a QApplication @@ -92,11 +89,6 @@ JNIEXPORT jlong JNICALL Java_gnu_java_awt_peer_qt_MainQtThread_init jfieldID nofid = env->GetFieldID( cls, "mainThreadInterface", "J" ); env->SetLongField( obj, nofid, (jlong)mainThread ); -#if defined(Q_WS_X11) - // turn off double-buffering. - qt_x11_set_global_double_buffer( (doublebuffer == JNI_TRUE) ); -#endif - return (jlong)qtApp; } diff --git a/libjava/classpath/native/jni/qt-peer/qtmenupeer.cpp b/libjava/classpath/native/jni/qt-peer/qtmenupeer.cpp index bf081e9..1ac1714 100644 --- a/libjava/classpath/native/jni/qt-peer/qtmenupeer.cpp +++ b/libjava/classpath/native/jni/qt-peer/qtmenupeer.cpp @@ -125,6 +125,7 @@ public: jclass menuCls = env->GetObjectClass( menuPeer ); jmethodID mid = env->GetMethodID(menuCls, "add", "(J)V"); + env->DeleteLocalRef(menuCls); env->CallVoidMethod( menuPeer, mid, (jlong)newAction ); env->DeleteGlobalRef( menuPeer ); diff --git a/libjava/classpath/native/jni/xmlj/Makefile.am b/libjava/classpath/native/jni/xmlj/Makefile.am index d4b9447..0e9249f 100644 --- a/libjava/classpath/native/jni/xmlj/Makefile.am +++ b/libjava/classpath/native/jni/xmlj/Makefile.am @@ -17,6 +17,8 @@ xmlj_util.c \ xmlj_util.h \ xmlj_xpath.c +libxmlj_la_LIBADD = $(top_builddir)/native/jni/classpath/jcl.lo + AM_LDFLAGS = @CLASSPATH_MODULE@ @XML_LIBS@ @XSLT_LIBS@ AM_CPPFLAGS = @CLASSPATH_INCLUDES@ diff --git a/libjava/classpath/native/jni/xmlj/Makefile.in b/libjava/classpath/native/jni/xmlj/Makefile.in index 2fb6e20..05c3d87 100644 --- a/libjava/classpath/native/jni/xmlj/Makefile.in +++ b/libjava/classpath/native/jni/xmlj/Makefile.in @@ -44,17 +44,18 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ - $(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) -libxmlj_la_LIBADD = +libxmlj_la_DEPENDENCIES = $(top_builddir)/native/jni/classpath/jcl.lo am_libxmlj_la_OBJECTS = xmlj_dom.lo xmlj_error.lo xmlj_io.lo \ xmlj_node.lo xmlj_sax.lo xmlj_transform.lo xmlj_util.lo \ xmlj_xpath.lo @@ -162,6 +163,7 @@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ JIKESENCODING = @JIKESENCODING@ +JIKESWARNINGS = @JIKESWARNINGS@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ @@ -283,6 +285,7 @@ xmlj_util.c \ xmlj_util.h \ xmlj_xpath.c +libxmlj_la_LIBADD = $(top_builddir)/native/jni/classpath/jcl.lo AM_LDFLAGS = @CLASSPATH_MODULE@ @XML_LIBS@ @XSLT_LIBS@ AM_CPPFLAGS = @CLASSPATH_INCLUDES@ diff --git a/libjava/classpath/native/jni/xmlj/xmlj_util.h b/libjava/classpath/native/jni/xmlj/xmlj_util.h index 7bbe78b..72601ae 100644 --- a/libjava/classpath/native/jni/xmlj/xmlj_util.h +++ b/libjava/classpath/native/jni/xmlj/xmlj_util.h @@ -1,5 +1,5 @@ /* xmlj_util.h - - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,10 +38,6 @@ exception statement from your version. */ #ifndef XMLJ_UTIL_H #define XMLJ_UTIL_H -#if defined __64BIT__ || defined __LP64 || defined _LP64 || defined __LP64__ || defined _ADDR64 -# define XMLJ_64BIT_POINTER 1 -#endif - #include <jni.h> #include <libxml/xmlstring.h> diff --git a/libjava/classpath/native/target/Linux/Makefile.in b/libjava/classpath/native/target/Linux/Makefile.in index 50579b9..6ec7df8 100644 --- a/libjava/classpath/native/target/Linux/Makefile.in +++ b/libjava/classpath/native/target/Linux/Makefile.in @@ -41,10 +41,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ - $(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -140,6 +141,7 @@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ JIKESENCODING = @JIKESENCODING@ +JIKESWARNINGS = @JIKESWARNINGS@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ diff --git a/libjava/classpath/native/target/Makefile.in b/libjava/classpath/native/target/Makefile.in index 2dcc1f2..73566fd 100644 --- a/libjava/classpath/native/target/Makefile.in +++ b/libjava/classpath/native/target/Makefile.in @@ -41,10 +41,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ - $(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -149,6 +150,7 @@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ JIKESENCODING = @JIKESENCODING@ +JIKESWARNINGS = @JIKESWARNINGS@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ diff --git a/libjava/classpath/native/target/generic/Makefile.in b/libjava/classpath/native/target/generic/Makefile.in index 13f2026..7ca81e2 100644 --- a/libjava/classpath/native/target/generic/Makefile.in +++ b/libjava/classpath/native/target/generic/Makefile.in @@ -41,10 +41,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ - $(top_srcdir)/m4/acinclude.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/acinclude.m4 \ + $(top_srcdir)/m4/ax_create_stdint_h.m4 \ + $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -140,6 +141,7 @@ JAY = @JAY@ JAY_SKELETON = @JAY_SKELETON@ JIKES = @JIKES@ JIKESENCODING = @JIKESENCODING@ +JIKESWARNINGS = @JIKESWARNINGS@ KJC = @KJC@ LDFLAGS = @LDFLAGS@ LIBDEBUG = @LIBDEBUG@ |