pspp-cvs
[Top][All Lists]
Advanced

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

[Pspp-cvs] pspp ChangeLog Smake src/data/file-name.c src/l...


From: Ben Pfaff
Subject: [Pspp-cvs] pspp ChangeLog Smake src/data/file-name.c src/l...
Date: Fri, 12 Oct 2007 04:54:46 +0000

CVSROOT:        /cvsroot/pspp
Module name:    pspp
Changes by:     Ben Pfaff <blp> 07/10/12 04:54:46

Modified files:
        .              : ChangeLog Smake 
        src/data       : file-name.c 
        src/language   : command.c 
        src/language/data-io: list.q 
        src/language/stats: crosstabs.q 
        src/libpspp    : ChangeLog alloc.h 

Log message:
        malloca-instead-of-local_alloc.patch from patch #6230.
        
        * alloc.h (local_alloc): Removed.  Changed all users to use
        xmalloca instead.
        (local_free): Removed.  Changed all users to use freea instead.
        
        * Smake: Drop alloca, alloca-opt modules as we don't use them
        anymore.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/ChangeLog?cvsroot=pspp&r1=1.87&r2=1.88
http://cvs.savannah.gnu.org/viewcvs/pspp/Smake?cvsroot=pspp&r1=1.60&r2=1.61
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/file-name.c?cvsroot=pspp&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/command.c?cvsroot=pspp&r1=1.28&r2=1.29
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/data-io/list.q?cvsroot=pspp&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/stats/crosstabs.q?cvsroot=pspp&r1=1.36&r2=1.37
http://cvs.savannah.gnu.org/viewcvs/pspp/src/libpspp/ChangeLog?cvsroot=pspp&r1=1.80&r2=1.81
http://cvs.savannah.gnu.org/viewcvs/pspp/src/libpspp/alloc.h?cvsroot=pspp&r1=1.4&r2=1.5

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/pspp/pspp/ChangeLog,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -b -r1.87 -r1.88
--- ChangeLog   11 Oct 2007 04:59:34 -0000      1.87
+++ ChangeLog   12 Oct 2007 04:54:46 -0000      1.88
@@ -1,3 +1,8 @@
+2007-10-11  Ben Pfaff  <address@hidden>
+
+       * Smake: Drop alloca, alloca-opt modules as we don't use them
+       anymore.
+
 2007-10-10  Ben Pfaff  <address@hidden>
 
        * acinclude.m4: Improve formatting.

Index: Smake
===================================================================
RCS file: /cvsroot/pspp/pspp/Smake,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -b -r1.60 -r1.61
--- Smake       14 Jun 2007 14:21:23 -0000      1.60
+++ Smake       12 Oct 2007 04:54:46 -0000      1.61
@@ -5,8 +5,6 @@
 GNULIB_TOOL = $(GNULIB)/gnulib-tool
 
 GNULIB_MODULES = \
-       alloca \
-       alloca-opt \
        assert \
        byteswap \
        c-ctype \

Index: src/data/file-name.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/file-name.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- src/data/file-name.c        9 Oct 2007 03:50:20 -0000       1.18
+++ src/data/file-name.c        12 Oct 2007 04:54:46 -0000      1.19
@@ -28,14 +28,16 @@
 #include "intprops.h"
 #include "minmax.h"
 #include "dirname.h"
+#include "xmalloca.h"
 
-#include <libpspp/alloc.h>
 #include <libpspp/message.h>
 #include <data/settings.h>
 #include <libpspp/str.h>
 #include <libpspp/verbose-msg.h>
 #include <libpspp/version.h>
 
+#include "xalloc.h"
+
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
 
@@ -279,13 +281,13 @@
       if (get_safer_mode ())
        return safety_violation (fn);
 
-      s = local_alloc (strlen (fn));
+      s = xmalloca (strlen (fn));
       memcpy (s, fn, strlen (fn) - 1);
       s[strlen (fn) - 1] = 0;
 
       f = popen (s, mode[0] == 'r' ? "r" : "w");
 
