[libvirt] [libvirt-glib 2/2] RFC: Make use of GUINT_TO_POINTER/GPOINTER_TO_UINT

Christophe Fergeau cfergeau at redhat.com
Thu Aug 2 12:12:43 UTC 2012


On Mon, Jul 30, 2012 at 06:30:28PM +0200, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>
> 
> We create struct and a free function each time we need to pass a simple
> unsigned integer to an async function. Code can be simplified if we
> don't do that but rather use glib's API to convert to/from uint to
> pointer.

If I was writing such code, I'd probably go with GUINT_TO_POINTER, but
since it's written with a struct, and it's more consistent with other async
code, I'd keep it this way as it makes things more predictable and
readable. But if you really want to make this change, this is fine with me.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120802/66f9d1b5/attachment-0001.sig>


More information about the libvir-list mailing list