From: Ben Pfaff Date: Sat, 2 Apr 2011 04:11:47 +0000 (-0700) Subject: gui: Fix const-ness warning for measure_to_string() return type. X-Git-Tag: v0.7.8~19 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9470b672abaceaaf5b7d7408c83610a9643a75e;p=pspp-builds.git gui: Fix const-ness warning for measure_to_string() return type. This fixes the following GCC warning: src/ui/gui/var-display.c: In function ‘measure_to_string’: rc/ui/gui/var-display.c:25: warning: return discards qualifiers from pointer target type --- diff --git a/src/ui/gui/var-display.c b/src/ui/gui/var-display.c index 1b9bf71c..26de981f 100644 --- a/src/ui/gui/var-display.c +++ b/src/ui/gui/var-display.c @@ -16,7 +16,7 @@ static const gchar none[] = N_("None"); -gchar * +const gchar * measure_to_string (const struct variable *var, GError **err) { const gint measure = var_get_measure (var); diff --git a/src/ui/gui/var-display.h b/src/ui/gui/var-display.h index 927e235c..62212c8e 100644 --- a/src/ui/gui/var-display.h +++ b/src/ui/gui/var-display.h @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2007 Free Software Foundation + Copyright (C) 2007, 2011 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,6 +30,6 @@ extern const gchar *const alignments[n_ALIGNMENTS + 1]; extern const gchar *const measures[n_MEASURES + 1]; gchar *missing_values_to_string (const PsppireDict *dict, const struct variable *pv, GError **err); -gchar *measure_to_string (const struct variable *var, GError **err); +const gchar *measure_to_string (const struct variable *var, GError **err); #endif diff --git a/src/ui/gui/variable-info-dialog.c b/src/ui/gui/variable-info-dialog.c index 088083f5..37f501a4 100644 --- a/src/ui/gui/variable-info-dialog.c +++ b/src/ui/gui/variable-info-dialog.c @@ -89,9 +89,8 @@ populate_text (PsppireDictView *treeview, gpointer data) text); g_free (text); - text = measure_to_string (var, NULL); g_string_append_printf (gstring, _("Measurement Level: %s\n"), - text); + measure_to_string (var, NULL)); /* Value Labels */