pspp-builds.git
14 years agoAUTORECODE: Use "union value" instead of custom "union arc_value".
Ben Pfaff [Fri, 2 Apr 2010 23:48:55 +0000 (16:48 -0700)]
AUTORECODE: Use "union value" instead of custom "union arc_value".

These days "union value" has everything that AUTORECODE needs, so there is
no point in maintaining a local replacement for it.

14 years agoAUTORECODE: Fix indentation.
Ben Pfaff [Fri, 2 Apr 2010 14:51:25 +0000 (07:51 -0700)]
AUTORECODE: Fix indentation.

14 years agovariable-parser: Implement PV_NO_DUPLICATE.
Ben Pfaff [Sat, 3 Apr 2010 04:26:52 +0000 (21:26 -0700)]
variable-parser: Implement PV_NO_DUPLICATE.

Now that we have string_set, PV_NO_DUPLICATE is easy to implement, so
we might as well.

14 years agovariable-parser: Eliminate use of old hash table data structure.
Ben Pfaff [Fri, 2 Apr 2010 23:48:12 +0000 (16:48 -0700)]
variable-parser: Eliminate use of old hash table data structure.

14 years agoAdd case-insensitive string set.
Ben Pfaff [Sat, 3 Apr 2010 18:29:33 +0000 (11:29 -0700)]
Add case-insensitive string set.

14 years agovalue: New function value_clone_pool().
Ben Pfaff [Fri, 2 Apr 2010 23:47:14 +0000 (16:47 -0700)]
value: New function value_clone_pool().

14 years agodictionary: Use hmap instead of older hsh_table.
Ben Pfaff [Mon, 12 Apr 2010 04:45:16 +0000 (21:45 -0700)]
dictionary: Use hmap instead of older hsh_table.

The greatest benefit of this change is that it allows dict_lookup_var() to
avoid creating and destroying a whole variable just to look one up by name.

14 years agohmapx: New function hmapx_clear().
Ben Pfaff [Sun, 4 Apr 2010 19:51:08 +0000 (12:51 -0700)]
hmapx: New function hmapx_clear().

14 years agohmap: New function hmap_clear().
Ben Pfaff [Sun, 11 Apr 2010 20:04:37 +0000 (13:04 -0700)]
hmap: New function hmap_clear().

14 years agovariable: Remove unneeded assertions.
Ben Pfaff [Sat, 10 Apr 2010 03:55:25 +0000 (20:55 -0700)]
variable: Remove unneeded assertions.

These assertions are already effectively checked anyhow, since the program
will already segfault if passed a null pointer.

14 years agodictionary: Remove unneeded assertions.
Ben Pfaff [Sat, 10 Apr 2010 03:54:24 +0000 (20:54 -0700)]
dictionary: Remove unneeded assertions.

These assertions are already effectively checked anyhow, since the program
will already segfault if passed a null pointer.

14 years agovardict: Make vardict opaque to variable code.
Ben Pfaff [Sat, 10 Apr 2010 03:41:04 +0000 (20:41 -0700)]
vardict: Make vardict opaque to variable code.

14 years agoMake struct variable refer to struct vardict through a pointer.
Ben Pfaff [Fri, 9 Apr 2010 04:37:24 +0000 (21:37 -0700)]
Make struct variable refer to struct vardict through a pointer.

This will allow the dictionary to integrate struct vardict into itself in
an upcoming commit.

14 years agoMake "internal variables" part of a dictionary.
Ben Pfaff [Fri, 9 Apr 2010 04:06:43 +0000 (21:06 -0700)]
Make "internal variables" part of a dictionary.

The "internal variables" created by var_create_internal() are somewhat of
a nasty corner case in the PSPP dictionary and variable implementation,
because they are the only variables that have a case index and
dictionary index but do not belong to a dictionary.  This commit fixes
that wart, by putting internal variables in a dictionary that is used just
for them.  It adds an assertion to var_set_vardict() to ensure that this
is now an invariant property.

As part of the change, var_create_internal() is renamed
dict_Create_internal_var() and moved to dictionary.c, since it fits better
there.  Also, a new function dict_destroy_internal_var() must now be used
to destroy internal variables.

The dictionary indexes of internal variables are no longer unique
process-wide.  A previous commit eliminated the dependencies on this
property.

14 years agovariable: Introduce and use new function var_get_encoding().
Ben Pfaff [Fri, 9 Apr 2010 04:28:42 +0000 (21:28 -0700)]
variable: Introduce and use new function var_get_encoding().

These changes seem like slight cleanups since they eliminate a function
parameter in these cases.

