Re: void * pointer convert problem.
- From: "Eric J.Hu" <ehu@xxxxxxxxxx>
- Date: Fri, 30 Dec 2005 14:34:13 -0500
"tmp123" <tmp123@xxxxxxxxx> wrote in message news:1135970785.059294.45060@xxxxxxxxxxxxxxxxxxxxxxxxxxxx...
> > 317
void* bPtr;
> > 325 bPtr = (proc_timing_bin_p)(&hPtr->ptBin[0]);
> > 329 bPtr = (exec_timing_bin_p)(&hPtr->etBin[0]);
> > 342 if(key < bPtr->key)
>
> Hi,
>
> a) If the field key has the same offset in both strutures (proc and
> exec), then you can use anyone:
>
> if (key < (proc_timing_bin_p *)bPtr->key ) ....
>
> b) If the offset is not the same, your request has no solution. The
> most near is:
>
> if (key < (hbt == PROC_TIMING_BIN)?(proc_timing_bin_p
> *)bPtr->key:(exec_timing_bin_p *)bPtr->key ) ...
>
> Kind regards.
>
> > 325 bPtr = (proc_timing_bin_p)(&hPtr->ptBin[0]);
> > 329 bPtr = (exec_timing_bin_p)(&hPtr->etBin[0]);
> > 342 if(key < bPtr->key)
>
> Hi,
>
> a) If the field key has the same offset in both strutures (proc and
> exec), then you can use anyone:
>
> if (key < (proc_timing_bin_p *)bPtr->key ) ....
>
> b) If the offset is not the same, your request has no solution. The
> most near is:
>
> if (key < (hbt == PROC_TIMING_BIN)?(proc_timing_bin_p
> *)bPtr->key:(exec_timing_bin_p *)bPtr->key ) ...
>
> Kind regards.
>
Yeah! They have same offset, so I can choose the
first solution.
Thanks,
Eric
- References:
- void * pointer convert problem.
- From: Eric J.Hu
- Re: void * pointer convert problem.
- From: Christopher Benson-Manica
- Re: void * pointer convert problem.
- From: Eric J.Hu
- Re: void * pointer convert problem.
- From: tmp123
- void * pointer convert problem.
- Prev by Date: Re: Printf question.
- Next by Date: Re: How to stop reading a file?
- Previous by thread: Re: void * pointer convert problem.
- Next by thread: Re: void * pointer convert problem.
- Index(es):
Relevant Pages
|