Re: PATCH for tab-scrolling



On Thu, 2004-07-01 at 07:02, Daniel Brockman wrote:

>                       GDK Event Handler Functions
>                         in GtkWidget Subclasses
> 
>                Declaration  |  Definition  |  Occurences
>              ---------------+--------------+--------------
>                gint         |  gint        |         115
>                gboolean     |  gboolean    |          46
>                gint         |  gboolean    |          17
>                gboolean     |  gint        |           0
> 
> This means that gint is almost three times as common as gboolean.
> Further, noone declares their function as returning gboolean and then
> goes and defines it with a gint return type.  On the other hand, a
> significant number of people define their function with a gboolean
> return type despite the fact that it's declared as returning gint.
> 
> Now that kind of mixing is obviously incorrect, and as Owen pointed out,
> the gint-gint case is undesireable too, since the declarations in
> gtkwidget.h use gboolean.
> 
> Should I file this as a bug?

It's actually, in practice, not really a huge problem since gboolean is
typedef'ed to int and will always stay that way. But it would certainly
be good to clean up in the HEAD branch of CVS.

I don't think there is much point in filing a bug unless you also
include the appropriate patch. A couple of hints about such a patch:

 A) It shouldn't mix in any other changes but should stick to the
    one problem of gint vs. gboolean
 B) In general, the rough rule of thumb is that groups of related
    prototypes should be aligned together. So, if gint=>gboolean
    breaks alignment, you don't need to realign *all* prototypes
    in the C file, but can simply add a space before and after
    the event handlers and align those.
 C) http://people.redhat.com/otaylor/egtk.el is quite helpful in
    producing the correct alignment.

Regards,
						Owen

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



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