14 years agodictionary: Fix memory leak in dict_set_encoding().
Ben Pfaff [Fri, 9 Apr 2010 04:12:02 +0000 (21:12 -0700)]
dictionary: Fix memory leak in dict_set_encoding().

If this function was called more than once for a given dictionary then all
but the final encoding name would be leaked.

14 years agodictionary: Fix potential access beyond allocated memory.
Ben Pfaff [Sat, 10 Apr 2010 04:45:50 +0000 (21:45 -0700)]
dictionary: Fix potential access beyond allocated memory.

This code replaces the dictionary's "var" array by another one, so it must
either update "var_cap" to the allocated size or allocate "var_cap" (not
"var_cnt") elements.  I chose the latter fix.

14 years agoGet rid of unnecessary uses of var_get_dict_index().
Ben Pfaff [Thu, 8 Apr 2010 05:12:07 +0000 (22:12 -0700)]
Get rid of unnecessary uses of var_get_dict_index().

Some code used the result of var_get_dict_index() on a pair of variables to
tell whether the variables are the same.  This is unnecessary: v1 == v2
works just as well.

Other code used the result of var_get_dict_index() as part of a hash value
computation.  This is reasonable, but it is even better just to hash the
pointer to the variable.

14 years agohash-functions: New function hash_pointer().
Ben Pfaff [Thu, 8 Apr 2010 04:39:06 +0000 (21:39 -0700)]
hash-functions: New function hash_pointer().

14 years agoexamples: Remove obsolete Makefile.am.
Ben Pfaff [Sat, 27 Mar 2010 21:09:02 +0000 (14:09 -0700)]
examples: Remove obsolete Makefile.am.

The build is now done through automake.mk (and has been for a long time
now).

14 years agoUpdate to most recent gnulib.
Ben Pfaff [Fri, 26 Mar 2010 03:36:21 +0000 (20:36 -0700)]
Update to most recent gnulib.

14 years agodict: Make dict_clone_var(), dict_clone_var_assert() not rename variables.
Ben Pfaff [Thu, 25 Mar 2010 04:18:34 +0000 (21:18 -0700)]
dict: Make dict_clone_var(), dict_clone_var_assert() not rename variables.

Most uses of dict_clone_var() and dict_clone_var_assert() do not involve
renaming variables, but the interface assumes that renaming is the common
case.  This commit changes their interfaces to not support renaming and
adds new functions dict_clone_var_as() and dict_clone_var_as_assert() to
support renaming during cloning.

14 years agobt: Improve code formatting.
Ben Pfaff [Sat, 20 Mar 2010 05:14:42 +0000 (22:14 -0700)]
bt: Improve code formatting.

14 years agobt: New function bt_is_empty().
Ben Pfaff [Sat, 20 Mar 2010 05:14:24 +0000 (22:14 -0700)]
bt: New function bt_is_empty().

14 years agopsppire: Use default GTK+ font in output shown in GUI.
Ben Pfaff [Mon, 22 Mar 2010 04:06:44 +0000 (21:06 -0700)]
psppire: Use default GTK+ font in output shown in GUI.

This makes the output look more consistent with the rest of the interface.

I didn't see an easy way to get a "default" monospace font.  GTK+ doesn't
seem to have one.

Reported by John Darrington.

14 years agoFREQUENCIES: Simplify code for sorting the frequency table.
Ben Pfaff [Sat, 20 Mar 2010 04:29:41 +0000 (21:29 -0700)]
FREQUENCIES: Simplify code for sorting the frequency table.

14 years agoFREQUENCIES: Get rid of final (non-const) file-scope variable.
Ben Pfaff [Fri, 19 Mar 2010 04:55:09 +0000 (21:55 -0700)]
FREQUENCIES: Get rid of final (non-const) file-scope variable.

14 years agoFREQUENCIES: Move file-scope variables for charts into struct frq_proc.
Ben Pfaff [Fri, 19 Mar 2010 04:42:17 +0000 (21:42 -0700)]
FREQUENCIES: Move file-scope variables for charts into struct frq_proc.

14 years agoFREQUENCIES: Move file-scope variables for stats into struct frq_proc.
Ben Pfaff [Fri, 19 Mar 2010 04:31:11 +0000 (21:31 -0700)]
FREQUENCIES: Move file-scope variables for stats into struct frq_proc.

14 years agoFREQUENCIES: Move file-scope variables for percentiles into struct frq_proc.
Ben Pfaff [Fri, 19 Mar 2010 04:27:57 +0000 (21:27 -0700)]
FREQUENCIES: Move file-scope variables for percentiles into struct frq_proc.

