pspp
20 months agowork
Ben Pfaff [Sun, 6 Aug 2023 21:50:41 +0000 (14:50 -0700)]
work

20 months agowork
Ben Pfaff [Sun, 6 Aug 2023 19:08:19 +0000 (12:08 -0700)]
work

20 months agowork
Ben Pfaff [Sun, 6 Aug 2023 17:12:52 +0000 (10:12 -0700)]
work

20 months agowork
Ben Pfaff [Sun, 6 Aug 2023 05:13:22 +0000 (22:13 -0700)]
work

20 months agomore work on parser
Ben Pfaff [Sat, 5 Aug 2023 21:02:55 +0000 (14:02 -0700)]
more work on parser

20 months agowork
Ben Pfaff [Thu, 3 Aug 2023 15:44:54 +0000 (08:44 -0700)]
work

20 months agoconverters maps work
Ben Pfaff [Wed, 2 Aug 2023 05:21:13 +0000 (22:21 -0700)]
converters maps work

20 months agowork
Ben Pfaff [Wed, 2 Aug 2023 01:20:25 +0000 (18:20 -0700)]
work

20 months agosack is fully implemented
Ben Pfaff [Tue, 1 Aug 2023 17:07:06 +0000 (10:07 -0700)]
sack is fully implemented

20 months agosack works
Ben Pfaff [Tue, 1 Aug 2023 05:05:29 +0000 (22:05 -0700)]
sack works

20 months agowork
Ben Pfaff [Mon, 31 Jul 2023 18:06:57 +0000 (11:06 -0700)]
work

20 months agowork
Ben Pfaff [Mon, 31 Jul 2023 17:53:58 +0000 (10:53 -0700)]
work

20 months agowork
Ben Pfaff [Mon, 31 Jul 2023 16:50:46 +0000 (09:50 -0700)]
work

20 months agoAdd file names and line numbers to error messages.
Ben Pfaff [Sun, 30 Jul 2023 15:27:30 +0000 (08:27 -0700)]
Add file names and line numbers to error messages.

20 months agoseparate sack integration test binary
Ben Pfaff [Sun, 30 Jul 2023 14:43:33 +0000 (07:43 -0700)]
separate sack integration test binary

20 months agofinish sack library
Ben Pfaff [Sat, 29 Jul 2023 23:26:22 +0000 (16:26 -0700)]
finish sack library

20 months agosack making progress!
Ben Pfaff [Sat, 29 Jul 2023 19:21:20 +0000 (12:21 -0700)]
sack making progress!

20 months agowork on testing
Ben Pfaff [Sat, 29 Jul 2023 16:17:48 +0000 (09:17 -0700)]
work on testing

20 months agoparse zlib header and trailer
Ben Pfaff [Sat, 29 Jul 2023 04:37:35 +0000 (21:37 -0700)]
parse zlib header and trailer

20 months agoput common state into struct
Ben Pfaff [Sat, 29 Jul 2023 04:28:36 +0000 (21:28 -0700)]
put common state into struct

20 months agoactually use the new state machine
Ben Pfaff [Sat, 29 Jul 2023 03:47:37 +0000 (20:47 -0700)]
actually use the new state machine

20 months agozlib-compressed data compiles
Ben Pfaff [Sat, 29 Jul 2023 03:12:48 +0000 (20:12 -0700)]
zlib-compressed data compiles

20 months agowork (zlib works?)
Ben Pfaff [Fri, 28 Jul 2023 20:19:45 +0000 (13:19 -0700)]
work (zlib works?)

20 months agowork
Ben Pfaff [Fri, 28 Jul 2023 13:38:56 +0000 (06:38 -0700)]
work

20 months agowork
Ben Pfaff [Thu, 27 Jul 2023 16:08:45 +0000 (09:08 -0700)]
work

20 months agowork
Ben Pfaff [Wed, 26 Jul 2023 06:07:57 +0000 (23:07 -0700)]
work

20 months agowork
Ben Pfaff [Wed, 26 Jul 2023 03:38:21 +0000 (20:38 -0700)]
work

20 months agowork
Ben Pfaff [Tue, 25 Jul 2023 05:58:30 +0000 (22:58 -0700)]
work

