Re: [PATCH spice-server 2/3] test-gst: Remove options parsing leaks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 12, 2017 at 07:19:32AM -0400, Frediano Ziglio wrote:
> About checking for pointer assuming you have to check for NULL
> would mean the NULL is not 0 which would mean that
> memset(structure_ptr, 0, sizeof(structure)) cannot set pointer
> to NULL which would mean that assuming pointer initialized from
> GObject NULL are not correct, I would personally vote again
> the if (pointer != NULL) style, if (pointer) is good as well.

I'm not saying it's more correct, I'm saying it can make the code easier
to read.

if (obscure_name) {} -> you know from reading the code it's a boolean
if (obscure_name != 0) {} -> ok, it's some int value
if (obscure_name == NULL) {} -> this time it's a pointer

Christophe
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]