In article <[log in to unmask]>,
Brian White d1352 <[log in to unmask]> asked:
> [deleted]
>long cix_read_next (char *base, char *set,
> void *buffer, int (*perform)(void *));
>
>is the prototype.
>
>The problem is when I try to make this call:
>
>int jcx372_proc_entry (job_pfm_hist_dtl *jphd);
>lresult = cix_read_next (base, dset, &jphd, jcx372_proc_entry);
> [deleted]
>I don't understand what I'm doing wrong, particularly when the
>"void *buffer" argument in cix_read_next takes a pointer to the same
>structure that "(*perform) (void *)" is rejecting!!
>
Brian,
You need to use a cast (or type coercion) of the form:
lresult = cix_read_next (base, dset, &jphd, (TYPE) jcx372_proc_entry);
where TYPE (in this case) is: int (*) (void *).
Notice that the coercion looks just like the prototype declaration for
param 4 above, except that the identifier is left out. In general, this is
true for all casts.
Hence your line of code should be:
lresult = cix_read_next (base, dset, &jphd,
(int (*) (void *)) jcx372_proc_entry);
The problems you noted with qsort are due to the same problem and
can be fixed in the same manner.
I hope that this helps you.
--Jim
|