[Spice-devel] [PATCH 4/4] vdagent: Use glib's commandline parser

Christophe Fergeau cfergeau at redhat.com
Tue May 16 16:27:54 UTC 2017


On Tue, May 16, 2017 at 06:07:00PM +0200, Victor Toso wrote:
> Hi,
> 
> On Tue, May 16, 2017 at 05:29:57PM +0200, Christophe Fergeau wrote:
> > On Fri, May 12, 2017 at 01:19:40PM +0200, Victor Toso wrote:
> > > From: Victor Toso <me at victortoso.com>
> > > 
> > > As we already depend on glib, let's remove code that glib can take
> > > care. In this case, we don't need to handle commandline parsing
> > > ourselves.
> > > 
> > > In regard the global variables:
> > > 
> > > * static const char * -> static char * [only paths]
> >
> > Ideally, they would need to be g_free'd at some point, dunno if you
> > have looked at doing that, but it was inconvenient, or if this was
> > forgotten?
> 
> tbh, I thought GOptionEntry wouldn't take a const gchar *. I'll move it
> to const again.

I don't think it would accept a const gchar *, see
https://developer.gnome.org/glib/stable/glib-Commandline-option-parser.html#GOptionEntry
« If arg type is G_OPTION_ARG_STRING or G_OPTION_ARG_FILENAME, the
location will contain a newly allocated string if the option was given.
That string needs to be freed by the callee using g_free(). »

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170516/7073417f/attachment.sig>


More information about the Spice-devel mailing list