🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pilot.programmer.codewarrior
Article #32

Floating Point Compile Problem

#32
From: 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
Technical Details
Message-ID: <dersh-A01657.18474116052002@news.directvinternet.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!hub1.nntpserver.com!telocity-west!TELOCITY!nopics.sjc!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 109d41,7a2d6d9fef2f0486,start
X-Google-Attributes: gid109d41,public
X-Google-Thread: 10baa0,7a2d6d9fef2f0486,start
X-Google-Attributes: gid10baa0,public
X-Google-ArrivalTime: 2002-05-16 16:47:41 PST
From: Adam Dershowitz <dersh@alum.mit.edu>
Newsgroups: pilot.programmer.codewarrior,codewarrior.palm
Mail-Copies-To: poster
Subject: Floating Point Compile Problem
User-Agent: MT-NewsWatcher/3.1 (PPC)
Date: Thu, 16 May 2002 18:47:42 -0500
Message-ID: <dersh-A01657.18474116052002@news.directvinternet.com>
NNTP-Posting-Host: nopics.sjc
Lines: 63
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!hub1.nntpserver.com!telocity-west!TELOCITY!nopics.sjc!not-for-mail