20 months agowork
Ben Pfaff [Tue, 25 Jul 2023 02:48:39 +0000 (19:48 -0700)]
work

20 months agowork
Ben Pfaff [Tue, 25 Jul 2023 00:34:56 +0000 (17:34 -0700)]
work

20 months agowork on rust
Ben Pfaff [Mon, 24 Jul 2023 16:02:56 +0000 (09:02 -0700)]
work on rust

21 months agomore library work
Ben Pfaff [Sun, 23 Jul 2023 23:00:04 +0000 (16:00 -0700)]
more library work

21 months agomore work on library
Ben Pfaff [Sun, 23 Jul 2023 22:25:27 +0000 (15:25 -0700)]
more work on library

21 months agoWork on system file library.
Ben Pfaff [Sun, 23 Jul 2023 21:19:26 +0000 (14:19 -0700)]
Work on system file library.

21 months agofeature complete
Ben Pfaff [Sun, 23 Jul 2023 18:12:35 +0000 (11:12 -0700)]
feature complete

21 months agoI think it's complete.
Ben Pfaff [Sun, 23 Jul 2023 05:48:28 +0000 (22:48 -0700)]
I think it's complete.

21 months agowork
Ben Pfaff [Sat, 22 Jul 2023 20:09:36 +0000 (13:09 -0700)]
work

2 years agorust
Ben Pfaff [Sun, 16 Apr 2023 23:38:50 +0000 (16:38 -0700)]
rust

2 years agowork on rust version of pspp-dump-sav
Ben Pfaff [Sun, 19 Mar 2023 00:50:19 +0000 (17:50 -0700)]
work on rust version of pspp-dump-sav

2 years agoMATRIX: Check format specifier on PRINT command.
Ben Pfaff [Sat, 18 Mar 2023 21:41:40 +0000 (14:41 -0700)]
MATRIX: Check format specifier on PRINT command.

Thanks to Youngseok Choi for reporting the bug.

2 years agolexer: Avoid reentering the lexer upon error in special cases.
Ben Pfaff [Sat, 18 Mar 2023 21:09:38 +0000 (14:09 -0700)]
lexer: Avoid reentering the lexer upon error in special cases.

Thanks to Youngseok Choi for reporting the bug.

2 years agolexer: Simplify lex_get_error().
Ben Pfaff [Sat, 18 Mar 2023 21:25:08 +0000 (14:25 -0700)]
lexer: Simplify lex_get_error().

2 years agolexer: Get rid of useless code in lex_get_error().
Ben Pfaff [Sat, 18 Mar 2023 20:55:40 +0000 (13:55 -0700)]
lexer: Get rid of useless code in lex_get_error().

This function ellipsized the syntax and then didn't do anything with the
result.

2 years agodata-out: Make binary output buffer big enough for a null terminator.
Ben Pfaff [Sat, 18 Mar 2023 19:34:39 +0000 (12:34 -0700)]
data-out: Make binary output buffer big enough for a null terminator.

The max width for binary output is 16, for P or PK format, plus there
needs to be room for a null terminator, for a total width of 17 bytes.
The buffer here was undersized at only 16 bytes.  This commit fixes the
problem.

Thanks to Youngseok Choi for reporting the bug.

2 years agoMATRIX: Fix multiplication of empty matrices.
Ben Pfaff [Sat, 18 Mar 2023 19:22:42 +0000 (12:22 -0700)]
MATRIX: Fix multiplication of empty matrices.

This crashed due to an assertion failure in blas before.
Thanks to Youngseok Choi for reporting the bug.

2 years agodoc: Improve documentation for GET DATA/TYPE=PSQL.
Ben Pfaff [Sat, 18 Mar 2023 19:10:07 +0000 (12:10 -0700)]
doc: Improve documentation for GET DATA/TYPE=PSQL.

Reported by Kent Nassen.

2 years agoEnsure that interactive output appears without a one-command delay.
Ben Pfaff [Sat, 18 Mar 2023 18:43:16 +0000 (11:43 -0700)]
Ensure that interactive output appears without a one-command delay.

When pspp was run in the text-based mode interactively, output for a given
command only appeared after the next command was read.  This fixes the
problem and adds a test.

Thanks to the anonymous reporter.

Bug #63910.

