John Darrington [Thu, 16 Apr 2009 13:06:31 +0000 (21:06 +0800)]
Improve the style handling of the column/row title buttons.
It seems that the style of the button wasn't `attached' before
it was used. Further, use of the "buttondefault" detail on
gtk_paint_box made wierd looking buttons with some themes.
I don't pretend to fully understand all this, but these changes
seem to be an improvement.
John Darrington [Mon, 13 Apr 2009 23:07:14 +0000 (07:07 +0800)]
Fixed bug in q2c when munging hyphenated strings.
Q2c wasn't terminating strings generated by its munge
function, resulting in garbage being placed into generated
code. Thanks to Michel Boaventura for reporting this.
Ben Pfaff [Thu, 9 Apr 2009 04:55:31 +0000 (21:55 -0700)]
Use Bob Jenkins lookup3 hash instead of FNV.
The Jenkins lookup3 hash is superior to FNV in collision resistance,
avalanching, and performance on systems that do not have fast
multiplication. It also provides a good way to combine the result of
a previous hashing step with the current hash, using its "basis" argument.
This commit replaces the PSPP implementation of FNV with the Jenkins
lookup3 hash and updates all the current users.
In addition, John Darrington pointed out that commit dd2e61b4a
"Make create_iconv() properly distinguish converters by name"
unintentionally introduced gratuitous hash collisions, by causing
all converters where tocode and fromcode were the same to hash to
value 0, and converters where tocode and fromcode were swapped to
hash to the same value as each other. Using the "basis" argument to
the Jenkins hash properly, instead of just attempting to combine
hash values with XOR, fixes this problem.
Ben Pfaff [Thu, 9 Apr 2009 04:39:22 +0000 (21:39 -0700)]
NPAR TESTS: Consistently order variables in summary statistics.
The set of variables in the NPAR TESTS specs structure was ordered
randomly, according to however the hash function happened to arrange them.
Sort them by variable name, instead, so that they always appear in
alphabetical order in, e.g., descriptive statistics output.
The particular hash function PSPP uses now tends to order variables
alphabetically anyhow. The next commit changes the PSPP hash functions,
so fixing this in advance prevents having to update any test output.
Ben Pfaff [Wed, 8 Apr 2009 04:20:47 +0000 (21:20 -0700)]
SET LOCALE: Don't use lex_tokstr() after skipping to next token.
The return value from lex_tokstr() is only valid until the next call to
lex_get() (or another function that changes the current token), so don't
advance past the token until we're done with its string value.
Ben Pfaff [Wed, 8 Apr 2009 04:15:40 +0000 (21:15 -0700)]
Make create_iconv() properly distinguish converters by name.
The code in create_iconv() assumed that every pair of different converters
had a different hash value. This is a bad assumption: eventually, we will
be unlucky, and two different converters will hash to the same value, and
we will get a bad conversion. So we have to compare (and store) the
names of the codes that each converters converts to and from.
Also, compute the hash value without making an extra copy of fromcode
and tocode.
Ben Pfaff [Wed, 8 Apr 2009 04:02:14 +0000 (21:02 -0700)]
Add "x" prefix to calls to plain malloc(), calloc(), strdup(), realloc().
In review commit 503f53bfdde "Read dictionary encoding from data files"
I noticed uses of plain strdup() (not xstrdup()). Some greps showed that
there were several other uses of strdup(), as well as calloc(), malloc(),
and realloc(), in the source tree. This commit adds "x" prefixes to each
of them, to ensure proper error handling.
Ben Pfaff [Wed, 8 Apr 2009 03:48:10 +0000 (20:48 -0700)]
Remove redundant test in lex_is_idn().
Commit 90f346cc0 "Made var_is_valid_name more permissive" made characters
with values above 127 valid in identifiers by allowing them in
lex_is_id1() and lex_is_idn(), but since the latter includes the former
in its test the addition there is redundant and can be eliminated.
John Darrington [Tue, 7 Apr 2009 02:30:13 +0000 (10:30 +0800)]
Allow users to set the precision of output statistics.
Instead of hard coding the width and decimals of output
numbers, respect the default format in most instances.
Counts are normally displayed with the format of the weight
variable, if any. Closes patch #6785
John Darrington [Mon, 6 Apr 2009 11:07:30 +0000 (19:07 +0800)]
Added a cell-padding parameter to the sheet.
Added a cell-padding paramter of type GtkBorder which specifies the
space between a cell's contents and the border. The text is no
longer squashed right up against the left hand edge.
John Darrington [Mon, 6 Apr 2009 02:21:01 +0000 (10:21 +0800)]
Merge psppire-axis and psppire-axis-impl
There's only one implementation of psppire-axis now,
and having the implementation seperated from the interface
in a brige configuration just adds too much complexity.
John Darrington [Fri, 3 Apr 2009 10:16:57 +0000 (18:16 +0800)]
Binomial tests can now be specified by a cutpoint.
This change extends the NPAR TEST /BINOMIAL subcommand
so that binomial tests can be specified by cutpoint.
The manual had previously, incorrectly stated that this
was supported. Now it actually is. Fixes bug #26056
John Darrington [Thu, 2 Apr 2009 00:46:57 +0000 (08:46 +0800)]
Use a system file's "character code" to set the encoding.
When reading a system file, use the "character code" as a
fallback to set the dictionary's character encoding. If present,
record 7, subtype 20 will override this parameter.
Jason H Stover [Mon, 30 Mar 2009 20:39:27 +0000 (16:39 -0400)]
design_matrix.c: New accessor functions design_matrix_get_element and
design_matrix_set_element.
covariance_matrix.c: New accessor function
covariance_matrix_get_element. Use new accessor functions
design_matrix_get_element and design_matrix_set_element.
Jason Stover [Sun, 29 Mar 2009 15:04:31 +0000 (11:04 -0400)]
covariance-matrix.c (covariance_accumulator_to_matrix): Use sum_i and
sum_j to compute products of means. Store the sums of variables in
cov->sums, rather than storing the means.
John Darrington [Sun, 29 Mar 2009 01:29:41 +0000 (09:29 +0800)]
Avoid calling iconv_open on each conversion.
Instead of creating a convertor each time a string
needs to be re-encoded, we now keep a hash of convertors
keyed by the permutation of input/output encodings.
John Darrington [Sat, 28 Mar 2009 11:50:51 +0000 (20:50 +0900)]
Convert encoding even if encodings are identical.
recode_string must continue, even if the source and
target encodings are identical, because invalid bytes
in the source string need to become '?' to avoid
later problems.
John Darrington [Sat, 28 Mar 2009 03:24:34 +0000 (12:24 +0900)]
Convert files named on the command line to filename encoding.
Files specified on the command line must be converted to the
"filename" encoding (whatever it may be) otherwise some systems
will not know they exist. Tested by Michel Boaventura.
Partially fixes bug #26023
Ben Pfaff [Fri, 27 Mar 2009 04:11:12 +0000 (21:11 -0700)]
Fix error message for bad characters in syntax files.
Before this commit, on systems where "char" is a signed type,
formatting a char with %o would sign-extend to the width of "int",
so that a typical error message would look like:
Bad character in input: `\37777777605'.
With this commit, the value gets zero-extended, producing the more
sensible error mesage:
Bad character in input: `\205'.
John Darrington [Sat, 21 Mar 2009 06:12:47 +0000 (15:12 +0900)]
Fix crash when running under windows with non-english locale
Fixed a bug which manifested itself when running a Mingw compiled
binary with a non-english locale. setlocale returns a statically
allocated string, so it's valid only until the next call to setlocale.
Thanks to Michel Boaventura for reporting and helping to diagnose this
problem.