John Darrington [Sun, 22 Feb 2009 23:43:23 +0000 (08:43 +0900)]
Add a set_unsaved method.
Added a psppire_window_set_unsaved method, which can be
used to indicate that the contents of a window has been
modified since it was last saved.
Use this method for the syntax window.
John Darrington [Sun, 8 Feb 2009 10:22:05 +0000 (19:22 +0900)]
Use c-ctype functions in lexer.
Lexical analysis should not depend upon the locale,
so change is* functions from ctype.h to the c_is*
counterparts from gnulib. This should avoid potential
i18n issues.
Ben Pfaff [Sat, 7 Feb 2009 05:49:44 +0000 (21:49 -0800)]
Link against -lws2_32 on Windows.
Gnulib commit df1da811, "Fix link errors on Windows when close
module is used", adds a Makefile variable $(LIB_CLOSE) that expands
to -lws2_32. This commit adds that variable to the linker command
line.
It might not be necessary to add this to both pspp and psppire,
but it shouldn't hurt.
Ben Pfaff [Fri, 6 Feb 2009 05:25:55 +0000 (21:25 -0800)]
Speed up Wilcoxon matched-pairs signed-ranks significance routine.
The performance of this routine was O(2**N). This improves it to
O(N*W). For N=30, W=120 this reduces calculation time from 6m9s
to .002s, which is a 123000x speedup.
Ben Pfaff [Fri, 6 Feb 2009 03:36:18 +0000 (19:36 -0800)]
perl-module: Make PSPP::Reader::get_next_case() return a list.
PSPP::Reader::get_next_case() was documented to return a list,
but actually it returned a reference to a list. This commit
changes the behavior to match the documentation.
This also fixes the behavior on reading past the end of the file.
Previously this was documented to return undef but caused a
segfault in practice. Now it returns an empty list.
Also increase PSPP version number from 0.7.1 to 0.7.2 at John
Darrington's request, to alert users of the previous version of
the Perl interface.
John Darrington [Wed, 4 Feb 2009 05:29:53 +0000 (14:29 +0900)]
Don't build the perl module if cross compiling.
Whilst, in general, it should be possible to cross compile a perl
module, the current organisation of the module doesn't support it.
So this has been disabled until somebody has the time and resources
to fix and test it.
Ben Pfaff [Sat, 31 Jan 2009 05:03:34 +0000 (21:03 -0800)]
Accept LF, CR LF, and LF as new-line sequences in data files.
Until now, PSPP has used the host operating system's idea of the
new-line sequence when reading data files and other text files.
This means that, when a file with CR LF line ends is read on an OS
that uses LF as new-line (e.g. an MS-DOS file on Unix), each line
appears to have a CR at the the end. This commit fixes the
problem, by normalizing the new-line sequence at time of reading.
This commit eliminates a performance optimization from
ds_read_line(), because the getdelim() function that it used cannot
be made to stop reading at one of two different delimiters. If
this causes a real performance regression, then the getndelim2
function from gnulib could be used to restore the optimization.
John Darrington [Tue, 20 Jan 2009 22:54:56 +0000 (07:54 +0900)]
Fix further bug in NPAR BINOMIAL
Change "break" to "continue", so that if a binomial
variable was missing, only this single variable is skipped
rather than all subsequent ones. Thanks to Ben Pfaff for
reporting this.
Ben Pfaff [Wed, 14 Jan 2009 04:41:54 +0000 (20:41 -0800)]
Put unique dictionary indexes into internal variables
Code that Jason is working on creates some internal variables, using
var_create_internal(), and wants to hash those variables based
on their dictionary indexes, along with some other variables that
are actually in a dictionary. Thus, the internal variables need to
have unique dictionary indexes.
John Darrington [Fri, 9 Jan 2009 23:49:32 +0000 (08:49 +0900)]
Move .ui files to build directory
The .ui files had been inadvertently put in the src directory.
This change moves them to the build directory, since they're
(currently) generated from the .glade files.
Ben Pfaff [Wed, 7 Jan 2009 07:17:32 +0000 (23:17 -0800)]
Make cases simpler, faster, and easier to understand.
Cases (struct ccase) is reference-counted to avoid copying more
data than necessary. But the existing implementation that uses
separate structures for references to cases (struct ccase) and
the cases themselves (struct case_data) has a number of issues:
- The semantics of struct ccase are tricky to remember; one
has to remember to treat struct ccase as essentially a
pointer type. I get confused sometimes myself.
(One of the symptoms of this was the existence of
the case_nullify and case_is_null functions, which are
exactly analogous to setting a pointer to null and comparing
one against null, respectively.)
- Every reference to data in a case involves two levels of
indirection, which is one more than actually necessary.
- The implementation is somewhat complicated.
This commit simplifies things, by dropping a level of indirection.
Now, a case is just a pointer to a struct ccase, which contains
the actual data. Reference counting is still present, but it is
simplified. The only thing that must be remembered is that, before
modifying a case that may be shared, it must be passed through
case_unshare() to make a new unshared copy if necessary.
John Darrington [Tue, 30 Dec 2008 02:09:00 +0000 (11:09 +0900)]
New objects psppire-window and psppire-syntax-window.
Moved most of the functionality from syntax-editor into syntax-window,
and window-manager into psppire-window. Eventually window-manager.c will
be superseeded.