#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)
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;
}
#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 <readline/readline.h>
#endif
+#include "xalloc.h"
+#include "xmalloca.h"
+
#include "gettext.h"
#define _(msgid) gettext (msgid)
#define N_(msgid) msgid
{
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"))
#include "intprops.h"
#include "size_max.h"
+#include "xmalloca.h"
+
#include <data/casegrouper.h>
#include <data/casereader.h>
#include <data/dictionary.h>
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)
{
d->cp_x = 0;
d->cp_y += d->font_height;
- local_free (leader);
+ freea (leader);
}
/* 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 <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>
#include <output/table.h>
#include "minmax.h"
+#include "xalloc.h"
+#include "xmalloca.h"
#include "gettext.h"
#define _(msgid) gettext (msgid)
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++)
break;
}
}
- local_free (v);
+ freea (v);
}
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 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;
}
next_crosstab:
- local_free (te);
+ freea (te);
}
}
/* Crosstabulation name. */
{
- char *buf = local_alloc (128 * x->nvar);
+ char *buf = xmalloca (128 * x->nvar);
char *cp = buf;
int i;
}
tab_text (t, 0, 0, TAB_LEFT, buf);
- local_free (buf);
+ freea (buf);
}
/* Counts and percentages. */
/* Title. */
{
- char *title = local_alloc (x->nvar * 64 + 128);
+ char *title = xmalloca (x->nvar * 64 + 128);
char *cp = title;
int i;
strcpy (cp, "].");
tab_title (table, "%s", title);
- local_free (title);
+ freea (title);
}
tab_offset (table, 0, 2);
/* 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.;
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];