* 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.
+2007-10-11 Ben Pfaff <blp@gnu.org>
+
+ * Smake: Drop alloca, alloca-opt modules as we don't use them
+ anymore.
+
2007-10-10 Ben Pfaff <blp@gnu.org>
* acinclude.m4: Improve formatting.
2007-10-10 Ben Pfaff <blp@gnu.org>
* acinclude.m4: Improve formatting.
GNULIB_TOOL = $(GNULIB)/gnulib-tool
GNULIB_MODULES = \
GNULIB_TOOL = $(GNULIB)/gnulib-tool
GNULIB_MODULES = \
- alloca \
- alloca-opt \
assert \
byteswap \
c-ctype \
assert \
byteswap \
c-ctype \
#include "intprops.h"
#include "minmax.h"
#include "dirname.h"
#include "intprops.h"
#include "minmax.h"
#include "dirname.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 <libpspp/message.h>
#include <data/settings.h>
#include <libpspp/str.h>
#include <libpspp/verbose-msg.h>
#include <libpspp/version.h>
#include "gettext.h"
#define _(msgid) gettext (msgid)
#include "gettext.h"
#define _(msgid) gettext (msgid)
if (get_safer_mode ())
return safety_violation (fn);
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");
memcpy (s, fn, strlen (fn) - 1);
s[strlen (fn) - 1] = 0;
f = popen (s, mode[0] == 'r' ? "r" : "w");
#include <data/variable.h>
#include <language/lexer/lexer.h>
#include <language/prompt.h>
#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>
#include <libpspp/assertion.h>
#include <libpspp/compiler.h>
#include <libpspp/message.h>
#include <readline/readline.h>
#endif
#include <readline/readline.h>
#endif
+#include "xalloc.h"
+#include "xmalloca.h"
+
#include "gettext.h"
#define _(msgid) gettext (msgid)
#define N_(msgid) msgid
#include "gettext.h"
#define _(msgid) gettext (msgid)
#define N_(msgid) msgid
{
const char *cp = strrchr (shell_fn, '/');
cp = cp ? &cp[1] : shell_fn;
{
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"))
strcpy (shell_process, "-");
strcat (shell_process, cp);
if (strcmp (cp, "sh"))
#include "intprops.h"
#include "size_max.h"
#include "intprops.h"
#include "size_max.h"
#include <data/casegrouper.h>
#include <data/casereader.h>
#include <data/dictionary.h>
#include <data/casegrouper.h>
#include <data/casereader.h>
#include <data/dictionary.h>
int line_number = 0;
const char *Line = _("Line");
int line_number = 0;
const char *Line = _("Line");
- char *leader = local_alloc (strlen (Line)
- + INT_STRLEN_BOUND (line_number) + 1 + 1);
+ char *leader = xmalloca (strlen (Line)
+ + INT_STRLEN_BOUND (line_number) + 1 + 1);
while (index < cmd.n_variables)
{
while (index < cmd.n_variables)
{
d->cp_x = 0;
d->cp_y += d->font_height;
d->cp_x = 0;
d->cp_y += d->font_height;
}
/* There are three possible layouts for the LIST procedure:
}
/* There are three possible layouts for the LIST procedure:
#include <language/dictionary/split-file.h>
#include <language/lexer/lexer.h>
#include <language/lexer/variable-parser.h>
#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/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>
#include <libpspp/misc.h>
#include <libpspp/pool.h>
#include <libpspp/str.h>
#include <output/table.h>
#include "minmax.h"
#include <output/table.h>
#include "minmax.h"
+#include "xalloc.h"
+#include "xmalloca.h"
#include "gettext.h"
#define _(msgid) gettext (msgid)
#include "gettext.h"
#define _(msgid) gettext (msgid)
sorted_tab = xnrealloc (sorted_tab,
n_sorted_tab + count, sizeof *sorted_tab);
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++)
for (j = 2; j < x->nvar; j++)
v[j] = get_var_range (x->vars[j])->min;
for (j = 0; j < count; j++)
}
sorted_tab = xnrealloc (sorted_tab,
}
sorted_tab = xnrealloc (sorted_tab,
struct crosstab *x = xtab[t];
const size_t entry_size = (sizeof (struct table_entry)
+ sizeof (union value) * (x->nvar - 1));
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;
/* Construct table entry for the current record and table. */
te->table = t;
/* Crosstabulation name. */
{
/* Crosstabulation name. */
{
- char *buf = local_alloc (128 * x->nvar);
+ char *buf = xmalloca (128 * x->nvar);
}
tab_text (t, 0, 0, TAB_LEFT, buf);
}
tab_text (t, 0, 0, TAB_LEFT, buf);
}
/* Counts and percentages. */
}
/* Counts and percentages. */
- char *title = local_alloc (x->nvar * 64 + 128);
+ char *title = xmalloca (x->nvar * 64 + 128);
strcpy (cp, "].");
tab_title (table, "%s", title);
strcpy (cp, "].");
tab_title (table, "%s", title);
}
tab_offset (table, 0, 2);
}
tab_offset (table, 0, 2);
/* Spearman correlation, Pearson's r. */
if (cmd.a_statistics[CRS_ST_CORR])
{
/* 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.;
{
double y, t, c = 0., s = 0.;
calc_r (R, C, &v[6], &t[6], &ase[6]);
t[6] = v[6] / t[6];
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];
calc_r ((double *) rows, (double *) cols, &v[7], &t[7], &ase[7]);
t[7] = v[7] / t[7];
+2007-10-11 Ben Pfaff <blp@gnu.org>
+
+ * 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 <blp@gnu.org>
* float-format.c (float_get_lowest): New function.
2007-10-11 Ben Pfaff <blp@gnu.org>
* float-format.c (float_get_lowest): New function.
void *nmalloc (size_t n, size_t s);
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
-