🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pilot.programmer.codewarrior
2 messages
2 total messages Started by Adam Dershowitz Thu, 16 May 2002 23:47
Floating Point Compile Problem
#32
Author: Adam Dershowitz
Date: Thu, 16 May 2002 23:47
63 lines
2149 bytes
I am trying to throw together a quick app that will require some 
floating point ops on the Palm.  But I can't get something very simple 
to compile.  I have #include <NewFloatMgr.h> and have finally tried the 
following very simple stuff:

void test3(void)
{
FormPtr frm;
Handle h;
char * p;
FieldType * fldP;
FieldType * fldP_in;
FlpCompDouble in_num;
FlpDouble test;
double test3;

frm = FrmGetActiveForm();

fldP_in=(FieldType 
*)FrmGetObjectPtr(frm,FrmGetObjectIndex(frm,MainQ1Field));

h=FldGetTextHandle(fldP_in);
test3=20.2;
test = 10.2;
in_num.fd = 10.3;
test = FlpAtoF(h);
in_num.fd = FlpAtoF(h);
...


And then I get the following errors:

Error   : cannot convert
'double' to
'struct '
convert.c line 101   test = 10.2;

Error   : cannot convert
'double' to
'struct '
convert.c line 102   in_num.fd = 10.3;

Error   : cannot convert
'int' to
'struct '
convert.c line 103   test = FlpAtoF(h);

Error   : cannot convert
'int' to
'struct '
convert.c line 104   in_num.fd = FlpAtoF(h);

I can't see why it thinks that what should be a double (test and 
in_num.fd) and why it thinks that the return of FlpAtoF are ints?
Got any ideas?  
I am using an old version of CodeWarrior (3.2)  but floats should have 
worked then and should work now.


Thanks,

--Adam
dersh@alum.mit.edu
Re: Floating Point Compile Problem
#33
Author: Ben Combee
Date: Sat, 18 May 2002 09:08
19 lines
1929 bytes
In article <dersh-A01657.18474116052002@news.directvinternet.com>, 
dersh@alum.mit.edu says...
> I am trying to throw together a quick app that will require some 
> floating point ops on the Palm.  But I can't get something very simple 
> to compile.  I have #include <NewFloatMgr.h> and have finally tried the 
> following very simple stuff:

When you say 3.2, are you using the version number from the About 
CodeWarrior box?  That would map to CodeWarrior for Palm OS DR3 or R4, 
IIRC.

Unfortunately, I don't know anything about a toolset that old... I would 
try out the current V8 demo and see if that works better for your 
purpose.

-- 
Ben Combee <bcombee@metrowerks.com>
CodeWarrior for Palm OS technical lead
Get help at http://palmoswerks.com/
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads