pspp
14 years agogui: Save positions of windows only when they are closed. 20100227040506/pspp 20100228040509/pspp 20100301040511/pspp
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. 20100225040506/pspp 20100226040508/pspp
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. 20100224040512/pspp
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. 20100222040508/pspp 20100223040526/pspp
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. 20100221040520/pspp
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. 20100220040512/pspp
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. 20100219093019/pspp
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.
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"

14 years agooutput: Make errors, warnings, and notes into a new "message_item".
Ben Pfaff [Sun, 7 Feb 2010 17:42:53 +0000 (09:42 -0800)]
output: Make errors, warnings, and notes into a new "message_item".

This lets us move the terminal UI's support for writing errors to a file
or to stdout into a new "msglog" output driver, and to convert journaling
from a special case to an output driver of its own.

14 years agoGreatly simplify PSPP configuration.
Ben Pfaff [Sun, 7 Feb 2010 04:35:46 +0000 (20:35 -0800)]
Greatly simplify PSPP configuration.

This gets rid of the "devices" configuration file entirely.  Now you
can make pspp output to, for example, an HTML file, by invoking it as
"pspp -o out.html".  Please read the documentation for full information.

It would be good to have a way to read options from a file to support,
for example, the IBM-PC or Unicode line drawing characters as implemented
in "devices" in previous versions.  I hope that we can introduce that
soon.

14 years agodoc: Distribute doc/pspp.xml, so that users don't need makeinfo or xmllint.
Ben Pfaff [Sat, 6 Feb 2010 19:11:41 +0000 (11:11 -0800)]
doc: Distribute doc/pspp.xml, so that users don't need makeinfo or xmllint.

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

14 years agoUpdate Catalan and Brazilian Portuguese translations.
Ben Pfaff [Sat, 6 Feb 2010 19:02:27 +0000 (11:02 -0800)]
Update Catalan and Brazilian Portuguese translations.

14 years agoAdd Spanish translation from translationproject.org.
Ben Pfaff [Sat, 6 Feb 2010 19:02:00 +0000 (11:02 -0800)]
Add Spanish translation from translationproject.org.

This translation is by F.J.Miguel <Miguel.Quesada@uab.cat> and others.
Miguel included the following note:

I appreciate very much the work of Xavier and Palmira with translation, the
support from coordinators Jordi and Santiago, and the comments from Ben,
John and Michel. Encouragement for those working with other languages!!!

14 years agomake-file: Fix #includes.
Ben Pfaff [Wed, 3 Feb 2010 06:18:10 +0000 (22:18 -0800)]
make-file: Fix #includes.

In particular "gl/xvasprintf.h" is needed for xasprintf(), but I took the
opportunity to update the header file style and ordering too.

14 years agodatasheet-test: Make variable "const".
Ben Pfaff [Wed, 3 Feb 2010 04:26:55 +0000 (20:26 -0800)]
datasheet-test: Make variable "const".

14 years agollx: New function llx_find() to find a pointer in a list.
Ben Pfaff [Wed, 3 Feb 2010 04:15:38 +0000 (20:15 -0800)]
llx: New function llx_find() to find a pointer in a list.

14 years agollx: New macro LLX_INITIALIZER to initialize an llx list statically.
Ben Pfaff [Wed, 3 Feb 2010 04:14:54 +0000 (20:14 -0800)]
llx: New macro LLX_INITIALIZER to initialize an llx list statically.

14 years agoNew "string_array" data structure for working with arrays of strings.
Ben Pfaff [Wed, 3 Feb 2010 06:10:11 +0000 (22:10 -0800)]
New "string_array" data structure for working with arrays of strings.

Occasionally a dynamic array of strings is very useful, so this commit
adds a set of helper functions for working with them.

14 years agoverbose-msg: Remove.
Ben Pfaff [Wed, 3 Feb 2010 05:53:14 +0000 (21:53 -0800)]
verbose-msg: Remove.

