[gst-devel] remove NULL/0 initialisation in _init()

Stefan Kost ensonic at hora-obscura.de
Wed Jun 27 08:52:49 CEST 2007


hi tim,

Quoting Tim Müller <t.i.m at zen.co.uk>:

> On Tue, 2007-06-26 at 10:24 +0200, Stefan Kost wrote:
>
>> not a big issue, but in most instance _init() functions we set members
>> to NULL/0 which is superflous. If you look at
>> gobjec/gtype.c/g_type_create_instance (GType type) you'll see that it
>> is using g_slice_new0 (was g_new0 in the past).
>>
>> Is it okay, if I clean up the redundant inits?
>
> I find those very useful when reading code. Even if they are
> superfluous, removing them feels like pointless micro-optimisation to
> me. </random opinion>

I agree that its good to leave some stuff for the readabillity, like  
setting the default enum-value even if this is 0 in fact. Although  
setting pointer to NULL or some counters to 0 is imho not that  
helpful. We also don't do this generally. I could do like Jan said -  
commenting the stuff out. Is that a compromise?

Stefan

>
>  Cheers
>   -Tim
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>






More information about the gstreamer-devel mailing list