2 years agoFix typo in manual.
Ben Pfaff [Wed, 8 Mar 2023 01:30:09 +0000 (17:30 -0800)]
Fix typo in manual.

Reported by knassen@chartermi.net.

2 years agoCLOSE FILE HANDLE: Fix bugs and add test.
Ben Pfaff [Tue, 7 Mar 2023 20:37:39 +0000 (12:37 -0800)]
CLOSE FILE HANDLE: Fix bugs and add test.

In addition to the particular bug that was reported, there was a memory
leak.  This commit fixes both.

Reported by knassen@chartermi.net.

2 years agoSHOW: Implement SHOW ENVIRONMENT.
Ben Pfaff [Tue, 7 Mar 2023 05:16:37 +0000 (21:16 -0800)]
SHOW: Implement SHOW ENVIRONMENT.

Requested by knassen@chartermi.net.

2 years agoDATA LIST: Fix crash with a bare / at the end of the command.
Ben Pfaff [Tue, 7 Mar 2023 01:00:13 +0000 (17:00 -0800)]
DATA LIST: Fix crash with a bare / at the end of the command.

Embarrassingly, this was in an example from the manual.

Reported by knassen@chartermi.net.

2 years agocase-map: Make creating a case_map destroy the stage.
Ben Pfaff [Sun, 5 Mar 2023 19:14:45 +0000 (11:14 -0800)]
case-map: Make creating a case_map destroy the stage.

This fit the usage model in every case in practice.

2 years agodataset: Replace 'compactor' by a translating casewriter.
Ben Pfaff [Sun, 5 Mar 2023 19:08:00 +0000 (11:08 -0800)]
dataset: Replace 'compactor' by a translating casewriter.

2 years agocase-map: Identity map is only when there are no changes at all.
Ben Pfaff [Sun, 5 Mar 2023 19:07:38 +0000 (11:07 -0800)]
case-map: Identity map is only when there are no changes at all.

case_map_stage_get_case_map() called a mapping an identity map when no
data was reordered, which left the possibility that data was removed from
the end would be called an identity map.  This seems like a bad idea, so
this commit tightens the criteria.

This is a bigger than necessary change that also avoids per-variable
malloc()s that weren't really needed.

This might be a bug fix.  I haven't identified a particular bug that
it fixes.

2 years agocase-map: Optimize case_map_create_output_translator() for no-op case.
Ben Pfaff [Sun, 5 Mar 2023 19:04:29 +0000 (11:04 -0800)]
case-map: Optimize case_map_create_output_translator() for no-op case.

2 years agodictionary: Get rid of case indexes.
Ben Pfaff [Sun, 5 Mar 2023 06:26:03 +0000 (22:26 -0800)]
dictionary: Get rid of case indexes.

Dictionary index (the index into the variables in the dictionary)
and case index (the index into struct ccase for a variable from
the dictionary) have always been independent, but they are
*usually* the same.  It is much cleaner to have an invariant
that they are *always* the same.  This commit makes that the case.

2 years agodictionary: Short-circuit no-op case in dict_reorder_var().
Ben Pfaff [Sun, 5 Mar 2023 17:23:53 +0000 (09:23 -0800)]
dictionary: Short-circuit no-op case in dict_reorder_var().

2 years agodictionary: Always compact immediately upon deletion of a variable.
Ben Pfaff [Sun, 5 Mar 2023 03:06:12 +0000 (19:06 -0800)]
dictionary: Always compact immediately upon deletion of a variable.

With this change, the dictionary has a new invariant that the case_indexes
are always a permutation of [0,N) where N is the number of variables in
the dictionary.  Most commonly, the case_indexes are the same as the
dict_indexes, but reordering the dictionary can permute them.

2 years agopc+-file-reader: Drop unneeded struct member.
Ben Pfaff [Sat, 4 Mar 2023 16:31:29 +0000 (08:31 -0800)]
pc+-file-reader: Drop unneeded struct member.

2 years agodictionary: Get rid of "internal var" concept.
Ben Pfaff [Sat, 4 Mar 2023 02:45:00 +0000 (18:45 -0800)]
dictionary: Get rid of "internal var" concept.

It's nasty and doesn't conform to the usual invariants.

