[webkit-efl] Using 0 or NULL in public C headers documentation ?

Gyuyoung Kim gyuyoung at gmail.com
Mon Jul 16 17:49:23 PDT 2012


It seems to me that many efl folks agree to change 0 with NULL in public
APIs used by EFL application. If someone wanna change this, he should file
a bug, then update WebKit EFL coding style guide line as well.

Gyuyoung.

On Mon, Jul 16, 2012 at 9:03 PM, Thiago Marcos P. Santos <
tmpsantos at gmail.com> wrote:

> On Mon, Jul 16, 2012 at 9:25 AM, Dumez, Christophe <
> christophe.dumez at intel.com> wrote:
>
>> Hi,
>>
>> At the moment, we using not consistent in the usage of NULL or 0 in the
>> documentation of our public C headers.
>>
>> The best practice is not currently documented by:
>> http://trac.webkit.org/wiki/EFLWebKitCodingStyle
>>
>> However, Gyuyoung is telling me there is an "unspoken" rule for
>> WebKit-EFL port that we should use 0.
>> I personally disagree and I think we should *always* use NULL in our
>> public C headers.
>>
>> While 0 is advised for null pointers in C++, it is not for C (
>> http://lwn.net/Articles/93574/).
>> If you look at the EVAS documentation, it is also using NULL in its
>> documentation, not 0.
>>
>> What do other WebKit EFL developers think?
>> We need to agree first, then document it on the coding style page and
>> patch the code accordingly.
>>
>> For example,
>>
>> /**
>>  * Gets the Ewk_Settings of this view.
>>  *
>>  * @param o the view object to get Ewk_Settings
>>  *
>>  * @return the Ewk_Settings of this view or @c *NULL* on failure
>>  */
>>  EAPI Ewk_Settings *ewk_view_settings_get(const Evas_Object *o);
>>
>
>
> IMO is fine. Using NULL is more C-ish. And we should not have any
> technical issues if we use 0 on the implementation and NULL on the headers
> [1].
>
> [1] http://c-faq.com/null/machnon0.html
>
> _______________________________________________
> webkit-efl mailing list
> webkit-efl at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo/webkit-efl
>
>


-- 
- Gyuyoung
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-efl/attachments/20120717/a13537e3/attachment.html>


More information about the webkit-efl mailing list