pspp-cvs
[Top][All Lists]
Advanced

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

[Pspp-cvs] pspp ./ChangeLog ./configure.ac src/data/Change...


From: Ben Pfaff
Subject: [Pspp-cvs] pspp ./ChangeLog ./configure.ac src/data/Change...
Date: Sun, 16 Apr 2006 02:52:28 +0000

CVSROOT:        /cvsroot/pspp
Module name:    pspp
Branch:         
Changes by:     Ben Pfaff <address@hidden>      06/04/16 02:52:28

Modified files:
        .              : ChangeLog configure.ac 
        src/data       : ChangeLog sfm-private.h sys-file-reader.c 
                         sys-file-writer.c 

Log message:
        Get rid of our own int32 type in favor of the standard int32_t type.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/ChangeLog.diff?tr1=1.51&tr2=1.52&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/configure.ac.diff?tr1=1.44&tr2=1.45&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/data/ChangeLog.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/data/sfm-private.h.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/data/sys-file-reader.c.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/pspp/pspp/src/data/sys-file-writer.c.diff?tr1=1.3&tr2=1.4&r1=text&r2=text

Patches:
Index: pspp/ChangeLog
diff -u pspp/ChangeLog:1.51 pspp/ChangeLog:1.52
--- pspp/ChangeLog:1.51 Sun Apr 16 02:15:06 2006
+++ pspp/ChangeLog      Sun Apr 16 02:52:28 2006
@@ -1,3 +1,11 @@
+Sat Apr 15 19:51:22 2006  Ben Pfaff  <address@hidden>
+
+       Get rid of our own int32 type in favor of the standard int32_t
+       type.
+       
+       * configure.ac: Don't need to check the sizes of integer types
+       anymore.
+
 Sat Apr 15 19:13:59 2006  Ben Pfaff  <address@hidden>
 
        * configure.ac, acinclude.m4: Complain about missing prerequisites
Index: pspp/configure.ac
diff -u pspp/configure.ac:1.44 pspp/configure.ac:1.45
--- pspp/configure.ac:1.44      Sun Apr 16 02:15:06 2006
+++ pspp/configure.ac   Sun Apr 16 02:52:28 2006
@@ -62,10 +62,6 @@
 
 dnl  Dont use AC_TYPE_OFF_T --- it doesnt generate the HAVE_TYPE macro
 AC_CHECK_TYPES(off_t) 
-AC_CHECK_SIZEOF(short, 2)
-AC_CHECK_SIZEOF(int, 4)
-AC_CHECK_SIZEOF(long, 4)
-AC_CHECK_SIZEOF(long long, 0)
 AC_CHECK_SIZEOF(float, 0)
 AC_CHECK_SIZEOF(double, 8)
 AC_CHECK_SIZEOF(long double, 0)
Index: pspp/src/data/ChangeLog
diff -u pspp/src/data/ChangeLog:1.11 pspp/src/data/ChangeLog:1.12
--- pspp/src/data/ChangeLog:1.11        Sun Apr 16 02:42:39 2006
+++ pspp/src/data/ChangeLog     Sun Apr 16 02:52:28 2006
@@ -1,3 +1,15 @@
+Sat Apr 15 19:48:57 2006  Ben Pfaff  <address@hidden>
+
+       Get rid of our own int32 type in favor of the standard int32_t
+       type.
+       
+       * sfm-private.h: (int32 macro) Don't define this anymore.  Do
+       include <stdint.h>.
+
+       * sys-file-reader.c: Use int32_t instead of int32 throughout.
+       
+       * sys-file-writer.c: Use int32_t instead of int32 throughout.
+
 Sat Apr 15 19:36:47 2006  Ben Pfaff  <address@hidden>
 
        Remove ill-considered file routines that are no longer used.
Index: pspp/src/data/sfm-private.h
diff -u pspp/src/data/sfm-private.h:1.4 pspp/src/data/sfm-private.h:1.5
--- pspp/src/data/sfm-private.h:1.4     Wed Mar 15 03:29:10 2006
+++ pspp/src/data/sfm-private.h Sun Apr 16 02:52:28 2006
@@ -21,6 +21,7 @@
    structures. */
 
 #include <libpspp/compiler.h>
+#include <stdint.h>
 #include "variable.h"
 
 /* This attribute might avoid some problems.  On the other hand... */
