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.
Ben Pfaff [Sun, 30 Nov 2008 23:23:20 +0000 (15:23 -0800)]
Replace case_ordering with subcase.
The case_ordering data structure was useful for comparing cases,
but that is all that it did. In fact, the same data structure
can be used, at least, for extracting data from cases into arrays
of values, stuffing values back into cases, and for more general
comparisons than case_ordering anticipated.
This commit adds those abilities to case_ordering. It also renames
it to "subcase", because it is useful for more than just sorting
cases, which is all that case_ordering was designed for.
This commit also changes the allocation pattern for subcase from
having the implementation allocate all of the memory, to having
the subcase client allocate "struct subcase". This saves a
memory allocation without making life harder for anyone.
- Naming: the "case_ordering" name implied that it was
only useful for ordering (comparing cases).
Ben Pfaff [Wed, 29 Oct 2008 13:33:56 +0000 (06:33 -0700)]
Allow MATCH FILES before an active file has been defined.
Except when it has the active file as an input, MATCH FILES does
not require an active file, and produces an active file, so it
makes sense to allow it anywhere.
Thanks to John Darrington for pointing out the bug.
Ben Pfaff [Sun, 30 Nov 2008 23:26:43 +0000 (15:26 -0800)]
Rename compare_values, hash_values with "_short" suffix.
The compare_values and hash_values functions do not compare an
entire value. Rather, they compare only the short string prefix
of long string values. I have a feeling that this misnaming was
confusing people (it certainly confused me) so this commit renames
them.
It also adds a new function value_compare_3way() that does what
one what expect such a function to do.
John Darrington [Mon, 1 Dec 2008 01:07:48 +0000 (10:07 +0900)]
Remove font information from cell attributes and sheet model.
Deleted the font_desc member from the GtkSheetCellAttr struct
and also all font related stuff from the GSheetModel interface.
Instead, fonts are now considered strictly a parameter of the
viewing widget instead of data in the model.