2 years agocase-map: Simplify case_map_stage_get_case_map().
Ben Pfaff [Sat, 4 Mar 2023 01:56:15 +0000 (17:56 -0800)]
case-map: Simplify case_map_stage_get_case_map().

A caseproto can't contain -1s anymore, so don't look for them.

2 years agocase-map: Remove buggy and unused case_map_clone().
Ben Pfaff [Sat, 4 Mar 2023 01:55:12 +0000 (17:55 -0800)]
case-map: Remove buggy and unused case_map_clone().

The xmemdup() in the implementation copied 'old->proto' to 'new->map',
which can't possibly work.  We could fix it but it wasn't used anyway.

2 years agodictionary: Get rid of next_value_idx.
Ben Pfaff [Sat, 4 Mar 2023 01:31:36 +0000 (17:31 -0800)]
dictionary: Get rid of next_value_idx.

At this point, it was always the number of variables in the dictionary.

2 years agocaseproto: Disallow -1 elements in caseprotos.
Ben Pfaff [Sat, 4 Mar 2023 00:49:33 +0000 (16:49 -0800)]
caseproto: Disallow -1 elements in caseprotos.

This is a stronger invariant that should make PSPP code easier to
understand.

It required updating dict_get_proto() to avoid intermediate stages in
which a -1 appeared as a width.

2 years agocaseproto: Allocate base struct and widths separately.
Ben Pfaff [Sat, 4 Mar 2023 00:43:52 +0000 (16:43 -0800)]
caseproto: Allocate base struct and widths separately.

This will allow constructing a caseproto from a passed-in array
without copying it.

2 years agodataset: Before deleting variables, make sure new values are added.
Ben Pfaff [Sat, 4 Mar 2023 00:43:59 +0000 (16:43 -0800)]
dataset: Before deleting variables, make sure new values are added.

This fixes a crash reported privately by knassen(at)chartermi.net.

2 years agocaseinit: Introduce new caseinit_translate_casereader_to_init_vars().
Ben Pfaff [Thu, 2 Mar 2023 22:25:30 +0000 (14:25 -0800)]
caseinit: Introduce new caseinit_translate_casereader_to_init_vars().

2 years agoMakefiles: Make a couple of targets build more quietly.
Ben Pfaff [Sun, 5 Mar 2023 17:24:30 +0000 (09:24 -0800)]
Makefiles: Make a couple of targets build more quietly.

2 years agocaseproto: Fix calculation in caseproto_reserve().
Ben Pfaff [Sat, 4 Mar 2023 00:32:24 +0000 (16:32 -0800)]
caseproto: Fix calculation in caseproto_reserve().

This reserved way too much in a lot of cases.

2 years agoDO REPEAT: Order PRINT output correctly.
Ben Pfaff [Thu, 2 Mar 2023 22:16:25 +0000 (14:16 -0800)]
DO REPEAT: Order PRINT output correctly.

This was printed in reverse order, although the commands were executed in
the correct order.

2 years agoUpdate README.
Ben Pfaff [Mon, 27 Feb 2023 18:00:48 +0000 (10:00 -0800)]
Update README.

The PSPP output subsystem is now pretty good and I don't think that it's
necessary to include it as future work anymore.

I haven't heard anything about OpenBSD in a while, so I don't think it's
necessary to list its tests as an explicit caveat.

These days I tend to prefer hearing bug reports via email.

2 years agoAdd support for variable sets in the system file format.
Ben Pfaff [Sun, 26 Feb 2023 01:48:46 +0000 (17:48 -0800)]
Add support for variable sets in the system file format.

Variable sets are primarily a GUI feature, but this commit doesn't
implement them in the GUI.

2 years agodictionary: Avoid name shadowing in dict_clone().
Ben Pfaff [Mon, 27 Feb 2023 04:26:44 +0000 (20:26 -0800)]
dictionary: Avoid name shadowing in dict_clone().

In this case, it wasn't a bug, but it was confusing.

2 years agoAvoid another possible null pointer dereference
John Darrington [Sun, 26 Feb 2023 10:21:24 +0000 (11:21 +0100)]
Avoid another possible null pointer dereference

* modified:   tests/output/tex-strings.c

2 years agoAvoid possible null pointer dereference
John Darrington [Sun, 26 Feb 2023 09:59:50 +0000 (10:59 +0100)]
Avoid possible null pointer dereference

