Eliminate temp_case, and a few other cleanups.
[pspp-builds.git] / src / ChangeLog
index eb405c3516cce83d6602c25234aea103947657ee..5e7f0c1a3757b1b36a3c27479cd8479bc817cef5 100644 (file)
@@ -1,3 +1,304 @@
+Tue Mar  9 23:10:41 2004  Ben Pfaff  <blp@gnu.org>
+
+       * format.c: (global array translate_fmt[]) Removed.
+       (translate_fmt) New function as replacement.
+       (parse_format_specifier_name) Rewrite.
+
+       * pfm-read.c: (convert_format) Use translate_fmt() instead of
+       translate_fmt[].
+
+       * sfm-read.c: (parse_format_spec) Ditto.
+
+       * postscript.c: (text) Fix handling of fonts with missing
+       ligatures.
+
+       * sort.c: (struct external_sort) Add temp_name member.
+       (destroy_external_sort) Free temp_dir, temp_name members.
+       (init_external_sort) Allocate temp_name.
+       (get_temp_file_name) Change prototype.
+       (open_temp_file) Deal with change to get_temp_file_name().
+       (close_temp_file) Ditto.
+       (remove_temp_file) Ditto.
+       (write_temp_file) Ditto.
+       (read_temp_file) Ditto.
+       (sort_sink_destroy) Removed.
+       (sort_sink_class) Change destroy member to null.
+
+Tue Mar  9 22:36:34 2004  Ben Pfaff  <blp@gnu.org>
+
+       Eliminate temp_case.
+
+       * aggregate.c: (cmd_aggregate) No need to save/restore temp_case
+       anymore.  Use agr_11x_finish().
+       (aggregate_single_case) Make first param const.
+       (accumulate_aggregate_info) Ditto.
+       (agr_00x_end_func) Use compaction_case, not temp_case.
+       (agr_11x_func) Break into agr_11x_read(), agr_11x_finish().
+
+       * data-list.c: (struct data_list_pgm) Add `case_size' member.
+       (cmd_data_list) Initialize case_size.
+       (read_from_data_list_fixed) Add struct ccase * param, use instead
+       of temp_case.
+       (read_from_data_list_free) Ditto.
+       (read_from_data_list_list) Ditto.
+       (read_one_case) Rename data_list_trns_proc(), all references
+       updated.  Add argument in calling above functions.  Use c
+       argument instead of temp_case.
+       (destroy_dls) Rename data_list_trns_free(), all references
+       updated.
+
+       * expr-evl.c: (expr_evaluate) Make second parameter const.
+
+       * file-type.c: (struct file_type_pgm) Add `case_size' member.
+       (cmd_end_file_type) Initialize `case_size'.
+       (file_type_source_read) Add struct ccase * parameter.  Use instead
+       of temp_case.
+
+       * flip.c: Rewritten.
+
+       * get.c: (struct get_pgm) New structure to keep track of
+       case_size.
+       (cmd_get) Initialize case_size.
+       (cmd_import) Ditto.
+       (get_source) Deal with struct get_pgm.
+       (get_source_read) Add struct ccase * parameter, use instead of
+       temp_case.
+       (import_source_read) Ditto.
+
+       * get.c: Use a null pointer instead of temp_case to represent the
+       "current case" in a struct mtf_file's input member.
+       (mtf_processing_finish) Pass null to mtf_processing(), not
+       temp_case.
+       (mtf_read_nonactive_records) Don't set iter->input to temp_case.
+       (mtf_compare_BY_values) Add extra arg, use instead of null input
+       members.
+       (mtf_processing) Use c parameter instead of temp_case.  Pass
+       compaction_case to process_active_file_output_case().
+       
+       * glob.c: (global variable temp_case) Removed.
+
+       * inpt-pgm.c: (struct input_program_pgm) Add `case_size' member.
+       (cmd_input_program) Initialize case_size.  Set
+       vfm_source->value_cnt.
+       (init_case) Add struct ccase * parameter, use instead of
+       temp_case.
+       (clear_case) Ditto.
+       (input_program_source_read) Ditto.
+
+       * matrix-data.c: (matrix_data_read_without_rowtype) Ditto.
+       (dump_cell_content) Ditto.
+       (nr_output_data) Ditto.
+       (read_matrices_without_rowtype) Ditto.
+       (matrix_data_read_with_rowtype) Ditto.
+       (wr_read_splits) Ditto.
+       (wr_output_data) Ditto.
+
+       * sort.h: (struct sort_cases_pgm) New member `case_size'.
+       
+       * sort.c: (sort_cases) Initialize scp->case_size.
+       (struct external_sort) Remove `case_size' member.
+       (write_initial_runs) Only call vfm_sink->class_destroy if
+       non-null.
+       (struct sort_source_aux) New structure.
+       (sort_source_read_helper) New function.
+       (sort_source_read) Use sort_source_read_helper().
+       (read_sort_output) Change interface to be more reasonable.
+       (read_internal_sort_output) Ditto.
+       (read_external_sort_output) Ditto.
+
+       * vars-prs.c: (dict_class_to_name) Pass return value through
+       gettext.
+
+       * vfm.c: (struct procedure_aux_data) Add `trns_case' member.
+       (procedure) Initialize trns_case.
+       (procedure) Pass trns_case to vfm_source->class->read().
+       Free trns_case.
+       (process_active_file) Start using struct procedure_aux_data.
+       (process_active_file_write_case) Pass trns_case to
+       transformations, lag_case(), clear_case().
+       (process_active_file_output_case) Add struct ccase * parameter.
+       (create_trns_case) New function.
+       (make_temp_case) Removed.
+       (vector_initialization) Removed.
+       (close_active_file) Only call make_source if non-null, otherwise
+       set vfm_source to null pointer.  Don't free temp_case.
+       (disk_source_read) Add struct ccase * parameter, use instead of
+       temp_case.
+       (memory_source_read) Ditto.
+       (lag_case) Add const struct ccase * member.
+       (procedure_write_case) Use trns_case instead of temp_case.
+       (clear_case) Add struct ccase * member, use instead of temp_case.
+       (exclude_this_case) Ditto.
+       (create_case_source) Add struct dictionary * parameter, use to
+       initialize source->value_cnt.
+
+       * vfm.h: (struct case_source) Add `value_cnt' member.
+       (struct case_source_class) Add struct ccase * parameter to `read'
+       member function pointer.
+       (struct case_sink_class) Make struct ccase * parameter const in
+       `write' member function pointer.
+       
+Wed Mar  3 20:44:37 2004  Ben Pfaff  <blp@gnu.org>
+
+       Fix a lot of "possibly uninitialized variable" warnings.  Some of
+       them are even real bugs.  A few of them make me wonder how the
+       code ever worked.
+
+       * aggregate.c: (parse_aggregate_functions) Initialize `function.
+
+       * ascii.c: (output_lines) Add default case to switch.
+
+       * crosstabs.q: Remove static variable `expected' and all
+       references to it.
+       (display_crosstabulation) Always calculate expected value.
+       (calc_chisq) Ditto.
+       (output_pivot_table) Initialize `cmp'.
+       (display_crosstabulation) New variable `last_row', which is
+       initialized.
+
+       * data-in.c: (parse_numeric) Always initialize sign.  How did this
+       work at all?!
+
+       * data-list.c: (repeating_data_trns_proc) Always initialize code.
+       Always set info.ofs.  (How did this work?!)
+
+       * expr-opt.c: (optimize_tree) Always initialize `m'.
+       (evaluate_tree) Always initialize `c'.  (How did this work?)
+
+       * frequencies.q: (frq_custom_variables) Always initialize min,
+       max.
+       (frq_custom_grouped) Always initialize `dl'.
+
+       * groff-font.c: (groff_read_font) Always initialize char_set.
+
+       * matrix-data.c: (nr_output_data) Initialize `split'.
+       (wr_read_splits) Remove shadowing split_cnt declaration.
+       (wr_output_data) Initialize `split'.
+
+       * output.c: (tokener) Skip add character on syntax error.
+
+       * pool.c: (pool_strndup) Always set `copy'.  (How did this work?!)
+
+       * postscript.c: (read_ps_encodings) Use line.string instead of
+       uninitialized `bp'.
+       (write_text) Add default case to switch.
+       (text) Always initialize multiple variables.  Fix bug with
+       ligatures.
+
+       * print.c: (fixed_parse_fortran) Initialize head.
+       (alloc_line) Add default case to switch.
+
+       * recode.c: (parse_dest_spec) Handle case where nothing matches.
+       (recode_trns_proc) Move variable declaration inward.  Add default
+       case to switch.
+
+       * sfm-read.c: (read_header) Initialize skip_amt.
+
+       * sysfile-info.c: (display_variables) Always initialize pc.
+
+       * vars-prs.c: Initialized `included'.
+
+Wed Mar  3 09:30:09 2004  Ben Pfaff  <blp@gnu.org>
+
+       * main.c: (main) sigaction()'s sa_flags member was uninitialized.
+       Just use signal() instead.
+
+Wed Mar  3 09:26:30 2004  Ben Pfaff  <blp@gnu.org>
+
+       Get rid of vfm_sink_info and vfm_source_info.
+       
+       * aggregate.c: (agr_00x_end_func) Don't increment
+       sfm_sink_info.ncases.
+
+       * sort.c: (do_internal_sort) Get case count from
+       vfm_source->class->count().
+       (struct external_sort) Add `case_size' member.
+       (do_external_sort) Initialize case_size.
+       (struct initial_run_state) Add `case_size' member.
+       (write_initial_runs) Initialize case_size.
+       (sort_sink_write) Use case_size.
+       (read_external_sort_output) Use case_size.  Get case_cnt from
+       initial_runs.
+
+       * vfm.c: (struct write_case_data) Add underscores to existing arg
+       names, all references updated.  Renamed `aux' as `func_aux', all
+       references updated.  Added new `aux' member.
+       (global var vfm_source_info) Removed.
+       (global var vfm_sink_info) Removed.
+       (struct procedure_aux_data) New.
+       (struct split_aux_data) New.
+       (procedure) Use `aux' fields for procedure_aux_data,
+       split_aux_data.
+       (process_active_file_write_case) Pass case_count + 1 to
+       transformation procedures, exclude_this_case().
+       (process_active_file_output_case) Don't increment
+       vfm_sink_info.ncases.
+       (prepare_for_writing) Don't initialize vfm_sink_info.  Don't try
+       to send data to disk early.
+       (make_temp_case) Don't use vfm_sink_info.case_size.
+       (close_active_file) Don't initialize vfm_source_info.
+       (struct disk_stream_info) New, to allow for case_cnt and case_size fields.
+       (disk_sink_create) Initialize and/or update disk_stream_info.
+       (disk_sink_write) Ditto.
+       (disk_sink_destroy) Ditto.
+       (disk_sink_make_source) Ditto.
+       (disk_source_read) Ditto.
+       (disk_source_destroy) Ditto.
+       (global var disk_source_class) Add disk_source_count().
+       (disk_source_count) New function.
+       (struct memory_sink_info) Add `case_cnt', `case_size' members.
+       (struct memory_source_info) Ditto.
+       (memory_sink_create) Deal with case_cnt, case_size.
+       (memory_sink_write) Ditto.
+       (memory_sink_make_source) Ditto.
+       (memory_source_read) Ditto.
+       (memory_source_count) New function.
+       (memory_source_class) Add memory_source_count().
+       (procedure_write_case) Don't use vfm_sink_info.ncases.  Do use
+       proc_aux->cases_written, and pass it to transformation procedures
+       and exclude_this_case ().
+       (exclude_this_case) Add case_num parameter.  Pass it to
+       expr_evaluate().
+       (SPLIT_FILE_procfunc) Use split_aux->prev_case instead of static
+       variable.
+
+       * vfm.h: (struct case_source_class) Add `count' member.
+
+       * vfmP.h: (struct stream_info) Removed.
+       (global variable vfm_source_info) Removed.
+       (global variable vfm_sink_info) Removed.
+       
+Tue Mar  2 23:38:17 2004  Ben Pfaff  <blp@gnu.org>
+
+       * var.h: (typedef trns_proc_func) New typedef.
+       (trns_free_func) New typedef.
+       (struct trns_header) Change `proc' to type trns_proc_func, `free'
+       to type trns_free_func.  This only changes the actual type of
+       trns_proc_func, adding a `case_num' parameter.  Updated all
+       implementations to use the typedefs instead.
+
+       * compute.c: (compute_num) Pass case_num to expr_evaluate().
+       (compute_num_vec) Ditto.
+       (compute_str) Ditto.
+       (compute_str_vec) Ditto.
+
+       * do-if.c: (do_if_trns_proc) Ditto.
+
+       * expr-evl.c: (expr_evaluate) Add new case_num parameter, use for
+       OP_CASENUM.
+
+       * inpt-pgm.c: (input_program_source_read) Maintain case count,
+       pass to transformation functions.
+       (reread_trns_proc) Pass case_num arg to expr_evaluate().
+
+       * loop.c: (loop_1_trns_proc) Ditto.
+       (loop_2_trns_proc) Ditto.
+       (loop_3_trns_proc) Ditto.
+
+       * print.c: (print_space_trns_proc) Ditto.
+
+       * sel-if.c: (select_if_proc) Ditto.
+
 Tue Mar  2 11:36:52 2004  Ben Pfaff  <blp@gnu.org>
 
        * frequencies.q: (cleanup_freq_tab) Avoid memory leak by