[kaffe] CVS kaffe (guilhem): Fixes for jar

2005-07-22 Thread Kaffe CVS
PatchSet 6757 
Date: 2005/07/22 07:25:11
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Fixes for jar

2005-07-21  Kurt Miller <[EMAIL PROTECTED]>

* libraries/javalib/kaffe/tools/jar/Jar.java
(listFilesInJar,extractFilesInJar): Handle correctly -t and -x 
arguments.

Members: 
ChangeLog:1.4282->1.4283 
libraries/javalib/kaffe/tools/jar/Jar.java:1.9->1.10 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4282 kaffe/ChangeLog:1.4283
--- kaffe/ChangeLog:1.4282  Thu Jul 21 17:56:19 2005
+++ kaffe/ChangeLog Fri Jul 22 07:25:11 2005
@@ -1,3 +1,8 @@
+2005-07-21  Kurt Miller <[EMAIL PROTECTED]>
+
+   * libraries/javalib/kaffe/tools/jar/Jar.java
+   (listFilesInJar,extractFilesInJar): Handle correctly -t and -x 
arguments.
+
 2005-07-21  Guilhem Lavaux  <[EMAIL PROTECTED]>
 
* WHATSNEW, TODO: Updated.
Index: kaffe/libraries/javalib/kaffe/tools/jar/Jar.java
diff -u kaffe/libraries/javalib/kaffe/tools/jar/Jar.java:1.9 
kaffe/libraries/javalib/kaffe/tools/jar/Jar.java:1.10
--- kaffe/libraries/javalib/kaffe/tools/jar/Jar.java:1.9Sun Jun 26 
01:21:53 2005
+++ kaffe/libraries/javalib/kaffe/tools/jar/Jar.javaFri Jul 22 07:25:14 2005
@@ -642,8 +642,8 @@
 
 
// see if the current ZipEntry's name equals 
-   // the file we want to extract. If equal then
-   // print the name of the file to stdout.
+   // the file we want to extract or if it starts
+   // with a path matching the dir we want to extract.
 
String entry_name = entry.getName();
boolean match = (shortnames == null);
@@ -657,6 +657,17 @@
for (int i = 0; i < shortnames.length ; i++) {
if (entry_name.equals(shortnames[i])) {
match = true;
+   break;
+   } else if (shortnames[i].endsWith("/")) {
+   if (entry_name.startsWith(shortnames[i])) {
+   match = true;
+   break;
+   }
+   } else {
+   if (entry_name.startsWith(shortnames[i] + '/')) { 
+   match = true;
+   break;
+   }
}
}
}
@@ -752,6 +763,20 @@
if (entry_name.equals(shortnames[i])) {
match = true;
longname = longnames[i];
+   break;
+   } else if (shortnames[i].endsWith("/")) {
+   if (entry_name.startsWith(shortnames[i])) {
+   String shortname = shortnames[i].substring(0, 
shortnames[i].length() -1);
+   match = true;
+   longname = longnames[i].substring(0, 
longnames[i].lastIndexOf(shortname)) + entry_name;
+   break;
+   }
+   } else {
+   if (entry_name.startsWith(shortnames[i] + '/')) { 
+   match = true;
+   longname = longnames[i].substring(0, 
longnames[i].lastIndexOf(shortnames[i])) + entry_name;
+   break;
+   }
}
}
}

___
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


[kaffe] CVS kaffe (guilhem): Generated stdint fix.

2005-07-22 Thread Kaffe CVS
PatchSet 6758 
Date: 2005/07/22 11:36:15
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Generated stdint fix.

2005-07-22  Kurt Miller <[EMAIL PROTECTED]>

* m4/ax_create_stdint_h.m4: Define intmax_t if it is not available.

* configure: Regenerated.

Members: 
ChangeLog:1.4283->1.4284 
configure:1.471->1.472 
m4/ax_create_stdint_h.m4:1.4->1.5 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4283 kaffe/ChangeLog:1.4284
--- kaffe/ChangeLog:1.4283  Fri Jul 22 07:25:11 2005
+++ kaffe/ChangeLog Fri Jul 22 11:36:15 2005
@@ -1,3 +1,9 @@
+2005-07-22  Kurt Miller <[EMAIL PROTECTED]>
+
+   * m4/ax_create_stdint_h.m4: Define intmax_t if it is not available.
+
+   * configure: Regenerated.
+
 2005-07-21  Kurt Miller <[EMAIL PROTECTED]>
 