This feature is not used very much and in fact is really only useful at all
because it is difficult to understand how PSPP configuration works.
Upcoming commits will make PSPP configuration much simpler, so we drop it
now to simplify the code in advance.

14 years agomessage: Give MSG_ values for categories and severities different prefixes
Ben Pfaff [Wed, 3 Feb 2010 05:44:14 +0000 (21:44 -0800)]
message: Give MSG_ values for categories and severities different prefixes

This reduces confusion in reading and writing code that uses these values.

14 years agoarray: Fix typo in comment.
Ben Pfaff [Wed, 3 Feb 2010 04:12:08 +0000 (20:12 -0800)]
array: Fix typo in comment.

14 years agodoc: Be more optimistic about PSPP completion.
Ben Pfaff [Wed, 3 Feb 2010 05:30:13 +0000 (21:30 -0800)]
doc: Be more optimistic about PSPP completion.

14 years agoconfigure.ac: Modernize call to AC_INIT so that PACKAGE_URL gets defined.
Ben Pfaff [Wed, 20 Jan 2010 04:25:33 +0000 (20:25 -0800)]
configure.ac: Modernize call to AC_INIT so that PACKAGE_URL gets defined.

14 years agoodt: Avoid assertion failure if "mimetype" file cannot be created.
Ben Pfaff [Sat, 6 Feb 2010 04:12:21 +0000 (20:12 -0800)]
odt: Avoid assertion failure if "mimetype" file cannot be created.

Triggered by tests/bugs/unwritable-dir.sh.

14 years agoodt: Fix writing files with names different from pspp.odt.
Ben Pfaff [Sun, 31 Jan 2010 04:48:26 +0000 (20:48 -0800)]
odt: Fix writing files with names different from pspp.odt.

14 years agohtml: Delete redundant code.
Ben Pfaff [Sun, 31 Jan 2010 04:40:30 +0000 (20:40 -0800)]
html: Delete redundant code.

This code was part of an earlier attempt at CSS styling for HTML output.
It does nothing useful, so remove it.

14 years agocsv: Close pipe files properly.
Ben Pfaff [Thu, 4 Feb 2010 05:05:43 +0000 (21:05 -0800)]
csv: Close pipe files properly.

csv_create() opens the output file with fn_open() so csv_destroy() should
close it with fn_close() to ensure that pipes and the standard file
descriptors are closed properly.

14 years agocsv: Open output file immediately, instead of delaying.
Ben Pfaff [Thu, 4 Feb 2010 04:13:36 +0000 (20:13 -0800)]
csv: Open output file immediately, instead of delaying.

14 years agocairo: Avoid GLib-GObject-CRITICAL from g_object_unref() on error path.
Ben Pfaff [Sat, 6 Feb 2010 04:11:33 +0000 (20:11 -0800)]
cairo: Avoid GLib-GObject-CRITICAL from g_object_unref() on error path.

This could be triggered by an error creating the output file, e.g. by
tests/bugs/unwritable-dir.sh.

14 years agocairo: Require minimum page width.
Ben Pfaff [Fri, 5 Feb 2010 04:21:47 +0000 (20:21 -0800)]
cairo: Require minimum page width.

A too-narrow page (in particular, a zero-width page) can cause an infinite
loop in the rendering code.

14 years agoascii: Remove unimplemented "tab-width" setting.
Ben Pfaff [Thu, 4 Feb 2010 04:02:31 +0000 (20:02 -0800)]
ascii: Remove unimplemented "tab-width" setting.

14 years agoMake text output left-justified in ascii and cairo drivers.
Ben Pfaff [Fri, 5 Feb 2010 05:06:13 +0000 (21:06 -0800)]
Make text output left-justified in ascii and cairo drivers.

This only makes a difference for text output that wraps across lines, for
example with long error messages.

14 years agomsg-ui: Fix typo in user message.
Ben Pfaff [Fri, 5 Feb 2010 05:12:55 +0000 (21:12 -0800)]
msg-ui: Fix typo in user message.

