[libvirt] [PATCH] lib: Use more of VIR_STEAL_PTR()
Erik Skultety
eskultet at redhat.com
Mon Jan 28 13:26:03 UTC 2019
On Mon, Jan 28, 2019 at 02:03:07PM +0100, Michal Privoznik wrote:
> From: Your Name <you at example.com>
>
> We have this very handy macro called VIR_STEAL_PTR() which steals
> one pointer into the other and sets the other to NULL. The
> following coccinelle patch was used to create this commit:
>
> @ rule1 @
> identifier a, b;
> @@
>
> - b = a;
> ...
> - a = NULL;
> + VIR_STEAL_PTR(b, a);
>
> Some places were clean up afterwards to make syntax-check happy
> (e.g. some curly braces were removed where the body become a one
> liner).
>
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
Reviewed-by: Erik Skultety <eskultet at redhat.com>
More information about the libvir-list
mailing list