Re: void * pointer convert problem.



> 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.

.



Relevant Pages

  • Re: void * pointer convert problem.
    ... same offset in both strutures (proc and ... > exec), then you can use ...
    (comp.lang.c)
  • Re: An idiom for code generation with exec
    ... suggest that there's a better way to achieve this, without using exec, ... Extract the offset from the spec, ... at compile time instead of run time and saving performance. ...
    (comp.lang.python)
  • Re: An idiom for code generation with exec
    ... suggest that there's a better way to achieve this, without using exec, ... The packets that arrive have a known format. ... that the procedure of extracting field values from packets is very ...
    (comp.lang.python)
  • Re: An idiom for code generation with exec
    ... suggest that there's a better way to achieve this, without using exec, ... Extract the offset from the spec, ... Then reverse. ...
    (comp.lang.python)
  • Re: An idiom for code generation with exec
    ... suggest that there's a better way to achieve this, without using exec, ... This is a partial capability display. ... to specify the format of his packets in a file similar to above. ...
    (comp.lang.python)