Re: Warning question - correct or not?
Re: Warning question - correct or not?
- Subject: Re: Warning question - correct or not?
- From: Sailesh Agrawal <email@hidden>
- Date: Wed, 27 Jul 2005 02:49:00 -0700
Rune Lindman wrote:
Is the following code correct? I always used to write like this but
since moving to Xcode/GCC I get warning messages.
UInt16 outMark = (HasColumn(inCommand)) ? checkMark : noMark;
warning: enumeral mismatch in conditional expression: `<anonymous
enum>' vs `<anonymous enum>'
How can I change the code without resorting to if/else
You could either cast both checkMark and noMark to UInt16, i.e.
UInt16 outMark = (HasColumn(inCommand)) ? (UInt16)checkMark :
(UInt16)noMark;
Or if you define checkMark and noMark your self then have them as the
same type, i.e.
typedef enum
{
checkMark,
noMark
} MyType;
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden