John Darrington [Sun, 25 Mar 2012 08:47:27 +0000 (10:47 +0200)]
Histograms: Put hard limit on the number of histogram bins
Histograms with less than one bin are not useful (and tend to cause crashes!)
Histograms with very large numbers of bins are also of little use, and cause
other implementation headaches.
John Darrington [Sat, 24 Mar 2012 06:42:51 +0000 (07:42 +0100)]
Histograms: Ensure that the bins are aligned to an odd number of half bin widths
This has the benefit that the centres of the bins are aligned to integer multiples
of bin widths, and thus the labels are shorter. For example, instead of labels
-1.5 -0.5 0.5 1.5 2.5 we get -2 -1 0 1 2 which is more aesthetically pleasing.
Ben Pfaff [Mon, 19 Mar 2012 04:40:49 +0000 (21:40 -0700)]
sort: Allocate space for sort buffers on demand, not in advance.
Each call to sort_create_writer() was allocating possibly a very
large amount of memory when in many cases only a small fraction of
that memory would actually be used. This commit switches to
allocating a small amount of memory and gradually increasing the
allocation on demand.
John Darrington [Fri, 16 Mar 2012 19:37:21 +0000 (20:37 +0100)]
EXAMINE: Complete re-implementation
This change is a complete re-implementation of the EXAMINE command.
It includes a few minor changes to the tests, to accommodate slight
changes in semantics (to bring it in line with other software).
Closes bug #30732
John Darrington [Wed, 14 Mar 2012 18:42:49 +0000 (19:42 +0100)]
Fix GtkCritical in recode dialog.
Commit 2b4fb7e846d62f1a70656bb42a0f769363ed0832 changed the internals of PsppireVarView.
Unfortunately recode-dialog.c was directly accessing the implementation instead of
using the interface. This change fixes that.
John Darrington [Sat, 3 Mar 2012 10:33:38 +0000 (11:33 +0100)]
Examine tests: Remove leading slash from factor variables.
I haven't seen any examples of syntax which does this, and it leads to
ambiguities: Does /STATISTICS refer to the STATISTICS subcommand or to
a factor variable named "STATISTICS". I think it's better therefore to
disallow a slash here.
Ben Pfaff [Fri, 2 Mar 2012 07:11:22 +0000 (23:11 -0800)]
Sort attributes by name for display, to make order arch-independent.
When data file attributes or variable attributes were displayed by
e.g. DISPLAY ATTRIBUTES or SYSFILE INFO, they were sorted in hash
order, which varies by architecture. Therefore, the tests that
depended on this order failed on big-endian machines such as mips.
This commit fixes the problem by displaying attributes in sorted
order.
This fixes a failure in the "Perl copying system files" reported
by Debian buildds.
Ben Pfaff [Fri, 2 Mar 2012 06:32:42 +0000 (22:32 -0800)]
identifier: Apply isdigit() only to values in valid range.
Applying isdigit() to a value that is not EOF or in the range
0...UCHAR_MAX yields undefined behavior and in fact caused a
segfault on several Debian architectures for U+FFFD.
Found by "lexer properly reports scan errors" test on Debian buildds.
Ben Pfaff [Thu, 1 Mar 2012 06:43:22 +0000 (22:43 -0800)]
encoding-guesser: Fall back to windows-1252 when UTF-8 can't be right.
Until now the encoding-guesser code has used UTF-8 as a fallback in
situations where we can tell that the file is not valid UTF-8. In
this kind of situation having a single-byte character set as a
fallback makes more sense. This commit hard-codes windows-1252 as
that fallback, since it is a widely encountered encoding (and
compatible with ISO-8859-1 as well).
John Darrington originally suggested this, if I recall correctly.
The bug report that spurred this work was from Harry Thijssen. With
this commit, PSPP properly reads his windows-1252 file when the
system locale uses UTF-8 encoding.
John Darrington [Thu, 1 Mar 2012 20:21:44 +0000 (21:21 +0100)]
Don't update the icon cache if DESTDIR is non-empty.
Packagers generally use "make install DESTDIR=xxx" to generate their install
files, which are then copied in place to the target filesystem. In such a
scenario, it's inappropriate to copy the icon.cache files. This change
therefore does not update the icon cache if a DESTDIR has been specified.
Instead it's left to the packager to make his own arrangements for updating
the icon cache on the target filesystem.
John Darrington [Tue, 28 Feb 2012 20:47:09 +0000 (21:47 +0100)]
Postgres test: Create socket in /tmp instead of current directory
It seems that some systems do not allow unix domain sockets with long
pathnames. This change therefore creates a directory in /tmp using
the mktemp command.
John Darrington [Wed, 29 Feb 2012 17:32:20 +0000 (18:32 +0100)]
Kruskal-Wallis: Sort grouped ranks before displaying them.
Debian's autobuilder showed that the KW tests were failing because the
hash which holds the rank entries was being iterated in arbitrary order.
This change sorts the entries before displaying them, so they should
always appear in the same order.
John Darrington [Sun, 26 Feb 2012 17:11:43 +0000 (18:11 +0100)]
Generate pspp.desktop
This change autogenerates the pspp.desktop file instead of simply including it.
This allows us to have the translations updated from the po files instead of
someone having to manually enter the strings directly in the file.
Ben Pfaff [Sat, 18 Feb 2012 19:03:01 +0000 (11:03 -0800)]
str: Skip only up to one-past-the-end in ss_tokenize().
If ss_tokenize() was called with '*save_idx' positioned at
one-past-the-end of a string, it would continue to advance it past
that point, which is surprising. This avoids doing that.
Found by Valgrind. Reported-by: John Darrington <john@darrington.wattle.id.au>
John Darrington [Sat, 18 Feb 2012 11:18:23 +0000 (12:18 +0100)]
Use if(0) instead of #if 0
The Gnu Coding Standards recommend run time conditionals instead of preprocessor
conditionals. I think this makes sense too, since #if 0'd code becomes obsolete
without anyone noticing.
John Darrington [Tue, 14 Feb 2012 10:13:15 +0000 (11:13 +0100)]
Reliability Test: Do not allow splits greater than the number of variables.
It's not meaningful to have a split point which is greater than the number
of variables (and not useful when they are equal). And the system was
exhaughsting its memory when such a test was run. This change therefore
disallows such a combination and updates the behaviour of the GUI accordingly.
John Darrington [Mon, 13 Feb 2012 18:16:37 +0000 (19:16 +0100)]
Use ButtonBox Mask nick field for it's correct purpose.
It seems that the GFlagsValue nick field was mistakenly being used as if
it was a translatable label. Not only was this wrong, but it also created
unnecessary work for translators. This change provides descriptions of the
flags and removes them from the translatable strings.
Ben Pfaff [Sat, 11 Feb 2012 18:16:25 +0000 (10:16 -0800)]
tests: Improve test for supported encodings.
I misunderstood the purpose for the config.charset script. I had a
notion that it was supposed to print all of the character sets that
are supported by the operating system. It doesn't (it prints
character set names that need translation for the operating system).
This change switches to using the same code that will be used at
PSPP runtime to determine whether an encoding is supported, for
determining during the tests whether an encoding is supported.
This should cause fewer tests to be skipped on Mac OS.
Reported-by: Jeremy Lavergne <jeremy@lavergne.gotdns.org>
Ben Pfaff [Sat, 11 Feb 2012 18:09:28 +0000 (10:09 -0800)]
perl-module: use $(MAKE) directly in rules that call make.
The GNU make manual says that $(MAKE) must appear directly in a rule
rather than through recursive expansion to work properly. (This
change fixes a GNU make warning about an unavailable jobserver.)
Ben Pfaff [Wed, 8 Feb 2012 06:08:41 +0000 (22:08 -0800)]
sys-file: Recode string fields in file header also.
Chris Muller <chris.muller@mullermedia.com> provided an example
EBCDIC-encoded mainframe system file from the 1980s. This commit
goes one step toward being able to read and write these files in
PSPP, by recoding most of the string fields in the file header.