Hello all,

I have turned on all warnings via -Wall and I am getting the following
warning in my event handling code:
"warning: enumeration value "x" not handled in switch" where "x" are all the
various possible events such as penDownEvent, et. al. I realize I can turn
this off one of two ways; using the -Wno-switch or adding a default label.
I'm choosing to use the default label.

My question:
I'm not sure what to put in the default block. Should I set handled to 1 or
leave the block empty? And explain why, please (yes, this is an essay
question <g>).

If it helps, the only events I am setting to handled are: frmOpenEvent,
ctlSelectEvent (tho I'm not sure why), menuEvent, and penUpEvent. It is a
simple solitaire game where the user taps on squares to place tiles.

TIA,

-Paul

I have the following code:

// Event handler for Program
static Boolean Program (EventPtr event)
{
FormPtr form;
int handled = 0;

   switch (event->eType)
      {
      case frmOpenEvent:
         form = FrmGetActiveForm();
         FrmDrawForm(form);
         handled = 1;
         break;

      case penUpEvent:
         // some code
         handled = 1;
         break;

      // etc...

      default:
         // what goes here????
         break;

      } // end of switch (event->eType)

   return handled;
}




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

Reply via email to