help-smalltalk
[Top][All Lists]
Advanced

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

Re : [Help-smalltalk] GTK+ binding generator


From: Mathieu Suen
Subject: Re : [Help-smalltalk] GTK+ binding generator
Date: Tue, 19 Oct 2010 14:03:44 +0100 (BST)

Hi,

talking of awk it  seems to me that you should add this:

_______________
old mode 100644
new mode 100755
index 7e65823..66ab6fc
--- a/packages/gtk/funcs.awk
+++ b/packages/gtk/funcs.awk
@@ -353,7 +355,10 @@ function ctype( the_type, name )
 
   pointer = ((name ~ /^\*/) || (name ~ /\[[0-9]*\]/))
 
-  res = type[the_type]
+  if (the_type in type)
+    res = type[the_type]
+  else
+    res = ""
 
   if (!pointer || res == "__skip_this__")
     {
@@ -373,7 +378,10 @@ function returned( var )
 {
   pointer = var ~ /\*$/
   var = strip(var)
-  res = type[var]
+  if (var in type)
+    res = type[var]
+  else
+    res = ""
 
   if (!pointer || res == "__skip_this__")
     {
@@ -381,7 +389,11 @@ function returned( var )
         res = "#int"
     }
   else {
-    res = ptr_type[res]
+    if (res in ptr_type)
+      res = ptr_type[res]
+    else
+      res = ""
+
     if (res == "")
       res = "#{" var "}"
   }
_______________

This is because the statement : "type[var]" is going to make (var in type) true 
even if before var was not in type.

That make the following test pass :
 if (first_line[2] == "get_type" && (prefixClassName in 
type))                                                  

     next

I don't know if that is the intention here but at least you can try.
Paolo, maybe you can tell.

Thanks






----- Message d'origine ----
> De : Gwenaël Casaccio <address@hidden>
> À : Paolo Bonzini <address@hidden>
> Cc : address@hidden
> Envoyé le : Mar 19 octobre 2010, 14h 45min 09s
> Objet : Re: [Help-smalltalk] GTK+ binding generator
> 
> Hi,
> 
> I still have the warnings
> 
> Gwen
> 
> On Mon, Oct 18, 2010 at  7:18 PM, Paolo Bonzini <address@hidden> wrote:
> > On  10/18/2010 06:33 PM, Holger Hans Peter Freyther wrote:
> >> The problem  is that... the function is called
> >>
> >> g_bus_something, so  the awk script asssumes the Object is called GBus but 
>in
> >> that case  it is GDBus(Connection) or such...
> >
> > Thanks for the help, try  this:
> >
> > --- a/packages/gtk/funcs.awk
> > +++  b/packages/gtk/funcs.awk
> > @@ -100,10 +100,12 @@ BEGIN {
> >      ptr_type["#cObject"] = "#cObject"
> >
> >     # Fix asymmetry
> > -     method_regexp =  
>"^g_param_values?_|^g_param_type_|^gtk_file_chooser_|^gdk_window_"
> > +     method_regexp =  
>"^g_bus_|^g_param_values?_|^g_param_type_|^gtk_file_chooser_|^gdk_window_"
> >  +    prefix_class["g_bus_"] = "GDBusConnection"
> >      prefix_class["g_param_value_"] = "GParamSpec"
> >      prefix_class["g_param_values_"] = "GParamSpec"
> >      prefix_class["g_param_type_"] = "GParamSpec"
> > +    self_class["g_bus_"] =  "GDBusConnection"
> >     self_class["g_param_value_"] =  "GParamSpec"
> >     self_class["g_param_values_"] = "GParamSpec"
> >      self_class["g_param_type_"] = "GParamSpec"
> >
> >  Paolo
> >
> > _______________________________________________
> >  help-smalltalk mailing list
> > address@hidden
> > http://lists.gnu.org/mailman/listinfo/help-smalltalk
> >
> 
> _______________________________________________
> help-smalltalk  mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-smalltalk
> 






reply via email to

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