I am using Codewarrior 8.3 (IDE version 5.9) to program a 56f8367 DSC.

I am using respected third party software, so I imagine that they know what they are doing and don't want to mess with their code too much, but they are playing around with passing void \* parameters and it is something I am not totally familiar with.

So I have this function:

```
static void T_CALLBACK _transmit(
  void *pContext,
  TX_DATA *pTxDescriptor)
{
  CONTEXT *pLinkContext = (CONTEXT *)pContext;
  ...
}

```

which is being called through a function pointer. When I stop the processor just before this function call, I can see the address pointed to by pContext is 0x1000, but after it is cast here, the address pointed to by pLinkContext is 0x0800. This, obviously causes problems because we start writing and reading from a different part of memory.

There is something weird going on with the byte addressing/alignment where it is getting "shifted" over 1 bit. I see what is going wrong, I just don't understand why or, more importantly, how to solve the problem.

What should I be looking for?

(Editing to add the call per comment request) - although, I'm not sure how much it will help considering everything is buried in structures and is being called through a function pointer. I can say that "pTprtContext->tmw.pChannel->pLinkContext" is of a different type than CONTEXT, pLinkContext does match up with the beginning of CONTEXT, so I think they are just trying to insert it in there.

```
static void T_LOCAL _transmitNextFrame(
  D_CONTEXT *pTprtContext)
{
  ...
  /* Transmit frame */
  pTprtContext->t.pChannel->pLink->pLinkTransmit(
    pTprtContext->t.pChannel->pLinkContext, &pTprtContext->linkTxDescriptor);
}

```