14 years agoodt: Change default output file name to "pspp.odt".
Ben Pfaff [Fri, 29 Jan 2010 00:41:40 +0000 (16:41 -0800)]
odt: Change default output file name to "pspp.odt".

It seems that "pspp.pdt" was just a typo.

14 years agoascii: Fix handling of file open error.
Ben Pfaff [Wed, 20 Jan 2010 04:15:58 +0000 (20:15 -0800)]
ascii: Fix handling of file open error.

This fixes a hang in tests/bugs/unwritable-dir.sh.

Reported by John Darrington.

14 years agopspp: Fix interactive usability for multi-line commands.
Ben Pfaff [Tue, 19 Jan 2010 06:19:13 +0000 (22:19 -0800)]
pspp: Fix interactive usability for multi-line commands.

Until now, the terminal UI has only flushed output just before reading
the first line of a command.  This generally worked OK because typically
only the final command produced output, not intermediate lines.  But now
every line of a command potentially produces output (e.g. the command name
or the command syntax).  With the ASCII driver that makes the interface
difficult to use because it typically opens and holds open a pipe to an
interactive program such as "more", which in turn turns off terminal echo
etc.

Flushing output before reading each command avoids this problem and makes
the terminal UI more usable.

14 years agoascii: Fix closing pipe files in ascii_destroy().
Ben Pfaff [Tue, 19 Jan 2010 06:10:30 +0000 (22:10 -0800)]
ascii: Fix closing pipe files in ascii_destroy().

Files that are opened with fn_open() must be closed with fn_close(), but
ascii_destroy() wasn't doing that.  This made a particular difference for
interactive output where fn_close() calls pclose() instead of fclose().

14 years agoascii: Fix ascii_flush().
Ben Pfaff [Tue, 19 Jan 2010 06:09:03 +0000 (22:09 -0800)]
ascii: Fix ascii_flush().

ascii_flush() was not actually flushing the contents of the page, so this
commit changes it to do that.

This change made it clear that the proper place to reset the "y" position
on the page is in ascii_close_page(), so it makes that change too.

14 years agomessage: Fix corner case in msg_emit().
Ben Pfaff [Tue, 19 Jan 2010 00:10:10 +0000 (16:10 -0800)]
message: Fix corner case in msg_emit().

In most cases, msg_emit() initialized the "where" member of the message
passed in.  However, if msg_init() had not yet been called, it did not do
this.  This fixes that corner case.

In addition, one caller of msg_emit() did not initialize these members.  It
is not necessary for both msg_emit() and its callers to do so, but since
most callers did so, this commit simply makes the remaining caller do so
as well, for consistency.

14 years agomessage: Make msg_dup() copy and msg_destroy() free the file name.
Ben Pfaff [Mon, 18 Jan 2010 23:59:56 +0000 (15:59 -0800)]
message: Make msg_dup() copy and msg_destroy() free the file name.

This fixes a PSPPIRE bug in its message handling (found by inspection).  It
makes copies of messages to use later.  The file names were not being
copied, so in the meantime it was posible that they would be freed,
yielding a use-after-free error.

Since doing this sensibly required changing the file_name member of
struct msg_locator from "const char *" to "char *", it also touches up
places where this caused new warnings.

14 years agoNew library for interned strings.
Ben Pfaff [Mon, 18 Jan 2010 23:13:02 +0000 (15:13 -0800)]
New library for interned strings.

An "interned" string is stored in a global hash table.  Only one copy of any
given string is kept in the hash table, which reduces memory usage in cases
where there might otherwise be many duplicates of a given string.

Interned strings can be compared for equality by comparing pointers, which
can also be a significant advantage in some cases.

Interned strings are immutable.

This commit adds a general-purpose implementation of interned strings and
adapts the implementation of value labels, which already had a
special-purpose and less convenient implementation of interned strings,
to use them.

