Ben Pfaff [Mon, 29 Aug 2022 17:02:48 +0000 (10:02 -0700)]
Improve error messages by citing syntax in more of them.
A while back, PSPP gained the ability to cite particular tokens in
diagnostics, but few of the existing messages were enhanced to do
so. This commit adds this to several more of them, in particular
all of the messages that used lex_error() and variations.
Ben Pfaff [Sun, 28 Aug 2022 23:23:46 +0000 (16:23 -0700)]
CTABLES: Make ID values reproducible when category labels are moved.
ID values were assigned in an arbitrary order when category labels were
moved, because the pivot table leaf index for the category dimension was
not included in the sort. This fixes the problem.
This also factors finding the category leaf index out of the inner loop in
ctables_table_output(). This index doesn't vary across that inner loop and
I simply hadn't noticed while writing the code.
Ben Pfaff [Fri, 24 Jun 2022 23:37:36 +0000 (16:37 -0700)]
Smake: Fix icon rendering by using correct application ID.
PSPP-specific icons were not showing up properly in the GUI because
the compiled-in resources were looking in gnu.pspp whereas the name
is now org.gnu.pspp. This fixes the problem.
Fixes: a421d8d9f61b ("Change application ID from org.fsf.pspp to org.gnu.pspp.")
Ben Pfaff [Fri, 24 Jun 2022 16:34:05 +0000 (09:34 -0700)]
Smake: Fix dependencies for src/ui/gui/resources.xml.
This file is a list of all the icon files, but generating it doesn't use
icon files themselves, so depending on them isn't useful. On the other
hand, the file does need to be regenerated if the icon list changes, and
that icon list is in Smake itself, so this target does need to depend on
the Makefiles.
This commit removes the remaining references to the perl memory test.
The configure step still asked for optional Memory::Usage perl module
which is not used without the perl memory test.
I changed the import assistant window to a modal window such that
the other windows cannot be changed while the import is ongoing.
There are problems when the main window is closed during the import.
but the memory module was still loaded. On debian this
memory module requires an additional dependency
libmemory-usage-perl which is not required. As the
memory module is not used inside the test I removed it.
Ben Pfaff [Fri, 3 Jun 2022 22:01:19 +0000 (15:01 -0700)]
line-reader: Avoid undefined behavior in printf utility in test.
The test used
printf '\"'
assuming that it would print just a double-quote, but on at least one
system it printed a backslash followed by a double-quote. This commit
changes it to
print '"'
which should be reliable everywhere.
Thanks to Michael Orlitzky <michael@orlitzky.com> for reporting this bug.
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.