Reduce platform dependence.
[pspp-builds.git] / src / data / sys-file-writer.c
index a7cc830f777ca90784c6331d43cb4827396aabfd..34f59d332d1544abf2bdd67497d228ab6f88ee45 100644 (file)
@@ -46,7 +46,6 @@
 #include "value-labels.h"
 #include "variable.h"
 
-#include "stat-macros.h"
 #include "minmax.h"
 
 #include "gettext.h"
@@ -709,9 +708,13 @@ write_variable_display_parameters (struct sfm_writer *w,
 
       v = dict_get_var(dict, i);
 
-      params.measure = var_get_measure (v);
+      params.measure = (var_get_measure (v) == MEASURE_NOMINAL ? 1
+                        : var_get_measure (v) == MEASURE_ORDINAL ? 2
+                        : 3);
       params.width = var_get_display_width (v);
-      params.align = var_get_alignment (v);
+      params.align = (var_get_alignment (v) == ALIGN_LEFT ? 0
+                      : var_get_alignment (v) == ALIGN_RIGHT ? 1
+                      : 2);
       
       buf_write (w, &params, sizeof(params));