[vlc-devel] [DISCUSSION] To use or not to use EMPTY_STR?

Filip Roséen filip at atch.se
Fri Aug 5 14:44:56 CEST 2016


Hi Francois,

On 16/08/05 14:34, Francois Cartegnie wrote:

> >     #define EMPTY_STR(str) (!str || !*str)
>
> Outside of an error prone name,
> what's the point against that macro ?

Disregarding the name I have no objections to usage of such macro (on the
contrary really since I think the presence of the macro makes it easier to
reason about conditions that includes other checks).

The reason I am asking is because I noticed that there are
translation-units that use the *helper* in some scenarios, but then fall
back to writing the condition out explicitly in others.

As such, I was wondering if there is a policy along the lines of *"use the
provided helper-macros where applicable"*, and if such *"policy"* exists;

  - should new code that lacks usage of *helper-macros* be patched to use
    them?

The questions raised also applies to macros such as `VLC_UNUSED`,
`VLC_CLIP`, among others.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20160805/78580aa2/attachment.html>


More information about the vlc-devel mailing list