14 years agoUpdate Makefile for tests to reflect currently recommended style.
Ben Pfaff [Mon, 18 Jan 2010 21:21:24 +0000 (13:21 -0800)]
Update Makefile for tests to reflect currently recommended style.

The Autotest example Makefile was recently update to use $(VAR) notation
instead of @VAR@ notation:
    http://permalink.gmane.org/gmane.comp.sysutils.autoconf.patches/6978

This commit updates tests/automake.mk to follow this new style.

14 years agoFix use of uninitialized data in table_casereader_get_cell().
Ben Pfaff [Sun, 17 Jan 2010 22:37:45 +0000 (14:37 -0800)]
Fix use of uninitialized data in table_casereader_get_cell().

Thanks to John Darrington for pointing out the problem.

14 years agopsppire: Reimplement overview pane for output viewer window.
Ben Pfaff [Sun, 17 Jan 2010 06:11:47 +0000 (22:11 -0800)]
psppire: Reimplement overview pane for output viewer window.

14 years agopsppire: Add File|Export command to output viewer window.
Ben Pfaff [Sun, 17 Jan 2010 03:48:57 +0000 (19:48 -0800)]
psppire: Add File|Export command to output viewer window.

This should really pick the default export format based on the extension
typed by the user, but it does work.

14 years agoRewrite PSPP output engine.
Ben Pfaff [Sun, 17 Jan 2010 02:07:31 +0000 (18:07 -0800)]
Rewrite PSPP output engine.

This rewrite makes the PSPP output engine much more object-oriented and
extensible than previously.  It should make it much easier to add new
output features, such as cell footnotes and nested tables.  It also makes
minimal changes to code that currently uses the output engine.  The largest
changes are to the implementation of the LIST procedure, which are
necessary because this procedure had a too-intimate relationship with the
details of the output drivers.

The cairo and ascii drivers are now much better at breaking large cells and
large tables across pages and at choosing appropriate sizes for rows and
columns.

This commit adds a new output driver called "csv", which presents output
in comma-separated value format.  It also updates all of the test cases
that produce output to use this output format.

This commit enhances the HTML output significantly and the ODF output
slightly.

This commit adds support for charts to the GUI output.  However, it
temporarily removes the tree-view output summary pane from GUI output.  It
should not be difficult to restore this later.

14 years agoLIST: Remove WEIGHT subcommand.
Ben Pfaff [Sun, 17 Jan 2010 00:06:38 +0000 (16:06 -0800)]
LIST: Remove WEIGHT subcommand.

This subcommand is not needed for compatibility, and it is not really
useful because the case weight can be listed by including the name of
the weighting variable on the LIST command.

14 years agoDistribute some files that were forgotten.
Ben Pfaff [Sat, 16 Jan 2010 21:09:48 +0000 (13:09 -0800)]
Distribute some files that were forgotten.

14 years agocasereader: Make parameter to casereader_count_cases const.
Ben Pfaff [Tue, 22 Dec 2009 01:11:47 +0000 (17:11 -0800)]
casereader: Make parameter to casereader_count_cases const.

casereader_count_cases does not conceptually modify its argument, since
there is no way for the client to observe the difference (other than
through improved performance).  So there is no need for the parameter to
be const.

14 years agostr: New function ds_steal_cstr.
Ben Pfaff [Mon, 21 Dec 2009 04:05:24 +0000 (20:05 -0800)]
str: New function ds_steal_cstr.

14 years agoAdd new SENTINEL macro to compiler.h, for GCC's __attribute__((sentinel)).
Ben Pfaff [Mon, 21 Dec 2009 04:00:47 +0000 (20:00 -0800)]
Add new SENTINEL macro to compiler.h, for GCC's __attribute__((sentinel)).

14 years agoWeight cases dialog: set the sensitivity of radiobuttons.
John Darrington [Wed, 30 Dec 2009 10:07:08 +0000 (11:07 +0100)]
Weight cases dialog: set the sensitivity of radiobuttons.

