pspp
2 years agowork on monolithic output and outer borders pivot-titles
Ben Pfaff [Mon, 26 Dec 2022 17:04:12 +0000 (09:04 -0800)]
work on monolithic output and outer borders

2 years agotable: Fix use of uninitialized data.
Ben Pfaff [Mon, 16 Jan 2023 17:54:30 +0000 (09:54 -0800)]
table: Fix use of uninitialized data.

Fixes: 62a04ffbf5aa ("output: Combine color and stroke into table_border_style.")
2 years agoCTABLES: Avoid uninitialized variable warning in some GCC versions.
Ben Pfaff [Mon, 16 Jan 2023 16:50:07 +0000 (08:50 -0800)]
CTABLES: Avoid uninitialized variable warning in some GCC versions.

2 years agooutput: Combine color and stroke into table_border_style.
Ben Pfaff [Sun, 15 Jan 2023 18:05:03 +0000 (10:05 -0800)]
output: Combine color and stroke into table_border_style.

Rules in tables have a line style (stroke) and a color.  Until now, these
have been mostly maintained separately.  This commit combines them in most
places.

2 years agorender: Get rid of RENDER_LINE_* in favor of similar TABLE_STROKE_*.
Ben Pfaff [Sun, 15 Jan 2023 17:28:08 +0000 (09:28 -0800)]
render: Get rid of RENDER_LINE_* in favor of similar TABLE_STROKE_*.

These had the same values.  They were separated for abstraction reasons
that don't seem to be needed, and eliminating one of them eliminates some
conversions.

2 years agotable: Rename TAB_* to TABLE_CELL_* and reduce from 16 to 8 bits each.
Ben Pfaff [Fri, 23 Dec 2022 21:17:56 +0000 (13:17 -0800)]
table: Rename TAB_* to TABLE_CELL_* and reduce from 16 to 8 bits each.

2 years agotable: Drop support for -1 as style to table_hline(), table_vline().
Ben Pfaff [Fri, 23 Dec 2022 20:49:45 +0000 (12:49 -0800)]
table: Drop support for -1 as style to table_hline(), table_vline().

The callers didn't ever pass a style of -1.

2 years agotable: Remove table_box().
Ben Pfaff [Fri, 23 Dec 2022 20:48:50 +0000 (12:48 -0800)]
table: Remove table_box().

It was only used from table_put() to erase any rules within a joined cell,
but the client code didn't ever put rules in a joined cell, so it was only
used as a no-op.

2 years agoONEWAY: Fix incorrect, duplicate "(J) Family" label.
Ben Pfaff [Thu, 5 Jan 2023 01:38:41 +0000 (17:38 -0800)]
ONEWAY: Fix incorrect, duplicate "(J) Family" label.

ONEWAY output should contain dimensions labeled "(I) Family" and
"(J) Family", but they incorrectly both had the latter label.  This fixes
the problem.

Thanks to Andreas Hammer for reporting the bug.

Fixes: 5cab4cf3322f ("output: Introduce pivot tables.")
2 years agodoc: Make the developers guide just a description of file formats.
Ben Pfaff [Sun, 27 Nov 2022 18:27:48 +0000 (10:27 -0800)]
doc: Make the developers guide just a description of file formats.

The other material in the developers guide was mostly obsolete or very
incomplete.  I don't think it really helped any developers.

There were a few possibly valuable parts.  I added them to the source tree,
which is where I think developers would be inclined to look.

2 years agoMove all command implementations into a single 'commands' directory.
Ben Pfaff [Sun, 27 Nov 2022 18:05:35 +0000 (10:05 -0800)]
Move all command implementations into a single 'commands' directory.

The original division of commands into subdirectories was fairly arbitrary,
and over time it got more confusing, even to me (who made the divisions
to begin with).  I don't see a problem with having them in a single
directory, and it will confuse me less.  This commit moves them all into
one place.

2 years agoRemove unneeded #includes.
Ben Pfaff [Sun, 27 Nov 2022 17:39:27 +0000 (09:39 -0800)]
Remove unneeded #includes.