@@ -30,17 +31,6 @@
 #pragma option -a-             /* Turn off alignment. */
 #endif
 
-/* Find 32-bit signed integer type. */
-#if SIZEOF_SHORT == 4
-  #define int32 short
-#elif SIZEOF_INT == 4
-  #define int32 int
-#elif SIZEOF_LONG == 4
-  #define int32 long
-#else
-  #error Which one of your basic types is 32-bit signed integer?
-#endif
-
 /* Find 64-bit floating-point type. */
 #if SIZEOF_FLOAT == 8
   #define flt64 float
@@ -70,12 +60,12 @@
   {
     char rec_type[4] P;                /* 00: Record-type code, "$FL2". */
     char prod_name[60] P;      /* 04: Product identification. */
-    int32 layout_code P;       /* 40: 2. */
-    int32 case_size P;         /* 44: Number of `value's per case. 
+    int32_t layout_code P;     /* 40: 2. */
+    int32_t case_size P;       /* 44: Number of `value's per case. 
                                   Note: some systems set this to -1 */
-    int32 compress P;          /* 48: 1=compressed, 0=not compressed. */
-    int32 weight_idx P;         /* 4c: 1-based index of weighting var, or 0. */
-    int32 case_cnt P;          /* 50: Number of cases, -1 if unknown. */
+    int32_t compress P;                /* 48: 1=compressed, 0=not compressed. 
*/
+    int32_t weight_idx P;         /* 4c: 1-based index of weighting var, or 0. 
*/
+    int32_t case_cnt P;                /* 50: Number of cases, -1 if unknown. 
*/
     flt64 bias P;              /* 54: Compression bias (100.0). */
     char creation_date[9] P;   /* 5c: `dd mmm yy' creation date of file. */
     char creation_time[8] P;   /* 65: `hh:mm:ss' 24-hour creation time. */
@@ -86,13 +76,13 @@
 /* Record Type 2: Variable. */
 struct sysfile_variable
   {
-    int32 rec_type P;          /* 2. */
-    int32 type P;              /* 0=numeric, 1-255=string width,
+    int32_t rec_type P;                /* 2. */
+    int32_t type P;            /* 0=numeric, 1-255=string width,
                                   -1=continued string. */
-    int32 has_var_label P;     /* 1=has a variable label, 0=doesn't. */
-    int32 n_missing_values P;  /* Missing value code of -3,-2,0,1,2, or 3. */
-    int32 print P;     /* Print format. */
-    int32 write P;     /* Write format. */
+    int32_t has_var_label P;   /* 1=has a variable label, 0=doesn't. */
+    int32_t n_missing_values P;        /* Missing value code of -3,-2,0,1,2, 
or 3. */
+    int32_t print P;   /* Print format. */
+    int32_t write P;   /* Write format. */
     char name[SHORT_NAME_LEN] P; /* Variable name. */
     /* The rest of the structure varies. */
   };
Index: pspp/src/data/sys-file-reader.c
diff -u pspp/src/data/sys-file-reader.c:1.5 pspp/src/data/sys-file-reader.c:1.6
--- pspp/src/data/sys-file-reader.c:1.5 Fri Mar 17 04:58:25 2006
+++ pspp/src/data/sys-file-reader.c     Sun Apr 16 02:52:28 2006
@@ -99,7 +99,7 @@
 
 /* Reverse the byte order of 32-bit integer *X. */
 static inline void
-bswap_int32 (int32 *x_)
+bswap_int32 (int32_t *x_)
 {
   char *x = (char *) x_;
   bswap (x + 0, x + 3);
@@ -170,7 +170,7 @@
 
 static int read_header (struct sfm_reader *,
                         struct dictionary *, struct sfm_read_info *);
-static int parse_format_spec (struct sfm_reader *, int32,
+static int parse_format_spec (struct sfm_reader *, int32_t,
                              struct fmt_spec *, const struct variable *);
 static int read_value_labels (struct sfm_reader *, struct dictionary *,
                               struct variable **var_by_idx);
@@ -279,7 +279,7 @@
   /* Read records of types 3, 4, 6, and 7. */
   for (;;)
     {
-      int32 rec_type;
+      int32_t rec_type;
 
       assertive_buf_read (r, &rec_type, sizeof rec_type, 0);
       if (r->reverse_endian)
@@ -307,9 +307,9 @@
          {
            struct
              {
-               int32 subtype P;
-               int32 size P;
-               int32 count P;
+               int32_t subtype P;
+               int32_t size P;
+               int32_t count P;
              }
            data;
             unsigned long bytes;
@@ -361,9 +361,9 @@
                    {
                      struct
                      {
-                       int32 measure P;
-                       int32 width P;
-                       int32 align P;
+                       int32_t measure P;
+                       int32_t width P;
+                       int32_t align P;
                      }
                      params;
 
@@ -476,7 +476,7 @@
 
        case 999:
          {
-           int32 filler;
+           int32_t filler;
 
            assertive_buf_read (r, &filler, sizeof filler, 0);
            goto success;
@@ -509,15 +509,15 @@
 static int
 read_machine_int32_info (struct sfm_reader *r, int size, int count)
 {
-  int32 data[8];
+  int32_t data[8];
   int file_bigendian;
 
   int i;
 
-  if (size != sizeof (int32) || count != 8)
+  if (size != sizeof (int32_t) || count != 8)
     lose ((ME, _("%s: Bad size (%d) or count (%d) field on record type 7, "
                  "subtype 3.   Expected size %d, count 8."),
-          fh_get_filename (r->fh), size, count, sizeof (int32)));
+          fh_get_filename (r->fh), size, count, sizeof (int32_t)));
 
   assertive_buf_read (r, data, sizeof data, 0);
   if (r->reverse_endian)
@@ -881,7 +881,7 @@
       if (sv.has_var_label == 1)
        {
          /* Disk buffer. */
-         int32 len;
+         int32_t len;
 
          /* Read length of label. */
          assertive_buf_read (r, &len, sizeof len, 0);
@@ -897,7 +897,7 @@
          if ( len != 0 ) 
            {
              /* Read label into variable structure. */
-             vv->label = buf_read (r, NULL, ROUND_UP (len, sizeof (int32)), 
len + 1);
+             vv->label = buf_read (r, NULL, ROUND_UP (len, sizeof (int32_t)), 
len + 1);
              if (vv->label == NULL)
                goto error;
              vv->label[len] = '\0';
@@ -978,7 +978,7 @@
 /* Translates the format spec from sysfile format to internal
    format. */
 static int
-parse_format_spec (struct sfm_reader *r, int32 s,
+parse_format_spec (struct sfm_reader *r, int32_t s,
                    struct fmt_spec *f, const struct variable *v)
 {
   f->type = translate_fmt ((s >> 16) & 0xff);
@@ -1024,10 +1024,10 @@
     };
 
   struct label *labels = NULL;
-  int32 n_labels;              /* Number of labels. */
+  int32_t n_labels;            /* Number of labels. */
 
   struct variable **var = NULL;        /* Associated variables. */
-  int32 n_vars;                        /* Number of associated variables. */
+  int32_t n_vars;                      /* Number of associated variables. */
 
   int i;
 
@@ -1040,7 +1040,7 @@
   if (r->reverse_endian)
     bswap_int32 (&n_labels);
 
-  if ( n_labels >= ((int32) ~0) / sizeof *labels)
+  if ( n_labels >= ((int32_t) ~0) / sizeof *labels)
     {    
       corrupt_msg(MW, _("%s: Invalid number of labels: %d.  Ignoring labels."),
                  fh_get_filename (r->fh), n_labels);
@@ -1077,7 +1077,7 @@
 
   /* Read record type of type 4 record. */
   {
-    int32 rec_type;
+    int32_t rec_type;
     
     assertive_buf_read (r, &rec_type, sizeof rec_type, 0);
     if (r->reverse_endian)
@@ -1103,7 +1103,7 @@
   var = xnmalloc (n_vars, sizeof *var);
   for (i = 0; i < n_vars; i++)
     {
-      int32 var_idx;
+      int32_t var_idx;
       struct variable *v;
 
       /* Read variable index, check range. */
@@ -1251,7 +1251,7 @@
 static int
 read_documents (struct sfm_reader *r, struct dictionary *dict)
 {
-  int32 line_cnt;
+  int32_t line_cnt;
   char *documents;
 
   if (dict_get_documents (dict) != NULL)
Index: pspp/src/data/sys-file-writer.c
diff -u pspp/src/data/sys-file-writer.c:1.3 pspp/src/data/sys-file-writer.c:1.4
--- pspp/src/data/sys-file-writer.c:1.3 Tue Mar 21 00:33:05 2006
+++ pspp/src/data/sys-file-writer.c     Sun Apr 16 02:52:28 2006
@@ -217,8 +217,8 @@
   {
     struct
       {
-       int32 rec_type P;
-       int32 filler P;
+       int32_t rec_type P;
+       int32_t filler P;
       }
     rec_999;
 
@@ -372,7 +372,7 @@
 /* Translates format spec from internal form in SRC to system file
    format in DEST. */
 static inline void
-write_format_spec (struct fmt_spec *src, int32 *dest)
+write_format_spec (struct fmt_spec *src, int32_t *dest)
 {
   *dest = (formats[src->type].spss << 16) | (src->w << 8) | src->d;
 }
@@ -425,7 +425,7 @@
     {
       struct label
        {
-         int32 label_len P;
+         int32_t label_len P;
          char label[255] P;
        }
       l;
@@ -468,16 +468,16 @@
 {
   struct value_label_rec
     {
-      int32 rec_type P;
-      int32 n_labels P;
+      int32_t rec_type P;
+      int32_t n_labels P;
       flt64 labels[1] P;
     };
 
   struct var_idx_rec
     {
-      int32 rec_type P;
-      int32 n_vars P;
-      int32 vars[1] P;
+      int32_t rec_type P;
+      int32_t n_vars P;
+      int32_t vars[1] P;
     };
 
   struct val_labs_iterator *i;
@@ -530,8 +530,8 @@
 {
   struct
     {
-      int32 rec_type P;                /* Always 6. */
-      int32 n_lines P;         /* Number of lines of documents. */
+      int32_t rec_type P;              /* Always 6. */
+      int32_t n_lines P;               /* Number of lines of documents. */
     }
   rec_6;
 
@@ -556,10 +556,10 @@
 
   struct
   {
-    int32 rec_type P;
-    int32 subtype P;
-    int32 elem_size P;
-    int32 n_elem P;
+    int32_t rec_type P;
+    int32_t subtype P;
+    int32_t elem_size P;
+    int32_t n_elem P;
   } vdp_hdr;
 
   vdp_hdr.rec_type = 7;
@@ -574,9 +574,9 @@
       struct variable *v;
       struct
       {
-       int32 measure P;
-       int32 width P;
-       int32 align P;
+       int32_t measure P;
+       int32_t width P;
+       int32_t align P;
       }
       params;
 
@@ -596,10 +596,10 @@
 {
   struct
     {
-      int32 rec_type P;
-      int32 subtype P;
-      int32 elem_size P;
-      int32 n_elem P;
+      int32_t rec_type P;
+      int32_t subtype P;
+      int32_t elem_size P;
+      int32_t n_elem P;
     }
   lv_hdr;
 
@@ -633,15 +633,15 @@
 {
   struct
     {
-      int32 rec_type_3 P;
-      int32 subtype_3 P;
-      int32 data_type_3 P;
-      int32 n_elem_3 P;
-      int32 elem_3[8] P;
-      int32 rec_type_4 P;
-      int32 subtype_4 P;
-      int32 data_type_4 P;
-      int32 n_elem_4 P;
+      int32_t rec_type_3 P;
+      int32_t subtype_3 P;
+      int32_t data_type_3 P;
+      int32_t n_elem_3 P;
+      int32_t elem_3[8] P;
+      int32_t rec_type_4 P;
+      int32_t subtype_4 P;
+      int32_t data_type_4 P;
+      int32_t n_elem_4 P;
       flt64 elem_4[3] P;
     }
   rec_7;
@@ -664,7 +664,7 @@
     
   rec_7.rec_type_3 = 7;
   rec_7.subtype_3 = 3;
-  rec_7.data_type_3 = sizeof (int32);
+  rec_7.data_type_3 = sizeof (int32_t);
   rec_7.n_elem_3 = 8;
   rec_7.elem_3[0] = version_component[0];
   rec_7.elem_3[1] = version_component[1];
@@ -885,7 +885,7 @@
       if (ok && !fseek (w->file, offsetof (struct sysfile_header, case_cnt),
                         SEEK_SET))
         {
-          int32 case_cnt = w->case_cnt;
+          int32_t case_cnt = w->case_cnt;
           fwrite (&case_cnt, sizeof case_cnt, 1, w->file);
           clearerr (w->file);
         }




reply via email to

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