This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [patch][gui] warning patrol no 3 gtk-peer stuff
- From: Thomas Fitzsimmons <fitzsim at redhat dot com>
- To: Andreas Tobler <toa at pop dot agri dot ch>
- Cc: Java Patches <java-patches at gcc dot gnu dot org>
- Date: Sat, 23 Oct 2004 22:07:36 -0400
- Subject: Re: [patch][gui] warning patrol no 3 gtk-peer stuff
- References: <4178F6A4.1010706@pop.agri.ch>
On Fri, 2004-10-22 at 08:01, Andreas Tobler wrote:
________________________________________________________________________
> Index: jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c,v
> retrieving revision 1.1.2.2
> diff -u -r1.1.2.2 gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c
> --- jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c 21 Oct 2004 21:12:19 -0000 1.1.2.2
> +++ jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c 22 Oct 2004 10:43:36 -0000
> @@ -51,12 +51,12 @@
> Java_gnu_java_awt_peer_gtk_GThreadNativeMethodRunner_nativeRun(JNIEnv *gdk_env __attribute__((unused)), jobject lcl_obj __attribute__((unused)), jlong funcAddr, jlong funcArg)
> {
> /* Convert the function's address back into a pointer to a C function. */
> - void *(*funcPtr)(void *) = (void *(*)(void *)) funcAddr;
> + void *(*funcPtr)(void *) = (void *(*)(void *)) (size_t)funcAddr;
>
> /* We do not need to worry about the return value from funcPtr(); it's
> just thrown away. That is part of the g_threads spec, so no reason
> to worry about returning it. */
> - (void) funcPtr((void *) funcArg);
> + (void) funcPtr((void *) (size_t)funcArg);
> /* Fall off the end and terminate the thread of control. */
> }
These size_t casts seem wrong. Have you looked into using intptr_t?
>
> Index: jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/libjava/jni/gtk-peer/Attic/gnu_java_awt_peer_gtk_GdkFontPeer.c,v
> retrieving revision 1.1.2.1
> diff -u -r1.1.2.1 gnu_java_awt_peer_gtk_GdkFontPeer.c
> --- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c 4 Oct 2004 16:45:49 -0000 1.1.2.1
> +++ jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontPeer.c 22 Oct 2004 10:43:37 -0000
> @@ -114,6 +114,7 @@
> struct peerfont *pfont = NULL;
> char const *family_name = NULL;
> enum java_awt_font_style style;
> + PangoFT2FontMap *ft2_map;
>
> gdk_threads_enter ();
> style = (enum java_awt_font_style) style_int;
> @@ -148,7 +149,10 @@
> if (useGraphics2D)
> {
> if (pfont->ctx == NULL)
> - pfont->ctx = pango_ft2_font_map_create_context (pango_ft2_font_map_for_display ());
> + {
> + ft2_map = PANGO_FT2_FONT_MAP(pango_ft2_font_map_for_display ());
> + pfont->ctx = pango_ft2_font_map_create_context (ft2_map);
> + }
> }
> else
> {
> Index: jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c,v
> retrieving revision 1.5.2.11
> diff -u -r1.5.2.11 gnu_java_awt_peer_gtk_GdkGraphics.c
> --- jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c 21 Oct 2004 21:45:05 -0000 1.5.2.11
> +++ jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c 22 Oct 2004 10:43:37 -0000
> @@ -43,6 +43,13 @@
>
> #define GDK_STABLE_IS_PIXMAP(d) (GDK_IS_PIXMAP(d))
>
> +/* Union used for type punning. */
> +union widget_union
> +{
> + void **void_widget;
> + GtkWidget **widget;
> +};
> +
This union should be moved to gtkpeer.h and ev_widget_union should be
eliminated.
The other changes look fine.
Tom