2 years agoCTABLES: Fix issue with special case for SLABELS POSITION=ROW.
Ben Pfaff [Fri, 25 Nov 2022 23:20:52 +0000 (15:20 -0800)]
CTABLES: Fix issue with special case for SLABELS POSITION=ROW.

With SLABELS POSITION=ROW and stacked variables with different summaries,
values were shown in the wrong rows.  This fixes the problem.

Thanks to Frans Houweling for reporting the bug.

2 years agopivot-table: Fix memory leak in debug print code.
Ben Pfaff [Fri, 25 Nov 2022 20:13:41 +0000 (12:13 -0800)]
pivot-table: Fix memory leak in debug print code.

2 years agoCTABLES: Fix treatment of multiline titles.
Ben Pfaff [Thu, 24 Nov 2022 00:51:19 +0000 (16:51 -0800)]
CTABLES: Fix treatment of multiline titles.

Bug #63032.
Thanks to Frans Houweling for reporting this bug.

2 years agoCTABLES: Make EMPTY independent of other settings on CATEGORIES.
Ben Pfaff [Thu, 24 Nov 2022 00:39:35 +0000 (16:39 -0800)]
CTABLES: Make EMPTY independent of other settings on CATEGORIES.

Frans Houweling reported that the following two commands behave
differently:

   CTABLES /TABLE=class > datum BY size
      /CATEGORIES VARIABLES=ALL EMPTY=EXCLUDE
      /CATEGORIES VARIABLES=size TOTAL=YES.
   CTABLES /TABLE=class > datum BY size
      /CATEGORIES VARIABLES=size TOTAL=YES
      /CATEGORIES VARIABLES=ALL EMPTY=EXCLUDE.

There was a good reason for this, which is that CATEGORIES always changes
all the category attributes of whatever variables are named.  That is,
CATEGORIES VARIABLES=ALL overrides TOTAL even if EMPTY is the only
subcommand given.  I don't know what SPSS does here, but this behavior is
surprising enough that I wanted to change it.  This commit does that;
afterward, both of the above commands behave the same way, which
combines effects of TOTAL=YES and EMPTY=EXCLUDE for size and just
EMPTY=EXCLUDE for the class and datum.

2 years agoexamples: Rename variables for nhtsa example to give them better names.
Ben Pfaff [Wed, 23 Nov 2022 02:47:59 +0000 (18:47 -0800)]
examples: Rename variables for nhtsa example to give them better names.

The existing names were taken from question numbers in the questionnaire
(I guess), which weren't meaningful.  This replaces them by meaningful
names.

Thanks to Frans Houweling <fhouweling@email.it> for providing the new
names!

2 years agospv-driver: Fix memory leak on error path.
Ben Pfaff [Wed, 23 Nov 2022 01:15:22 +0000 (17:15 -0800)]
spv-driver: Fix memory leak on error path.

2 years agospv: ALlow an extra 01 at the end of X3.
Ben Pfaff [Tue, 22 Nov 2022 22:47:45 +0000 (14:47 -0800)]
spv: ALlow an extra 01 at the end of X3.

One sample received in a user report had this present.

2 years agoUPDATE: Improve a test.
Ben Pfaff [Mon, 21 Nov 2022 07:00:19 +0000 (23:00 -0800)]
UPDATE: Improve a test.

2 years agoMEANS: Improve error messages and coding style.
Ben Pfaff [Mon, 21 Nov 2022 06:25:33 +0000 (22:25 -0800)]
MEANS: Improve error messages and coding style.

2 years agoOUTPUT MODIFY: Improve error messages and coding style.
Ben Pfaff [Mon, 21 Nov 2022 06:15:11 +0000 (22:15 -0800)]
OUTPUT MODIFY: Improve error messages and coding style.

2 years agoSET: Improve error messages and coding style.
Ben Pfaff [Mon, 21 Nov 2022 00:49:55 +0000 (16:49 -0800)]
SET: Improve error messages and coding style.

2 years agoINSERT: Improve error messages and coding style.
Ben Pfaff [Mon, 21 Nov 2022 00:46:30 +0000 (16:46 -0800)]
INSERT: Improve error messages and coding style.

2 years agoROC: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 22:14:04 +0000 (14:14 -0800)]
ROC: Improve error messages and coding style.

