Ben Pfaff [Mon, 11 May 2009 13:33:15 +0000 (06:33 -0700)]
gui: Fix segfault when pushing Del on a long string variable cell.
Thanks to John Darrington for reporting the problem.
Ben Pfaff [Mon, 11 May 2009 05:23:00 +0000 (22:23 -0700)]
Change "union value" to dynamically allocate long strings.
Until now, a single "union value" could hold a numeric value or a short
string value. A long string value (one longer than MAX_SHORT_STRING)
required a number of contiguous "union value"s. This situation was
inconvenient sometimes, because any occasion where a long string value
might be required (even if it was unlikely) required using dynamic
memory allocation.
With this change, a value of any type, regardless of whether it is numeric
or short or long string, occupies a single "union value". The internal
representation of short and long strings is now different, however: long
strings are now internally represented by a pointer to dynamically
allocated memory. This means that "union value"s must now be initialized
and uninitialized properly, to ensure that memory is properly allocated
and freed behind the scenese.
This change thus has a ripple effect on PSPP code that works with values.
In particular, code that deals with cases is greatly changed, because a
case now needs to know the type of each value that it contains. Thus, a
new concept called a "case prototype", which represents the type and
width of each value within a case, is introduced, and every place in PSPP
that creates a case must now create a corresponding prototype to go with
it. This is why this commit is so big.
As part of writing up this commit, it became clear that some code was poor
enough that it needed to be rewritten entirely. Therefore, CROSSTABS and
T-TEST are almost completely modified by this commit.
Ben Pfaff [Thu, 7 May 2009 05:58:01 +0000 (22:58 -0700)]
output: Add auxiliary data parameter to tab_dim.
Until now, the tab_dim function has not provided any way to pass auxiliary
data to the table dimensioning function. This commit adds this ability
and updates all the callers of tab_dim to do so.
Ben Pfaff [Thu, 7 May 2009 05:47:51 +0000 (22:47 -0700)]
New data structure sparse_xarray.
Ben Pfaff [Thu, 7 May 2009 03:34:14 +0000 (20:34 -0700)]
New wrapper for access to temporary files.
Ben Pfaff [Tue, 5 May 2009 12:42:23 +0000 (05:42 -0700)]
model-checker: Add command-line parser for model checking options.
This adds a parser for command-line options to configure a set of
mc_options for running the model checker. It is used by an upcoming test
for the sparse_xarray. It might also make sense to break the datasheet
tests out of PSPP into a separate program using this parser.
Ben Pfaff [Tue, 5 May 2009 12:39:03 +0000 (05:39 -0700)]
Implement new command-line argument parser.
glibc has two option parsers, but neither one of them feels quite
right:
- getopt_long is simple, but not modular, in that there is no
easy way to make it accept multiple collections of options
supported by different modules.
- argp is more sophisticated and more complete, and hence more
complex. It still lacks one important feature for
modularity: there is no straightforward way for option groups
that are implemented independently to have separate auxiliary
data,
The parser implemented in this commit is meant to be simple and
modular. It is based internally on getopt_long.
The initial use for this option parser is for an upcoming commit of a test
program that has some of its own options and some from the model checker,
but it should also be appropriate for PSPP and PSPPIRE if anyone wants to
adapt them to use it.
Ben Pfaff [Tue, 5 May 2009 05:30:02 +0000 (22:30 -0700)]
model-checker: Don't discard error states.
Even if a state with an error is a duplicate, we don't want to discard it,
because then we lose information about bugs.
Ben Pfaff [Tue, 5 May 2009 05:27:05 +0000 (22:27 -0700)]
model-checker: Revise advice on checking for duplicates.
Until now the documentation on the model checker has advised checking for
a duplicate state before checking for consistency, but in fact this can
cause bugs to be missed if only some paths to a given state yield
incorrect results. So revise the advice to check for consistency before
checking for a duplicate state.
Ben Pfaff [Tue, 5 May 2009 05:20:42 +0000 (22:20 -0700)]
model-checker: Add more progress functions.
The model checker supports "progress functions" that report the current
status of the model checking run. Until now the implementation only
exported a single progress function that printed a line of dots across
stderr. This commit moves the "fancy" progress function that was
previously part of the PSPP language code into the model checker itself
and adds an even more verbose progress function as well.
Ben Pfaff [Tue, 5 May 2009 05:33:48 +0000 (22:33 -0700)]
model-checker: Move summary printing function into model checker.
There is no reason that the model checker itself should not be able to
print a summary of its results. Until now, this code was buried in the
PSPP language code, but the model checker itself is a better place for it.
Ben Pfaff [Fri, 24 Apr 2009 04:09:12 +0000 (21:09 -0700)]
model-checker: Kill dependencies and move back to libpspp.
Commit
95b074ff3 "Moved the datasheet testing code out of
src/{libspp,data}" moved the model-checker implementation from libpspp
into language/tests because it depended on math/moments.h and
data/val-type.h, which violates the dependency structure of the PSPP
libraries.
However, now I want to use the model checker in a test that should not
need to use anything from language/tests, so this commit eliminates these
dependencies and moves the model checker back to src/libpspp.
Ben Pfaff [Tue, 5 May 2009 04:53:07 +0000 (21:53 -0700)]
sparse-array: Simplify code slightly.
Instead of checking whether the key is in range in each caller of
find_leaf_node, do it in find_leaf_node itself. This also allows checking
the cache before checking whether the key is in range, which might be an
optimization.
Ben Pfaff [Thu, 7 May 2009 03:22:09 +0000 (20:22 -0700)]
sparse-array: Improve iteration interface.
The sparse_array_scan function only supports iteration in the forward
direction and its interface is somewhat awkward. This commit replaces it
by four new functions that allow iteration in both forward and reverse
directions and have a more conventional interface.
Ben Pfaff [Tue, 5 May 2009 12:51:54 +0000 (05:51 -0700)]
sparse-array: Use __builtin_ctzl on GCC 4.0 or later, as an optimization.
This should be a worthwhile optimization in many cases, because
__builtin_ctzl compiles to a single machine instruction on x86, whereas
the generic implementation compiles to several.
Ben Pfaff [Tue, 5 May 2009 02:31:16 +0000 (19:31 -0700)]
range-set: New functions range_set_last and range_set_prev.
These are useful for iterating through a range set in reverse order.
Ben Pfaff [Fri, 24 Apr 2009 03:27:54 +0000 (20:27 -0700)]
range-set: Add new function range_set_scan().
Ben Pfaff [Fri, 24 Apr 2009 03:27:10 +0000 (20:27 -0700)]
range-set: Inline some simple functions.
Some of the range-set functions are very simple and worth inlining, so
move the definitions of those functions into range-set.h. This required
moving the definition of struct range_set and struct range_set_node into
the header. Some of the functions used internally by those functions had
to be moved too, and renamed as well since for internal use in range-set.c
their names did not respect the namespace.
Ben Pfaff [Fri, 24 Apr 2009 03:14:52 +0000 (20:14 -0700)]
range-set: Add test coverage for range_set_destroy(NULL).
"gcov -b" showed that range_set_destroy() was never called with a NULL
argument. There's no reason not to test that too (although of course it
is unlikely to be broken).
Ben Pfaff [Tue, 5 May 2009 14:03:24 +0000 (07:03 -0700)]
range-set: New function range_set_allocate_fully.
Ben Pfaff [Wed, 1 Apr 2009 05:00:44 +0000 (22:00 -0700)]
Delete CORRELATIONS skeletal parser.
This code didn't do anything useful, it just parsed syntax. We can
resurrect it when someone wants to implement CORRELATIONS later.
Ben Pfaff [Tue, 5 May 2009 14:03:02 +0000 (07:03 -0700)]
pool: New function pool_strdup0.
This function is the pool analogue of xmemdup0, except that it is only
appropriate for use with strings.
Ben Pfaff [Tue, 5 May 2009 12:46:01 +0000 (05:46 -0700)]
datasheet: Drop false dependency on md4.h.
datasheet-check.c doesn't use anything from md4.h, so there's no point in
including it.
Ben Pfaff [Thu, 16 Apr 2009 05:31:56 +0000 (22:31 -0700)]
perl-module: Better document "make test" requirements.
Ben Pfaff [Fri, 16 Jan 2009 04:39:18 +0000 (20:39 -0800)]
t-test: Move 'mode' variable from file scope into cmd_t_test().
Ben Pfaff [Fri, 16 Jan 2009 04:37:32 +0000 (20:37 -0800)]
t-test: Move 'cmd' variable from file scope into cmd_t_test().
This variable was only used inside cmd_t_test() anyhow.
Ben Pfaff [Fri, 16 Jan 2009 04:34:43 +0000 (20:34 -0800)]
t-test: Remove write-only variable.
Jason H Stover [Wed, 3 Jun 2009 19:54:19 +0000 (15:54 -0400)]
Moved static is_origin from design_matrix.c to category.c: cat_is_origin.
John Darrington [Sun, 17 May 2009 23:43:14 +0000 (07:43 +0800)]
Fix incorrect word order
John Darrington [Sun, 17 May 2009 23:42:31 +0000 (07:42 +0800)]
Remove whitespace before footnotes
John Darrington [Sun, 17 May 2009 23:39:06 +0000 (07:39 +0800)]
Correct grammar
John Darrington [Sun, 17 May 2009 07:29:54 +0000 (15:29 +0800)]
Change examples using heights to be all in millimetres
John Darrington [Sun, 17 May 2009 07:20:23 +0000 (15:20 +0800)]
Delete '*' from DATA LIST examples
John Darrington [Sun, 17 May 2009 07:16:23 +0000 (15:16 +0800)]
Mention that two juxtapose LIST keywords are intentional
John Darrington [Sun, 17 May 2009 05:15:41 +0000 (13:15 +0800)]
Fix misaligned menu items
John Darrington [Sun, 17 May 2009 05:06:59 +0000 (13:06 +0800)]
Added a tutorial chapter to the manual.
John Darrington [Sat, 16 May 2009 03:38:11 +0000 (11:38 +0800)]
Fix bug inserting rows and columns and rename state variable.
The code in psppire-data-editor was inspecting the variable
called "state" on the GtkWidget class whereas it should have
been looking at the PsppireSheet class.
To avoid any future confusion, PsppireSheet's "state" variable
has been renamed to select_status.
John Darrington [Sat, 16 May 2009 02:16:57 +0000 (10:16 +0800)]
Remove unused code
John Darrington [Fri, 15 May 2009 23:18:01 +0000 (07:18 +0800)]
Updated dutch translation. Thanks to unkonwn-1
Also regenerated en_GB.po
John Darrington [Fri, 15 May 2009 22:55:52 +0000 (06:55 +0800)]
Correct typo in command line argument string.
Thanks to Michel Boaventura for reporting this.
John Darrington [Thu, 14 May 2009 08:19:09 +0000 (16:19 +0800)]
Remove gratuitous call to change_active_cell.
This caused data from the previous cell to
be transfered to the new cell. Fixes bug #26568
John Darrington [Thu, 14 May 2009 07:48:14 +0000 (15:48 +0800)]
Remove unneeded object members
John Darrington [Wed, 13 May 2009 22:54:56 +0000 (06:54 +0800)]
Ensure that windows opens the right file for output.
Thanks to Michel Boaventura for reporting this problem.
Fixes bug #26542
John Darrington [Wed, 13 May 2009 22:48:17 +0000 (06:48 +0800)]
Correct default_output_path function on Windows.
John Darrington [Tue, 12 May 2009 23:29:38 +0000 (07:29 +0800)]
Don't create histograms for string variables.
Closes bug #26536
John Darrington [Tue, 12 May 2009 23:22:20 +0000 (07:22 +0800)]
Relocate the locale directory.
Thanks to Michel Boaventura for reporting this and
for providing the patch. Closes bug #26543
John Darrington [Sat, 9 May 2009 07:07:51 +0000 (15:07 +0800)]
Merge commit 'origin/stable'
John Darrington [Sat, 9 May 2009 07:04:48 +0000 (15:04 +0800)]
For consistency, use gnulib's memory allocation functions in the gui.
John Darrington [Sat, 9 May 2009 00:43:35 +0000 (08:43 +0800)]
Ensure that NUMERIC's format (if any) is a valid output format.
Thanks to Pascal Barbedor for reporting this problem.
John Darrington [Fri, 8 May 2009 10:56:36 +0000 (18:56 +0800)]
Fixed crash calculating trimmed mean with missing values.
Closes bug #26404
Jason H Stover [Mon, 4 May 2009 16:06:50 +0000 (12:06 -0400)]
Remove call to var_set_width
Jason H Stover [Fri, 1 May 2009 17:59:06 +0000 (13:59 -0400)]
Allocate adequate space for permutation
Jason H Stover [Wed, 29 Apr 2009 21:23:17 +0000 (17:23 -0400)]
Moved is_origin and get_exact_subscript to design-matrix.[ch]
Jason H Stover [Wed, 29 Apr 2009 16:27:59 +0000 (12:27 -0400)]
covariance-matrix.c: (is_covariance_contributor) Removed unnecessary recursion.
covariance-matrix.c (is_origin): Do not count a numeric variable as
the origin. Call is_origin only for categorical variables.
covariance-matrix.c (ordered_match_nodes): New function.
covariance-matrix.c (match_nodes): Use bitwise operators and
ordered_match_nodes for hashing instead of so many ifs.
covariance-matrix.c (hash_numeric_alpha): Use hash_value_short to hash
combinations of numeric and categorical variables.
covariance-matrix.c (get_value_from_subscript): New function to match
values and columns in a design matrix.
covariance-matrix.c: Removed unused design matrix struct sums from
struct covariance matrix. To get the means, use struct moments
instead.
covariance-matrix.c (covariance_accumulator_to_matrix): Use
design_matrix_set_element instead of covariance_matrix_insert. Drop
unused function covariance_matrix_insert.
covariance-matrix.c (covariance_accumulator_hash): Use hash_bytes instead of hsh_hash_bytes.
John Darrington [Tue, 28 Apr 2009 23:42:04 +0000 (07:42 +0800)]
Fix compilation error on Cygwin.
Fixes bug #26379
John Darrington [Thu, 23 Apr 2009 23:13:21 +0000 (07:13 +0800)]
Added Dutch translation. Thanks to unknown-1
John Darrington [Thu, 23 Apr 2009 12:46:33 +0000 (20:46 +0800)]
Fix bug where data sometimes got erroneously copied between cells
John Darrington [Thu, 23 Apr 2009 06:18:44 +0000 (14:18 +0800)]
Remove unused code
John Darrington [Thu, 23 Apr 2009 05:41:21 +0000 (13:41 +0800)]
Fix GUI bug risizing columns.
Remove the clip rectangle after showing the cell border so
that it doesn't interfere with other operations.
John Darrington [Wed, 22 Apr 2009 09:26:46 +0000 (17:26 +0800)]
Compensate cell border for gridline thickness
John Darrington [Wed, 22 Apr 2009 09:15:41 +0000 (17:15 +0800)]
Merge commit 'origin/stable'
Conflicts:
src/ui/gui/output-viewer.c
John Darrington [Wed, 22 Apr 2009 09:07:36 +0000 (17:07 +0800)]
Replace BORDER_WIDTH macro with appropriate cell_padding parameters
John Darrington [Mon, 20 Apr 2009 12:59:29 +0000 (20:59 +0800)]
Revert "Made psppire-conf thread safer"
This reverts commit
2d983f3e5bd2d5f531cbcbdcebe078034ddb8955.
John Darrington [Mon, 20 Apr 2009 12:58:52 +0000 (20:58 +0800)]
Revert "Make psppire-axis thread safer"
This reverts commit
18aa57536d6eac0b0562f31d9a7a01605c3d51ad.
John Darrington [Sun, 19 Apr 2009 11:07:23 +0000 (19:07 +0800)]
Made psppire-conf thread safer
John Darrington [Sun, 19 Apr 2009 10:59:34 +0000 (18:59 +0800)]
Make psppire-axis thread safer
John Darrington [Sun, 19 Apr 2009 10:05:48 +0000 (18:05 +0800)]
Separate the execute_syntax function into its own file.
John Darrington [Sun, 19 Apr 2009 09:29:45 +0000 (17:29 +0800)]
Whitespace changes only.
Make this file appear sane when viewed under emacs.
John Darrington [Thu, 16 Apr 2009 23:59:28 +0000 (07:59 +0800)]
Continue button to grab default on realization
John Darrington [Thu, 16 Apr 2009 23:43:55 +0000 (07:43 +0800)]
Grab default for close button on message dialog
John Darrington [Thu, 16 Apr 2009 13:26:57 +0000 (21:26 +0800)]
Hide tooltip when leaving sheet
John Darrington [Thu, 16 Apr 2009 13:14:21 +0000 (21:14 +0800)]
Unmap tooltip when sheet is unmapped
John Darrington [Thu, 16 Apr 2009 13:10:29 +0000 (21:10 +0800)]
remove superfluous tests
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 [Thu, 16 Apr 2009 00:02:33 +0000 (08:02 +0800)]
Update some comments
John Darrington [Wed, 15 Apr 2009 23:55:25 +0000 (07:55 +0800)]
Avoid warnings when opening a new system file.
John Darrington [Wed, 15 Apr 2009 23:45:31 +0000 (07:45 +0800)]
Hold the thread lock in a timer callback
John Darrington [Tue, 14 Apr 2009 11:09:24 +0000 (19:09 +0800)]
Make the gui more thread safe
John Darrington [Tue, 14 Apr 2009 02:03:52 +0000 (10:03 +0800)]
Ensure that setlocale (LC_MESSAGES is called when appropriate.
The wrong preprocessor macro was being tested before calling
setlocale (LC_MESSAGES, "") which resulted in translations not
being loaded.
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.
John Darrington [Mon, 13 Apr 2009 07:00:38 +0000 (15:00 +0800)]
Fixed bug opening the find dialog.
Thanks to Michel Boaventura for reporting this.
John Darrington [Mon, 13 Apr 2009 06:50:06 +0000 (14:50 +0800)]
Use replacement rename function from gnulib
John Darrington [Sat, 11 Apr 2009 07:49:36 +0000 (15:49 +0800)]
Tolerate the inability to convert character encodings
John Darrington [Sat, 11 Apr 2009 07:18:39 +0000 (15:18 +0800)]
Change g_print to g_warning
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.
John Darrington [Thu, 9 Apr 2009 10:53:52 +0000 (18:53 +0800)]
Fix some compiler warnings
John Darrington [Thu, 9 Apr 2009 07:58:58 +0000 (15:58 +0800)]
Implemented the sign test.
Added an implementation of the SIGN test for the NPAR TESTS
command. Closes patch #6801
John Darrington [Thu, 9 Apr 2009 00:51:24 +0000 (08:51 +0800)]
Fixed crash on quit
John Darrington [Wed, 8 Apr 2009 08:20:22 +0000 (16:20 +0800)]
Use the replacement rename function from gnulib.
Use the gnulib replacement rename function, to
overcome problems on certain systems saving a
file when that filename already exists. Closes bug #25795
Ben Pfaff [Wed, 8 Apr 2009 04:26:50 +0000 (21:26 -0700)]
Fix memory leak in cmd_data_list().
Ben Pfaff [Wed, 8 Apr 2009 04:24:43 +0000 (21:24 -0700)]
Fix a few typos and capitalization errors in developers guide.
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 [Wed, 8 Apr 2009 01:14:57 +0000 (09:14 +0800)]
Merge commit 'origin/master' into charset
Conflicts:
src/ui/gui/psppire-data-editor.c
John Darrington [Wed, 8 Apr 2009 00:07:37 +0000 (08:07 +0800)]
Fix problems saving data files with non-ascii filenames.
Convert filenames to the system encoding before stuffing into
syntax strings.
John Darrington [Tue, 7 Apr 2009 23:13:10 +0000 (07:13 +0800)]
Fixed problem saving syntax files with non-ascii names.
The function save_editor_to_file now takes a filename
in Glib filename encoding.
John Darrington [Tue, 7 Apr 2009 11:30:23 +0000 (19:30 +0800)]
Merge commit 'origin/stable'
Conflicts:
src/language/stats/crosstabs.q
src/language/stats/examine.q
src/language/stats/frequencies.q
src/language/stats/oneway.q
tests/command/examine-extremes.sh
tests/command/examine.sh