Re: [cp-patches] FYI: use HAVE_INET6 throughout the networking code

2007-06-25 Thread Mark Wielaard
Hi Dalibor,

On Mon, 2007-06-25 at 02:07 +0200, Dalibor Topic wrote:
 the attached patch largely fixes the build on cygwin, and lets IPv6 
 dependant code only be built if we find IPv6 facilities.
 [...]
  * native/jni/native-lib/cpnet.c
  (cpnet_getHostByName, cpnet_getHostByAddr) Build IPv6 dependant
  code conditionally on IPv6 facilities being available.
  (cpnet_aton) Moved variable declaration of inet6_addr to the scope
  of its use. Build IPv6 dependant code conditionally
  on IPv6 facilities being available.

This broke the build (bad Dalibor!), because the variable declaration
was moved just after the first usage. Moved it back (and guarded it with
the new HAVE_INET6 define.

2007-06-25  Mark Wielaard  [EMAIL PROTECTED]

* native/jni/native-lib/cpnet.c
(cpnet_aton) Moved variable declaration of inet6_addr so it is
actually in the scope of its use.

Committed,

Mark

diff -u -r1.9 cpnet.c
--- native/jni/native-lib/cpnet.c   25 Jun 2007 00:05:33 -  1.9
+++ native/jni/native-lib/cpnet.c   25 Jun 2007 09:41:54 -
@@ -767,6 +767,10 @@
 {
   jbyte *bytes = NULL;
 
+#if defined(HAVE_INET_PTON)  defined(HAVE_INET6)
+  jbyte inet6_addr[16];
+#endif
+
 #ifdef HAVE_INET_ATON
   struct in_addr laddr;
   if (inet_aton (hostname, laddr))
@@ -793,8 +797,6 @@
 #if defined(HAVE_INET_PTON)  defined(HAVE_INET6)
   if (inet_pton (AF_INET6, hostname, inet6_addr)  0)
 {
-  jbyte inet6_addr[16];
-
   *addr = cpnet_newIPV6Address(env);
   cpnet_bytesToIPV6Address(*addr, inet6_addr);
   return 0;



signature.asc
Description: This is a digitally signed message part


Re: [cp-patches] FYI: use HAVE_INET6 throughout the networking code

2007-06-25 Thread Dalibor Topic

Mark Wielaard wrote:

Hi Dalibor,

On Mon, 2007-06-25 at 02:07 +0200, Dalibor Topic wrote:
the attached patch largely fixes the build on cygwin, and lets IPv6 
dependant code only be built if we find IPv6 facilities.

[...]
 * native/jni/native-lib/cpnet.c
 (cpnet_getHostByName, cpnet_getHostByAddr) Build IPv6 dependant
 code conditionally on IPv6 facilities being available.
 (cpnet_aton) Moved variable declaration of inet6_addr to the scope
 of its use. Build IPv6 dependant code conditionally
 on IPv6 facilities being available.


This broke the build (bad Dalibor!), because the variable declaration
was moved just after the first usage. Moved it back (and guarded it with
the new HAVE_INET6 define.


Thanks for the catch!

cheers,
dalibor topic



[cp-patches] FYI: AWT stuff

2007-06-25 Thread Roman Kennke
This adds a bunch of 1.6 methods and constants to our AWT, and fixes
some issues in the peers. Together with these patches and a bunch of
modifications on OpenJDK, I was able to use the GTK peers in OpenJDK to
get Swing running:

http://kennke.org/blog/2007/06/25/openjdk-swing-on-gtk-peers/

2007-06-25  Roman Kennke  [EMAIL PROTECTED]

* gnu/java/awt/peer/ClasspathFontPeer.java
(canDisplay): Take character as integer codepoint.
* gnu/java/awt/peer/gtk/GdkFontPeer.java
(canDisplay): Take character as integer codepoint.
* gnu/java/awt/peer/gtk/GtkComponentPeer.java
(postMouseEvent): Use MouseEvent constructor with absolute coordinates
to avoid deadlock (over getLocationOnScreen()).
* gnu/java/awt/peer/gtk/VolatileImageGraphics.java
(getDeviceConfiguration): Fall back to the default configuration
if the component is not set.
* gnu/java/awt/peer/qt/QtFontMetrics.java
(canDisplay): Take character as integer codepoint.
* gnu/java/awt/peer/qt/QtFontPeer.java
(canDisplay): Take character as integer codepoint.
* gnu/java/awt/peer/x/XFontPeer2.java
(canDisplay): Take character as integer codepoint.
* include/gnu_java_awt_peer_qt_QtFontMetrics.h
(canDisplay): Take character as integer codepoint.
* java/awt/Font.java
(DIALOG): New constant.
(DIALOG_INPUT): New constant.
(MONOSPACED): New constant.
(SANS_SERIF): New constant.
(SERIF): New constant.
(Font(Font)): New constructor.
(canDisplay(char)): Use new canDisplay(int) method.
(canDisplay(int)): New method.
(hasLayoutAttributes): New method.
* java/awt/event/MouseEvent.java
(absX,absY): New fields.
(MouseEvent): New constructor with absolute coordinates.
(getLocationOnScreen): New method.
(getXOnScreen): New method.
(getYOnScreen): New method.
* native/jni/qt-peer/qtfontmetrics.cpp
(canDisplay): Take character as integer codepoint.

/Roman

-- 
Dipl.-Inform. (FH) Roman Kennke, Software Engineer, http://kennke.org
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com   * Tel: +49-721-663 968-0
USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe
Geschäftsführer: Dr. James J. Hunt
Index: include/gnu_java_awt_peer_qt_QtFontMetrics.h
===
RCS file: /cvsroot/classpath/classpath/include/gnu_java_awt_peer_qt_QtFontMetrics.h,v
retrieving revision 1.9
diff -u -1 -0 -r1.9 gnu_java_awt_peer_qt_QtFontMetrics.h
--- include/gnu_java_awt_peer_qt_QtFontMetrics.h	30 Apr 2006 10:37:36 -	1.9
+++ include/gnu_java_awt_peer_qt_QtFontMetrics.h	25 Jun 2007 11:25:17 -
@@ -7,21 +7,21 @@
 
 #ifdef __cplusplus
 extern C
 {
 #endif
 
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_init (JNIEnv *env, jobject, jobject);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_initGraphics (JNIEnv *env, jobject, jobject, jobject);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_dispose (JNIEnv *env, jobject);
 JNIEXPORT jobject JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_getStringBounds (JNIEnv *env, jobject, jstring);
-JNIEXPORT jboolean JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_canDisplay (JNIEnv *env, jobject, jchar);
+JNIEXPORT jboolean JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_canDisplay (JNIEnv *env, jobject, jint);
 JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_getAscent (JNIEnv *env, jobject);
 JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_getDescent (JNIEnv *env, jobject);
 JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_getHeight (JNIEnv *env, jobject);
 JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_getLeading (JNIEnv *env, jobject);
 JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_getMaxAdvance (JNIEnv *env, jobject);
 JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_charWidth (JNIEnv *env, jobject, jchar);
 JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_qt_QtFontMetrics_stringWidth (JNIEnv *env, jobject, jstring);
 
 #ifdef __cplusplus
 }
Index: gnu/java/awt/peer/ClasspathFontPeer.java
===
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/ClasspathFontPeer.java,v
retrieving revision 1.11
diff -u -1 -0 -r1.11 ClasspathFontPeer.java
--- gnu/java/awt/peer/ClasspathFontPeer.java	12 Apr 2007 14:02:16 -	1.11
+++ gnu/java/awt/peer/ClasspathFontPeer.java	25 Jun 2007 11:25:18 -
@@ -637,21 +637,21 @@
   /* Remaining methods are abstract */
 
   /** 
* Implementation of [EMAIL PROTECTED] Font#canDisplay(char)}
*
* @param font the font this peer is being called from. This may be
* useful if you are sharing peers between