14 years agoFREQUENCIES: Move file-scope variable syntax_pool into struct frq_proc.
Ben Pfaff [Thu, 18 Mar 2010 16:34:05 +0000 (09:34 -0700)]
FREQUENCIES: Move file-scope variable syntax_pool into struct frq_proc.

14 years agoFREQUENCIES: Eliminate file-scope variables n_variables, v_variables.
Ben Pfaff [Thu, 18 Mar 2010 05:02:42 +0000 (22:02 -0700)]
FREQUENCIES: Eliminate file-scope variables n_variables, v_variables.

Also, as a nice side effect, FREQUENCIES no longer uses the variable
auxiliary data feature, which is ugly at best.

14 years agoFREQUENCIES: Get rid of unused data_pool.
Ben Pfaff [Thu, 18 Mar 2010 04:20:23 +0000 (21:20 -0700)]
FREQUENCIES: Get rid of unused data_pool.

14 years agoFREQUENCIES: Capitalize names of enums.
Ben Pfaff [Thu, 18 Mar 2010 04:18:24 +0000 (21:18 -0700)]
FREQUENCIES: Capitalize names of enums.

This is just a cleanup for consistency with the style used elsewhere in
PSPP.

14 years agoFREQUENCIES: Use newer hmap library instead of older hsh_table library.
Ben Pfaff [Wed, 17 Mar 2010 04:43:15 +0000 (21:43 -0700)]
FREQUENCIES: Use newer hmap library instead of older hsh_table library.

The FREQUENCIES procedure can use some cleanup.  Here's one step.

14 years agovalue: New function value_clone().
Ben Pfaff [Tue, 16 Mar 2010 05:05:24 +0000 (22:05 -0700)]
value: New function value_clone().

14 years agoarray: Fix indentation.
Ben Pfaff [Wed, 17 Mar 2010 04:36:25 +0000 (21:36 -0700)]
array: Fix indentation.

14 years agoINSTALL: libintl is also required.
Ben Pfaff [Wed, 17 Mar 2010 03:45:22 +0000 (20:45 -0700)]
INSTALL: libintl is also required.

Reported by Michel Boaventura <michel.boaventura@gmail.com>.

14 years agoINSTALL: Remove duplicate pkg-config requirement.
Ben Pfaff [Wed, 17 Mar 2010 03:37:48 +0000 (20:37 -0700)]
INSTALL: Remove duplicate pkg-config requirement.

14 years agogui: Add charts, additional formatting feature to FREQUENCIES dialog.
Ben Pfaff [Sun, 14 Mar 2010 06:08:30 +0000 (22:08 -0800)]
gui: Add charts, additional formatting feature to FREQUENCIES dialog.

Partial fix for bug #27832 "Wishlist: graphic output in GUI".

14 years agotests: Integrate FREQUENCIES tests into Autotest testsuite.
Ben Pfaff [Sun, 14 Mar 2010 05:44:30 +0000 (21:44 -0800)]
tests: Integrate FREQUENCIES tests into Autotest testsuite.

14 years agoFREQUENCIES: Modernize syntax and improve chart support.
Ben Pfaff [Sun, 14 Mar 2010 05:53:05 +0000 (21:53 -0800)]
FREQUENCIES: Modernize syntax and improve chart support.

The FREQUENCIES syntax was carrying a lot of baggage from old versions
that is no longer mentioned in the SPSS syntax reference.  This commit
removes support for those obsolete features.

The implementation only supported a single chart at a time.  Now it
supports pie charts and histograms in a single command.  The MIN and
MAX format options are now implemented, as are the MISSING/NOMISSING
options for pie charts.  (The FREQ/PERCENT options are still not
implemented.)

Also update documentation to match.

14 years agoFREQUENCIES: Use Freedman-Diaconis formula to choose histogram bin width.
Ben Pfaff [Sat, 13 Mar 2010 19:43:13 +0000 (11:43 -0800)]
FREQUENCIES: Use Freedman-Diaconis formula to choose histogram bin width.

Recently the FREQUENCIES procedure adopted Sturges' formula, more or less
arbitrarily, to choose the bin width of histograms.  Gaj Vidmar
<gaj.vidmar@mf.uni-lj.si>, however, recommended the Freedman-Diaconis
formula instead, so this commit adopts that formula instead.

Tested with only a few examples.

14 years agoFREQUENCIES: Add ability to calculating percentiles without showing them.
Ben Pfaff [Sat, 13 Mar 2010 19:41:14 +0000 (11:41 -0800)]
FREQUENCIES: Add ability to calculating percentiles without showing them.

