Ben Pfaff [Tue, 21 Sep 2010 05:42:17 +0000 (22:42 -0700)]
i18n: Handle EINVAL more gracefully.
EINVAL indicates an invalid multibyte sequence at the end of buffer. It
seems to me that there is no point in swallowing up a single byte and going
on at that point; instead, one might as well just declare the conversion
done after adding the fallback character. This is what this commit does.
Ben Pfaff [Tue, 21 Sep 2010 05:15:38 +0000 (22:15 -0700)]
i18n: Properly restart conversion when output buffer overflows.
The E2BIG case tries to restart the whole conversion, by reinitializing
all variables to their initial states. However the value of 'text' might
already have been advanced somewhat if there was a previous loop for e.g.
an invalid character. This commit fixes the problem by keeping the
original 'text' around and using a moving input pointer instead.
Ben Pfaff [Sat, 18 Sep 2010 04:25:19 +0000 (21:25 -0700)]
linreg: Delete unused static function.
This function drew attention to itself through a warning about a missing
return type, but it isn't used so just delete it instead of adding a
return type
Ben Pfaff [Sat, 18 Sep 2010 04:03:57 +0000 (21:03 -0700)]
Suppress warnings about conversions between char * and unsigned char *.
For some time PSPP has used "unsigned char *" for string data and "char *"
for most other strings. Transforming between these properly generally
involves recoding, and there are some places where this is possibly
missing. The usual way to "fix" these warnings would be to insert casts,
but this would not fix the problem, just suppress the warnings, and it is
difficult to "grep" for casts so they would be hard to find for fixing
later.
This commit doesn't actually fix the problems, but it does suppress the
warnings while making them easy to find later: just grep for CHAR_CAST_BUG.
John Darrington [Wed, 15 Sep 2010 12:53:41 +0000 (14:53 +0200)]
Consolidate quoting style in printed strings.
The GNU coding standards say to use `xxxx' for quoted
strings. Previously we've been using a mixture of that style
and "xxxx". This change substitutes all instances of the latter
with the former.
Ben Pfaff [Sun, 29 Aug 2010 21:55:41 +0000 (14:55 -0700)]
settings: Avoid using a pointer and global data for algorithms.
Until now the difference between the current and global settings for
the algorithms in uses has been maintained as two values plus a pointer
to the setting actually in use. Using global data like that makes it
harder to save and restore settings, so this commit adopt an alternate
method that avoids using global data or pointers.
Ben Pfaff [Sun, 29 Aug 2010 18:37:19 +0000 (11:37 -0700)]
settings: Make viewwidth, viewlength "int"s instead of pointers.
I don't recall exactly why these were pointers any longer, but it doesn't
seem to be necessary any longer. It is more straightforward if they are
just stored in the same way as the other settings.
Ben Pfaff [Sun, 29 Aug 2010 21:53:01 +0000 (14:53 -0700)]
format: Introduce a new type, struct fmt_settings.
Until now the collection of formatting styles have been poorly abstracted,
as an array. This commit introduces a new type, struct fmt_settings, that
represents all of the formatting styles currently in use.
John Darrington [Sat, 14 Aug 2010 17:49:51 +0000 (19:49 +0200)]
Add optional callback functions to categoricals.
Added callback functions to categoricals to enable
per category calculations to be done at the request
of the caller. This change also modifies oneway.c (show_descriptives)
to use this new feature. However at present it doesn't
work properly when multiple dependent variables are
specified.
John Darrington [Sat, 14 Aug 2010 09:16:21 +0000 (11:16 +0200)]
Covariance matrix interface change.
covariance_2pass_create now takes a pointer to a
struct categoricals which must be created by the caller,
instead of creating this object for itself. This will
(hopefully) make the implementation of interactions and other
features easier.
John Darrington [Fri, 13 Aug 2010 16:21:16 +0000 (18:21 +0200)]
Oneway: Use covariance matrix and sweep operator
Calculate the anova table using the routines from
src/math/covariance.c and lib/linreg/sweep.c instead
of the add hoc method. This change doesn't remove
all traces of the old method, since the data is still
needed for some subcommands. This will be the subject
of future changes.
John Darrington [Sun, 8 Aug 2010 07:33:19 +0000 (09:33 +0200)]
Categoricals.c Create entries for all groups.
Although for the purposes of creating a covariance matrix, only
n - 1 entries are needed, for other purposes (such as descriptive
statistics, contrasts, planned comparisons etc) all n entries are required.
(where n is the number of distinct values). This change updates
categories.c so that all n categories are generated. Covariance matrix
routines are free to ignore the ones not of interest.
John Darrington [Sun, 22 Aug 2010 10:36:37 +0000 (12:36 +0200)]
SET MXWARNS = 0 to be interpreted as unlimited.
This change introduces a special meaning to the
value of zero for the MXWARNS settings. When
a zero value is set. A single warning will be
emitted informing the user that the setting is
in effect. Thereafter no warning will be emitted.
All warning situations will be ignored.
John Darrington [Sun, 22 Aug 2010 09:05:16 +0000 (11:05 +0200)]
Move MX* processing to libpspp/message.c
This change moves the guts of src/ui/terminal/msg-ui.c
into libpspp/message.c The affected code handles the
processing of the MXWARNS and MXERRS settings. As this
code was under src/ui/terminal these settings were being
ignored in the GUI
John Darrington [Thu, 19 Aug 2010 14:54:45 +0000 (16:54 +0200)]
Fix translation of column header.
The "var" column header in the data view was not getting
translated, due to lack of a call to gettext. Thanks to
Mindaugas embar@super.lt for reporting this.
Ben Pfaff [Sat, 7 Aug 2010 20:47:33 +0000 (13:47 -0700)]
SAVE: Fix UNSELECTED=RETAIN with a filter variable.
Apparently this had never been tested. It assert-failed consistently
because the filter variable being saved was from the dictionary before
reading the data, but the dictionary after reading the data was
different due to the temporary transformation used to drop the
filtered data.
Ben Pfaff [Tue, 3 Aug 2010 05:11:13 +0000 (22:11 -0700)]
Replace S_I[RWX]{USR,GRP,OTH} macros by their values.
POSIX 2008 guarantees that these macros have their traditional Unix values,
so it should no be longer necessary to use the macros for portability's
sake. Personally, I find the values easier to read, especially when
several of them are OR'd together.