-      local_free (s);
+      freea (s);
 
       return f;
     }

Index: src/language/command.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/command.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- src/language/command.c      5 Sep 2007 06:23:02 -0000       1.28
+++ src/language/command.c      12 Oct 2007 04:54:46 -0000      1.29
@@ -31,7 +31,6 @@
 #include <data/variable.h>
 #include <language/lexer/lexer.h>
 #include <language/prompt.h>
-#include <libpspp/alloc.h>
 #include <libpspp/assertion.h>
 #include <libpspp/compiler.h>
 #include <libpspp/message.h>
@@ -49,6 +48,9 @@
 #include <readline/readline.h>
 #endif
 
+#include "xalloc.h"
+#include "xmalloca.h"
+
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
 #define N_(msgid) msgid
@@ -777,7 +779,7 @@
        {
          const char *cp = strrchr (shell_fn, '/');
          cp = cp ? &cp[1] : shell_fn;
-         shell_process = local_alloc (strlen (cp) + 8);
+         shell_process = xmalloca (strlen (cp) + 8);
          strcpy (shell_process, "-");
          strcat (shell_process, cp);
          if (strcmp (cp, "sh"))

Index: src/language/data-io/list.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/data-io/list.q,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- src/language/data-io/list.q 12 Oct 2007 04:49:26 -0000      1.29
+++ src/language/data-io/list.q 12 Oct 2007 04:54:46 -0000      1.30
@@ -21,6 +21,8 @@
 
 #include "intprops.h"
 #include "size_max.h"
+#include "xmalloca.h"
+
 #include <data/casegrouper.h>
 #include <data/casereader.h>
 #include <data/dictionary.h>
@@ -462,7 +464,7 @@
   int line_number = 0;
 
   const char *Line = _("Line");
-  char *leader = local_alloc (strlen (Line)
+  char *leader = xmalloca (strlen (Line)
                               + INT_STRLEN_BOUND (line_number) + 1 + 1);
 
   while (index < cmd.n_variables)
@@ -517,7 +519,7 @@
   d->cp_x = 0;
   d->cp_y += d->font_height;
 
-  local_free (leader);
+  freea (leader);
 }
 
 /* There are three possible layouts for the LIST procedure:

Index: src/language/stats/crosstabs.q
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/stats/crosstabs.q,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- src/language/stats/crosstabs.q      12 Oct 2007 04:49:27 -0000      1.36
+++ src/language/stats/crosstabs.q      12 Oct 2007 04:54:46 -0000      1.37
@@ -46,13 +46,11 @@
 #include <language/dictionary/split-file.h>
 #include <language/lexer/lexer.h>
 #include <language/lexer/variable-parser.h>
-#include <libpspp/alloc.h>
 #include <libpspp/array.h>
 #include <libpspp/assertion.h>
 #include <libpspp/compiler.h>
 #include <libpspp/hash.h>
 #include <libpspp/message.h>
-#include <libpspp/message.h>
 #include <libpspp/misc.h>
 #include <libpspp/pool.h>
 #include <libpspp/str.h>
@@ -60,6 +58,8 @@
 #include <output/table.h>
 
 #include "minmax.h"
+#include "xalloc.h"
+#include "xmalloca.h"
 
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
@@ -551,7 +551,7 @@
 
          sorted_tab = xnrealloc (sorted_tab,
                                   n_sorted_tab + count, sizeof *sorted_tab);
-         v = local_alloc (sizeof *v * x->nvar);
+         v = xmalloca (sizeof *v * x->nvar);
          for (j = 2; j < x->nvar; j++)
             v[j] = get_var_range (x->vars[j])->min;
          for (j = 0; j < count; j++)
@@ -585,7 +585,7 @@
                     break;
                 }
            }
-         local_free (v);
+         freea (v);
        }
 
       sorted_tab = xnrealloc (sorted_tab,
@@ -615,7 +615,7 @@
       struct crosstab *x = xtab[t];
       const size_t entry_size = (sizeof (struct table_entry)
                                 + sizeof (union value) * (x->nvar - 1));
-      struct table_entry *te = local_alloc (entry_size);
+      struct table_entry *te = xmalloca (entry_size);
 
       /* Construct table entry for the current record and table. */
       te->table = t;
@@ -664,7 +664,7 @@
       }
 
     next_crosstab:
