Ben Pfaff [Thu, 27 Dec 2018 04:29:50 +0000 (20:29 -0800)]
tests: Tag all the tests that take more than about 1s as "slow".
This makes it possible to run a quicker set of tests, which still have
pretty good coverage, with something like this:
make -j10 check TESTSUITEFLAGS='-j10 -k !slow'
Ben Pfaff [Wed, 26 Dec 2018 00:16:41 +0000 (16:16 -0800)]
cairo: Fix word-wrapping of ".000" and similar.
The Unicode line-breaking algorithm (or perhaps Pango's implementation of
it) is willing to break after the period in ".000". This looks odd. This
commit works around the problem.
Ben Pfaff [Mon, 26 Nov 2018 01:01:39 +0000 (17:01 -0800)]
output: Add support for cell margins.
Until now, space between cells was implemented by adding some space on the
sides of rules. That worked fine before cells could have colored
backgrounds, but now it means that the backgrounds don't reach all the way
to the rules. Thus, this commit adds configurable margins to the cells
themselves.
Ben Pfaff [Sat, 15 Dec 2018 18:43:47 +0000 (10:43 -0800)]
ascii: Get rid of the idea of pages.
In the era when I started writing this code, people still printed output on
dot-matrix printers and fanfold paper. That's no longer a realistic use
case: today, no one prints plain text output. It's just for viewing on a
screen, and on a screen there is no need or desire to break tables up
vertically into virtual "pages".
Ben Pfaff [Sun, 9 Dec 2018 20:46:17 +0000 (12:46 -0800)]
table: Get rid of TAL_GAP.
This is only necessary in pathological cases. Those cases don't really
come up in normal usage and as PSPP shifts toward pivot tables they won't
come up at all.
Ben Pfaff [Sun, 2 Dec 2018 21:28:44 +0000 (13:28 -0800)]
SYSFILE INFO: Get rid of nested tables.
Nested tables aren't really necessary and make a number of things harder in
the output subsystem. SYSFILE INFO and DISPLAY, which share code, were the
only code that used them, so this removes them from that code.
Ben Pfaff [Mon, 3 Dec 2018 02:36:51 +0000 (18:36 -0800)]
get-data-psql.at: Make test work with Debian pg_wrapper arrangement.
It had been years since I tested Postgres, but I was making a change that
would affect the Postgres test, and I found out that the test didn't work.
This fixes it.
Ben Pfaff [Mon, 26 Nov 2018 14:54:52 +0000 (06:54 -0800)]
segment: Fix behavior when #! line is not new-line terminated.
The code here is supposed to maintain a invariant that, when it returns a
nonnegative value, it initializes *type, but it failed to do that when a
#! line did not end in a new-line. This fixes the problem.
Bug #55101.
Thanks for Friedrich Beckmann for narrowing down the problem.
Found by the Debian buildd: https://buildd.debian.org/status/fetch.php?pkg=pspp&arch=arm64&ver=1.2.0-1&stamp=1543183214&raw=0
Ben Pfaff [Fri, 16 Nov 2018 21:51:38 +0000 (13:51 -0800)]
ascii: Update min_breaks along with width and length.
min_breaks has to be no larger than the page width (or length), otherwise
the rendering algorithm fails, but the automatic update for TTYs didn't
take that into account.
Ben Pfaff [Sun, 25 Nov 2018 06:22:18 +0000 (22:22 -0800)]
render: Use "long long" instead of "double" for arithmetic.
When I wrote this code in 2010, it seemed reasonable to me to use
floating-point arithmetic to do large integer calculations, because 64-bit
machines were not yet pervasive. Over 8 years later, 32-bit machines are
now a rarity. This commit switches types and modernizes the coding style.
This fixed an assertion failure that I was getting mysteriously while
rendering a particular table. I didn't investigate further because using
integers seemed like a much better idea anyway.
Ben Pfaff [Sat, 17 Nov 2018 04:27:30 +0000 (20:27 -0800)]
psppire: Fix multiple definitions of align_enum_type and two others.
These were defined in both psppire-dict.c and widgets.c, which causes a
problem building with -fno-common (which is desirable because it allows
Address Sanitizer to work better).
fixed setting the font size via css syntax - Closes Bug #55006
The pspp 1.2.0 release showed a problem with setting the font via
the font selection dialog. The root cause is that the style
setting should be done via css syntax and not pango syntax. I
changed the code to do the style setting via css syntax.
See: https://savannah.gnu.org/bugs/?55006
The minimum width setting in the comment dialog does not work how
it is implemented. I removed that code part as it does not seem
to be crucial. At least on MacOS the default
width is large enough to hold 80 characters. Even without that
the user can increase the size of the dialog.
changed install directory for pspp.appdata.xml to metainfo
The default directory for the appdata xml file changed
from appdata to metainfo. During debian package development
lintian complained about the wrong location.
changed emacs mode description to comply with elpa
During the debian package development lintian proposed
to install emacs mode via the elpa system. I changed
the pspp emacs mode description to comply to elpa.
Ben Pfaff [Sun, 14 Oct 2018 19:31:52 +0000 (12:31 -0700)]
hash-functions: Avoid signed integer overflow.
cppcheck reported that 0xdeadbeef + 8 yielded signed integer overflow.
This is probably harmless, as long as the compiler doesn't do something
really strange, but it's even better if we just ensure that this
arithmetic is done as unsigned.
Ben Pfaff [Sat, 6 Oct 2018 22:12:07 +0000 (15:12 -0700)]
lexer: Fix details of journaling.
This fixes test 1075: ASCII driver syntax printback.
Reported by John Darrington and Jeremy Lavergne. Fixes: b4f585e70eca ("lexer: Fix buffer overread in journaling when source does not end in \n.") Fixes: e0f9210e814d ("lexer: Add support for embedded \0 bytes and missing trailing new-line.")
John Darrington [Sat, 29 Sep 2018 10:51:02 +0000 (12:51 +0200)]
Reference count struct dictionary.
This change:
* Adds a ref count to struct dictionary.
* Wraps dict_destroy in a ref-counted wrapper dict_unref.
* Replaces most calls to dict_destroy with dict_unref.
* Adds a new function dict_ref.
* Changes PsppireDict so take a reference to the struct dict it contains.
* Fixes some leaked dictionaries in PsppireImportAssistant.
Ben Pfaff [Sat, 29 Sep 2018 22:43:39 +0000 (15:43 -0700)]
lexer: Fix buffer overread in journaling when source does not end in \n.
An earlier commit removed the requirement that a source file ends in \n,
but the lexer still made that assumption. This is intended to fix the
problem. (Probably, some new tests should be added.)
Thanks to John Darrington for reporting the problem.
Fixes: e0f9210e814d ("lexer: Add support for embedded \0 bytes and missing trailing new-line.")
Ben Pfaff [Mon, 24 Sep 2018 03:42:07 +0000 (20:42 -0700)]
lexer: Add support for embedded \0 bytes and missing trailing new-line.
The lexer, at a low level, has not supported \0 bytes in the input stream
because it used such a byte as the end-of-input indicator. This caused
some awkwardness for the higher-level lexer, which had to remove and flag
\0 bytes as it read them. This caused a bug in the higher-level lexer,
which raised an error for each \0 byte it removed but did so when the
lexer was in an intermediate state, which could read uninitialized data.
This commit fixes the problem by adding support for \0 bytes to the
low-level lexer (segmenter). At the same time, it adds support for input
that doesn't end in a new-line character.
Bug #54664.
Thanks to Tianxiao Gu for reporting this bug.
Ben Pfaff [Mon, 24 Sep 2018 03:26:28 +0000 (20:26 -0700)]
DO REPEAT: Avoid relying on null terminators.
find_dummy_var() currently relies on the string passed in to have a null
terminator (even though it accepts a length). This is safe in the current
tree but an upcoming commit will not ensure that it is null-terminated, so
this commit removes the dependency.