* modified:   src/ui/gui/psppire-encoding-selector.c

2 years agotreewide: Use struct fmt_spec by value instead of pointer in most cases.
Ben Pfaff [Sun, 26 Feb 2023 00:51:00 +0000 (16:51 -0800)]
treewide: Use struct fmt_spec by value instead of pointer in most cases.

struct fmt_spec is a small struct, only 4 bytes in size.  It doesn't make
sense to pass it by pointer in most cases.  This commit makes that change
treewide.

2 years agopivot-table: Force width of weight formats to 40.
Ben Pfaff [Sat, 25 Feb 2023 03:01:15 +0000 (19:01 -0800)]
pivot-table: Force width of weight formats to 40.

It was too confusing when output tables contained **** because of weight
variables with narrow widths.

Recently reported by Andreas Hammer.  I've also noticed the same thing
myself.

2 years agodictionary: Make dict_get_weight_format() return by value, not pointer.
Ben Pfaff [Sat, 25 Feb 2023 02:46:48 +0000 (18:46 -0800)]
dictionary: Make dict_get_weight_format() return by value, not pointer.

This seems like a better interface.

2 years agoDISPLAY MACROS: New command.
Ben Pfaff [Tue, 21 Feb 2023 19:05:16 +0000 (11:05 -0800)]
DISPLAY MACROS: New command.

2 years agoDELETE VARIABLES: Fix bugs related to details of case compaction.
Ben Pfaff [Mon, 20 Feb 2023 22:56:34 +0000 (14:56 -0800)]
DELETE VARIABLES: Fix bugs related to details of case compaction.

We have to change AUTORECODE and RANK so that they don't add a
transformation, since transformations prevent DELETE VARIABLES.

Thanks to Frans Houweling for reporting the problem.

2 years agocase-map: New function case_map_clone().
Ben Pfaff [Tue, 21 Feb 2023 04:00:23 +0000 (20:00 -0800)]
case-map: New function case_map_clone().

This will acquire its first user in an upcoming commit.

2 years agocase-map: Use stateless translator in case_map_create_input_translator().
Ben Pfaff [Mon, 20 Feb 2023 23:50:28 +0000 (15:50 -0800)]
case-map: Use stateless translator in case_map_create_input_translator().

Case mapping isn't stateful, so this could be more efficient in some cases.

2 years agocasereader-translator: Add a class for casereader translators.
Ben Pfaff [Mon, 20 Feb 2023 23:47:52 +0000 (15:47 -0800)]
casereader-translator: Add a class for casereader translators.

This will make it easier to pass these around from one function to another.

2 years agodoc: Avoid using stdout in Makefile rule to generate .spv files.
Ben Pfaff [Tue, 21 Feb 2023 01:48:54 +0000 (17:48 -0800)]
doc: Avoid using stdout in Makefile rule to generate .spv files.

When pspp writes anything to stdout, also writing the .spv file to stdout
causes confusing corruption.  This avoids the problem.

2 years agozip-reader: Report corrupted Zip archives.
Ben Pfaff [Mon, 20 Feb 2023 20:01:16 +0000 (12:01 -0800)]
zip-reader: Report corrupted Zip archives.

2 years agotests: Fix ODR violations rather than ignoring them.
Ben Pfaff [Mon, 20 Feb 2023 20:00:42 +0000 (12:00 -0800)]
tests: Fix ODR violations rather than ignoring them.

2 years agoconfigure: Work around Gnulib warning with GCC 12.x.
Ben Pfaff [Mon, 20 Feb 2023 19:59:21 +0000 (11:59 -0800)]
configure: Work around Gnulib warning with GCC 12.x.

This keeps getting in my way.  I assume that either Gnulib or GCC will
eventually get fixed, so work around it for now.

2 years agoFix understanding of how long string variable missing values work.
Ben Pfaff [Mon, 20 Feb 2023 18:44:38 +0000 (10:44 -0800)]
Fix understanding of how long string variable missing values work.

Thanks to Andreas Hammer for reporting this bug at
https://lists.gnu.org/archive/html/pspp-users/2023-02/msg00000.html.

The data file that triggered this bug is ESS10SC.sav, available from
https://ess-search.nsd.no/en/study/172ac431-2a06-41df-9dab-c1fd8f3877e7

