Ben Pfaff [Mon, 2 Sep 2019 06:53:23 +0000 (06:53 +0000)]
AUTORECODE: Use minimum width output format for new variables.
The target variables don't need any decimals, since they are always
integers, and only need to be as wide as their largest value, which is
known in advance.
Ben Pfaff [Mon, 2 Sep 2019 06:37:02 +0000 (06:37 +0000)]
AUTORECODE: Properly handle value labels.
Value labels are supposed to be copied from source variables, where they
are present. Also, it's better to format the source values using the
print format rather than just assuming that %g is the right format.
Ben Pfaff [Mon, 2 Sep 2019 06:28:08 +0000 (06:28 +0000)]
variable: New function var_append_value_name__().
This variation on var_append_value_name() allows the caller to pass in the
parameter specifying how to show the value, which will be useful in an
upcoming commit.
Ben Pfaff [Mon, 2 Sep 2019 06:27:11 +0000 (06:27 +0000)]
variable: Make var_append_value_name() omit trailing white space.
This seems to be desirable in the cases where it's actually used. It only
affects one test case in the current testsuite, but it's an improvement for
an upcoming change too.
Ben Pfaff [Mon, 2 Sep 2019 05:14:52 +0000 (05:14 +0000)]
AUTORECODE: Fix treatment of missing values.
User-missing values are supposed to be recoded to a separate range above
the non-missing values. The system-missing value is supposed to not be
recoded at all. This fixes and documents that behavior.
Ben Pfaff [Sun, 21 Jul 2019 01:44:09 +0000 (18:44 -0700)]
AUTORECODE: Make GROUP option work properly with multi-length strings.
When GROUP is used, all of the variables are supposed to be put into a
single table. The implementation assumed in practice that, for string
variables, all of the strings were the same width, which caused problems.
This commit fixes the problem and updates the test to match.
Ben Pfaff [Sun, 21 Jul 2019 02:18:53 +0000 (19:18 -0700)]
value: Drop distinction between long and short string values.
The time has passed when this is a super valuable distinction. There is
basically no distinction in the language itself anymore, the efficiency
gains sound pretty marginal, and the differences lead to bugs, both
correctness- and memory leak-wise, that are hard to test for (because the
developer must make sure to test both short and long strings everywhere).
This commit changes the code so that both short and long strings are
represented the way that long strings were previously.
The default current_layer should be all-zeros, but the code wasn't
allocating current_layer at all. This didn't cause much of a problem
because nothing in the current tree allocates layers, but it will as
layers are added.
Ben Pfaff [Thu, 4 Jul 2019 23:23:06 +0000 (16:23 -0700)]
README.Git: Advance to Gnulib commit 9ce9be2ef0cb ("autoupdate").
A recent commit to PSPP depended on a more recent version of Gnulib that
includes Gnulib commit 3cd207e1d0fd ("fatal-signal: Pass the signal number
to the action.") but the PSPP commit did not actually advance the Gnulib
dependency to that commit. This commit does that (actually it advances to
Gnulib tip of master).
Fixes: 21d2449f801c ("unlink_replace_files: Change signature to avoid compiler warning.")
John Darrington [Thu, 23 May 2019 08:05:06 +0000 (10:05 +0200)]
Matrix reader: Remove reliance on hash functions.
This code made inappropriate use of hash functions to identify
uniqueness in sets of values. This code removes that code, and
compares them explicitly.
John Darrington [Thu, 23 May 2019 05:33:55 +0000 (07:33 +0200)]
Matrix Data: Identify splits explicitly instead of with hashes.
The MATRIX DATA command was using hashes to identify splits in the
input. This works most of the time, but it is not guaranteed that
every combination of split values will produce a unique hash.
This change explicitly compares the values instead.
John Darrington [Tue, 21 May 2019 12:30:46 +0000 (14:30 +0200)]
Add the WARN_UNUSED_RESULT attribute to all hash functions.
A hash function has no purpose if the result is unused, and
tests will typically not pick up a mistake where the
programmer forgets to assign the result - the hash table will
merely degenerate to a linear searched array.
When calculating the values for a categorical barchart displaying
percentages, use the sub-category totals as the denominator, rather
than the primary totals.