[vlc-devel] [Request for Comment] new filter module forAtmoLight

Andre Weber WeberAndre at gmx.de
Sun Nov 25 12:08:30 CET 2007


>>Le Sunday 25 November 2007 12:05:31 Jean-Paul Saman, vous avez écrit :
>>> 5) write function pointers in structs as (it is much more readible and
>>> directly clear it is meant to be a function):

>>This is only true as far as they are many of them.

>>> struct mystruct
>>> {
>>>  int (*pf_atmo_initialize) (void);
>>>  void (*pf_atmo_finalize) (int);
>>>  int (*pf_atmo_switch_effect) (int);
>>>  int (*pf_atmo_set_live_source) (int);
>>>  void (*pf_atmo_create_transfer_buffers) (int, int, int, int);
>>>  uint8_t* (*pf_atmo_lock_transfer_buffer) (void);
>>>  void (*pf_atmo_send_pixel_data) (void);
>>> }
I thought having prototypes of the function pointers is realy easier to read - but when
it's prefered inside VLC I will change that - for me it looks not easier to read.

>>> 6) Coding style:
>>> - we use i_width iso width

>That's one big mistake. This has incited people into using "int" recklessly,
>when it should be something else. At a time when we cannot assume,
>e.g. "ssize_t" and "int" are the same (they aren't on amd64), these convetion
>is plain simply beyond its time.
so the problem isn't the name "i_width" in my structure its the datatype INT
from which I assumed 32-bit in size - and you are right on amd64 it will 64-bit
- is there a type definition inside videolan for a int32?


>> - in "C" files declare variables at the beginning of a code block (just
>> proper software engineering)

>Proper software engineering?
>You declare variables when you need them. This limits the risk of erroneous
>variable "reuse", and is way more readable, as it avoids scrolling to find
>variables. It also helps the compiler know that a variable is not needed
>before it's declared, which can only help optimization.
mmh... especialy for variables in for(...) I use the local declaration, to avoid
problems, for missue / reuse of variables.
That would I like to keep inside my source -- can I? or not?







-- 
Rémi Denis-Courmont
http://www.remlab.net/
----- Original Message ----- 
From: "Rémi Denis-Courmont" <rdenis at simphalempin.com>
To: <vlc-devel at videolan.org>
Sent: Sunday, November 25, 2007 11:53 AM
Subject: Re: [vlc-devel] [Request for Comment] new filter module forAtmoLight


> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>




More information about the vlc-devel mailing list