Re: misc fixes




On Oct 4, 2005, at 4:47 AM, Marc Lehmann wrote:

Allowing NULL in a structure can be even harder for a perl-
only user to track down, because the resulting breakage may not occur
for quite some time.

Which resulting breakage do you talk about? The breakage is already there, in Gtk2, and consists of not allowing undef where it is valid. It's easy
to track down, too: the program will barf immediately.

I was talking about the breakage that would result in allowing undef/ NULL where it's not supposed to be. For example, if you set NULL for a pointer in a structure that isn't used until much later, and causes a segfault deep within gtk+.


The real fix is to have better upstream documentation of the lifetime
and value constraints of structure members.

That makes no sense at all. Changing upstream _documentation_ will not
magically fix the Gtk2 module. Wether documented or not, the code needs
change.

No, it will not magically fix the module, but it would make it more possible for us to write correct bindings on the first try. You're probably quite correct that language bindings authors are not the target audience for the existing docs.


+ source code to find out what to do, and in some of those "fringe"
cases, it doesn't seem worth it --- for example, gdk_gc_set_clip_mask
() and gdk_gc_set_clip_region() haven't been touched since before the
code was in sourceforge's CVS!

I can't follow that either - do you hint that not too many people use those
functions so it isn't worth to fix them?
[...]
In any case, if those fixes are deemed unworthy, then I can stop wasting
my time with bugfixes in the future.

That wasn't what i meant at all. In fact, i wasn't justifying the thought that it "doesn't **seem** worth the effort", just pointing out that this happens, usually very late at night when the desire to finish now overpowers the desire to finish correctly.

In retrospect, i made a gamble, and i was wrong. You have found it, and all will be well shortly.


xs/GdkEvent.xs:
The changes to get_time() look all right.  To pass undef, you'll have
to call it like "Gtk2::Gdk::Event::get_time(undef)", correct?


Probably. I'd probably do it differently, but the Gtk2 API policies of
making everything a method never made sense to me. I'd guess the Gtk2-way
would be "Gtk2::Gdk::Event->get_time" or "Gtk2::Gdk::Event->get_time
(undef)", both of which would be implementable.

Allowing the first argument to be, NULL, package name, or object would allow these:

   $event->get_time
   Gtk2::Gdk::Event->get_time
   Gtk2::Gdk::Event::get_time(undef)


xs/GdkPixbuf.xs is good. That needs to go into stable as well as HEAD.

Hmm - any reason why the other bugfixes shouldn't go into stable as well?

/me looks again

Erm, indeed, no.


To be fair, you did so "no hurry".  ;-)

Well, I am a bit puzzled on why there was time to do a new Gtk2 stable
release which such ground-breaking fixes in example code and the
testsuite, while actual code-bugfixes were ignored.

The example fixes had been sitting around for a couple of weeks, and had come from answering a question for the mailing list. I think Torsten was waiting for me to okay your patch, and i have been able to devote pitifully little time to gtk2-perl over the last month.


Yes, I know I am the only perl-widget-writer in existance (or so it
seems), but I do implement the fixes I complain about in most cases,
too...

I know of a few widget writers. And we do appreciate the fixes, even if things currently are a snafu.


--
Found: Poop
Someone's dog lost some poop in front of the Studio Theatre. Unfortunately, this article has been slightly damaged since it was neglectfully left on the sidewalk. It is available to its rightful owner (or its owner's rightful owner) if they so desire to come and scrape it off my shoe.
  -- someplace on the internet




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