2 years agoRANK: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 22:03:13 +0000 (14:03 -0800)]
RANK: Improve error messages and coding style.

2 years agoONEWAY: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 21:54:37 +0000 (13:54 -0800)]
ONEWAY: Improve error messages and coding style.

2 years agoGRAPH: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 21:29:12 +0000 (13:29 -0800)]
GRAPH: Improve error messages and coding style.

2 years agoLOGISTIC REGRESSION: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 19:28:02 +0000 (11:28 -0800)]
LOGISTIC REGRESSION: Improve error messages and coding style.

2 years agoGLM: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 17:58:01 +0000 (09:58 -0800)]
GLM: Improve error messages and coding style.

2 years agosplit-file: New function output_split_file_values_peek().
Ben Pfaff [Sun, 20 Nov 2022 17:52:31 +0000 (09:52 -0800)]
split-file: New function output_split_file_values_peek().

This helper function encapsulates what most of the callers were doing.

2 years agocasereader: Add const to casereader_peek() and casereader_is_empty().
Ben Pfaff [Sun, 20 Nov 2022 17:51:09 +0000 (09:51 -0800)]
casereader: Add const to casereader_peek() and casereader_is_empty().

These don't affect the external state of a casereader even though they can
affect its internal state.

2 years agocasereader-shim: Fix typo in comment.
Ben Pfaff [Sun, 20 Nov 2022 17:50:21 +0000 (09:50 -0800)]
casereader-shim: Fix typo in comment.

2 years agoDisentangle the interaction parser from the variable parser.
Ben Pfaff [Sun, 20 Nov 2022 17:02:00 +0000 (09:02 -0800)]
Disentangle the interaction parser from the variable parser.

Both GLM and LOGISTIC REGRESSION used the interaction parser, but only GLM
used it to parse interactions in the full sense.  LOGISTIC REGRESSION was
just parsing a list of variables and then creating interactions from them.
This commit moves the interaction parser from variable-parser into GLM and
adds new code to LOGISTIC REGRESSION that satisfies its needs.

2 years agoGLM: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 02:57:53 +0000 (18:57 -0800)]
GLM: Improve error messages and coding style.

2 years agoFACTOR: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 01:48:08 +0000 (17:48 -0800)]
FACTOR: Improve error messages and coding style.

2 years agoQUICK CLUSTER: Improve error messages and coding style.
Ben Pfaff [Sun, 20 Nov 2022 01:00:57 +0000 (17:00 -0800)]
QUICK CLUSTER: Improve error messages and coding style.

2 years agoMATRIX: Improve error messages.
Ben Pfaff [Sun, 20 Nov 2022 00:58:49 +0000 (16:58 -0800)]
MATRIX: Improve error messages.

2 years agoEXAMINE: Improve error messages and coding style.
Ben Pfaff [Fri, 11 Nov 2022 17:38:50 +0000 (09:38 -0800)]
EXAMINE: Improve error messages and coding style.

2 years agoexpressions: Minor error message improvement.
Ben Pfaff [Thu, 17 Nov 2022 22:37:31 +0000 (14:37 -0800)]
expressions: Minor error message improvement.

2 years agopool: Support null 'pool' argument in pool_vasprintf().
Ben Pfaff [Fri, 11 Nov 2022 17:40:33 +0000 (09:40 -0800)]
pool: Support null 'pool' argument in pool_vasprintf().

Other similar functions support a null 'pool', so this function should too.

2 years agoDESCRIPTIVES: Improve error messages and coding style.
Ben Pfaff [Fri, 11 Nov 2022 06:17:21 +0000 (22:17 -0800)]
DESCRIPTIVES: Improve error messages and coding style.

2 years agoCTABLES: Improve error messages.
Ben Pfaff [Fri, 11 Nov 2022 06:15:18 +0000 (22:15 -0800)]
CTABLES: Improve error messages.

2 years agoCROSSTABS: Improve error messages and coding style.
Ben Pfaff [Fri, 11 Nov 2022 06:13:32 +0000 (22:13 -0800)]
CROSSTABS: Improve error messages and coding style.

