At 03:16 PM 9/10/2002 -0700, you wrote:
>Ok, I've been pulling my hair out all morning on this problem.  I've just
>switched to CodeWarrior 8.0 and am wondering if this might be a quirk with
>CW.

No, its a requirement of the C programming language.

>I have a very simple structure definition and function that uses the
>pointer to the sturcture as a parameter.  But it won't compile.  I keep
>getting "pointer/array required."  If I change MyIrEvt (just as a test) to
>anything else that doesn't match the MyIrEvt within the function, it
>compiles fine.  It is as though the MyIrEvt in the function is losing the
>type.

If you don't put the types on the parameter list to your function, it will 
assume type "int"... this goes back to K&R C, and was part of the C standard.

>I have tried changing the way the structure is defined using almost every
>possible declaration variations and it doesn't work.
>I have tried all forms of casting and nothing works.  I have left out most
>of the code and just included the relevant definitions.  Anyone have a
>clue what is going on here?
>typedef struct _MyIrEvent{
>         IrEvent IrEvt;
>         UInt16 test;
>} MyIrEvent;

could also be written as

typedef struct MyIrEvent {
         IrEvent IrEvt;
         UInt16 test;
} MyIrEvent;

to avoid having a struct tag name that's gratuitously different from the 
typedef name.

>MyIrEvent *MyIrEvt;  // I have also tried _MyIrEvent *MyIrEvt
>
>static void DoIR(MyIRC, MyIrEvt) {
>         switch(MyIrEvt->IrEvt) {    // this won't compile
>                 case LEVENT_DATA_IND:
>                 break;
>         // more case stuff below
>}

Write this as

static void DoIR( /* some type I don't know */ MyIRC, MyIrEvent *MyIrEvt) {
         switch(MyIrEvt->IrEvt) {    // this won't compile
                 case LEVENT_DATA_IND:
                 break;
         // more case stuff below
}

I don't understand what you're trying to do declaring the parameters 
without types.

-- 
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to