On Tue, May 16, 2017 at 12:32:35PM -0400, Frediano Ziglio wrote: > > > > 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@xxxxxxxxxxxxxx> > > > > > > > > > > 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 > > > > Yes, if the option is given. If not calling something like g_free("constant") will warn > and if not probably crash. Initializing with it NULL should avoid any problems, I think. > No, don't accept a const char*, but you have to pass a pointer to that > which is a const char** which is accepted (or at least should be). > > Frediano
Attachment:
signature.asc
Description: PGP signature
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel