Boki
Thu Jun 08 20:11:17 CDT 2006
Phil Frisbie, Jr. =E5=AF=AB=E9=81=93=EF=BC=9A
> Boki wrote:
>
> > Hi All,
> >
> > I can't pass this complier:
> >
> > void Boki (unsigned char ABC, unsigned int Data)
> > {
> > Boki_SendData(ABC);
> > Boki_SendData(Data >> 8); //send high byte
> > Boki_SendData(Data); //send low byte
> > }
> >
> >
> > err msg:
> > warning C4761: integral size mismatch in argument; conversion supplied
> >
> > Don't know why error here....
> > Could you please advice how to fix that ?
>
> That is not an error, that is a warning to let you know you MIGHT have a
> problem, but the compiler has fixed it so the code will compile and run. =
You
> have two problems I see:
>
> I assume Boki_SendData() accepts type unsigned char, correct? So if you g=
ive it
> anything other than an unsigned char the compiler will warn you. You can =
get rid
> of the warning by casting the unsigned int values to unsigned char.
>
> However, you have another problem: unsigned int is NOT 16 bits on current
> versions of Windows (WIN32), it is 32 bits. So your code above is only se=
nding
> half of the bits of Data.
>
> --
> Phil Frisbie, Jr.
> Hawk Software
>
http://www.hawksoft.com
I got it! Thank you very much!
Best regards,
Boki.