Ben Pfaff [Tue, 18 Jan 2022 03:19:27 +0000 (19:19 -0800)]
spv-legacy-decoder: Always give the pivot table a title.
A pivot table must have a title. Some parts of PSPP rely on that. The
legacy SPV decoder didn't ensure this, and one SPV in my corpus didn't have
one, which led to null pointer dereferences, so this commit fixes the
problem.
Ben Pfaff [Mon, 30 May 2022 18:05:45 +0000 (11:05 -0700)]
perl-module: Copy Perl module from srcdir to builddir before distributing.
I ran into an issue where the Perl tests were failing in distcheck, but
not in check. I changed the sources for the Perl module, but distcheck
still used the old ones. It turns out that "make dist" uses files from
the builddir, which "make dist" wasn't updating from the srcdir because
that only happened when the Perl module was actually built, which "make
dist" and "make distcheck" don't do.
This commit fixes the problem by ensuring that the Perl module files get
updated in the builddir on "make dist".
Ben Pfaff [Mon, 30 May 2022 17:28:19 +0000 (10:28 -0700)]
perl-module: Remove test for memory usage.
This test only works if you're lucky. It doesn't work with Address
Sanitizer and it doesn't seem to work with current versions of Perl.
(It might be that there's a real leak, but I don't know how to debug
it in that case.)
Ben Pfaff [Sat, 28 May 2022 01:29:20 +0000 (18:29 -0700)]
gui: For text data import, use the same parser for preview as for import.
There were odd discrepancies between the preview code in the GUI for
text data import and the code in GET DATA /TYPE=TXT that implemented the
eventual import. This commit unifies the two parsers, dropping the one
that was used only for preview. This should prevent further discrepancies.
Bug #61809.
Thanks to Friedrich Beckmann for reporting this bug.
Ben Pfaff [Sat, 28 May 2022 00:15:02 +0000 (17:15 -0700)]
data-parser: Make data parser not require a dictionary.
An upcoming commit will make the GUI's text import use this code too, in
a context where a dictionary isn't yet available. The data parser only
uses the dictionary for one specific purpose that isn't relevant for the
GUI, so remove the need for it.
Ben Pfaff [Fri, 27 May 2022 19:55:47 +0000 (12:55 -0700)]
gui: Honor quotes in the text data import dialog.
The text data import dialog's preview of the data to be read
didn't honor the quotes but always treated " and ' and (weirdly)
parentheses as quotes. This makes it honor the user's settings.
Bug #61809.
Thanks for Friedrich Beckmann for reporting this bug.
Ben Pfaff [Sun, 10 Apr 2022 15:47:00 +0000 (08:47 -0700)]
expressions: Convert SYSMIS into int as INT_MIN during optimization too.
In an expression like LPAD('abc', $sysmis), the LPAD function is evaluated
using a C function that takes an 'int' as its second argument. During
expression evaluation, out-of-range values get converted into SYSMIS by
the NUM_TO_INTEGER operator that gets automatically inserted to ensure
that, and then SYSMIS gets converted into INT_MIN to pass to the C
function. This worked OK for runtime evaluation, but the optimizer failed
to do the conversion of SYSMIS to INT_MIN, which yielded undefined
behavior. Some platforms (e.g. GCC on x86) converted SYSMIS (which is
the second-smallest 'double' value) into INT_MIN, so no problem showed up
there, but other platforms yielded INT_MAX, causing unexpected failures.
This commit fixes the problem by explicitly converting SYSMIS into INT_MIN
during optimization.
Thanks to Friedrich Beckmann for reporting and uncovering the problem.
Bug #62267.
All comments which start with TRANSLATORS are visible for the
translators. The previous message is only visible if the translator
looks into the source code.
bug #62189: Fixed clipped numbers in histogram legend
I modified the legend rendering to avoid the clipping of mean and
standard deviation in the legend of the histogram plot. In addition
I changed the number print format to also show reasonable numbers
for small values.
Windows: Native build failed due to missing gnulib dependencies
The windows build failed because the gnulib header files were not
build before the compilation of c files for the native build.
The gnulib headers are
listed in the BUILT_SOURCES but that must be the first dependency
before the object files belonging to the executable. This is the
case for the default make target but not for an individual
executable like src/ui/terminal/pspp. I adapted the make file
to use the default make target.
See: https://www.gnu.org/software/automake/manual/html_node/Sources.html
Windows build: Adapted icon names to org.fsf.pspp naming
Ben changed the icon names to a naming scheme using org.fsf.xxx
The changes were missing in the windows build resulting in a
build failure for the windows target.
Ben Pfaff [Sun, 13 Mar 2022 19:34:36 +0000 (12:34 -0700)]
Switch from recursive to non-recursive use of Gnulib.
This allows for better use of dependencies in Makefiles. It causes a new
warning from Automake, which I hope to fix through a change to Gnulib
sometime soon. I'm consulting the other Gnulib maintainers on that:
https://lists.gnu.org/archive/html/bug-gnulib/2022-03/msg00044.html
Ben Pfaff [Sun, 13 Mar 2022 18:32:58 +0000 (11:32 -0700)]
Update to newest gnulib.
This required a dependency on Automake 1.11 or later. It also required
dropping C2x compatibility warnings because Gnulib now triggers them. The
Gnulib tempname module requires linking against $(LIB_GETRANDOM), so this
adds that in each case where the build links against libgl.
Ben Pfaff [Thu, 13 Jan 2022 05:50:54 +0000 (21:50 -0800)]
psppire-dialog-action-crosstabs: Do not add PIVOT or NOPIVOT to command.
The CROSSTABS command does not support /FORMAT=PIVOT or /FORMAT=NOPIVOT.
I can't find any evidence that it ever did. Perhaps q2c ignored keywords
it didn't recognize? SPSS does not document support for any such format
keywords, so it's better to remove them from the emitted syntax than to
add support to CROSSTABS.
Thanks to Alexandra Younger for reporting the issue.
Ben Pfaff [Sat, 1 Jan 2022 19:01:00 +0000 (11:01 -0800)]
FREQUENCIES: Fix percentiles and median calculation for multiple variables.
The calculations here were using the same space each time for
calculating percentiles and median, but different areas are needed. This
commit fixes the problem.
Bug #60728.
Thanks to elias tsolis for reporting the problem.
Ben Pfaff [Fri, 31 Dec 2021 19:06:48 +0000 (11:06 -0800)]
Replace more uses of 'cnt' by 'n'.
This continues the work begun in commit 339f1956cc72 ("treewide: Replace
<name>_cnt by n_<name>s and <name>_cap by allocated_<name>.") by replacing
more uses of 'cnt' by 'n', which I think is a better choice these days.
Ben Pfaff [Thu, 30 Dec 2021 21:58:12 +0000 (13:58 -0800)]
Change how checking for missing values works.
It's more flexible to have the functions that check for missing values
return what kind of missing value was found (or 0 if none), than to have
to pass in the kind of missing values to check for.
Ben Pfaff [Sun, 19 Dec 2021 23:41:50 +0000 (15:41 -0800)]
expressions: Major work to improve error messages.
This makes the error messages related to expressions much better, by being
more precise about the location of the problem. It also fixes a number of
documentation and compatibility issues encountered along the way, as well
as redoing the testsuite for expressions to make it easier to understand
and to work on.
Ben Pfaff [Sat, 25 Dec 2021 22:12:39 +0000 (14:12 -0800)]
expressions: Fix built sources.
The dependencies were incomplete for the built sources, which meant that
build errors often came up if one built particular targets, e.g. for
"make src/ui/terminal/pspp". This fixes the problem.
Ben Pfaff [Thu, 16 Dec 2021 04:20:48 +0000 (20:20 -0800)]
MATRIX: Update EVAL test to avoid failure on i386.
The i386 buildbot produced different precision for the eigenvalues
(integers rather than almost-integers), which isn't a significant
difference. This commit should avoid the problem.
Ben Pfaff [Fri, 10 Dec 2021 06:23:59 +0000 (22:23 -0800)]
Clean up how transformations work.
Transformations had a messy system that included "finalizers" that needed
to be called before a chain could be executed and the need to keep track
of relative offsets for control flow. This commit reworks and simplifies
the whole thing.
Also adds some INPUT PROGRAM, LOOP, and DO IF tests.
Ben Pfaff [Thu, 9 Dec 2021 23:03:45 +0000 (15:03 -0800)]
treewide: Replace <name>_cnt by n_<name>s and <name>_cap by allocated_<name>.
I used to think that _cnt was a good suffix for a count representing the
number of items in an array, but I haven't used that convention in a long
time and it looks wrong now. This changes these to an n_ prefix instead.
Similarly, but in far fewer cases, replace <name>_cap for the allocated
capacity of an array by allocated_<name>.
This doesn't change the name of ref_cnt members used as reference counts.
Those are pure counts, not the length of anything.
This doesn't change the Perl library because that's an external API.
Ben Pfaff [Tue, 23 Nov 2021 03:16:48 +0000 (19:16 -0800)]
lexer: Allow for negative lookahead within a command.
This allows to getting the location of prior tokens within a command,
which makes it easier to find the end of a group of tokens that was just
parsed by referring to the token at offset -1.
Ben Pfaff [Mon, 22 Nov 2021 19:45:48 +0000 (11:45 -0800)]
lexer: Keep entire source file in memory.
Previously, the lexer tried to keep only part of each source file in
memory, the part that wasn't fully parsed yet. With this commit, the
lexer holds the entire file in memory, even parts that are no longer
needed. This should make it easier to produce better error messages.
Ben Pfaff [Mon, 6 Dec 2021 05:18:22 +0000 (21:18 -0800)]
distributions: New module for probability distribution functions.
These functions are currently just used in expressions, but in an upcoming
commit they will also be used in matrices, so this commit makes them more
widely available.
Ben Pfaff [Mon, 6 Dec 2021 17:02:30 +0000 (09:02 -0800)]
lexer: Be consistent across 32/64 bit in lex_force_int_range().
The exact error message that this function reported varied between 32-
and 64-bit platforms for invalid integers that require more than 32 bits
but no more than 64 bits, since "long int" has a different range between
those platforms. This commit fixes the problem.
This issue caused the test "testing lexer crash due to overflow" to fail
on 32-bit platforms.
Thanks to Friedrich Beckmann for reporting the problem.