OK. We'll try it like that.
J'
On Mon, Apr 23, 2012 at 09:11:12PM -0700, Ben Pfaff wrote:
John Darrington <[email protected]> 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
_______________________________________________ pspp-dev mailing list [email protected] https://lists.gnu.org/mailman/listinfo/pspp-dev
