pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patch #5690] Clean up case code


From: John Darrington
Subject: Re: [patch #5690] Clean up case code
Date: Tue, 30 Jan 2007 20:53:29 +0900
User-agent: Mutt/1.5.13 (2006-08-11)

On Mon, Jan 15, 2007 at 07:08:47PM +0000, Ben Pfaff wrote:
     
     URL:
       <http://savannah.gnu.org/patch/?5690>
     
                      Summary: Clean up case code
                      Project: PSPP
                 Submitted by: blp
                 Submitted on: Monday 01/15/07 at 11:08
     Details:
     
     This cleans up and improves case.[ch] and fixes some bugs found in the
     process.

This has provided a sharp reminder about a rather nasty kludge that
exists in the GUI code ... now that case_clone unshares its data when
DEBUGGING is enabled, a gui built with this option is getting junk in
its data sheet.

The basic problem is that data/case.[ch] is designed such that it
forbids writing to case data which is contained by an existing
casefile.  For the GUI to work the way that GUIs are supposed to, it
needs to do exactly that.

Currently the code achieves this by calling case_data(), casting
away the const on the return value and performing an illicit write on
the value concerned.  Now, I can't get away with such a trick, at
least not if DEBUGGING is turned on.

I can see two alternative ways to overcome this, but neither are
particularly nice:

1. Copy the case locally, write to it, and replace it into the
   flexifile. This wouldn't be very efficient if we're dealing with
   very large cases.

2. Introduce some kind of special case for use in flexifiles which
   allows writing.


I'm leaning towards 1, because it'd be easier to implement, and this
operation wouldn't need to happen fast.

Any better ideas?

J'

-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.


Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]