projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix root cause of bug worked around by previous check-in, and remove
[pspp]
/
src
/
aggregate.c
diff --git
a/src/aggregate.c
b/src/aggregate.c
index 34ac3e843a1c10a2bb3f55768f5290f466bd7d03..dbfad40f6d4b2b79b938b6a83ed3c771bfa49b8d 100644
(file)
--- a/
src/aggregate.c
+++ b/
src/aggregate.c
@@
-141,11
+141,11
@@
static int aggregate_single_case (struct ccase *input, struct ccase *output);
static int create_sysfile (void);
static int agr_00x_trns_proc (struct trns_header *, struct ccase *);
static int create_sysfile (void);
static int agr_00x_trns_proc (struct trns_header *, struct ccase *);
-static void agr_00x_end_func (void);
+static void agr_00x_end_func (void
*
);
static int agr_10x_trns_proc (struct trns_header *, struct ccase *);
static void agr_10x_trns_free (struct trns_header *);
static int agr_10x_trns_proc (struct trns_header *, struct ccase *);
static void agr_10x_trns_free (struct trns_header *);
-static void agr_10x_end_func (void);
-static int agr_11x_func (
void
);
+static void agr_10x_end_func (void
*
);
+static int agr_11x_func (
write_case_data
);
#if DEBUGGING
static void debug_print (int flags);
#if DEBUGGING
static void debug_print (int flags);
@@
-343,7
+343,7
@@
cmd_aggregate (void)
agr_dict = NULL;
agr_dict = NULL;
- procedure (NULL, NULL, agr_00x_end_func);
+ procedure (NULL, NULL, agr_00x_end_func
, NULL
);
break;
}
break;
}
@@
-359,7
+359,7
@@
cmd_aggregate (void)
t->free = agr_10x_trns_free;
add_transformation (t);
t->free = agr_10x_trns_free;
add_transformation (t);
- procedure (NULL, NULL, agr_10x_end_func);
+ procedure (NULL, NULL, agr_10x_end_func
, NULL
);
}
break;
}
break;
@@
-371,12
+371,12
@@
cmd_aggregate (void)
if (!create_sysfile ())
goto lossage;
if (!create_sysfile ())
goto lossage;
- read_sort_output (agr_11x_func);
+ read_sort_output (agr_11x_func
, NULL
);
{
struct ccase *save_temp_case = temp_case;
temp_case = NULL;
{
struct ccase *save_temp_case = temp_case;
temp_case = NULL;
- agr_11x_func ();
+ agr_11x_func (
NULL
);
temp_case = save_temp_case;
}
temp_case = save_temp_case;
}
@@
-424,9
+424,7
@@
create_sysfile (void)
}
buf64_1xx = xmalloc (sizeof *buf64_1xx * w.case_size);
}
buf64_1xx = xmalloc (sizeof *buf64_1xx * w.case_size);
- buf_1xx = xmalloc (sizeof (struct ccase)
- + (sizeof (union value)
- * (dict_get_value_cnt (agr_dict) - 1)));
+ buf_1xx = xmalloc (dict_get_case_size (agr_dict));
return 1;
}
return 1;
}
@@
-664,6
+662,7
@@
parse_aggregate_functions (void)
}
free (dest[i]);
}
free (dest[i]);
+ destvar->init = 0;
if (dest_label[i])
{
destvar->label = dest_label[i];
if (dest_label[i])
{
destvar->label = dest_label[i];
@@
-1195,7
+1194,7
@@
initialize_aggregate_info (void)
/* Aggregate each case as it comes through. Cases which aren't needed
are dropped. */
static int
/* Aggregate each case as it comes through. Cases which aren't needed
are dropped. */
static int
-agr_00x_trns_proc (struct trns_header *h
unused
, struct ccase *c)
+agr_00x_trns_proc (struct trns_header *h
UNUSED
, struct ccase *c)
{
int code = aggregate_single_case (c, compaction_case);
debug_printf (("%d ", code));
{
int code = aggregate_single_case (c, compaction_case);
debug_printf (("%d ", code));
@@
-1207,7
+1206,7
@@
agr_00x_trns_proc (struct trns_header *h unused, struct ccase *c)
the cases have been output; very little has been cleaned up at this
point. */
static void
the cases have been output; very little has been cleaned up at this
point. */
static void
-agr_00x_end_func (void)
+agr_00x_end_func (void
*aux UNUSED
)
{
/* Ensure that info for the last break group gets written to the
active file. */
{
/* Ensure that info for the last break group gets written to the
active file. */
@@
-1252,7
+1251,7
@@
write_case_to_sfm (void)
/* Aggregate the current case and output it if we passed a
breakpoint. */
static int
/* Aggregate the current case and output it if we passed a
breakpoint. */
static int
-agr_10x_trns_proc (struct trns_header *h
unused
, struct ccase *c)
+agr_10x_trns_proc (struct trns_header *h
UNUSED
, struct ccase *c)
{
int code = aggregate_single_case (c, buf_1xx);
{
int code = aggregate_single_case (c, buf_1xx);
@@
-1264,7
+1263,7
@@
agr_10x_trns_proc (struct trns_header *h unused, struct ccase *c)
/* Close the system file now that we're done with it. */
static void
/* Close the system file now that we're done with it. */
static void
-agr_10x_trns_free (struct trns_header *h
unused
)
+agr_10x_trns_free (struct trns_header *h
UNUSED
)
{
fh_close_handle (outfile);
}
{
fh_close_handle (outfile);
}
@@
-1272,7
+1271,7
@@
agr_10x_trns_free (struct trns_header *h unused)
/* Ensure that info for the last break group gets written to the
system file. */
static void
/* Ensure that info for the last break group gets written to the
system file. */
static void
-agr_10x_end_func (void)
+agr_10x_end_func (void
*aux UNUSED
)
{
dump_aggregate_info (buf_1xx);
write_case_to_sfm ();
{
dump_aggregate_info (buf_1xx);
write_case_to_sfm ();
@@
-1283,7
+1282,7
@@
agr_10x_end_func (void)
appropriate. If temp_case is NULL, finishes up writing the last
case if necessary. */
static int
appropriate. If temp_case is NULL, finishes up writing the last
case if necessary. */
static int
-agr_11x_func (
void
)
+agr_11x_func (
write_case_data wc_data UNUSED
)
{
if (temp_case != NULL)
{
{
if (temp_case != NULL)
{