Add details on how various features interact.
[pspp] / src / sfm-read.c
index b8ba86d47672001204aec95375d19e42a1249432..03b6d5ab55c04805cb7b825c350ae4ce1d79072b 100644 (file)
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    02111-1307, USA. */
 
-/* AIX requires this to be the first thing in the file.  */
 #include <config.h>
-#if __GNUC__
-#define alloca __builtin_alloca
-#else
-#if HAVE_ALLOCA_H
-#include <alloca.h>
-#else
-#ifdef _AIX
-#pragma alloca
-#else
-#ifndef alloca                 /* predefined by HP cc +Olibcalls */
-char *alloca ();
-#endif
-#endif
-#endif
-#endif
-
 #include "sfm.h"
 #include "sfmP.h"
 #include <assert.h>
@@ -143,7 +126,7 @@ bswap_flt64 (flt64 *x)
 
 static void
 corrupt_msg (int class, const char *format,...)
-  __attribute__ ((format (printf, 2, 3)));
+     PRINTF_FORMAT (2, 3);
 
 /* Displays a corrupt sysfile error. */
 static void
@@ -540,7 +523,7 @@ read_header (struct file_handle * h, struct sfm_read_info * inf)
   struct sysfile_header hdr;           /* Disk buffer. */
   struct dictionary *dict;             /* File dictionary. */
   char prod_name[sizeof hdr.prod_name + 1];    /* Buffer for product name. */
-  int skip_amt;                        /* Amount of product name to omit. */
+  int skip_amt = 0;                    /* Amount of product name to omit. */
   int i;
 
   /* Create the dictionary. */
@@ -912,12 +895,10 @@ lossage:
 static int
 parse_format_spec (struct file_handle *h, int32 s, struct fmt_spec *v, struct variable *vv)
 {
-  if ((size_t) ((s >> 16) & 0xff)
-      >= sizeof translate_fmt / sizeof *translate_fmt)
+  v->type = translate_fmt ((s >> 16) & 0xff);
+  if (v->type == -1)
     lose ((ME, _("%s: Bad format specifier byte (%d)."),
           h->fn, (s >> 16) & 0xff));
-  
-  v->type = translate_fmt[(s >> 16) & 0xff];
   v->w = (s >> 8) & 0xff;
   v->d = s & 0xff;