This feature is not used yet, but it will be in an upcoming commit.

14 years agotab: Add debugging checks to tab_hline() to match those for tab_vline().
Ben Pfaff [Sat, 13 Mar 2010 18:59:09 +0000 (10:59 -0800)]
tab: Add debugging checks to tab_hline() to match those for tab_vline().

I'm not sure that this is really a good approach, but we might as well be
consistent.

14 years agoFREQUENCIES: Fix spelling error in dialog box text.
Ben Pfaff [Wed, 10 Mar 2010 22:19:59 +0000 (14:19 -0800)]
FREQUENCIES: Fix spelling error in dialog box text.

14 years agoDESCRIPTIVES: In GUI, generate Z scores immediately instead of deferring.
Ben Pfaff [Sat, 6 Mar 2010 18:57:29 +0000 (10:57 -0800)]
DESCRIPTIVES: In GUI, generate Z scores immediately instead of deferring.

Having the Z scores variable show up immediately, but not the actual Z
scores, confuses users.

Reported by Douglas A Ferguson <FergusonD@cofc.edu>.

14 years agogui: Fix build problem (missing header #include).
Ben Pfaff [Wed, 10 Mar 2010 17:44:39 +0000 (09:44 -0800)]
gui: Fix build problem (missing header #include).

Reported by Grzegorz Artur Daszuta <crefff@gmail.com>.

14 years agogui: Merge File|Open|Syntax and File|Open|Data into File|Open.
Ben Pfaff [Wed, 10 Mar 2010 05:48:42 +0000 (21:48 -0800)]
gui: Merge File|Open|Syntax and File|Open|Data into File|Open.

In playing with the GUI, I've found it increasingly annoying to have to
click an extra time to tell PSPPIRE whether I want to open a data file or
a syntax file.  There's no need for that--it can easily figure out what
kind of file it's being asked to read.  This commit implements that
behavior.

14 years agoFREQUENCIES: Choose number of bins for histogram based on valid cases.
Ben Pfaff [Wed, 10 Mar 2010 04:52:48 +0000 (20:52 -0800)]
FREQUENCIES: Choose number of bins for histogram based on valid cases.

Until now, histograms have always had exactly 11 bins.  There is no
"correct" number of bins, but a fixed number of bins also seems less than
ideal.  Use Sturges' formula, instead, to choose the number of bins.

Reported by Erik Frebold <efrebold@interchange.ubc.ca>.

14 years agoconfigure: Check for glib-genmarshal program at configure time.
Ben Pfaff [Wed, 10 Mar 2010 00:59:06 +0000 (16:59 -0800)]
configure: Check for glib-genmarshal program at configure time.

The GUI build cannot succeed without glib-genmarshal, so it seems like a
good idea to fail earlier.

Related to bug #28959, reported by Harry Thijssen.

14 years agoCROSSTABS: Make 3-way crosstabulation work reasonably.
Ben Pfaff [Tue, 9 Mar 2010 05:25:46 +0000 (21:25 -0800)]
CROSSTABS: Make 3-way crosstabulation work reasonably.

As reported in bug #27452, until now 3-way crosstabulations have completely
failed to work.  This commit makes them work, apparently correctly at
first glance.  Only the actual crosstabulation tables have been tested; it
is likely that statistics tables still do not display correctly or cause
runtime failures.

14 years agotab: Drop redundant assertions.
Ben Pfaff [Tue, 9 Mar 2010 04:43:54 +0000 (20:43 -0800)]
tab: Drop redundant assertions.

There is not much value in asserting that a pointer parameter is non-null
if that parameter is always dereferenced.

14 years agotests: Fix bug in NPAR TESTS subtest for CHISQUARE command.
Ben Pfaff [Tue, 9 Mar 2010 04:02:36 +0000 (20:02 -0800)]
tests: Fix bug in NPAR TESTS subtest for CHISQUARE command.

Reported by John Darrington.

14 years agoCROSSTABS: Rewrite tests in Autotest and add test for bug #27883.
Ben Pfaff [Sat, 6 Mar 2010 19:54:11 +0000 (11:54 -0800)]
CROSSTABS: Rewrite tests in Autotest and add test for bug #27883.

14 years agoterminal UI: Fix circumstances when errors should be logged to stdout.
Ben Pfaff [Sat, 6 Mar 2010 19:43:42 +0000 (11:43 -0800)]
terminal UI: Fix circumstances when errors should be logged to stdout.

The logic here was supposed to be that, if errors weren't already being
logged explicitly and if no output driver was already directed to stdout,
then send errors to standard output.  But one of the conditions was
reversed.  This fixes the problem.

14 years agoCROSSTABS: Initialize hash tables for every split, not just once overall.
Ben Pfaff [Sat, 6 Mar 2010 19:26:47 +0000 (11:26 -0800)]
CROSSTABS: Initialize hash tables for every split, not just once overall.

Fixes bug #27883, reported by Jason Stover.

14 years agoprocedure: Fix LIST procedure (and others) in GUI.
Ben Pfaff [Tue, 2 Mar 2010 06:20:02 +0000 (22:20 -0800)]
procedure: Fix LIST procedure (and others) in GUI.

John Darrington reported that the following syntax makes PSPPIRE
crash:

    data list list /alpha * beta * gamma *.
    begin data.
    1 2 3
    4 5 6
    end data.

    list.

The problem is that the GUI output driver keeps a reference to the
output_items that are submitted to it.  An output_item that in turn
has a reference to the casereader for the procedure casereader (that
is, the casereader returned by proc_open()), which currently is LIST
and few if any other procedures, then causes an assertion failure in
proc_commit().  This is because until now a precondition of
proc_commit() has been that the procedure casereader be closed, which
is what the assertion enforces.

This commit fixes the problem by getting rid of the precondition on
proc_commit().  Now the procedure casereader's lifetime may be
extended arbitrarily.  This should help take PSPP output in the
direction that I want it to go, where more and more output is
generated directly or semi-directly from casereaders, as the LIST
procedure now does.

14 years agocasereader: Factor buffering shim out into separate source file.
Ben Pfaff [Tue, 2 Mar 2010 06:12:48 +0000 (22:12 -0800)]
casereader: Factor buffering shim out into separate source file.

This moves the "shim" code out of casereader.c into a separate
casereader-shim.[ch] in preparation for using it from procedure.c.

This commit also adds an optimization: if the shim reads all of the
subreader, then it closes the subreader immediately, instead of waiting
for the shim itself to be destroyed. This can allow resources to be freed
earlier.

This commit also adds a new function casereader_shim_slurp().  This
function will be used for the first time in the following commit.

14 years agoconfigure: Always apply zlib crc32() rename fix.
Ben Pfaff [Fri, 26 Feb 2010 17:09:45 +0000 (09:09 -0800)]
configure: Always apply zlib crc32() rename fix.

PSPP can link against zlib indirectly even if it doesn't link directly, so
it is simplest to always rename gnulib's crc32() to gl_crc32().

Reported by John Darrington.

14 years agogui: Save positions of windows only when they are closed.
Ben Pfaff [Fri, 26 Feb 2010 05:40:52 +0000 (21:40 -0800)]
gui: Save positions of windows only when they are closed.

When windows in the GUI are moved around the desktop or resized, the
machine's disk can thrash madly in some setups.  This is because each
change in a window's position or size triggers a write to the PSPPIRE
preferences file noting the new position as a default for the next
PSPPIRE run.  It wasn't always a problem, but newer Glib versions call
fsync() from g_file_set_contents(), the function used to write the
preferences file, which bypasses the OS cache and forces a synchronous
disk write.

This commit makes PSPPIRE update the preferences file only when a window
is closed, which fixes the problem.  Avoiding g_file_set_contents() would
be another reasonable solution.

Reported by Grzegorz Artur Daszuta <crefff@gmail.com>.

14 years agopo: Update Dutch translation.
Ben Pfaff [Thu, 25 Feb 2010 04:36:56 +0000 (20:36 -0800)]
po: Update Dutch translation.

From Harry Thijssen via translationproject.org.

14 years agoFix zlib problem introduced by linking against gnulib's crc32() function.
Ben Pfaff [Wed, 24 Feb 2010 18:13:22 +0000 (10:13 -0800)]
Fix zlib problem introduced by linking against gnulib's crc32() function.

Diagnosed by John Darrington.

14 years agoodt: Remove dependency on external "zip" program.
Ben Pfaff [Wed, 24 Feb 2010 06:07:44 +0000 (22:07 -0800)]
odt: Remove dependency on external "zip" program.

14 years agocsv: Fix setting output file name.
Ben Pfaff [Sun, 21 Feb 2010 21:19:29 +0000 (13:19 -0800)]
csv: Fix setting output file name.

The output file named used to be provided as an option named "output-file",
but now it is a separate argument to the "create" function.  This had
been overlooked for the CSV driver, so that it always produced output in
a file named "pspp.csv", but this commit fixes the problem.

14 years agogui: Fix File|Export in output viewer.
Ben Pfaff [Sat, 20 Feb 2010 20:34:25 +0000 (12:34 -0800)]
gui: Fix File|Export in output viewer.

Commit f51ecb480 "Greatly simplify PSPP configuration" changed how PSPP
output drivers are configured but failed to completely update the
implementation of File|Export to match.  This commit fixes the problem.

A few problems, perhaps not connected, linger:

    * The CSV driver appears to always output to "pspp.csv" when invoked
      from the GUI, regardless of the requested file name.

    * The ODT driver appears to be broken.

Reported by John Darrington <john@darrington.wattle.id.au>.

14 years agogui: Suggest viewing the user manual online if starting Yelp fails.
Ben Pfaff [Sat, 20 Feb 2010 20:13:54 +0000 (12:13 -0800)]
gui: Suggest viewing the user manual online if starting Yelp fails.

Suggested by Harry Thijssen <pspp@sjpaes.nl>.

14 years agoAUTHORS, THANKS: Add additional credits for translators.
Ben Pfaff [Sat, 20 Feb 2010 20:11:06 +0000 (12:11 -0800)]
AUTHORS, THANKS: Add additional credits for translators.

Suggested by Harry Thijssen <pspp@sjpaes.nl>.

14 years agoRemove obsolete TODO file.
Ben Pfaff [Sat, 20 Feb 2010 20:01:35 +0000 (12:01 -0800)]
Remove obsolete TODO file.

Suggested by Harry Thijssen <pspp@sjpaes.nl>.

14 years agognumeric-reader: Avoid convert_xml_string_to_value segfault on NULL string
Ben Pfaff [Sat, 20 Feb 2010 19:24:34 +0000 (11:24 -0800)]
gnumeric-reader: Avoid convert_xml_string_to_value segfault on NULL string

If the 'xv' argument is null, the previous version of this code would
still dereference it.  This commit rewrites it to instead just set the
value as missing and avoid the segfault.  It also takes advantage of the
fairly recently added function value_copy_str_rpad() to eliminate some
code.

14 years agoNPAR TESTS: Avoid segfault in do_summary_box() if descriptives disabled.
Ben Pfaff [Sat, 20 Feb 2010 19:11:18 +0000 (11:11 -0800)]
NPAR TESTS: Avoid segfault in do_summary_box() if descriptives disabled.

Found by Clang (http://clang-analyzer.llvm.org).

14 years agoq2c: Mark functions that do not return NO_RETURN.
Ben Pfaff [Thu, 11 Feb 2010 04:00:54 +0000 (20:00 -0800)]
q2c: Mark functions that do not return NO_RETURN.

14 years agoq2c: Fix format string errors.
Ben Pfaff [Thu, 11 Feb 2010 04:00:31 +0000 (20:00 -0800)]
q2c: Fix format string errors.

These calls to write blank lines have caused warnings before, so introduce
a new function just for the purpose so that any future warnings can be
fixed in a single place.

14 years agoFix format string errors.
Ben Pfaff [Thu, 11 Feb 2010 03:52:46 +0000 (19:52 -0800)]
Fix format string errors.

Found by Clang (http://clang-analyzer.llvm.org).

14 years agoFREQUENCIES: Fix corner case for histogram calculation.
Ben Pfaff [Thu, 11 Feb 2010 04:07:08 +0000 (20:07 -0800)]
FREQUENCIES: Fix corner case for histogram calculation.

calc_stats() assumes that ft->n_valid is nonzero.  It has two callers, but
only one of them was checking ft->valid.  The other one (which produces a
histogram) is fixed up by this commit.

Found by Clang (http://clang-analyzer.llvm.org).

14 years agogui: Fix theoretical comparison against garbage pointer.
Ben Pfaff [Thu, 11 Feb 2010 04:26:15 +0000 (20:26 -0800)]
gui: Fix theoretical comparison against garbage pointer.

Presumably gtk_tree_model_iter_n_children() never returns a negative value,
but in case it ever could, this eliminates a comparison against an
uninitialized 'v1' value.

Found by Clang (http://clang-analyzer.llvm.org).

14 years agogui: Fix null pointer dereference in get_object_assert().
Ben Pfaff [Thu, 11 Feb 2010 04:08:28 +0000 (20:08 -0800)]
gui: Fix null pointer dereference in get_object_assert().

This function was checking whether o == NULL and then blindly
dereferencing it after it found it to be so.

Found by Clang (http://clang-analyzer.llvm.org).

14 years agomoments: Fix null pointer dereference in calc_moments().
Ben Pfaff [Thu, 11 Feb 2010 04:19:44 +0000 (20:19 -0800)]
moments: Fix null pointer dereference in calc_moments().

Found by Clang (http://clang-analyzer.llvm.org).

14 years agoMISSING VALUES: Fix free of indeterminate pointer.
Ben Pfaff [Thu, 11 Feb 2010 04:22:42 +0000 (20:22 -0800)]
MISSING VALUES: Fix free of indeterminate pointer.

If the main "while" loop in this function falls through immediately without
ever executing its body, then 'v' is passed to free() without ever being
initialized.

Found by Clang (http://clang-analyzer.llvm.org).

14 years agoBuild the ODT driver only if libxml2 is available.
Ben Pfaff [Thu, 11 Feb 2010 04:43:10 +0000 (20:43 -0800)]
Build the ODT driver only if libxml2 is available.

Reported by Michel Boaventura <michel@michelboaventura.com>.

14 years agodoc: Do not remove pspp.xml upon "make distclean".
Ben Pfaff [Sat, 20 Feb 2010 01:14:49 +0000 (17:14 -0800)]
doc: Do not remove pspp.xml upon "make distclean".

Reported by Harry Thijssen <pspp@sjpaes.nl>.

14 years agotestsuite: Don't check pspp version with AT_TESTED.
Ben Pfaff [Tue, 16 Feb 2010 17:45:27 +0000 (09:45 -0800)]
testsuite: Don't check pspp version with AT_TESTED.

AT_TESTED is for reporting the versions of binaries that you test, but
the testsuite doesn't currently test the "pspp" binary.  More
importantly, the Makefile doesn't ensure that the "pspp" binary is in
$PATH when the testsuite runs, which can cause a spurious test failure.

14 years agoperl-module: Automatically update PSPP.pm version number check.
Ben Pfaff [Mon, 15 Feb 2010 23:15:03 +0000 (15:15 -0800)]
perl-module: Automatically update PSPP.pm version number check.

Until now the $PSPP::VERSION variable was hard-coded in the source tree
and had to be manually updated whenever configure.ac was updated to
specify a new version number.  This is easy to forget.  So this commit
makes perl-module/lib/PSPP.pm a generated file, with the value of
$PSPP::VERSION automatically expanded from the @VERSION_FOR_PERL@
variable already set up by "configure".

14 years agoFACTOR: Avoid freeing indeterminate pointer.
Ben Pfaff [Mon, 15 Feb 2010 22:41:55 +0000 (14:41 -0800)]
FACTOR: Avoid freeing indeterminate pointer.

The first test in cmd_factor() is:
    if (!lex_force_match_id (lexer, "VARIABLES"))

If this fails, then control jumps to the "error" label, which frees
factor.vars, which has not been initialized at this point.

This commit fixes the problem by initializing factor.vars to NULL.  It is
not strictly necessary to also initialize factor.n_vars to 0, but it seems
like a good idea.

Found by Clang (http://clang-analyzer.llvm.org).

14 years agoconfigure.ac: Update version number to 0.7.4 to release new POT file. v0.7.4
Ben Pfaff [Mon, 15 Feb 2010 22:18:00 +0000 (14:18 -0800)]
configure.ac: Update version number to 0.7.4 to release new POT file.

translationproject.org needs a version number increment to receive a new
pspp.pot.

14 years agoAllow more version number flexibility, by using Automake "gnu" mode.
Ben Pfaff [Mon, 15 Feb 2010 21:46:49 +0000 (13:46 -0800)]
Allow more version number flexibility, by using Automake "gnu" mode.

The "gnits" mode that PSPP has used for some time constrains version
numbers considerably.  For example, it prevents using two hyphens in the
version number to indicate, for instance, a prerelease and a Git commit
number like 0.8.0-pre1-g12345678.

This commit changes PSPP to use "gnu" mode instead, and then to also
enable the extra options that "gnits" mode enabled automatically
that we still want to use.

The Automake manual discourages using "gnits" mode anyhow:

     ...Unless you are a Gnits standards contributor, it is
     recommended that you avoid this option until such time as the Gnits
     standard is actually published (which may never happen).

14 years agoRELIABILITY: Make expected test results reflect "N of Items" capitalization.
Ben Pfaff [Sat, 13 Feb 2010 19:32:51 +0000 (11:32 -0800)]
RELIABILITY: Make expected test results reflect "N of Items" capitalization.

Also update the documentation.

14 years agoInclude the .glade files in pspp.pot, not just the .ui files.
Ben Pfaff [Sat, 13 Feb 2010 18:47:39 +0000 (10:47 -0800)]
Include the .glade files in pspp.pot, not just the .ui files.

Reported by Harry Thijssen <pspp@sjpaes.nl>.

14 years agoRELIABILITY: Consistently capitalize "N of Items".
Ben Pfaff [Sat, 13 Feb 2010 04:55:25 +0000 (20:55 -0800)]
RELIABILITY: Consistently capitalize "N of Items".

Reported by Harry Thijssen <pspp@sjpaes.nl>.

14 years agoFACTOR: Mark translatable string as not a printf format string.
Ben Pfaff [Fri, 12 Feb 2010 06:05:55 +0000 (22:05 -0800)]
FACTOR: Mark translatable string as not a printf format string.

gettext uses a heuristic to guess whether a translatable string is a printf
format string.  In this case, it guesses wrong, so add a comment that tells
gettext that "% of Variance" is not a format string.

Without this change, the translationproject.org robot rejects translations.

Reported by fxmiguel@gmail.com.

14 years agoodt: Restore writing creator metadata.
Ben Pfaff [Fri, 12 Feb 2010 05:53:38 +0000 (21:53 -0800)]
odt: Restore writing creator metadata.

Commit 4d7a2ed5 "odt: Remove dependency on <pwd.h> because mingw32 does
not have it" stopped writing creator metadata to ODT output files.  This
commit adds it back, but only on systems that have <pwd.h>.

This commit also adds avoids a null pointer dereference if getpwuid()
returns NULL.  That should happen only rarely, but it is best to handle it
properly.

At John Darrington's request.

14 years agoSmake: Add mkdtemp module, used by odt output driver.
Ben Pfaff [Thu, 11 Feb 2010 04:28:42 +0000 (20:28 -0800)]
Smake: Add mkdtemp module, used by odt output driver.

Reported by Michel Boaventura <michel.boaventura@gmail.com>.

14 years agolevene: Write null pointers as NULL instead of as 0.
Ben Pfaff [Wed, 10 Feb 2010 05:13:59 +0000 (21:13 -0800)]
levene: Write null pointers as NULL instead of as 0.

Using 0 as a null pointer constant is not incorrect but NULL is the style
used in most of PSPP.

Found using coccinelle and coccicheck (http://coccinelle.lip6.fr/).

14 years agogui: Remove write-only variable 'new_type' from on_var_type_ok_clicked().
Ben Pfaff [Wed, 10 Feb 2010 05:10:43 +0000 (21:10 -0800)]
gui: Remove write-only variable 'new_type' from on_var_type_ok_clicked().

Found using coccinelle and coccicheck (http://coccinelle.lip6.fr/).

14 years agooutput: Support --without-cairo.
Ben Pfaff [Wed, 10 Feb 2010 04:55:00 +0000 (20:55 -0800)]
output: Support --without-cairo.

This was supposed to be supported all along, but I forgot to test it before
I did a commit.

Reported by Michel Boaventura <michel@michelboaventura.com>.

14 years agoodt: Remove dependency on <pwd.h> because mingw32 does not have it.
Ben Pfaff [Wed, 10 Feb 2010 03:23:40 +0000 (19:23 -0800)]
odt: Remove dependency on <pwd.h> because mingw32 does not have it.

The "meta:initial-creator" and "meta:creator" fields do not seem to me to
be important enough to have to deal with this dependency.

Reported by unknown-1 <pspp@sjpaes.nl>.

14 years agohmap-test: Disable ordered insert tests on GCC 4.3.
Ben Pfaff [Tue, 9 Feb 2010 05:09:15 +0000 (21:09 -0800)]
hmap-test: Disable ordered insert tests on GCC 4.3.

GCC 4.3 miscompiles this test (although it does not seem to miscompile
any important code actually in PSPP) so disable it to avoid spurious
failures from "make check".

14 years agoSmake: Remove unused gethostname, getlogin_r, strsep modules.
Ben Pfaff [Tue, 9 Feb 2010 04:36:46 +0000 (20:36 -0800)]
Smake: Remove unused gethostname, getlogin_r, strsep modules.

gethostname in particular has caused problems in the past on mingw32, so
it is good to get rid of it.

14 years agooutput: Phrase output driver error messages more consistently.
Ben Pfaff [Mon, 8 Feb 2010 17:43:00 +0000 (09:43 -0800)]
output: Phrase output driver error messages more consistently.

This should aid translation.

14 years agoMerge "output" into "master"
Ben Pfaff [Mon, 8 Feb 2010 04:22:31 +0000 (20:22 -0800)]
Merge "output" into "master"