Re: [Gimp-developer] Metadata-Browser and Widgets

2010-04-21 Thread Roman Joost
Hi Sven, On Tue, Apr 20, 2010 at 08:23:44PM +0200, Sven Neumann wrote: > You could use an interface and have your classes implement that > interface. GObject allows interfaces to have a default implementation. > You can for example implement common properties in an interface. There > are few examp

[Gimp-developer] Testing on NULL an unitialized values

2010-04-21 Thread Oliver Bandel
Hello, since some days I'm browsing through the Gimp-Code. What I have seen so far looks very tidy. But I also found some things that I would do differently, throughout the whole code, and maybe also in the libs (I didn't looked at them in detail). I would do EVERY pointer set to NULL, whe

Re: [Gimp-developer] Testing on NULL an unitialized values

2010-04-21 Thread Tor Lillqvist
> The test >   if( template ) > makes only sense, if you can be sure that uninitialzed values > will definitelky be NULL. You must have missed the g_return_val_if_fail (! template || GIMP_IS_CONTEXT (template), NULL) . It checks if template is NULL or a pointer to a valid GimpContext. If template

Re: [Gimp-developer] Testing on NULL an unitialized values

2010-04-21 Thread Oliver Bandel
Zitat von "Tor Lillqvist" : >> The test >>   if( template ) >> makes only sense, if you can be sure that uninitialzed values >> will definitelky be NULL. > > You must have missed the g_return_val_if_fail (! template || > GIMP_IS_CONTEXT (template), NULL) . > > It checks if template is NULL or a po

[Gimp-developer] git version and layer groups

2010-04-21 Thread Olivier
A small problem about layer groups in the git version: if I hide the layers of a layer group by clicking on the small white triangle in the layers dialog, then make another image active, and come back to the first image, then the layers of the layer group are no longer hidden. -- Olivier Lecarme _

[Gimp-developer] git version and layer groups

2010-04-21 Thread BlizZarD
I can confirm this -- BlizZarD (via www.gimpusers.com) ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

Re: [Gimp-developer] Testing on NULL an unitialized values

2010-04-21 Thread Omari Stephens
On 04/21/2010 11:58 AM, Oliver Bandel wrote: > Zitat von "Tor Lillqvist": > >>> The test >>>if( template ) >>> makes only sense, if you can be sure that uninitialzed values >>> will definitelky be NULL. >> >> You must have missed the g_return_val_if_fail (! template || >> GIMP_IS_CONTEXT (templ

Re: [Gimp-developer] Testing on NULL an unitialized values

2010-04-21 Thread Martin Nordholts
On 04/21/2010 01:58 PM, Oliver Bandel wrote: > Even only temporarily valies, if set to a certain value, > like 0 or NULL, will help in finding problems. I agree, and I try to initialize all local variables that I either add or modify the declaration of. I don't think it would be worth to commit

Re: [Gimp-developer] git version and layer groups

2010-04-21 Thread Martin Nordholts
On 04/21/2010 02:50 PM, Olivier wrote: > A small problem about layer groups in the git version: if I hide the > layers of a layer group by clicking on the small white triangle in the > layers dialog, then make another image active, and come back to the > first image, then the layers of the layer gr

Re: [Gimp-developer] Testing on NULL an unitialized values

2010-04-21 Thread Sven Neumann
On Wed, 2010-04-21 at 13:58 +0200, Oliver Bandel wrote: > Even only temporarily valies, if set to a certain value, > like 0 or NULL, will help in finding problems. Should be totally un-necessary as the compiler will warn you if your code uses uninitialized variables. We are compiling with -Wall a

Re: [Gimp-developer] Testing on NULL an unitialized values

2010-04-21 Thread Martin Nordholts
On 04/21/2010 07:53 PM, Sven Neumann wrote: > On Wed, 2010-04-21 at 13:58 +0200, Oliver Bandel wrote: > >> Even only temporarily valies, if set to a certain value, >> like 0 or NULL, will help in finding problems. > > Should be totally un-necessary as the compiler will warn you if your > code uses

Re: [Gimp-developer] Testing on NULL an unitialized values

2010-04-21 Thread Sven Neumann
On Wed, 2010-04-21 at 12:33 +0200, Oliver Bandel wrote: > Example: > > > == > /*/ > /* public functions > / > > Gim

Re: [Gimp-developer] Testing on NULL an unitialized values

2010-04-21 Thread Oliver Bandel
Zitat von "Sven Neumann" : > On Wed, 2010-04-21 at 12:33 +0200, Oliver Bandel wrote: > >> Example: >> >> >> == >> /*/ >> /* public functions >> *

Re: [Gimp-developer] Testing on NULL an unitialized values

2010-04-21 Thread Oliver Bandel
Hi, Zitat von "Omari Stephens" : > On 04/21/2010 11:58 AM, Oliver Bandel wrote: >> Zitat von "Tor Lillqvist": >> [...] >> Even only temporarily valies, if set to a certain value, >> like 0 or NULL, will help in finding problems. >> >> The mentioned function just was an example. >> >> Uninitial

Re: [Gimp-developer] Testing on NULL an unitialized values

2010-04-21 Thread Oliver Bandel
Zitat von "Martin Nordholts" : > On 04/21/2010 01:58 PM, Oliver Bandel wrote: >> Even only temporarily valies, if set to a certain value, >> like 0 or NULL, will help in finding problems. > > I agree, and I try to initialize all local variables that I either add > or modify the declaration of. I d

Re: [Gimp-developer] Testing on NULL an unitialized values

2010-04-21 Thread Oliver Bandel
Zitat von "Sven Neumann" : > On Wed, 2010-04-21 at 12:33 +0200, Oliver Bandel wrote: > >> Example: >> >> >> == >> /*/ >> /* public functions >> *

Re: [Gimp-developer] Testing on NULL an unitialized values

2010-04-21 Thread Martin Nordholts
On 04/21/2010 11:45 PM, Oliver Bandel wrote: > Zitat von "Martin Nordholts": > >> On 04/21/2010 01:58 PM, Oliver Bandel wrote: >>> Even only temporarily valies, if set to a certain value, >>> like 0 or NULL, will help in finding problems. >> >> I agree, and I try to initialize all local variables t

Re: [Gimp-developer] Testing on NULL an unitialized values

2010-04-21 Thread Martin Nordholts
On 04/22/2010 03:54 AM, Marc Lehmann wrote: > On Wed, Apr 21, 2010 at 08:14:33PM +0200, Martin Nordholts > wrote: >> The compiler doesn't catch all cases, like this one: >> >> #include >> int main(int argc, char **argv) >> { >> int var; >> if (argc == 2) >> var = 42; >> printf (