pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[datasets 03/18] gui: Fix const-ness warning for measure_to_string() ret


From: Ben Pfaff
Subject: [datasets 03/18] gui: Fix const-ness warning for measure_to_string() return type.
Date: Sat, 30 Apr 2011 22:36:31 -0700

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
---
 src/ui/gui/var-display.c          |    2 +-
 src/ui/gui/var-display.h          |    4 ++--
 src/ui/gui/variable-info-dialog.c |    3 +--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/ui/gui/var-display.c b/src/ui/gui/var-display.c
index 1b9bf71..26de981 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 927e235..62212c8 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 088083f..37f501a 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 */
-- 
1.7.2.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]