2 years agoCORRELATIONS: Improve error messages and coding style.
Ben Pfaff [Fri, 11 Nov 2022 06:12:04 +0000 (22:12 -0800)]
CORRELATIONS: Improve error messages and coding style.

2 years agoVECTOR: Improve error messages and coding style.
Ben Pfaff [Fri, 11 Nov 2022 06:06:26 +0000 (22:06 -0800)]
VECTOR: Improve error messages and coding style.

2 years agovariable-display: Improve coding style and error messages.
Ben Pfaff [Fri, 11 Nov 2022 06:04:12 +0000 (22:04 -0800)]
variable-display: Improve coding style and error messages.

2 years agoSORT VARIABLES: Improve error messages.
Ben Pfaff [Fri, 11 Nov 2022 05:50:26 +0000 (21:50 -0800)]
SORT VARIABLES: Improve error messages.

2 years agoMRSETS: Improve error messages.
Ben Pfaff [Fri, 11 Nov 2022 05:48:34 +0000 (21:48 -0800)]
MRSETS: Improve error messages.

2 years agoMATRIX DATA: Improve error messages.
Ben Pfaff [Thu, 10 Nov 2022 15:35:01 +0000 (07:35 -0800)]
MATRIX DATA: Improve error messages.

2 years agoREREAD: Improve error messages and coding style.
Ben Pfaff [Mon, 7 Nov 2022 03:09:16 +0000 (19:09 -0800)]
REREAD: Improve error messages and coding style.

2 years agoDATASET: Improve error messages and coding style.
Ben Pfaff [Sun, 6 Nov 2022 19:54:48 +0000 (11:54 -0800)]
DATASET: Improve error messages and coding style.

2 years agoFILE HANDLE: Improve error messages and coding style.
Ben Pfaff [Sun, 6 Nov 2022 19:52:58 +0000 (11:52 -0800)]
FILE HANDLE: Improve error messages and coding style.

2 years agoGET DATA: Improve coding style and tests.
Ben Pfaff [Sun, 6 Nov 2022 19:33:59 +0000 (11:33 -0800)]
GET DATA: Improve coding style and tests.

2 years agoCORRELATIONS: Rename cmd_correlation() to cmd_correlations() for consistency.
Ben Pfaff [Sun, 6 Nov 2022 19:28:59 +0000 (11:28 -0800)]
CORRELATIONS: Rename cmd_correlation() to cmd_correlations() for consistency.

2 years agoUse lex_error_expecting() in more places.
Ben Pfaff [Sun, 6 Nov 2022 19:41:06 +0000 (11:41 -0800)]
Use lex_error_expecting() in more places.

2 years agofile-handle-def: Style improvements.
Ben Pfaff [Sun, 6 Nov 2022 19:27:59 +0000 (11:27 -0800)]
file-handle-def: Style improvements.

2 years agolexer: New function lex_force_match_phrase().
Ben Pfaff [Sun, 25 Sep 2022 23:01:26 +0000 (16:01 -0700)]
lexer: New function lex_force_match_phrase().

2 years agospvxml-helpers: Avoid warning on recent versions of libxml2.
Ben Pfaff [Sun, 6 Nov 2022 18:42:51 +0000 (10:42 -0800)]
spvxml-helpers: Avoid warning on recent versions of libxml2.

2 years agoformat: Improve error messages.
Ben Pfaff [Wed, 21 Sep 2022 23:32:26 +0000 (16:32 -0700)]
format: Improve error messages.

2 years agodocs: Improve example in DEFINE.
Ben Pfaff [Wed, 21 Sep 2022 23:29:46 +0000 (16:29 -0700)]
docs: Improve example in DEFINE.

2 years agoDATA LIST: Improve error messages and coding style.
Ben Pfaff [Wed, 21 Sep 2022 23:29:32 +0000 (16:29 -0700)]
DATA LIST: Improve error messages and coding style.

2 years agoLOOP: Improve error messages and coding style.
Ben Pfaff [Wed, 21 Sep 2022 23:33:32 +0000 (16:33 -0700)]
LOOP: Improve error messages and coding style.

2 years agoDO REPEAT: Improve error messages and coding style.
Ben Pfaff [Wed, 21 Sep 2022 22:31:54 +0000 (15:31 -0700)]
DO REPEAT: Improve error messages and coding style.