2 years agodictionary: Fix misuse of DC_* treewide.
Ben Pfaff [Mon, 20 Feb 2023 17:48:50 +0000 (09:48 -0800)]
dictionary: Fix misuse of DC_* treewide.

The DC_* constants are bit values, but some code was using them as shift
offsets.  This fixes the problem.

2 years agoCTABLES: Always show computed categories even if they'd be zeros.
Ben Pfaff [Sat, 18 Feb 2023 00:12:21 +0000 (16:12 -0800)]
CTABLES: Always show computed categories even if they'd be zeros.

With CATEGORIES EXCLUDE=YES, empty computed categories weren't shown.  This
seems counterintuitive, so this commit fixes it.

Thanks to Frans Houweling for reporting this bug.

2 years agoCTABLES: Don't force the look to include empty rows and columns.
Ben Pfaff [Fri, 17 Feb 2023 17:46:45 +0000 (09:46 -0800)]
CTABLES: Don't force the look to include empty rows and columns.

Frans Houweling said that it looked wrong, and I don't have a strong reason
to do it.

2 years agopivot-table: Honor blank variable labels.
Ben Pfaff [Fri, 17 Feb 2023 16:39:35 +0000 (08:39 -0800)]
pivot-table: Honor blank variable labels.

pivot_value_new_variable() ignored empty-string variable labels.  This
honors them.

Requested by Frans Houweling.

2 years agooutput: Link cairo and libxml2 against liboutput.
Ben Pfaff [Fri, 17 Feb 2023 00:22:27 +0000 (16:22 -0800)]
output: Link cairo and libxml2 against liboutput.

This is almost meaningless to me but the bug reporter said it fixed
something.

Bug #63606.
Thanks to Michael Orlitzky for reporting the bug.

2 years agoAGGREGATE: Fix crash with temporary transformations.
Ben Pfaff [Fri, 17 Feb 2023 00:17:42 +0000 (16:17 -0800)]
AGGREGATE: Fix crash with temporary transformations.

Thanks to Frans Houweling for reporting this bug at
https://lists.gnu.org/archive/html/bug-gnu-pspp/2023-01/msg00004.html

2 years agodictionary: Fix invariant that no split file vars means SPLIT_NONE.
Ben Pfaff [Thu, 16 Feb 2023 23:59:45 +0000 (15:59 -0800)]
dictionary: Fix invariant that no split file vars means SPLIT_NONE.

Add SHOW SPLIT to enable testing.

Fixes a crash bug reported by Frans Houweling
at https://lists.gnu.org/archive/html/bug-gnu-pspp/2023-01/msg00011.html

2 years agoCROSSTABS: Always cite all the dimensions if there are too many.
Ben Pfaff [Thu, 16 Feb 2023 23:24:05 +0000 (15:24 -0800)]
CROSSTABS: Always cite all the dimensions if there are too many.

Otherwise, 32-bit and 64-bit systems cite different sets of dimensions,
which makes the test output change between i386 and x86-64.

Thanks to Friedrich Beckmann for reporting this bug.
Bug #63797.

2 years agoCROSSTABS: Fix confidence interval display for risk estimate output.
Ben Pfaff [Thu, 16 Feb 2023 23:14:50 +0000 (15:14 -0800)]
CROSSTABS: Fix confidence interval display for risk estimate output.

Bug #63747.

2 years agopivot-table-test: Add paged PDF output too.
Ben Pfaff [Thu, 16 Feb 2023 22:19:34 +0000 (14:19 -0800)]
pivot-table-test: Add paged PDF output too.

2 years agorender: Fix spanned width distribution for cells not at top or left.
Ben Pfaff [Sun, 22 Jan 2023 20:32:59 +0000 (12:32 -0800)]
render: Fix spanned width distribution for cells not at top or left.

This code always used the widths of rules at the left or top side of the
table, even in cases where the spanned cells were not at the top of left
side of the table.  This obviously made the calculations wrong sometimes.

2 years agospv-writer: Use correct namespaces for pageSetup.
Ben Pfaff [Sat, 11 Feb 2023 17:20:46 +0000 (09:20 -0800)]
spv-writer: Use correct namespaces for pageSetup.

This turns out to be important.