CodeWarrior Question

Robert Ritchey <[email protected]> Sat, 13 Sep 2008 08:29:13 -0700
Newsgroups gmane.comp.hardware.motorola.microcontrollers.coldfire
Message-ID <[email protected]>
Hi,
I am new to CodeWarrior and pretty green in C so I hope this is not
a totally naive question.  I have some code that takes two shorts and
puts them in a short. I have snipped the code so there is not a lot of
extraneous stuff.  My question is, CodeWarrior always gives me a
warning that I am trying to do an implicit conversion from unsigned int
to short unless I do an explicit cast.  It does this to me in other cases
too, I have to cast to a byte (unsigned char) a lot of places I don't think
I have to. A friend who has written a lot of C thinks I should not be
getting this warning.  I guess I am wondering if I am missing a setting
for CodeWarrior that would make it accept a statement that operates
on two shorts and puts them in a short without having to do a cast.
Thanks,

typedef struct
     {
     short            RiseEdge;                       /* Pulse rising 
edge time                       */
     short            FallEdge;                       /* Pulse 
falling edge time                      */
     } ChanInStruct;

bool TxPulseOffset(short *Offset)
{
     short   PulseWidth; 
                    /* Pulse width                          */
     PulseWidth = (short)(pRxChannelInput->FallEdge - 
pRxChannelInput->RiseEdge);        /* Pulse width is falling minus rising */
}


At 12:04 AM 9/13/2008 -0500, you wrote:


-Bob
--------------------------------------------------------------------
Robert Ritchey
Quest Engineering & Development, Inc.
Suite B/8
6125 South Ash Avenue
Tempe, AZ 85283
Tel: (480) 460-2652
FAX: (480) 460-2653
E-Mail: [email protected]
E-Mail: [email protected]
E-Mail: [email protected]
E-Mail: [email protected]
WWW: www.QuestEngDev.com/
WWW: www.Smart-Fly.com/
-------------------------------------------------------------------- 

---
[email protected]              Send a post to the list.
[email protected]        Join the list.
[email protected]    Join the list in digest mode.
[email protected]     Leave the list.