fixed intialization of coefficients
[pspp] / src / ui / gui / psppire-variable.c
index 6443ee901ed2c069744c9cd9943956afcc100fb6..3fa71ea30b5330fe194df1e6fd8e4745f286b527 100644 (file)
@@ -21,9 +21,9 @@
 #include <string.h>
 #include <stdlib.h>
 
-#include "missing-values.h"
-#include "value-labels.h"
-#include "format.h"
+#include <data/missing-values.h>
+#include <data/value-labels.h>
+#include <data/format.h>
 
 #include "psppire-variable.h"
 #include "psppire-dict.h"
@@ -87,11 +87,13 @@ psppire_variable_set_label(struct PsppireVariable *pv, const gchar *label)
 gboolean
 psppire_variable_set_decimals(struct PsppireVariable *pv, gint decimals)
 {
+  struct fmt_spec fmt;
+
   g_return_val_if_fail(pv, FALSE);
   g_return_val_if_fail(pv->dict, FALSE);
   g_return_val_if_fail(pv->v, FALSE);
 
-  struct fmt_spec fmt = pv->v->write;
+  fmt = pv->v->write;
 
   fmt.d = decimals;
 
@@ -103,11 +105,12 @@ psppire_variable_set_decimals(struct PsppireVariable *pv, gint decimals)
 gboolean
 psppire_variable_set_width(struct PsppireVariable *pv, gint width)
 {
+  struct fmt_spec fmt ;
   g_return_val_if_fail(pv, FALSE);
   g_return_val_if_fail(pv->dict, FALSE);
   g_return_val_if_fail(pv->v, FALSE);
 
-  struct fmt_spec fmt = pv->v->write;
+  fmt = pv->v->write;
 
   fmt.w = width;
 
@@ -342,8 +345,9 @@ psppire_variable_get_width(const struct PsppireVariable *pv)
   return pv->v->width;
 }
 
+
 gint
-psppire_variable_get_index(const struct PsppireVariable *pv)
+psppire_variable_get_fv(const struct PsppireVariable *pv)
 {
   g_return_val_if_fail(pv, -1);
   g_return_val_if_fail(pv->v, -1);
@@ -351,3 +355,14 @@ psppire_variable_get_index(const struct PsppireVariable *pv)
   return pv->v->fv;
 }
 
+
+
+gint
+psppire_variable_get_index(const struct PsppireVariable *pv)
+{
+  g_return_val_if_fail(pv, -1);
+  g_return_val_if_fail(pv->v, -1);
+
+  return pv->v->index;
+}
+