* libraries/javalib/kaffe/tools/jar/Jar.java
Index: kaffe/configure
diff -u kaffe/configure:1.471 kaffe/configure:1.472
--- kaffe/configure:1.471   Tue Jul 19 23:21:05 2005
+++ kaffe/configure Fri Jul 22 11:36:18 2005
@@ -53246,9 +53246,10 @@
 
 #ifndef _STDINT_HEADER_INTPTR
 #define _STDINT_NEED_INTPTR_T
+#endif
+
 #ifndef _STDINT_HAVE_INTMAX_T
 #define _STDINT_NEED_INTMAX_T
-#endif
 #endif
 
 
Index: kaffe/m4/ax_create_stdint_h.m4
diff -u kaffe/m4/ax_create_stdint_h.m4:1.4 kaffe/m4/ax_create_stdint_h.m4:1.5
--- kaffe/m4/ax_create_stdint_h.m4:1.4  Tue Jun 21 16:11:57 2005
+++ kaffe/m4/ax_create_stdint_h.m4  Fri Jul 22 11:36:26 2005
@@ -30,7 +30,7 @@
 dnl file will include it directly. No need for fuzzy HAVE_STDINT_H things...
 dnl
 dnl @, (status: used on new platforms) (see http://ac-archive.sf.net/gstdint/)
-dnl @version $Id: ax_create_stdint_h.m4,v 1.4 2005/06/21 16:11:57 guilhem Exp $
+dnl @version $Id: ax_create_stdint_h.m4,v 1.5 2005/07/22 11:36:26 guilhem Exp $
 dnl @author  Guido Draheim <[EMAIL PROTECTED]> 
 
 AC_DEFUN([AX_CHECK_DATA_MODEL],[
@@ -351,9 +351,10 @@
 
 #ifndef _STDINT_HEADER_INTPTR
 #define _STDINT_NEED_INTPTR_T
+#endif
+
 #ifndef _STDINT_HAVE_INTMAX_T
 #define _STDINT_NEED_INTMAX_T
-#endif
 #endif
 
 

___
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


[kaffe] CVS kaffe (guilhem): Fixlets for XLIB-AWT.

2005-07-22 Thread Kaffe CVS
PatchSet 6759 
Date: 2005/07/22 11:42:49
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Fixlets for XLIB-AWT.

* libraries/clib/awt/X/gra.c,
libraries/clib/awt/X/imggif.c,
libraries/clib/awt/X/imgjpeg.c,
libraries/clib/awt/X/imgpng.c: Fixed the use of real raw data
inside native calls.

Members: 
ChangeLog:1.4284->1.4285 
libraries/clib/awt/X/gra.c:1.24->1.25 
libraries/clib/awt/X/imggif.c:1.17->1.18 
libraries/clib/awt/X/imgjpeg.c:1.20->1.21 
libraries/clib/awt/X/imgpng.c:1.22->1.23 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4284 kaffe/ChangeLog:1.4285
--- kaffe/ChangeLog:1.4284  Fri Jul 22 11:36:15 2005
+++ kaffe/ChangeLog Fri Jul 22 11:42:49 2005
@@ -1,3 +1,11 @@
+2005-07-22  Guilhem Lavaux  <[EMAIL PROTECTED]>
+
+   * libraries/clib/awt/X/gra.c,
+   libraries/clib/awt/X/imggif.c,
+   libraries/clib/awt/X/imgjpeg.c,
+   libraries/clib/awt/X/imgpng.c: Fixed the use of real raw data
+   inside native calls.
+
 2005-07-22  Kurt Miller <[EMAIL PROTECTED]>
 
* m4/ax_create_stdint_h.m4: Define intmax_t if it is not available.
Index: kaffe/libraries/clib/awt/X/gra.c
diff -u kaffe/libraries/clib/awt/X/gra.c:1.24 
kaffe/libraries/clib/awt/X/gra.c:1.25
--- kaffe/libraries/clib/awt/X/gra.c:1.24   Thu Jul 21 17:30:36 2005
+++ kaffe/libraries/clib/awt/X/gra.cFri Jul 22 11:42:55 2005
@@ -798,15 +798,12 @@
   }
 }
 
-
-void
-Java_java_awt_Toolkit_graDrawImage ( JNIEnv* env UNUSED, jclass clazz UNUSED, 
jobject ngr, jobject nimg,
-jint srcX, jint srcY,
-jint dstX, jint dstY,
-jint width, jint height, jint bgval )
+static void
+drawImage (Graphics *gr, Image *img, 
+  jint srcX, jint srcY,
+  jint dstX, jint dstY,
+  jint width, jint height, jint bgval )
 {
-  Graphics *gr = UNVEIL_GR(ngr);
-  Image *img = UNVEIL_IMG(nimg);
   XGCValues values;
 
   DBG( AWT_GRA, printf("drawImage: %p %p (%p,%p,%p %d,%d) %d,%d, %d,%d, %d,%d, 
%x\n",
@@ -880,6 +877,18 @@
 
 
 void
+Java_java_awt_Toolkit_graDrawImage ( JNIEnv* env UNUSED, jclass clazz UNUSED, 
jobject ngr, jobject nimg,
+jint srcX, jint srcY,
+jint dstX, jint dstY,
+jint width, jint height, jint bgval )
+{
+  if (nimg == NULL)
+return;
+
+  drawImage(UNVEIL_GR(ngr), UNVEIL_IMG(nimg), srcX, srcY, dstX, dstY, width, 
height, bgval);
+}
+
+void
 Java_java_awt_Toolkit_graDrawImageScaled ( JNIEnv* env, jclass clazz, jobject 
ngr, jobject nimg,
   jint dx0, jint dy0, jint dx1, jint 
dy1,
   jint sx0, jint sy0, jint sx1, jint 
sy1, jint bgval )
@@ -929,8 +938,8 @@
   createXImage( X, tgt);
 
   initScaledImage( X, tgt, img, dx0-x0, dy0-y0, dx1-x0, dy1-y0, sx0, sy0, sx1, 
sy1);
-  Java_java_awt_Toolkit_graDrawImage ( env, clazz, gr, tgt, 0, 0,
-  x0, 
y0, tgt->width, tgt->height, bgval);
+  drawImage ( gr, tgt, 0, 0,
+ x0, y0, tgt->width, tgt->height, bgval);
   if ( tgt->shmiImg ) {
XSync( X->dsp, False); /* since we're going to destroy tgt, process its 
drawing first */
   }
Index: kaffe/libraries/clib/awt/X/imggif.c
diff -u kaffe/libraries/clib/awt/X/imggif.c:1.17 
kaffe/libraries/clib/awt/X/imggif.c:1.18
--- kaffe/libraries/clib/awt/X/imggif.c:1.17Wed Jan 19 11:04:31 2000
+++ kaffe/libraries/clib/awt/X/imggif.c Fri Jul 22 11:42:55 2005
@@ -54,7 +54,7 @@
 
 #define CHECK(gifOp) \
   if ( gifOp == GIF_ERROR ) { \
-if ( img )Java_java_awt_Toolkit_imgFreeImage( 0, 0, img); \
+if ( img )imgFreeImage( img); \
 if ( rowBuf ) AWT_FREE( rowBuf); \
 return 0; \
   }
Index: kaffe/libraries/clib/awt/X/imgjpeg.c
diff -u kaffe/libraries/clib/awt/X/imgjpeg.c:1.20 
kaffe/libraries/clib/awt/X/imgjpeg.c:1.21
--- kaffe/libraries/clib/awt/X/imgjpeg.c:1.20   Sat Mar 27 16:07:32 2004
+++ kaffe/libraries/clib/awt/X/imgjpeg.cFri Jul 22 11:42:55 2005
@@ -309,7 +309,7 @@
 
   if ( setjmp(jerr.setjmp_buffer)) {
 if ( img ) {
-  Java_java_awt_Toolkit_imgFreeImage( 0, 0, img);
+  imgFreeImage(img);
 }
 return 0;
   }
Index: kaffe/libraries/clib/awt/X/imgpng.c
diff -u kaffe/libraries/clib/awt/X/imgpng.c:1.22 
kaffe/libraries/clib/awt/X/imgpng.c:1.23
--- kaffe/libraries/clib/awt/X/imgpng.c:1.22Mon Apr  5 05:30:16 2004
+++ kaffe/libraries/clib/awt/X/imgpng.c Fri Jul 22 11:42:55 2005
@@ -173,7 +173,7 @@
 
   if ( setjmp(png_ptr->jmpbuf) ) {
if ( img )
- Java_java_awt_Toolkit_imgFreeImage( 0, 0, img);
+ imgFreeImage(img);
if ( rows )
  AWT_FREE( rows);
if ( data )

___
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cg

[kaffe] Re: Does 1.1.5 support Web Start ?

2005-07-22 Thread Tom Tromey
> "Wolfgang" == Wolfgang Baer <[EMAIL PROTECTED]> writes:

Wolfgang> No - however there exist free JNLP solutions:

Wolfgang> http://openjnlp.nanode.org/
Wolfgang> http://jnlp.sourceforge.net/netx/

Wolfgang> Haven't tried them myself so far.

netx works ok (but not great, due to some limitations in our http
protocol handler) with gcj; I imagine it would work with kaffe as
well.  I haven't tried OpenJNLP.

Tom


___
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


Re: [kaffe] SecureRandomTest failed

2005-07-22 Thread Ito Kazumitsu
> I am afraid something has changed so that Security.getProviders() returns
> 
> gnu.java.security.provider.Gnu: name=GNU version=1.0
> 
>   before
> 
> kaffe.security.provider.Kaffe: name=KAFFE version=1.0

Yes, gnu.java.security.provider.Gnu comes first. But that depends
on the environment.

I have found two independent problems related to this issue.

  (1) In some environment, e.g. my case with FreeBSD 5.4-RELEASE,
  Security.getProviders() by default lists only
  gnu.java.security.provider.Gnu. So if you add
  kaffe.security.provider.Kaffe, it is listed after
  gnu.java.security.provider.Gnu.

  But in another environment, Security.getProviders() by default lists
 gnu.crypto.jce.GnuCrypto
 org.metastatic.jessie.provider.Jessie
 kaffe.security.provider.Kaffe
 gnu.java.security.provider.Gnu
  in this order. So if you add kaffe.security.provider.Kaffe,
  it is not added because it is already there.
  Older Kaffe on FreeBSD 5.4-RELEASE also behaved this way. 

  (2) The SHA1PRNG algorithm provided by gnu.java.security.provider.Gnu
  is not secure enough because differnt instances always produce the
  same result. So in an environment where the problem (1) exists,
  SecureRandomTest fails.

To study this problem, I patched SecureRandomTest.java for debuging.

--- SecureRandomTest.java.orig  Thu Feb 24 23:42:08 2005
+++ SecureRandomTest.java   Sat Jul 23 05:52:43 2005
@@ -64,6 +64,10 @@
byte data[];
 
Security.addProvider(new kaffe.security.provider.Kaffe());
+   Provider[] pp = Security.getProviders();
+   for (int i=0; i < pp.length; i++) {
+ System.err.println(pp[i]);
+   }

/*
 * Make sure the SecureRandom's produce different sequences after

Then I tested this program on FreeBSD 5.4-RELEASE and Linux 2.6.7-co-0.6.2.
In both cases, I used kaffe whose ChangeLog head is:
   2005-07-22  Guilhem Lavaux  <[EMAIL PROTECTED]>

On FreeBSD 5.4-RELEASE:
[EMAIL PROTECTED] kaffe SecureRandomTest
gnu.java.security.provider.Gnu: name=GNU version=1.0
kaffe.security.provider.Kaffe: name=KAFFE version=1.0
java.lang.Error: The "secure" random isn't! : lpc=  0 lpc2 = 20 data = 
8bc7ec02ec7c04f87a13ec6120616ead831baeaf
   at java.lang.VMThrowable.fillInStackTrace (VMThrowable.java:native)
   at java.lang.VMThrowable.fillInStackTrace (VMThrowable.java:79)
   at java.lang.Throwable.fillInStackTrace (Throwable.java:498)
   at java.lang.Throwable. (Throwable.java:159)
   at java.lang.Error. (Error.java:81)
   at SecureRandomTest.checkHistory (SecureRandomTest.java:51)
   at SecureRandomTest.main (SecureRandomTest.java:89)

On Linux 2.6.7-co-0.6.2:
[EMAIL PROTECTED] kaffe SecureRandomTest
gnu.crypto.jce.GnuCrypto: name=GNU-CRYPTO version=2.1
org.metastatic.jessie.provider.Jessie: name=Jessie version=1.0
kaffe.security.provider.Kaffe: name=KAFFE version=1.0
gnu.java.security.provider.Gnu: name=GNU version=1.0
Two SecureRandoms produce different output.

___
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe