Add _build target for convenience.
[pspp-builds.git] / src / sysfile-info.c
index 45bffad762d22c03ce38434b757772ad5040931c..b5f559e5185527a9f68f8397d535db93cf56cb56 100644 (file)
@@ -29,6 +29,7 @@
 #include "file-handle.h"
 #include "hash.h"
 #include "lexer.h"
+#include "magic.h"
 #include "misc.h"
 #include "output.h"
 #include "sfm-read.h"
@@ -171,7 +172,7 @@ cmd_sysfile_info (void)
 
 static void display_macros (void);
 static void display_documents (void);
-static void display_variables (struct variable **, int, int);
+static void display_variables (struct variable **, size_t, int);
 static void display_vectors (int sorted);
 
 int
@@ -181,7 +182,7 @@ cmd_display (void)
   int sorted;
 
   /* Variables to display. */
-  int n;
+  size_t n;
   struct variable **vl;
 
   if (lex_match_id ("MACROS"))
@@ -247,7 +248,7 @@ cmd_display (void)
 
       if (as == AS_SCRATCH)
        {
-         int i, m;
+         size_t i, m;
          for (i = 0, m = n; i < n; i++)
            if (dict_class_from_id (vl[i]->name) != DC_SCRATCH)
              {
@@ -341,7 +342,7 @@ variables_dim (struct tab_table *t, struct outp_driver *d)
 }
   
 static void
-display_variables (struct variable **vl, int n, int as)
+display_variables (struct variable **vl, size_t n, int as)
 {
   struct variable **vp = vl;           /* Variable pointer. */
   struct tab_table *t;
@@ -349,7 +350,7 @@ display_variables (struct variable **vl, int n, int as)
   int nr;                      /* Number of rows. */
   int pc;                      /* `Position column' */
   int r;                       /* Current row. */
-  int i;
+  size_t i;
 
   _as = as;
   switch (as)
@@ -575,7 +576,7 @@ display_vectors (int sorted)
       return;
     }
 
-  vl = xmalloc (sizeof *vl * nvec);
+  vl = xnmalloc (nvec, sizeof *vl);
   for (i = 0; i < nvec; i++)
     vl[i] = dict_get_vector (default_dict, i);
   if (sorted)