Fix the sensitivity of the dialog's radiobuttons when the
the entry contains a variable.  Thanks to Matej Kovacic for
reporting this problem.

14 years agoChanges made by gnulib-tool
John Darrington [Wed, 30 Dec 2009 09:30:18 +0000 (10:30 +0100)]
Changes made by gnulib-tool

14 years agoInitialize factor dialog extraction parameters at dialog start
John Darrington [Mon, 28 Dec 2009 11:16:23 +0000 (12:16 +0100)]
Initialize factor dialog extraction parameters at dialog start

14 years agoFACTOR: Check that the number of factors does not exceed the number of variables
John Darrington [Mon, 28 Dec 2009 10:45:26 +0000 (11:45 +0100)]
FACTOR: Check that the number of factors does not exceed the number of variables

14 years agoRemoved some calls to deprecated Gtk functions
John Darrington [Mon, 28 Dec 2009 10:11:28 +0000 (11:11 +0100)]
Removed some calls to deprecated Gtk functions

14 years agoAvoid warnings about adjustments with non-zero page sizes
John Darrington [Mon, 28 Dec 2009 09:20:45 +0000 (10:20 +0100)]
Avoid warnings about adjustments with non-zero page sizes

14 years agoUse non-deprecated macros.
John Darrington [Mon, 28 Dec 2009 09:13:02 +0000 (10:13 +0100)]
Use non-deprecated macros.

Removed some deprecated GTK constructs, and replaced them
with their non-deprecated counterparts.

14 years agoAdd optional / to AGGREGATE OUTPUT subcommand.
John Darrington [Mon, 28 Dec 2009 07:50:22 +0000 (08:50 +0100)]
Add optional / to AGGREGATE OUTPUT subcommand.

SPSS expects a / to preceed the OUTPUT subcommand. So this
change allows PSPP to have one too.  Closes
bug #277774

14 years agoFACTOR: Ensure a non-zero number of factors.
John Darrington [Sun, 27 Dec 2009 18:04:59 +0000 (19:04 +0100)]
FACTOR: Ensure a non-zero number of factors.

Before attempting to perform factor analysis, check
that the number of factors is greater than zero.
Issue an appropriate warning if this is not the case.

14 years agoAdded a menu entry and dialog box for the FACTOR command.
John Darrington [Sun, 27 Dec 2009 17:25:26 +0000 (18:25 +0100)]
Added a menu entry and dialog box for the FACTOR command.

14 years agoRemove unused declarations
John Darrington [Sun, 27 Dec 2009 10:40:46 +0000 (11:40 +0100)]
Remove unused declarations

14 years agoChange GTK_SIGNAL_FUNC to G_CALLBACK.
John Darrington [Sun, 27 Dec 2009 10:28:07 +0000 (11:28 +0100)]
Change GTK_SIGNAL_FUNC to G_CALLBACK.

These macros are identical, but for consistency I've changed them
all to the latter.

14 years agoAvoid warning about GtkAdjustments with non-zero page_size
John Darrington [Sun, 27 Dec 2009 10:12:24 +0000 (11:12 +0100)]
Avoid warning about GtkAdjustments with non-zero page_size

14 years agoAdded documentation for the FACTOR command
John Darrington [Sat, 26 Dec 2009 09:30:09 +0000 (10:30 +0100)]
Added documentation for the FACTOR command

14 years agoFACTOR: Added "Scree Plots"
John Darrington [Fri, 25 Dec 2009 18:18:13 +0000 (19:18 +0100)]
FACTOR: Added  "Scree Plots"

14 years agoRemove obsolete file
John Darrington [Fri, 25 Dec 2009 09:59:17 +0000 (10:59 +0100)]
Remove obsolete file

14 years agoMerge branch 'master' into output
John Darrington [Fri, 25 Dec 2009 09:51:01 +0000 (10:51 +0100)]
Merge branch 'master' into output

Conflicts:

configure.ac