2 years agoRECODE: Improve error messages and coding style.
Ben Pfaff [Tue, 20 Sep 2022 06:13:16 +0000 (23:13 -0700)]
RECODE: Improve error messages and coding style.

2 years agoT-TEST: Improve error messages and coding style.
Ben Pfaff [Mon, 19 Sep 2022 02:59:16 +0000 (19:59 -0700)]
T-TEST: Improve error messages and coding style.

2 years agoSORT CASES: Improve error messages and coding style.
Ben Pfaff [Mon, 19 Sep 2022 02:31:47 +0000 (19:31 -0700)]
SORT CASES: Improve error messages and coding style.

2 years agoRELIABILITY: Improve error messages and coding style.
Ben Pfaff [Mon, 19 Sep 2022 02:08:06 +0000 (19:08 -0700)]
RELIABILITY: Improve error messages and coding style.

2 years agoREGRESSION: Improve error messages and coding style.
Ben Pfaff [Mon, 19 Sep 2022 01:43:01 +0000 (18:43 -0700)]
REGRESSION: Improve error messages and coding style.

2 years agoNPAR TESTS: Improve error messages and coding style.
Ben Pfaff [Mon, 19 Sep 2022 01:15:55 +0000 (18:15 -0700)]
NPAR TESTS: Improve error messages and coding style.

2 years agoMATRIX: Improve error messages.
Ben Pfaff [Sun, 18 Sep 2022 23:47:58 +0000 (16:47 -0700)]
MATRIX: Improve error messages.

2 years agoGLM: Improve error messages.
Ben Pfaff [Sun, 18 Sep 2022 23:47:49 +0000 (16:47 -0700)]
GLM: Improve error messages.

2 years agoFREQUENCIES: Improve error message and coding style.
Ben Pfaff [Sun, 18 Sep 2022 23:42:40 +0000 (16:42 -0700)]
FREQUENCIES: Improve error message and coding style.

2 years agolexer: Make lex_error_expecting_valist() support a longer list.
Ben Pfaff [Sun, 18 Sep 2022 23:42:26 +0000 (16:42 -0700)]
lexer: Make lex_error_expecting_valist() support a longer list.

2 years agoFACTOR: Improve error messages and coding style.
Ben Pfaff [Sun, 18 Sep 2022 21:08:28 +0000 (14:08 -0700)]
FACTOR: Improve error messages and coding style.

2 years agoEXAMINE: Improve error messages.
Ben Pfaff [Sun, 18 Sep 2022 21:08:20 +0000 (14:08 -0700)]
EXAMINE: Improve error messages.

2 years agoNUMERIC, STRING, LEAVE: Improve error messages.
Ben Pfaff [Sun, 18 Sep 2022 20:07:13 +0000 (13:07 -0700)]
NUMERIC, STRING, LEAVE: Improve error messages.

2 years agoRENAME VARIABLES: Remove obsolete comment.
Ben Pfaff [Sun, 18 Sep 2022 19:34:19 +0000 (12:34 -0700)]
RENAME VARIABLES: Remove obsolete comment.

2 years agoMODIFY VARS: Remove.
Ben Pfaff [Sun, 18 Sep 2022 19:33:03 +0000 (12:33 -0700)]
MODIFY VARS: Remove.

2 years agoMISSING VALUES: Improve error messages.
Ben Pfaff [Sat, 17 Sep 2022 16:43:42 +0000 (09:43 -0700)]
MISSING VALUES: Improve error messages.

2 years agoDELETE VARIABLES: Improve error messages.
Ben Pfaff [Fri, 16 Sep 2022 23:14:34 +0000 (16:14 -0700)]
DELETE VARIABLES: Improve error messages.

2 years agoAPPLY DICTIONARY: Style improvements.
Ben Pfaff [Fri, 16 Sep 2022 23:08:25 +0000 (16:08 -0700)]
APPLY DICTIONARY: Style improvements.

2 years agoSAVE TRANSLATE: Improve error messages and implementation of RENAME.
Ben Pfaff [Tue, 13 Sep 2022 02:19:38 +0000 (19:19 -0700)]
SAVE TRANSLATE: Improve error messages and implementation of RENAME.

