pspp-dev
[Top][All Lists]
Advanced

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

Re: transformations.c


From: Ben Pfaff
Subject: Re: transformations.c
Date: Sat, 30 Jun 2007 07:38:38 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.99 (gnu/linux)

John Darrington <address@hidden> writes:

> The following confuses me:
>
> /* Executes the given CHAIN of transformations on C,
>    passing *CASE_NR as the case number.
>    If a transformation modifies *CASE_NR, it will affect the case
>    number passed to following transformations.
>    ... */
> enum trns_result
> trns_chain_execute (struct trns_chain *chain, enum trns_result start,
>                     struct ccase *c, const size_t *case_nr)
>
> How can *case_nr be modified if it's const ?  

case_nr is const because trns_chain_execute never modifies it,
and neither does anything that obtains it through
trns_chain_execute.  

However, a transformation that has obtained a non-const pointer
to case_nr through another means may modify it.  The only
transformation that does that (if I recall correctly) is END
CASE, in end_case_trns_proc.  This is a rather exceptional
condition.
-- 
Ben Pfaff 
http://benpfaff.org




reply via email to

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