-      local_free (te);
+      freea (te);
     }
 }
 
@@ -924,7 +924,7 @@
 
   /* Crosstabulation name. */
   {
-    char *buf = local_alloc (128 * x->nvar);
+    char *buf = xmalloca (128 * x->nvar);
     char *cp = buf;
     int i;
 
@@ -937,7 +937,7 @@
       }
     tab_text (t, 0, 0, TAB_LEFT, buf);
 
-    local_free (buf);
+    freea (buf);
   }
 
   /* Counts and percentages. */
@@ -1064,7 +1064,7 @@
 
       /* Title. */
       {
-       char *title = local_alloc (x->nvar * 64 + 128);
+       char *title = xmalloca (x->nvar * 64 + 128);
        char *cp = title;
        int i;
 
@@ -1130,7 +1130,7 @@
        strcpy (cp, "].");
 
        tab_title (table, "%s", title);
-       local_free (title);
+       freea (title);
       }
 
       tab_offset (table, 0, 2);
@@ -2734,8 +2734,8 @@
   /* Spearman correlation, Pearson's r. */
   if (cmd.a_statistics[CRS_ST_CORR])
     {
-      double *R = local_alloc (sizeof *R * n_rows);
-      double *C = local_alloc (sizeof *C * n_cols);
+      double *R = xmalloca (sizeof *R * n_rows);
+      double *C = xmalloca (sizeof *C * n_cols);
 
       {
        double y, t, c = 0., s = 0.;
@@ -2774,8 +2774,8 @@
       calc_r (R, C, &v[6], &t[6], &ase[6]);
       t[6] = v[6] / t[6];
 
-      local_free (R);
-      local_free (C);
+      freea (R);
+      freea (C);
 
       calc_r ((double *) rows, (double *) cols, &v[7], &t[7], &ase[7]);
       t[7] = v[7] / t[7];

Index: src/libpspp/ChangeLog
===================================================================
RCS file: /cvsroot/pspp/pspp/src/libpspp/ChangeLog,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -b -r1.80 -r1.81
--- src/libpspp/ChangeLog       12 Oct 2007 04:49:27 -0000      1.80
+++ src/libpspp/ChangeLog       12 Oct 2007 04:54:46 -0000      1.81
@@ -1,5 +1,11 @@
 2007-10-11  Ben Pfaff  <address@hidden>
 
+       * alloc.h (local_alloc): Removed.  Changed all users to use
+       xmalloca instead.
+       (local_free): Removed.  Changed all users to use freea instead.
+
+2007-10-11  Ben Pfaff  <address@hidden>
+
        * float-format.c (float_get_lowest): New function.
        
        * magic.c: Removed.

Index: src/libpspp/alloc.h
===================================================================
RCS file: /cvsroot/pspp/pspp/src/libpspp/alloc.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- src/libpspp/alloc.h 7 Jul 2007 06:14:19 -0000       1.4
+++ src/libpspp/alloc.h 12 Oct 2007 04:54:46 -0000      1.5
@@ -24,16 +24,4 @@
 
 void *nmalloc (size_t n, size_t s);
 
-/* alloca() wrapper functions. */
-#if defined HAVE_ALLOCA || defined C_ALLOCA
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-#define local_alloc(X) alloca (X)
-#define local_free(P) ((void) 0)
-#else
-#define local_alloc(X) xmalloc (X)
-#define local_free(P) free (P)
-#endif
-
 #endif /* alloc.h */




reply via email to

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