2 years agoPRINT: Improve error messages.
Ben Pfaff [Tue, 13 Sep 2022 01:48:46 +0000 (18:48 -0700)]
PRINT: Improve error messages.

2 years agoplacement-parser: Improve error messages for format assignment.
Ben Pfaff [Mon, 12 Sep 2022 17:33:13 +0000 (10:33 -0700)]
placement-parser: Improve error messages for format assignment.

2 years agoPRINT SPACE: Improve error messages.
Ben Pfaff [Mon, 12 Sep 2022 16:34:59 +0000 (09:34 -0700)]
PRINT SPACE: Improve error messages.

2 years agoMATRIX DATA: Improve error messages.
Ben Pfaff [Mon, 12 Sep 2022 06:01:53 +0000 (23:01 -0700)]
MATRIX DATA: Improve error messages.

2 years agoLIST: Improve error messages.
Ben Pfaff [Mon, 12 Sep 2022 05:51:13 +0000 (22:51 -0700)]
LIST: Improve error messages.

2 years agoSET: Improve error messages for SET CCx.
Ben Pfaff [Mon, 12 Sep 2022 05:33:15 +0000 (22:33 -0700)]
SET: Improve error messages for SET CCx.

2 years agoImprove error messages for format specifiers.
Ben Pfaff [Mon, 12 Sep 2022 05:10:40 +0000 (22:10 -0700)]
Improve error messages for format specifiers.

2 years agoMATCH FILES, UPDATE, ADD FILES: Improve error messages.
Ben Pfaff [Mon, 12 Sep 2022 03:50:33 +0000 (20:50 -0700)]
MATCH FILES, UPDATE, ADD FILES: Improve error messages.

2 years agoSHOW: Display settings in pivot table.
Ben Pfaff [Mon, 12 Sep 2022 01:30:51 +0000 (18:30 -0700)]
SHOW: Display settings in pivot table.

2 years agoAssorted improvements to diagnostics.
Ben Pfaff [Mon, 12 Sep 2022 00:30:07 +0000 (17:30 -0700)]
Assorted improvements to diagnostics.

2 years agoINSERT: Add testing-only feature for ignoring cascading failures.
Ben Pfaff [Mon, 12 Sep 2022 00:24:42 +0000 (17:24 -0700)]
INSERT: Add testing-only feature for ignoring cascading failures.

This makes it easier to write tests that cause a lot of cascading failures.

2 years agoAGGREGATE: Bring up to speed.
Ben Pfaff [Sun, 11 Sep 2022 19:23:10 +0000 (12:23 -0700)]
AGGREGATE: Bring up to speed.

2 years agoDEFINE: Don't label a declaration, for C99 compatibility.
Ben Pfaff [Sun, 11 Sep 2022 19:08:43 +0000 (12:08 -0700)]
DEFINE: Don't label a declaration, for C99 compatibility.

Thanks to Friedrich Beckmann for reporting the problem.

Fixes: 36fc62cea799 ("macro: Coding style improvement in macro_tokens_from_string().")Fixes: b8f7ae6610f0 ("DEFINE: Improve error messages for parsing macro body.")
2 years agoAGGREGATE: Improve stats accumulation data structure.
Ben Pfaff [Sun, 11 Sep 2022 19:04:09 +0000 (12:04 -0700)]
AGGREGATE: Improve stats accumulation data structure.

2 years agostr: Replace ss_alloc_substring() by ss_clone() and similarly with a pool.
Ben Pfaff [Sun, 11 Sep 2022 18:40:02 +0000 (11:40 -0700)]
str: Replace ss_alloc_substring() by ss_clone() and similarly with a pool.

This makes it possible to use in an initializer.

2 years agoAGGREGATE: Use array instead of linked list.
Ben Pfaff [Sun, 11 Sep 2022 18:12:21 +0000 (11:12 -0700)]
AGGREGATE: Use array instead of linked list.

2 years agoAGGREGATE: Remove write-only struct member.
Ben Pfaff [Sun, 11 Sep 2022 18:10:11 +0000 (11:10 -0700)]
AGGREGATE: Remove write-only struct member.