"jose luis garcia" <[EMAIL PROTECTED]> wrote in message
news:43797@palm-dev-forum...
>
> Hello.
>
> I'm programming with codewarrior 7.0 ,and I have one problem with the
a
> function "SysBatteryInfo".
>
> The program's source is:
> ........
> SysBatteryKind kind;
> UInt16 voltage, warn, critical, timeout;
> UInt8 percent;
> Boolean plugged;
>
> voltage = SysBatteryInfo(false, &warn, &critical,
> &timeout, &kind, &plugged, &percent);
>
> .......
>
> When I make with codewarrior 7.0,I have this error
>
> " Error : illegal implicit conversion from 'unsigned short *' to
> 'short *' &timeout,&kind,&plugged,&percent);"
>
> Why this error of conversion? if In lite codewarrior I haven't this
error..
CodeWarrior Lite uses an older version of the compiler and also comes
with an older SDK.
The problem is that SysBatteryInfo wants a Int16* (short *) but all your
variables are UInt16's (unsigned short). From the SDK docs, it looks
like everything you've written is OK, but looking at the actual 3.5 SDK
include file SystemMgr.h, the prototype has maxTicksP as a Int16
parameter.
I would assume this is a documentation bug, so just make your timeout
variable Int16, and you'll be happy.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/