projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added src/ui/terminal/automake.mk and src/ui/gui/automake.mk
[pspp]
/
src
/
matrix-data.c
diff --git
a/src/matrix-data.c
b/src/matrix-data.c
index 03b06ebc7cb8bf5cf24cda21d2ba3942b61b5686..994285cd98d06d79c48603c7fed4dc30ebe1e3e8 100644
(file)
--- a/
src/matrix-data.c
+++ b/
src/matrix-data.c
@@
-172,7
+172,7
@@
cmd_matrix_data (void)
{
struct pool *pool;
struct matrix_data_pgm *mx;
{
struct pool *pool;
struct matrix_data_pgm *mx;
- struct file_handle *fh =
NULL
;
+ struct file_handle *fh =
fh_inline_file ()
;
unsigned seen = 0;
unsigned seen = 0;
@@
-258,7
+258,7
@@
cmd_matrix_data (void)
else if (lex_match_id ("FILE"))
{
lex_match ('=');
else if (lex_match_id ("FILE"))
{
lex_match ('=');
- fh = fh_parse ();
+ fh = fh_parse (
FH_REF_FILE | FH_REF_INLINE
);
if (fh == NULL)
goto lossage;
}
if (fh == NULL)
goto lossage;
}
@@
-961,11
+961,11
@@
read_matrices_without_rowtype (struct matrix_data_pgm *mx)
nr.mx = mx;
nr.data = NULL;
nr.mx = mx;
nr.data = NULL;
- nr.factor_values = x
malloc (sizeof *nr.factor_values
-
* mx->n_factors * mx->cell
s);
+ nr.factor_values = x
nmalloc (mx->n_factors * mx->cells,
+
sizeof *nr.factor_value
s);
nr.max_cell_idx = 0;
nr.max_cell_idx = 0;
- nr.split_values = x
malloc (sizeof *nr.split_values
-
* dict_get_split_cnt (default_dict)
);
+ nr.split_values = x
nmalloc (dict_get_split_cnt (default_dict),
+
sizeof *nr.split_values
);
vfm_source = create_case_source (&matrix_data_without_rowtype_source_class, &nr);
vfm_source = create_case_source (&matrix_data_without_rowtype_source_class, &nr);
@@
-1143,7
+1143,7
@@
matrix_data_read_without_rowtype (struct case_source *source,
{
int *cp;
{
int *cp;
- nr->data = pool_
alloc (mx->container, (PROX + 1) *
sizeof *nr->data);
+ nr->data = pool_
nalloc (mx->container, PROX + 1,
sizeof *nr->data);
{
int i;
{
int i;
@@
-1166,12
+1166,12
@@
matrix_data_read_without_rowtype (struct case_source *source,
int n_vectors = per_factor ? mx->cells : 1;
int i;
int n_vectors = per_factor ? mx->cells : 1;
int i;
- nr->data[*cp] = pool_alloc (mx->container,
-
n_vectors *
sizeof **nr->data);
+ nr->data[*cp] = pool_
n
alloc (mx->container,
+
n_vectors,
sizeof **nr->data);
for (i = 0; i < n_vectors; i++)
for (i = 0; i < n_vectors; i++)
- nr->data[*cp][i] = pool_alloc (mx->container,
-
n_entries *
sizeof ***nr->data);
+ nr->data[*cp][i] = pool_
n
alloc (mx->container,
+
n_entries,
sizeof ***nr->data);
}
}
}
}
}
}
@@
-1549,7
+1549,7
@@
wr_read_splits (struct wr_aux_data *wr,
else
{
compare = 0;
else
{
compare = 0;
- wr->split_values = x
malloc (split_cnt *
sizeof *wr->split_values);
+ wr->split_values = x
nmalloc (split_cnt,
sizeof *wr->split_values);
}
{
}
{
@@
-1644,7
+1644,7
@@
wr_output_data (struct wr_aux_data *wr,
struct factor_data *iter;
int i;
struct factor_data *iter;
int i;
- factors = x
malloc (sizeof *factors * mx->cell
s);
+ factors = x
nmalloc (mx->cells, sizeof *factor
s);
for (i = 0, iter = wr->data; iter; iter = iter->next, i++)
factors[i] = iter;
for (i = 0, iter = wr->data; iter; iter = iter->next, i++)
factors[i] = iter;
@@
-1836,8
+1836,8
@@
cache_miss:
{
struct factor_data *new = pool_alloc (mx->container, sizeof *new);
{
struct factor_data *new = pool_alloc (mx->container, sizeof *new);
- new->factors = pool_alloc (mx->container,
-
sizeof *new->factors * mx->n_
factors);
+ new->factors = pool_
n
alloc (mx->container,
+
mx->n_factors, sizeof *new->
factors);
{
size_t i;
{
size_t i;
@@
-1888,8
+1888,8
@@
wr_read_indeps (struct wr_aux_data *wr)
if (type == 1)
n_items *= mx->n_continuous;
if (type == 1)
n_items *= mx->n_continuous;
- c->data[wr->content] = pool_alloc (mx->container,
-
sizeof **c->data * n_items
);
+ c->data[wr->content] = pool_
n
alloc (mx->container,
+
n_items, sizeof **c->data
);
}
cp = &c->data[wr->content][n_rows * mx->n_continuous];
}
cp = &c->data[wr->content][n_rows * mx->n_continuous];