[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Minor(ish) changes to PsppireValueEntry
From: |
John Darrington |
Subject: |
Re: Minor(ish) changes to PsppireValueEntry |
Date: |
Tue, 24 Apr 2012 07:05:02 +0000 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
OK. We'll try it like that.
J'
On Mon, Apr 23, 2012 at 09:11:12PM -0700, Ben Pfaff wrote:
John Darrington <address@hidden> writes:
> diff --git a/src/data/value-labels.c b/src/data/value-labels.c
> index 0b2ae3f..679f4d1 100644
> --- a/src/data/value-labels.c
> +++ b/src/data/value-labels.c
> @@ -362,6 +362,12 @@ val_labs_equal (const struct val_labs *a, const
struct val_labs *b)
> {
> const struct val_lab *label;
>
> + if (a == b)
> + return true;
> +
> + if ( ( a == NULL && b != NULL) || (b == NULL && a != NULL))
> + return false;
> +
> if (val_labs_count (a) != val_labs_count (b) || a->width != b->width)
> return false;
This isn't right, because a null val_labs can equal a nonnull
one, if the nonnull one doesn't have any labels.
How about this instead:
if (val_labs_count (a) != val_labs_count (b))
return false;
if (a == NULL || b == NULL)
return true;
if (a->width != b->width)
return false;
The update to psppire_value_entry_set_value_labels() looks good
to me.
Thanks,
Ben.
--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://keys.gnupg.net or any PGP keyserver for public key.
signature.asc
Description: Digital signature
- Minor(ish) changes to PsppireValueEntry, John Darrington, 2012/04/22
- Re: Minor(ish) changes to PsppireValueEntry, Ben Pfaff, 2012/04/22
- Re: Minor(ish) changes to PsppireValueEntry, John Darrington, 2012/04/23
- Re: Minor(ish) changes to PsppireValueEntry, Ben Pfaff, 2012/04/24
- Re: Minor(ish) changes to PsppireValueEntry, Ben Pfaff, 2012/04/24
- Re: Minor(ish) changes to PsppireValueEntry, John Darrington, 2012/04/24
- Re: Minor(ish) changes to PsppireValueEntry, Ben Pfaff, 2012/04/24
- Re: Minor(ish) changes to PsppireValueEntry, Ben Pfaff, 2012/04/24
- Re: Minor(ish) changes to PsppireValueEntry, Ben Pfaff, 2012/04/24
- Re: Minor(ish) changes to PsppireValueEntry, Ben Pfaff, 2012/04/24
Re: Minor(ish) changes to PsppireValueEntry, John Darrington, 2012/04/24