[Spice-devel] [spice-gtk] g_getenv returns a const string

Hans de Goede hdegoede at redhat.com
Fri Apr 27 07:28:16 PDT 2012


ACK.

On 04/27/2012 03:14 PM, Christophe Fergeau wrote:
> When switching from getenv to g_getenv, 'doms' declaration
> wasn't changed from char * to const char *, which causes
> a gcc warning.
> ---
>   gtk/spice-util.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gtk/spice-util.c b/gtk/spice-util.c
> index 62c6549..8f4f1dc 100644
> --- a/gtk/spice-util.c
> +++ b/gtk/spice-util.c
> @@ -49,7 +49,7 @@ void spice_util_set_debug(gboolean enabled)
>   {
>   #if GLIB_CHECK_VERSION(2, 31, 0)
>       if (enabled) {
> -        gchar *doms = g_getenv("G_MESSAGES_DEBUG");
> +        const gchar *doms = g_getenv("G_MESSAGES_DEBUG");
>           if (!doms) {
>               g_setenv("G_MESSAGES_DEBUG", G_LOG_DOMAIN, 1);
>           } else if (!strstr(doms, G_LOG_DOMAIN)) {


More information about the Spice-devel mailing list