classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] Some more gtk-peer compiler warning fixes


From: Michael Koch
Subject: Re: [cp-patches] Some more gtk-peer compiler warning fixes
Date: Wed, 27 Oct 2004 09:25:58 +0200
User-agent: KMail/1.6.2

Am Mittwoch, 27. Oktober 2004 01:59 schrieb Mark Wielaard:
> -JNIEXPORT void JNICALL
> Java_gnu_java_awt_peer_gtk_GdkGlyphVector_setText -  (JNIEnv *env,
> jobject self, jstring text)
> -{
> -  struct textlayout *tl;
> -  gchar *str = NULL;
> -  gint len = 0;
> -
> -  gdk_threads_enter ();
> -  g_assert(self != NULL);
> -  g_assert(text != NULL);
> -
> -  tl = (struct textlayout *)NSA_GET_TEXT_LAYOUT_PTR (env, self);
> -  g_assert(tl != NULL);
> -  g_assert(tl->pango_layout != NULL);
> -  
> -  len = (*env)->GetStringUTFLength (env, text);
> -  str = (gchar *)(*env)->GetStringUTFChars (env, text, NULL);
> -  g_assert (str != NULL);
> -
> -  pango_layout_set_text (tl->pango_layout, text, len);
> -
> -  (*env)->ReleaseStringUTFChars (env, text, str);
> -  gdk_threads_leave ();  
> -}

This one is interesting as this method is not too much but just badly 
named. The following patch would have been better:

-JNIEXPORT void JNICALL 
Java_gnu_java_awt_peer_gtk_GdkGlyphVector_setText
+JNIEXPORT void JNICALL 
Java_gnu_java_awt_peer_gtk_GdkTextLayout_setText


What do you think ?


Michael
-- 
Homepage: http://www.worldforge.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]