This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Union pointer

Hi guys,

I use Keil µV3 for C16x for 1 year and today a problem came alive. I tried to solve it by myself, but not successfully. So I'm asking you - the experts of this forum - for any help (just a hint could be enough).

First let me introduce the problem by posting the source code:

//Definition of data type
typedef union {
unsigned char c2bytes[2];
unsigned int iWord;
} tLUT;

extern void vInitLUTforFT ( tLUT xhuge * );

...

main ( ) {
  tLUT XDATA uLUTamp[1024];

  vInitLUTforFT ( ( tLUT xhuge * ) uLUTamp[0].iWord );
}

...

//problematic function
void vInitLUTforFT ( tLUT xhuge *pLUTamp )
{
  unsigned int iAdd;

  iAdd = iIsolBitsToWord ( *pLUTamp.c2bytes[1], 0x03, 0 );
}

If I compile this SC following error message occurs:

error C69: left side of '.' requires struct/union

Now my questions:
Can be the parameter transition done in this way using a pointer on a type defined by a union?
How can I prevent the error C69 and correct the SC for compiling without errors/warnings?

Thanks guys!
Tobias

0